/* ==========================================================================
   Sumadh Animatrix Modern CRM & Operations UI
   Theme: Obsidian & Vibrant Accents (State-of-the-art Dark Mode)
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg-base: #0a0f1d;
  --bg-sidebar: #0f172a;
  --bg-topbar: rgba(15, 23, 42, 0.85);
  --bg-card: rgba(18, 28, 48, 0.7);
  --bg-card-hover: rgba(28, 41, 70, 0.85);
  --bg-card-solid: #111a2e;
  --bg-input: #0c1424;
  --border-input: rgba(255, 255, 255, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;
  --border-hover: rgba(255, 255, 255, 0.18);

  --accent-primary: #6366f1; /* Indigo */
  --accent-primary-hover: #4f46e5;
  --accent-secondary: #ec4899; /* Pink */
  --accent-emerald: #10b981; /* Success */
  --accent-amber: #f59e0b; /* Warning */
  --accent-rose: #f43f5e; /* Danger */
  --accent-cyan: #06b6d4; /* Info */

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --modal-bg: #111a2e;
  --modal-overlay: rgba(4, 7, 15, 0.8);
  --note-bg: rgba(99, 102, 241, 0.1);

  --scrollbar-thumb: rgba(255, 255, 255, 0.18);
  --scrollbar-track: rgba(15, 23, 42, 0.4);

  --btn-secondary-bg: rgba(255, 255, 255, 0.07);
  --btn-secondary-hover: rgba(255, 255, 255, 0.12);
  --btn-secondary-border: rgba(255, 255, 255, 0.12);

  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --topbar-height: 80px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 36px -4px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  color-scheme: dark;
}

[data-theme="light"] {
  --bg-base: #f1f5f9;
  --bg-sidebar: #ffffff;
  --bg-topbar: rgba(255, 255, 255, 0.92);
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-card-solid: #ffffff;
  --bg-input: #ffffff;
  --border-input: #cbd5e1;
  --border-subtle: #e2e8f0;
  --border-focus: #4f46e5;
  --border-hover: #94a3b8;

  --accent-primary: #4f46e5;
  --accent-primary-hover: #4338ca;
  --accent-secondary: #db2777;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-cyan: #0891b2;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #94a3b8;

  --modal-bg: #ffffff;
  --modal-overlay: rgba(15, 23, 42, 0.5);
  --note-bg: rgba(99, 102, 241, 0.08);

  --scrollbar-thumb: rgba(0, 0, 0, 0.2);
  --scrollbar-track: rgba(0, 0, 0, 0.04);

  --btn-secondary-bg: #f8fafc;
  --btn-secondary-hover: #e2e8f0;
  --btn-secondary-border: #cbd5e1;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 36px -4px rgba(0, 0, 0, 0.14);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.15);

  color-scheme: light;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.studio-app {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Mobile Topbar */
.mobile-topbar {
  display: none;
  height: 60px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 20px;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}
.mobile-topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mobile-topbar .brand-logo {
  height: 32px;
}
.mobile-topbar .brand-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Main Layout Grid */
.app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar Styling */
.studio-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 18px 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-collapse-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.sidebar-collapse-btn:hover {
  color: var(--accent-primary);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.05);
}
[data-theme="light"] .sidebar-collapse-btn {
  border-color: #e2e8f0;
  color: #64748b;
}
[data-theme="light"] .sidebar-collapse-btn:hover {
  background: #f1f5f9;
  color: #4f46e5;
  border-color: #cbd5e1;
}

.topbar-sidebar-toggle {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.topbar-sidebar-toggle:hover {
  color: var(--accent-primary);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.05);
}
[data-theme="light"] .topbar-sidebar-toggle {
  border-color: #cbd5e1;
  color: #475569;
}
[data-theme="light"] .topbar-sidebar-toggle:hover {
  background: #f1f5f9;
  color: #4f46e5;
}

.studio-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(236, 72, 153, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.brand-avatar {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.studio-title {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
  background: linear-gradient(90deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .studio-title {
  color: #0f172a;
  background: linear-gradient(90deg, #0f172a, #4338ca);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.studio-subtitle {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
}

[data-theme="light"] .studio-subtitle {
  color: #64748b;
  font-weight: 700;
}

[data-theme="light"] .brand-icon-wrap {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.sidebar-nav {
  flex: 1;
  padding: 24px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  padding: 16px 12px 8px;
  text-transform: uppercase;
}

[data-theme="light"] .nav-group-title {
  color: #94a3b8;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: var(--text-dim);
  transition: color 0.2s;
}

.nav-item:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-item:hover i {
  color: var(--accent-primary);
}

.nav-item.active {
  color: #ffffff;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.2), rgba(99, 102, 241, 0.05));
  border-left: 3px solid var(--accent-primary);
  font-weight: 600;
}

.nav-item.active i {
  color: var(--accent-primary);
}

[data-theme="light"] .nav-item {
  color: #475569;
}
[data-theme="light"] .nav-item i {
  color: #64748b;
}
[data-theme="light"] .nav-item:hover {
  color: #0f172a;
  background: #f1f5f9;
}
[data-theme="light"] .nav-item:hover i {
  color: var(--accent-primary);
}
[data-theme="light"] .nav-item.active {
  color: #4338ca;
  background: #eef2ff;
  border-left: 3px solid #4f46e5;
  font-weight: 600;
}
[data-theme="light"] .nav-item.active i {
  color: #4f46e5;
}

[data-theme="light"] .sidebar-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}
[data-theme="light"] .user-profile-badge {
  background: #ffffff;
  border-color: #e2e8f0;
}

.nav-badge {
  margin-left: auto;
  background: var(--accent-amber);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
[data-theme="light"] .nav-badge {
  background: #f59e0b;
  color: #ffffff;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.15);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-tag {
  font-size: 11px;
  color: var(--text-muted);
}

.logout-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.logout-icon-btn:hover {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
}

/* Studio Main Workspace */
.studio-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
  transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.studio-topbar {
  height: var(--topbar-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-topbar);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 80;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-shrink: 1;
}

.topbar-title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-subheading {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.topbar-right .btn {
  padding: 6px 12px;
  font-size: 12px;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

.theme-toggle-btn .icon-sun,
.theme-toggle-btn .icon-moon {
  font-size: 16px;
  position: absolute;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

/* Theme State Transitions */
[data-theme="dark"] .theme-toggle-btn .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
  color: #fbbf24;
}
[data-theme="dark"] .theme-toggle-btn .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.4);
}

[data-theme="light"] .theme-toggle-btn .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.4);
}
[data-theme="light"] .theme-toggle-btn .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
  color: #6366f1;
}

/* Views Container */
.content-body {
  padding: 24px 28px;
  flex: 1;
}

/* Collapsed Sidebar Rules */
.sidebar-collapsed .studio-sidebar {
  width: var(--sidebar-collapsed-width);
}
.sidebar-collapsed .studio-sidebar .brand-meta,
.sidebar-collapsed .studio-sidebar .nav-group-title,
.sidebar-collapsed .studio-sidebar .nav-item span:not(.nav-badge),
.sidebar-collapsed .studio-sidebar .user-details,
.sidebar-collapsed .studio-sidebar .logout-icon-btn,
.sidebar-collapsed .studio-sidebar .sidebar-collapse-btn {
  display: none !important;
}
.sidebar-collapsed .studio-sidebar .sidebar-header {
  padding: 0;
  justify-content: center;
}
.sidebar-collapsed .studio-sidebar .studio-brand {
  gap: 0;
}
.sidebar-collapsed .studio-sidebar .nav-item {
  justify-content: center;
  padding: 13px 0;
  position: relative;
}
.sidebar-collapsed .studio-sidebar .nav-item i {
  font-size: 18px;
  margin: 0;
}
.sidebar-collapsed .studio-sidebar .nav-item .nav-badge {
  position: absolute;
  top: 6px;
  right: 12px;
  padding: 2px 5px;
  font-size: 9px;
}
.sidebar-collapsed .studio-sidebar .sidebar-footer {
  padding: 12px 6px;
}
.sidebar-collapsed .studio-sidebar .user-profile-badge {
  justify-content: center;
  padding: 6px 0;
  background: transparent;
  border: none;
}
.sidebar-collapsed .studio-main {
  margin-left: var(--sidebar-collapsed-width);
}

.studio-view {
  display: none;
  animation: fadeIn 0.25s ease forwards;
}

.studio-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modern Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  background: var(--accent-primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: var(--text-main);
  border: 1px solid var(--btn-secondary-border);
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover);
  border-color: var(--border-hover);
}

[data-theme="light"] .btn-secondary {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-secondary), #d946ef);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(236, 72, 153, 0.3);
}

.btn-accent:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  gap: 6px;
}

.btn-light {
  background: #ffffff;
  color: #0f172a;
}
.btn-light:hover {
  background: #f1f5f9;
}

/* Alert Banner */
.delegation-alert-card {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.18), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-lg);
  padding: 18px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
  backdrop-filter: blur(8px);
}

.delegation-alert-card .alert-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.delegation-alert-card .alert-content h4 {
  font-size: 15px;
  font-weight: 700;
  color: #fef08a;
}

.delegation-alert-card .alert-content p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.delegation-alert-card button {
  margin-left: auto;
  flex-shrink: 0;
}

/* KPI Cards Grid - Condensed, Compact & Shorter Height */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  backdrop-filter: blur(10px);
  transition: transform 0.2s, border-color 0.2s;
}

.kpi-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
}

.kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.kpi-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.kpi-icon-wrap {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.kpi-icon-wrap.blue { background: rgba(99, 102, 241, 0.15); color: var(--accent-primary); }
.kpi-icon-wrap.purple { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.kpi-icon-wrap.amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.kpi-icon-wrap.emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }

.kpi-value {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.kpi-meta {
  margin-top: 4px;
}

.kpi-trend {
  font-size: 11px;
  font-weight: 600;
}
.kpi-trend.positive { color: var(--accent-emerald); }
.kpi-trend.warning { color: var(--accent-amber); }
.kpi-trend.neutral { color: var(--text-dim); }

/* Dashboard Split Grid */
.dashboard-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
}

.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel-title i {
  color: var(--accent-primary);
}

.panel-action-link {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.panel-action-link:hover { text-decoration: underline; }

.panel-body {
  padding: 20px 24px;
  flex: 1;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}
.empty-state i {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.empty-state p {
  font-size: 14px;
}

/* Table Styles */
.table-container {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
}

.studio-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.studio-table th {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.studio-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.studio-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.studio-table tbody tr:last-child td {
  border-bottom: none;
}

/* Light Mode Table Overrides */
[data-theme="light"] .table-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .studio-table th {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  color: #475569;
}

[data-theme="light"] .studio-table td {
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

[data-theme="light"] .studio-table tbody tr:hover {
  background: #f8fafc;
}

/* Clubbed Projects Table (4 Columns) */
#projectsTable {
  min-width: 820px;
  width: 100%;
}
#projectsTable th:nth-child(1), #projectsTable td:nth-child(1) { min-width: 250px; }
#projectsTable th:nth-child(2), #projectsTable td:nth-child(2) { min-width: 210px; }
#projectsTable th:nth-child(3), #projectsTable td:nth-child(3) { min-width: 180px; }
#projectsTable th:nth-child(4), #projectsTable td:nth-child(4) { min-width: 160px; width: 160px; text-align: right; white-space: nowrap; }

/* Clubbed Tasks Table (4 Columns: Task+Project, Assignee+Supervisors, Priority+Timeline+Status, Actions) */
.dept-task-group .studio-table {
  min-width: 820px;
  width: 100%;
}
.dept-task-group .studio-table th, .dept-task-group .studio-table td {
  padding: 10px 12px;
  font-size: 12px;
}
.dept-task-group .studio-table th:nth-child(1), .dept-task-group .studio-table td:nth-child(1) { min-width: 250px; }
.dept-task-group .studio-table th:nth-child(2), .dept-task-group .studio-table td:nth-child(2) { min-width: 170px; }
.dept-task-group .studio-table th:nth-child(3), .dept-task-group .studio-table td:nth-child(3) { min-width: 190px; }
.dept-task-group .studio-table th:nth-child(4), .dept-task-group .studio-table td:nth-child(4) { min-width: 175px; width: 175px; text-align: right; white-space: nowrap; }

/* Founder Team Productivity & Earnings Table (6 Streamlined Columns) */
#founderEarningsTable {
  min-width: 960px;
  width: 100%;
}
#founderEarningsTable th,
#founderEarningsTable td {
  padding: 12px 14px;
  vertical-align: middle;
}
#founderEarningsTable th:nth-child(1), #founderEarningsTable td:nth-child(1) { min-width: 210px; }
#founderEarningsTable th:nth-child(2), #founderEarningsTable td:nth-child(2) { min-width: 180px; }
#founderEarningsTable th:nth-child(3), #founderEarningsTable td:nth-child(3) { min-width: 155px; }
#founderEarningsTable th:nth-child(4), #founderEarningsTable td:nth-child(4) { min-width: 145px; }
#founderEarningsTable th:nth-child(5), #founderEarningsTable td:nth-child(5) { min-width: 190px; }
#founderEarningsTable th:nth-child(6), #founderEarningsTable td:nth-child(6) { min-width: 140px; width: 140px; text-align: right; white-space: nowrap; }

/* Individual Artist Date-Wise Table */
#individualDailyTable {
  min-width: 980px;
  width: 100%;
}

/* Studio Team Register */
#teamTable {
  min-width: 1120px;
  width: 100%;
}
#teamTable th:last-child,
#teamTable td:last-child {
  min-width: 140px;
  width: 140px;
  text-align: right;
  white-space: nowrap;
}

#productionTable {
  min-width: 980px;
  width: 100%;
}
#productionTable th:last-child,
#productionTable td:last-child {
  min-width: 110px;
  width: 110px;
  text-align: right;
  white-space: nowrap;
}

#managerLogsTable {
  min-width: 980px;
  width: 100%;
}

#financeTable {
  min-width: 960px;
  width: 100%;
}
#financeTable th:last-child,
#financeTable td:last-child {
  min-width: 90px;
  text-align: right;
  white-space: nowrap;
}

/* Badges & Pills */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
}
.badge-fcd { background: rgba(99, 102, 241, 0.2); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.4); }
.badge-manager { background: rgba(245, 158, 11, 0.2); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.4); }
.badge-indigo { background: rgba(99, 102, 241, 0.2); color: #a5b4fc; }
.badge-pink { background: rgba(236, 72, 153, 0.2); color: #f472b6; }
.badge-emerald { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.badge-amber { background: rgba(245, 158, 11, 0.2); color: #fde047; }
.badge-danger { background: rgba(244, 63, 94, 0.2); color: #fda4af; }

/* Light Theme Badges with High Contrast (Zero Yellow Text on White Background) */
[data-theme="light"] .badge-fcd { background: #e0e7ff; color: #4338ca; border: 1px solid #c7d2fe; }
[data-theme="light"] .badge-manager { background: #f3e8ff; color: #6b21a8; border: 1px solid #d8b4fe; }
[data-theme="light"] .badge-indigo { background: #e0e7ff; color: #4338ca; border: 1px solid #c7d2fe; }
[data-theme="light"] .badge-pink { background: #fce7f3; color: #be185d; border: 1px solid #fbcfe8; }
[data-theme="light"] .badge-emerald { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
[data-theme="light"] .badge-amber { background: #f1f5f9; color: #1e293b; border: 1px solid #cbd5e1; }
[data-theme="light"] .badge-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* Dedicated Project Badge (Non-egg shaped) */
.badge-project {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.3);
  max-width: 140px;
  word-break: normal;
}
[data-theme="light"] .badge-project {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

/* Role Micro Tags (PM / PRM) */
.role-micro-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.role-micro-tag.pm {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.35);
}
.role-micro-tag.prm {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
[data-theme="light"] .role-micro-tag.pm {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}
[data-theme="light"] .role-micro-tag.prm {
  background: #f3e8ff;
  color: #6b21a8;
  border-color: #d8b4fe;
}

/* Priority Pills with Status Dot */
.priority-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.priority-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.priority-pill.priority-critical { background: rgba(244, 63, 94, 0.18); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.4); }
.priority-pill.priority-critical .dot { background: #f43f5e; }
.priority-pill.priority-high { background: rgba(236, 72, 153, 0.18); color: #f472b6; border: 1px solid rgba(236, 72, 153, 0.4); }
.priority-pill.priority-high .dot { background: #ec4899; }
.priority-pill.priority-medium { background: rgba(245, 158, 11, 0.18); color: #fde047; border: 1px solid rgba(245, 158, 11, 0.4); }
.priority-pill.priority-medium .dot { background: #f59e0b; }
.priority-pill.priority-low { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.4); }
.priority-pill.priority-low .dot { background: #94a3b8; }

/* Light Theme: Clean contrast, no yellow text */
[data-theme="light"] .priority-pill.priority-critical { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; }
[data-theme="light"] .priority-pill.priority-critical .dot { background: #ef4444; }
[data-theme="light"] .priority-pill.priority-high { background: #fce7f3; color: #be185d; border-color: #fbcfe8; }
[data-theme="light"] .priority-pill.priority-high .dot { background: #ec4899; }
[data-theme="light"] .priority-pill.priority-medium { background: #f1f5f9; color: #1e293b; border: 1px solid #cbd5e1; }
[data-theme="light"] .priority-pill.priority-medium .dot { background: #3b82f6; }
[data-theme="light"] .priority-pill.priority-low { background: #f8fafc; color: #475569; border-color: #cbd5e1; }
[data-theme="light"] .priority-pill.priority-low .dot { background: #64748b; }

/* Status tags */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.status-pill.unassigned { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.35); }
.status-pill.assigned { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.35); }
.status-pill.in-progress { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.35); }
.status-pill.completed { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.35); }
.status-pill.critical { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.35); }

/* Light Theme Status Pills (Zero Yellow Text on White Background) */
[data-theme="light"] .status-pill.unassigned { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
[data-theme="light"] .status-pill.assigned { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
[data-theme="light"] .status-pill.in-progress { background: #e0e7ff; color: #4338ca; border: 1px solid #c7d2fe; }
[data-theme="light"] .status-pill.completed { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
[data-theme="light"] .status-pill.critical { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }

/* Filter & Control Bars */
.view-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.view-filter-bar .form-select {
  width: auto !important;
  min-width: 150px !important;
  max-width: 220px !important;
  flex: 0 1 auto !important;
  display: inline-block !important;
  padding: 8px 12px !important;
  font-size: 13px !important;
}

.search-input-wrap {
  position: relative;
  min-width: 260px;
}
.search-input-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 13px;
  pointer-events: none;
}
.search-input-wrap input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 9px 14px 9px 38px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}
.search-input-wrap input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
[data-theme="light"] .search-input-wrap input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .search-input-wrap input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Pipeline Tabs */
.pipeline-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.pipeline-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.pipeline-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.pipeline-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.pipeline-tab.active {
  background: var(--bg-card-hover);
  color: var(--text-main);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pipeline-tab .tab-badge {
  background: var(--accent-amber);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* Light Mode Pipeline Tabs */
[data-theme="light"] .pipeline-tabs {
  background: #e2e8f0;
  border-color: #cbd5e1;
}
[data-theme="light"] .pipeline-tab {
  color: #475569;
}
[data-theme="light"] .pipeline-tab:hover {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.6);
}
[data-theme="light"] .pipeline-tab.active {
  background: #ffffff;
  color: #4338ca;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
[data-theme="light"] .pipeline-tab .tab-badge {
  background: #f59e0b;
  color: #ffffff;
}

/* Calculator Card */
.production-calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 32px;
  backdrop-filter: blur(12px);
}

.calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.calc-title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.calc-title-wrap i {
  font-size: 28px;
  color: var(--accent-secondary);
}

.calc-title-wrap h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  color: var(--text-main);
}

.calc-title-wrap p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.calc-standards {
  display: flex;
  gap: 8px;
}

.form-row-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  position: static !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 7px !important;
  margin-bottom: 0 !important;
}

.form-group label {
  position: static !important;
  transform: none !important;
  display: block !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  color: var(--text-muted) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.6px !important;
  line-height: 1.2 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-input) !important;
  border: 1px solid var(--border-input) !important;
  border-radius: var(--radius-md) !important;
  padding: 11px 14px !important;
  color: var(--text-main) !important;
  font-family: inherit !important;
  font-size: 13.5px !important;
  outline: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease !important;
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-dim) !important;
  opacity: 0.8 !important;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22) !important;
  background: var(--bg-input) !important;
}

input[type="date"].form-input {
  color-scheme: inherit;
  cursor: pointer;
}

.calc-output-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 24px;
}

.calc-metric .label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 4px;
}

.calc-metric .val {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}
.calc-metric.highlight .val {
  color: var(--accent-emerald);
}

/* Projects Cards Grid (Consolidated Studio Layout) */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 22px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.project-title {
  font-family: 'Outfit', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  margin-top: 6px;
  margin-bottom: 4px;
}

.project-client {
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.project-service-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  width: fit-content;
}
[data-theme="light"] .project-service-tag {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}

.project-progress-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.project-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.project-progress-header .progress-label {
  color: var(--text-muted);
  font-weight: 600;
}
.project-progress-header .progress-val {
  color: var(--text-main);
  font-weight: 700;
}
.project-progress-header .progress-val strong {
  color: var(--accent-primary);
}

.project-progress-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}
[data-theme="light"] .project-progress-track {
  background: #e2e8f0;
}

.project-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), #8b5cf6);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.project-meta-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  font-size: 12px;
}
[data-theme="light"] .project-meta-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.project-meta-box .meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.project-meta-box .meta-label {
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 5px;
}
.project-meta-box .meta-val {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.project-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}
[data-theme="light"] .project-card-footer {
  border-top-color: #e2e8f0;
}

/* Team Grid */
.team-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.team-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.team-avatar-circle {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.team-card-rates {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 12px;
}

/* Modals */
.studio-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: var(--modal-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 20px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.studio-modal[open] {
  display: flex;
}

.modal-card {
  background: var(--modal-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title-wrap h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s ease;
}
.modal-close-btn:hover {
  background: var(--btn-secondary-bg);
  color: var(--text-main);
}

.modal-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-note {
  font-size: 12.5px;
  color: var(--text-muted);
  background: var(--note-bg);
  border-left: 3px solid var(--accent-primary);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
}

.modal-actions .btn {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}

.toast {
  background: #1e293b;
  color: #ffffff;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent-primary);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideToast 0.3s ease forwards;
}

.toast.success { border-color: var(--accent-emerald); }
.toast.error { border-color: var(--accent-rose); }
.toast.warning { border-color: var(--accent-amber); }

@keyframes slideToast {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
  gap: 5px;
  border-radius: var(--radius-sm);
  line-height: 1.25;
  font-weight: 600;
}

/* Earnings Summary Bar */
.earnings-summary-bar {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 12px !important;
  padding: 16px 20px !important;
  background: #f8fafc !important;
  border-top: 1px solid #e2e8f0 !important;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  width: 100% !important;
  box-sizing: border-box !important;
}
[data-theme="dark"] .earnings-summary-bar {
  background: rgba(15, 23, 42, 0.75) !important;
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}
.summary-metric-card {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 14px !important;
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
  min-width: 0 !important;
}
[data-theme="dark"] .summary-metric-card {
  background: rgba(30, 41, 59, 0.7) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
.summary-metric-card.highlight {
  background: rgba(16, 185, 129, 0.08) !important;
  border: 1.5px solid rgba(16, 185, 129, 0.4) !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08) !important;
}
[data-theme="dark"] .summary-metric-card.highlight {
  background: rgba(16, 185, 129, 0.12) !important;
  border-color: rgba(16, 185, 129, 0.5) !important;
}
@media (max-width: 1220px) {
  .topbar-right .btn span {
    display: none;
  }
  .topbar-right .btn {
    padding: 7px 11px;
    font-size: 13px;
  }
}

@media (max-width: 1100px) {
  .earnings-summary-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 680px) {
  .earnings-summary-bar {
    grid-template-columns: 1fr !important;
  }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .dashboard-split-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .mobile-topbar {
    display: flex;
  }
  .studio-sidebar {
    transform: translateX(-100%);
  }
  .studio-sidebar.open {
    transform: translateX(0);
  }
  .studio-main {
    margin-left: 0;
  }
  .studio-topbar {
    padding: 0 20px;
  }
  .content-body {
    padding: 20px;
  }
}

/* ======================================================= */
/* DEPARTMENT GROUPED TASKS & PIPELINE LISTING              */
/* ======================================================= */
.dept-task-group {
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.dept-task-group:hover {
  border-color: var(--border-medium);
}

.dept-task-header {
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

[data-theme="light"] .dept-task-header {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.dept-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dept-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
}

.dept-title-meta h3 {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.dept-title-meta p {
  font-size: 12px;
  color: var(--text-dim);
  margin: 2px 0 0 0;
}

.dept-badges-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dept-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.dept-status-indicator.active {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.dept-status-indicator.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.dept-status-indicator.completed {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.dept-status-indicator.idle {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
}

/* Light Mode Polish for Department Badges */
[data-theme="light"] .dept-task-group {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .dept-task-header {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}
[data-theme="light"] .dept-icon-circle {
  background: #e0e7ff;
  color: #4338ca;
}
[data-theme="light"] .dept-status-indicator.active {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}
[data-theme="light"] .dept-status-indicator.pending {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}
[data-theme="light"] .dept-status-indicator.completed {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
[data-theme="light"] .dept-status-indicator.idle {
  background: #f1f5f9;
  color: #64748b;
  border-color: #cbd5e1;
}

.empty-pipelines-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 14px;
}
[data-theme="light"] .empty-pipelines-bar {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* ======================================================= */
/* BONUS TRACKING & GRAPHICAL DASHBOARD                    */
/* ======================================================= */
.bonus-achievement-card {
  padding: 18px 22px;
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  transition: all var(--transition-normal);
}

.bonus-achievement-card.activated {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14) 0%, rgba(236, 72, 153, 0.14) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 4px 20px -2px rgba(16, 185, 129, 0.2);
}

.bonus-achievement-card.locked {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(99, 102, 241, 0.08) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.bonus-progress-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 768px) {
  .bonus-progress-grid {
    grid-template-columns: 1fr;
  }
}

.bonus-progress-box {
  background: rgba(0, 0, 0, 0.25);
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .bonus-progress-box {
  background: #ffffff;
  border-color: #e2e8f0;
}

.bonus-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.bonus-track {
  height: 8px;
  background: var(--border-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.bonus-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ======================================================= */
/* FINANCE DASHBOARD & RATIO BAR                           */
/* ======================================================= */
.finance-overview-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px !important;
  margin-bottom: 20px !important;
}

@media (max-width: 1024px) {
  .finance-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 600px) {
  .finance-overview-grid {
    grid-template-columns: 1fr !important;
  }
}

.finance-ratio-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 20px;
}

[data-theme="light"] .finance-ratio-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.finance-ratio-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}

.finance-ratio-track {
  height: 10px;
  display: flex;
  border-radius: 5px;
  overflow: hidden;
  background: var(--border-subtle);
}

.ratio-bar-income {
  background: var(--accent-emerald);
  transition: width 0.5s ease;
}

.ratio-bar-expense {
  background: var(--accent-rose);
  transition: width 0.5s ease;
}

/* Text & Icon Color Utilities */
.text-emerald { color: var(--accent-emerald) !important; }
.text-rose { color: var(--accent-rose) !important; }
.text-purple { color: #8b5cf6 !important; }
.text-blue { color: var(--accent-primary) !important; }
.text-amber { color: var(--accent-amber) !important; }

.kpi-icon-wrap.rose { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
[data-theme="light"] .kpi-icon-wrap.emerald { background: #d1fae5; color: #047857; }
[data-theme="light"] .kpi-icon-wrap.rose { background: #fee2e2; color: #b91c1c; }
[data-theme="light"] .kpi-icon-wrap.blue { background: #e0e7ff; color: #4338ca; }
[data-theme="light"] .kpi-icon-wrap.purple { background: #f3e8ff; color: #7e22ce; }
[data-theme="light"] .kpi-icon-wrap.amber { background: #fef3c7; color: #b45309; }

/* Finance Streams Breakdown & Allocation */
@media (max-width: 900px) {
  .finance-streams-grid {
    grid-template-columns: 1fr !important;
  }
}

.stream-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .stream-row {
  background: #f8fafc;
  border-color: #f1f5f9;
}

.stream-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.stream-progress-track {
  height: 5px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.stream-progress-fill-income {
  height: 100%;
  background: var(--accent-emerald);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.stream-progress-fill-expense {
  height: 100%;
  background: var(--accent-rose);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Motivational Bonus Incentive Cards & Booster Grid */
.bonus-motivate-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

@media (max-width: 768px) {
  .bonus-motivate-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.bonus-motivate-card {
  padding: 12px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  text-align: center;
  transition: all 0.2s ease;
}

[data-theme="light"] .bonus-motivate-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.bonus-motivate-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-amber);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.16);
}

.bonus-tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

/* ======================================================= */
/* REFINED TASK & DELIVERABLE LISTING DESIGN SYSTEM        */
/* ======================================================= */
.dept-task-group .studio-table tbody tr {
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--border-subtle);
}
.dept-task-group .studio-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}
[data-theme="light"] .dept-task-group .studio-table tbody tr:hover {
  background: #f8fafc;
}

.task-id-badge {
  font-family: 'Outfit', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
}

.task-project-pill {
  font-size: 11px;
  font-weight: 600;
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-theme="light"] .task-project-pill {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.task-title-text {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.4;
  margin-top: 2px;
}

.task-remarks-text {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 3px;
  line-height: 1.35;
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.assignee-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.assignee-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.assignee-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-main);
}

.assignee-unassigned {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.supervisors-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.sup-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sup-chip.pm {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.sup-chip.prm {
  background: rgba(236, 72, 153, 0.12);
  color: #f472b6;
  border: 1px solid rgba(236, 72, 153, 0.25);
}

[data-theme="light"] .sup-chip.pm {
  background: #eef2ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

[data-theme="light"] .sup-chip.prm {
  background: #fdf2f8;
  color: #be185d;
  border-color: #fbcfe8;
}

.task-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-meta-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}

.task-progress-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.task-progress-bar {
  flex: 1;
  max-width: 80px;
  height: 6px;
  background: var(--border-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.task-progress-fill {
  height: 100%;
  background: var(--accent-emerald);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.task-progress-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.task-deadline-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-actions-toolbar {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

