/* ============================================================
   ARDENT ONPOINT — Unified Dashboard Stylesheet (full rewrite)
   ------------------------------------------------------------
   Single source of truth for the dashboard, login, and shared
   shell. Every class referenced by HTML and JS is covered here.
   Premium SaaS aesthetic: refined neutrals, layered elevation,
   subtle motion, accessible focus, full responsive + dark mode.
   ============================================================ */

/* ── Tokens ───────────────────────────────────────────────── */
:root {
  /* base palette */
  --c-blue-50:  #eff6ff;
  --c-blue-100: #dbeafe;
  --c-blue-200: #bfdbfe;
  --c-blue-500: #3b82f6;
  --c-blue-600: #2563eb;
  --c-blue-700: #1d4ed8;

  --c-slate-50:  #f8fafc;
  --c-slate-100: #f1f5f9;
  --c-slate-200: #e2e8f0;
  --c-slate-300: #cbd5e1;
  --c-slate-400: #94a3b8;
  --c-slate-500: #64748b;
  --c-slate-600: #475569;
  --c-slate-700: #334155;
  --c-slate-800: #1e293b;
  --c-slate-900: #0f172a;
  --c-slate-950: #020617;

  --c-green-50:  #f0fdf4;
  --c-green-500: #22c55e;
  --c-green-600: #16a34a;
  --c-green-700: #15803d;
  --c-amber-50:  #fffbeb;
  --c-amber-500: #f59e0b;
  --c-amber-600: #d97706;
  --c-amber-700: #b45309;
  --c-red-50:    #fef2f2;
  --c-red-500:   #ef4444;
  --c-red-600:   #dc2626;
  --c-red-700:   #b91c1c;

  /* semantic light */
  --bg:           var(--c-slate-50);
  --bg-subtle:    #f5f7fb;
  --bg-muted:     var(--c-slate-100);
  --bg-card:      #ffffff;
  --surface:      #ffffff;
  --border:       var(--c-slate-200);
  --border-light: var(--c-slate-100);
  --hairline:     rgba(15, 23, 42, .06);
  --text:         var(--c-slate-900);
  --text-secondary: var(--c-slate-600);
  --text-muted:   var(--c-slate-500);
  --text-soft:    var(--c-slate-400);

  --accent:       var(--c-blue-500);
  --accent-hover: var(--c-blue-600);
  --accent-soft:  rgba(59, 130, 246, .08);
  --accent-tint:  rgba(59, 130, 246, .14);

  --success:        var(--c-green-500);
  --success-hover:  var(--c-green-600);
  --warning:        var(--c-amber-500);
  --warning-hover:  var(--c-amber-600);
  --danger:         var(--c-red-500);
  --danger-hover:   var(--c-red-600);

  --sidebar-bg:     #0b1220;
  --sidebar-fg:     #cbd5e1;
  --sidebar-w:      252px;

  /* spacing scale (4px base) */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px;

  /* radii */
  --radius-xs: 4px; --radius-sm: 6px; --radius: 8px;
  --radius-md: 10px; --radius-lg: 12px; --radius-xl: 16px; --radius-pill: 999px;

  /* layered shadows */
  --shadow-xs: 0 1px 1px rgba(15, 23, 42, .04);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 1px rgba(15, 23, 42, .03);
  --shadow:    0 2px 4px rgba(15, 23, 42, .04), 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .06), 0 2px 4px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, .10), 0 4px 8px rgba(15, 23, 42, .05);
  --shadow-xl: 0 24px 48px rgba(15, 23, 42, .12), 0 8px 16px rgba(15, 23, 42, .06);
  --shadow-focus: 0 0 0 3px rgba(59, 130, 246, .18);

  /* motion */
  --motion-fast: 120ms; --motion: 180ms; --motion-slow: 280ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  /* z scale */
  --z-sticky: 50; --z-overlay: 100; --z-modal: 200; --z-popover: 300; --z-toast: 500;

  /* type */
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;
  --fs-xs: 11px; --fs-sm: 12px; --fs-base: 13px; --fs-md: 14px;
  --fs-lg: 16px; --fs-xl: 20px; --fs-2xl: 24px; --fs-display: 28px;
}

[data-theme="dark"] {
  --bg:           #0a1020;
  --bg-subtle:    #0f172a;
  --bg-muted:     #1e293b;
  --bg-card:      #131c2f;
  --surface:      #131c2f;
  --border:       #233047;
  --border-light: #1c2740;
  --hairline:     rgba(255, 255, 255, .06);
  --text:         #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted:   #94a3b8;
  --text-soft:    #64748b;
  --accent-soft:  rgba(59, 130, 246, .14);
  --accent-tint:  rgba(59, 130, 246, .22);
  --sidebar-bg:   #060b18;
  --shadow-xs: 0 1px 1px rgba(0, 0, 0, .3);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4), 0 1px 1px rgba(0, 0, 0, .3);
  --shadow:    0 2px 4px rgba(0, 0, 0, .4), 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .45), 0 2px 4px rgba(0, 0, 0, .4);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, .55), 0 4px 8px rgba(0, 0, 0, .4);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, .65), 0 8px 16px rgba(0, 0, 0, .5);
}

/* Ardent brand theme override (orange) — kept compatible */
[data-ardent-theme="ardent"] {
  --accent:       #f97316;
  --accent-hover: #ea580c;
  --accent-soft:  rgba(249, 115, 22, .09);
  --accent-tint:  rgba(249, 115, 22, .16);
  --shadow-focus: 0 0 0 3px rgba(249, 115, 22, .22);
  --sidebar-bg:   #1a0a02;
}

/* ── Reset / Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}
img, svg, video, canvas { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
hr { border: none; height: 1px; background: var(--border); margin: var(--space-4) 0; }

/* ── Accessibility ────────────────────────────────────────── */
*:focus { outline: none; }
*:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); }
.btn:focus-visible, .input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  box-shadow: var(--shadow-focus);
}
.u-sr-only {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ── Scrollbars ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, .4);
  border: 2px solid transparent;
  background-clip: padding-box;
  border-radius: var(--radius-pill);
  transition: background var(--motion);
}
::-webkit-scrollbar-thumb:hover { background: rgba(100, 116, 139, .65); background-clip: padding-box; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .35); background-clip: padding-box; }

/* ── App Shell ────────────────────────────────────────────── */
.dash { display: flex; min-height: 100vh; }
.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: var(--space-6) var(--space-6) var(--space-12); flex: 1; }

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  position: fixed; top: 0; left: 0; bottom: 0;
  background: var(--sidebar-bg);
  background-image: linear-gradient(180deg, var(--sidebar-bg) 0%, color-mix(in srgb, var(--sidebar-bg) 92%, #000) 100%);
  display: flex; flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  border-right: 1px solid rgba(255, 255, 255, .03);
  box-shadow: var(--shadow-md);
}
.sb-brand {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.sb-brand-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  flex-shrink: 0; overflow: hidden;
}
.sb-brand-text { font-size: 14px; font-weight: 700; color: #f1f5f9; letter-spacing: -.005em; }
.sb-brand-sub  { font-size: 10.5px; color: #64748b; font-weight: 500; }

.sb-section { padding: var(--space-3) 0 var(--space-1); }
.sb-section + .sb-section { border-top: 1px solid rgba(255, 255, 255, .03); }
.sb-section.collapsed .sb-dropdown-body { display: none; }

.sb-section-title, .sb-dropdown-toggle {
  display: flex; align-items: center;
  padding: 10px 20px 6px;
  font-size: 10.5px; font-weight: 600;
  color: #64748b;
  text-transform: uppercase; letter-spacing: .06em;
  user-select: none;
}
.sb-dropdown-toggle { cursor: pointer; transition: color var(--motion); }
.sb-dropdown-toggle:hover { color: #94a3b8; }
.sb-dropdown-arrow { margin-left: auto; font-size: 16px; transition: transform var(--motion) var(--ease); }
.sb-section.collapsed .sb-dropdown-arrow,
.sb-dropdown-toggle.collapsed .sb-dropdown-arrow { transform: rotate(-90deg); }

.sb-nav { list-style: none; padding: 2px 0; }
.sb-nav li[hidden] { display: none; }
.sb-nav a {
  display: flex; align-items: center; gap: 10px;
  margin: 1px 8px; padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: #94a3b8;
  font-size: 12.5px; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast), box-shadow var(--motion-fast);
  position: relative;
}
.sb-nav a:hover { background: rgba(255, 255, 255, .05); color: #e2e8f0; }
.sb-nav a.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, .18) 0%, rgba(59, 130, 246, .02) 100%);
  color: #93c5fd;
  box-shadow: inset 2px 0 0 var(--accent);
}
.sb-nav-icon { font-size: 16px !important; width: 16px; height: 16px; opacity: .9; flex-shrink: 0; }
.sb-spacer { flex: 1; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(2px);
  z-index: 90;
  animation: fadeIn var(--motion) var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px;
  padding: 0 var(--space-6);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
  z-index: var(--z-sticky);
  box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}
.topbar-left { display: flex; align-items: center; gap: var(--space-2); min-width: 0; flex: 1; overflow: hidden; }
.topbar-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  letter-spacing: -.005em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin: 0;
}
.topbar-actions { display: flex; align-items: center; gap: var(--space-2); }
.topbar-divider { width: 1px; height: 24px; background: var(--border); margin: 0 var(--space-1); flex-shrink: 0; }

#sidebarToggle, #theme-toggle, .theme-selector-btn {
  width: 34px; height: 34px;
  display: none;
  align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast);
}
#theme-toggle, .theme-selector-btn { display: flex; }
#sidebarToggle:hover, #theme-toggle:hover, .theme-selector-btn:hover {
  background: var(--bg-muted); color: var(--text);
}

.topbar-user { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-1) 0; }
.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; flex-shrink: 0;
}
.topbar-user-info { display: flex; flex-direction: column; min-width: 0; }
.topbar-user-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 140px;
}
.topbar-user-role { font-size: 11px; color: var(--text-muted); text-transform: capitalize; line-height: 1.2; }
.topbar-logout {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background var(--motion-fast), color var(--motion-fast);
}
.topbar-logout:hover { background: rgba(239, 68, 68, .1); color: var(--danger); }
.topbar-tasks-btn { position: relative; display: flex; align-items: center; gap: 4px; }

/* ── Sections ─────────────────────────────────────────────── */
.section { display: none; }
.section.active { display: block; animation: sectionIn var(--motion) var(--ease-out); }
@keyframes sectionIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.section-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.section-title { font-size: var(--fs-xl); font-weight: 700; letter-spacing: -.01em; color: var(--text); }

.section-desc {
  display: flex; gap: var(--space-3);
  background: linear-gradient(135deg, rgba(59, 130, 246, .04), rgba(59, 130, 246, 0));
  border: 1px solid rgba(59, 130, 246, .14);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin-bottom: var(--space-4);
  font-size: 13px; color: var(--text-secondary); line-height: 1.55;
  position: relative;
}
.section-desc > .material-icons {
  font-size: 22px; color: var(--accent); flex-shrink: 0;
  background: rgba(59, 130, 246, .1); border-radius: var(--radius-md);
  padding: 6px;
}
.section-desc strong { color: var(--text); font-weight: 600; }
.section-desc p { margin: 0; }
.desc-list { padding-left: var(--space-4); margin-top: 6px; list-style: disc; }
.desc-list li { margin-bottom: 2px; }
.desc-dismiss {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: var(--radius-xs);
  color: var(--text-muted);
  transition: background var(--motion-fast), color var(--motion-fast);
}
.desc-dismiss:hover { background: var(--bg-muted); color: var(--text); }
.section-desc-toggle {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast);
}
.section-desc-toggle:hover { background: var(--bg-muted); color: var(--text); border-color: var(--c-slate-300); }

/* ── Stats / KPIs ─────────────────────────────────────────── */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.stat {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--motion) var(--ease), border-color var(--motion) var(--ease), transform var(--motion) var(--ease);
}
.stat:hover { box-shadow: var(--shadow-sm); border-color: var(--c-slate-300); }
.stat-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.stat-icon .material-icons { font-size: 20px; }
.stat-icon.blue  { background: var(--accent-soft);          color: var(--accent); }
.stat-icon.green { background: rgba(34, 197, 94, .1);       color: var(--success); }
.stat-icon.amber { background: rgba(245, 158, 11, .1);      color: var(--warning); }
.stat-icon.slate { background: var(--bg-muted);             color: var(--text-muted); }
.stat-body { flex: 1; min-width: 0; }
.stat-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; }

.monday-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
}
.monday-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--motion) var(--ease), border-color var(--motion) var(--ease);
}
.monday-kpi:hover { box-shadow: var(--shadow-sm); border-color: var(--c-slate-300); }
.monday-kpi-value { font-size: 24px; font-weight: 700; color: var(--text); letter-spacing: -.02em; line-height: 1.1; }
.monday-kpi-value--accent { color: var(--accent); }
.monday-kpi-value--blue { color: var(--c-blue-600); }
.monday-kpi-value--success { color: var(--success); }
.monday-kpi-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.monday-kpi-trend { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; margin-top: 4px; }
.monday-kpi-trend--up { color: var(--success); }
.monday-kpi-trend--down { color: var(--danger); }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--motion) var(--ease), border-color var(--motion) var(--ease);
  overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-sm); }
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: 14px 20px;
  border-bottom: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.card-header-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.card-title {
  font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: -.005em;
  display: flex; align-items: center; gap: 6px;
}
.card-body { padding: var(--space-5); }
.card-body.flush { padding: 0; }

/* List card variant (used for saved-lists, notes, partnerships, etc.) */
.lists-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-3);
}
.list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--motion) var(--ease), border-color var(--motion) var(--ease), transform var(--motion) var(--ease);
  cursor: pointer;
}
.list-card:hover { box-shadow: var(--shadow-md); border-color: var(--c-slate-300); transform: translateY(-1px); }
.list-card-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.list-card-desc  { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 8px; }
.list-card-meta  { font-size: 11px; color: var(--text-muted); display: flex; gap: 10px; }

/* ── Toolbar / Filters ────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.toolbar .input,
.toolbar .select,
.toolbar .input-sm,
.toolbar .select.input-sm { height: 32px; width: auto; }
.filter-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 11.5px; font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast);
}
.filter-pill:hover { background: var(--bg-subtle); border-color: var(--c-slate-300); color: var(--text); }
.filter-pill--accent { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.filter-pill--accent:hover { background: var(--accent-tint); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; line-height: 1.4;
  letter-spacing: -.005em;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  cursor: pointer;
  transition:
    background var(--motion-fast) var(--ease),
    border-color var(--motion-fast) var(--ease),
    color var(--motion-fast) var(--ease),
    box-shadow var(--motion-fast) var(--ease),
    transform var(--motion-fast) var(--ease);
}
.btn:active:not(:disabled):not([disabled]) { transform: translateY(.5px); }
.btn:disabled, .btn[disabled] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn .material-icons { font-size: 16px !important; }
.btn .material-icons.sm { font-size: 14px !important; }

.btn-sm { padding: 5px 10px; font-size: 12px; gap: 4px; }
.btn-sm .material-icons { font-size: 14px !important; }
.btn-xs { padding: 3px 8px; font-size: 11px; gap: 3px; border-radius: var(--radius-xs); }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(59, 130, 246, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 2px 6px rgba(59, 130, 246, .3), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.btn-secondary, .btn-ghost {
  background: var(--surface); color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled), .btn-ghost:hover:not(:disabled) {
  background: var(--bg-muted); color: var(--text); border-color: var(--c-slate-300);
}
.btn-ghost.btn-success         { color: var(--success); border-color: transparent; background: transparent; }
.btn-ghost.btn-success:hover   { background: rgba(34, 197, 94, .08); border-color: transparent; }
.btn-ghost.btn-danger          { color: var(--danger); border-color: transparent; background: transparent; }
.btn-ghost.btn-danger:hover    { background: rgba(239, 68, 68, .08); border-color: transparent; }
.btn-danger {
  background: var(--danger); color: #fff;
  box-shadow: 0 1px 2px rgba(239, 68, 68, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }
.btn-success {
  background: var(--success); color: #fff;
  box-shadow: 0 1px 2px rgba(34, 197, 94, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.btn-success:hover:not(:disabled) { background: var(--success-hover); }
.btn-delete {
  background: transparent; color: var(--danger); border: 1px solid var(--border);
}
.btn-delete:hover:not(:disabled) { background: rgba(239, 68, 68, .08); border-color: var(--danger); }

.btn-icon-xs {
  background: none; border: none; padding: 4px;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.btn-icon-xs:hover { background: var(--bg-muted); color: var(--text); }

.btn.is-loading { color: transparent !important; pointer-events: none; position: relative; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 14px; height: 14px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%;
  color: #fff;
  animation: spin .7s linear infinite;
}
.btn-ghost.is-loading::after, .btn-secondary.is-loading::after { color: var(--text-secondary); }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ── Form Controls ────────────────────────────────────────── */
.input, .select, .textarea {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text);
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast);
  outline: none;
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.input:hover:not(:focus):not(:disabled),
.select:hover:not(:focus):not(:disabled),
.textarea:hover:not(:focus):not(:disabled) { border-color: var(--c-slate-300); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}
.input:disabled, .select:disabled, .textarea:disabled {
  background: var(--bg-muted); color: var(--text-muted); cursor: not-allowed;
}
.input-sm, .select.input-sm { padding: 6px 10px; font-size: 12px; }
.textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
.input-error, .input.is-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, .12) !important;
}
.field-error-msg, .form-error {
  color: var(--danger); font-size: 11.5px; margin-top: 4px;
  display: flex; align-items: center; gap: 4px;
}
.error-text { color: var(--danger); font-size: 13px; margin-top: var(--space-3); }

.select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}

.field { margin-bottom: var(--space-3); }
.field--mt { margin-top: var(--space-3); }
.field-icon { color: var(--text-muted); font-size: 16px; }
.field-label, .label {
  display: block;
  font-size: 12.5px; font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}
.field-hint, .form-help {
  font-size: 11.5px; color: var(--text-muted); margin-top: 4px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.form-grid { display: grid; gap: var(--space-3); }
.form-grid-2col { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.form-grid-3col { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.form-grid-4col { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-3); }

.form-section {
  padding: var(--space-4);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
}
.form-section-title {
  font-size: 12px; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: .04em;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: var(--space-3);
}
.record-form-sections { display: flex; flex-direction: column; gap: var(--space-3); }

.perms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.perm-checkbox, .perm-checkbox-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  cursor: pointer;
  transition: background var(--motion-fast), border-color var(--motion-fast);
}
.perm-checkbox:hover, .perm-checkbox-item:hover { background: var(--accent-soft); border-color: var(--accent); }
.perm-checkbox input[type="checkbox"], .perm-cb { accent-color: var(--accent); width: 16px; height: 16px; }

/* Status pill (kanban etc.) */
.status-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-muted);
  font-size: 11px; font-weight: 600;
  text-transform: capitalize;
  color: var(--text-secondary);
}

/* Status option radios (cost proposal etc.) */
.status-option {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--motion-fast) !important;
}
.status-option:hover { border-color: var(--accent) !important; background: var(--accent-soft) !important; }
.status-option:has(input[type="radio"]:checked) {
  background: var(--accent-soft) !important;
  border-color: var(--accent) !important;
  font-weight: 600;
}
.status-option input[type="radio"] { accent-color: var(--accent); }

/* ── Tables ───────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; }
.tbl thead { border-bottom: 1px solid var(--border); background: var(--bg-subtle); }
.tbl th {
  padding: 11px 16px;
  text-align: left;
  font-size: 10.5px; font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .05em;
  background: var(--bg-subtle);
  white-space: nowrap;
  position: sticky; top: 0;
  z-index: 1;
}
.tbl th.sortable { cursor: pointer; user-select: none; transition: color var(--motion-fast), background var(--motion-fast); }
.tbl th.sortable:hover { color: var(--text); background: var(--bg-muted); }
.tbl th.sortable::after { content: "↕"; margin-left: 4px; opacity: .35; font-size: 10px; }
.tbl th.sorted-asc::after { content: "↑"; opacity: 1; color: var(--accent); }
.tbl th.sorted-desc::after { content: "↓"; opacity: 1; color: var(--accent); }
.tbl td {
  padding: 11px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
  vertical-align: middle;
}
.tbl tbody tr { transition: background var(--motion-fast); }
.tbl tbody tr:hover { background: var(--bg-subtle); }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr.clickable-row { cursor: pointer; }
.tbl tbody tr.clickable-row:hover { background: var(--accent-soft); }
.tbl-actions { display: flex; gap: 4px; }
.tbl-actions .btn { padding: 4px 8px; }
.tbl-empty { padding: 64px 16px !important; text-align: center; color: var(--text-muted); font-size: 13px; }
.tbl-name { font-weight: 600; color: var(--text); }
.tbl-accent { color: var(--accent); font-weight: 600; }
.tbl-accent-link { color: var(--accent); }
.tbl-accent-link:hover { color: var(--accent-hover); text-decoration: underline; }
.tbl-capitalize { text-transform: capitalize; }
.tbl-mono { font-family: var(--mono); font-size: 12px; }
.tbl-truncate { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Cost-proposal items / totals */
.items-table, .totals-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.items-table th, .totals-table th { background: var(--bg-subtle); }
.items-table th, .items-table td, .totals-table th, .totals-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
  font-size: 12.5px;
}
.items-table tr:last-child td, .totals-table tr:last-child td { border-bottom: none; }
.cp-item-row td { background: var(--surface); }
.cp-is-header td {
  background: var(--bg-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text);
}
.total-row td {
  font-weight: 700;
  background: var(--bg-subtle);
}
.total-row.grand td {
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 14px;
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 10.5px; font-weight: 600;
  letter-spacing: .01em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.badge-approved, .badge-active, .badge-engaged, .badge-success { background: var(--c-green-50); color: var(--c-green-700); }
.badge-approved .badge-dot, .badge-active .badge-dot, .badge-engaged .badge-dot, .badge-success .badge-dot { background: var(--success); }
.badge-pending, .badge-warning { background: var(--c-amber-50); color: var(--c-amber-700); }
.badge-pending .badge-dot, .badge-warning .badge-dot { background: var(--warning); }
.badge-rejected, .badge-danger { background: var(--c-red-50); color: var(--c-red-700); }
.badge-rejected .badge-dot, .badge-danger .badge-dot { background: var(--danger); }
.badge-new { background: var(--c-blue-50); color: var(--c-blue-700); }
.badge-new .badge-dot { background: var(--accent); }
.badge-info { background: rgba(14, 165, 233, .08); color: #0369a1; }
.badge-info .badge-dot { background: #0ea5e9; }
.badge-inactive, .badge-default { background: var(--bg-muted); color: var(--text-muted); }
.badge-inactive .badge-dot, .badge-default .badge-dot { background: var(--text-soft); }
[data-theme="dark"] .badge { border-color: var(--hairline); background-color: color-mix(in srgb, currentColor 12%, transparent); }

/* Audit action badges */
.audit-action-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.audit-action-badge.create { background: var(--c-green-50); color: var(--c-green-700); }
.audit-action-badge.update { background: var(--c-blue-50);  color: var(--c-blue-700); }
.audit-action-badge.delete { background: var(--c-red-50);   color: var(--c-red-700); }
.audit-action-badge.login  { background: var(--c-amber-50); color: var(--c-amber-700); }
.audit-action-badge.other  { background: var(--bg-muted);   color: var(--text-muted); }
[data-theme="dark"] .audit-action-badge.create { background: rgba(34, 197, 94, .15); color: #4ade80; }
[data-theme="dark"] .audit-action-badge.update { background: rgba(59, 130, 246, .15); color: #93c5fd; }
[data-theme="dark"] .audit-action-badge.delete { background: rgba(239, 68, 68, .15); color: #fca5a5; }
[data-theme="dark"] .audit-action-badge.login  { background: rgba(245, 158, 11, .15); color: #fcd34d; }
[data-theme="dark"] .audit-action-badge.other  { background: rgba(148, 163, 184, .15); color: #94a3b8; }

/* ── Pager ────────────────────────────────────────────────── */
.pager {
  display: flex; align-items: center; gap: 4px;
  padding: 14px 20px;
  border-top: 1px solid var(--hairline);
  flex-wrap: wrap;
}
.pager button, .pager-prev, .pager-next {
  min-width: 32px; height: 32px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 500;
  color: var(--text-secondary);
  transition: background var(--motion-fast), border-color var(--motion-fast), color var(--motion-fast);
}
.pager button:hover:not(:disabled):not(.active) { background: var(--bg-muted); border-color: var(--c-slate-300); color: var(--text); }
.pager button.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; pointer-events: none; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.pager-ellipsis { padding: 0 6px; color: var(--text-muted); font-size: 12px; user-select: none; }
.pagination-counter { padding: 4px 8px; font-size: 12px; color: var(--text-muted); margin-left: auto; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: var(--z-modal);
  align-items: flex-start; justify-content: center;
  padding: 48px 16px;
  overflow-y: auto;
}
.modal-backdrop.open { display: flex; animation: fadeIn var(--motion) var(--ease); }
.overlay-modal-backdrop { z-index: var(--z-popover); }
.modal-panel, .modal-card {
  width: 100%; max-width: 540px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  animation: modalIn var(--motion-slow) var(--ease-out);
  display: flex; flex-direction: column;
}
.modal-panel.wide, .modal-panel.full { max-width: 800px; }
.modal-panel.full { max-width: 1100px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: 18px 24px;
  border-bottom: 1px solid var(--hairline);
}
.modal-title { font-size: 15px; font-weight: 600; letter-spacing: -.005em; color: var(--text); }
.modal-x {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast);
}
.modal-x:hover { background: var(--bg-muted); color: var(--text); border-color: var(--border); }
.modal-body { padding: var(--space-6); flex: 1; overflow: auto; }
.modal-foot, .modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2);
  padding: 14px 24px;
  background: var(--bg-subtle);
  border-top: 1px solid var(--hairline);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
[data-theme="dark"] .modal-foot, [data-theme="dark"] .modal-footer { background: var(--bg); }

/* Generic "modal" container fallback (used by some legacy templates) */
.modal {
  position: fixed; inset: 0; z-index: var(--z-modal);
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: var(--space-4);
}

/* Record / IG / Sprout slide-over panel */
.record-detail-backdrop {
  display: none; position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
  z-index: var(--z-modal);
  justify-content: flex-end;
}
.record-detail-backdrop[style*="display: flex"], .record-detail-backdrop.open { display: flex !important; }
.record-detail-panel {
  width: 100%; max-width: 600px; height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-xl);
  display: flex; flex-direction: column;
  animation: panelIn var(--motion-slow) var(--ease-out);
}
@keyframes panelIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.record-detail-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
  position: sticky; top: 0; z-index: 1;
}
.record-detail-body { flex: 1; overflow: auto; padding: var(--space-5); }

/* ── Toasts ───────────────────────────────────────────────── */
.toast-wrap {
  position: fixed; top: 16px; right: 16px;
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: var(--c-slate-800);
  color: #fff;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: var(--shadow-lg);
  font-size: 13px; font-weight: 500;
  min-width: 280px; max-width: 380px;
  pointer-events: auto;
  animation: toastIn var(--motion-slow) var(--ease-out);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }
.toast-success { background: var(--c-green-700); }
.toast-error   { background: var(--c-red-700); }
.toast-info    { background: var(--c-blue-700); }

/* Sileo toast (richer notification style) */
.sileo-toast-container {
  position: fixed; top: 16px; right: 16px;
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none;
}
.sileo-toast {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 320px; max-width: 420px;
  pointer-events: auto;
  animation: toastIn var(--motion-slow) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.sileo-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sileo-text { flex: 1; min-width: 0; }
.sileo-text-title { font-size: 13px; font-weight: 600; color: var(--text); }
.sileo-text-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; line-height: 1.5; }
.sileo-action {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 11.5px; font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.sileo-action:hover { background: var(--bg-muted); color: var(--text); }
.sileo-close {
  width: 20px; height: 20px;
  background: none; border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.sileo-close:hover { color: var(--text); }
.sileo-progress {
  position: absolute; bottom: 0; left: 0;
  height: 3px; background: var(--accent);
  animation: sileoProgress 5s linear forwards;
}
@keyframes sileoProgress { from { width: 100%; } to { width: 0; } }

/* ── Notifications ────────────────────────────────────────── */
.notification-wrap { position: relative; }
.notification-panel {
  display: none;
  position: absolute; top: calc(100% + 6px); right: 0;
  width: min(380px, 90vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-popover);
  max-height: 480px;
  overflow: hidden;
  animation: panelDropIn var(--motion) var(--ease-out);
}
.notification-panel.open { display: flex; flex-direction: column; }
@keyframes panelDropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.notification-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg-subtle);
}
[data-theme="dark"] .notification-header { background: var(--bg); }
.notification-list { flex: 1; overflow-y: auto; }
.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
  cursor: pointer;
  transition: background var(--motion-fast);
  display: flex; flex-direction: column; gap: 4px;
}
.notification-item:hover { background: var(--bg-subtle); }
.notification-item.unread { background: rgba(59, 130, 246, .04); }
.notification-item.unread:hover { background: rgba(59, 130, 246, .08); }
.notification-item-message { font-size: 13px; color: var(--text); line-height: 1.4; }
.notification-item-time { font-size: 11px; color: var(--text-muted); }
.notification-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--danger); color: #fff;
  border: 2px solid var(--surface);
  border-radius: var(--radius-pill);
  font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
}

/* ── Skeleton ─────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-muted) 0%, #e6ecf3 40%, var(--bg-muted) 80%);
  background-size: 600px 100%;
  border-radius: var(--radius-sm);
  animation: skeletonShimmer 1.4s ease-in-out infinite;
}
[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, #1e293b 0%, #2c3a52 40%, #1e293b 80%);
  background-size: 600px 100%;
}
@keyframes skeletonShimmer { 0% { background-position: -300px 0; } 100% { background-position: 300px 0; } }
.skeleton-text { height: 12px; margin: 6px 0; border-radius: var(--radius-xs); }

/* ── Empty / Error states ─────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
  gap: var(--space-2);
}
.empty-state-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--bg-muted); color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: var(--space-1);
}
.empty-state-icon .material-icons { font-size: 28px; }
.empty-state-title { font-size: 14px; font-weight: 600; color: var(--text); }
.home-empty, .audit-empty, .ig-detail-empty {
  text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 13px;
}

/* ── Tabs ─────────────────────────────────────────────────── */
.tab-bar, .tab-container {
  display: flex; gap: 2px;
  border-bottom: 1px solid var(--border);
  padding: 0;
  overflow-x: auto;
}
.tab-btn {
  padding: 9px 14px;
  background: none; border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  transition: color var(--motion-fast), border-color var(--motion-fast), background var(--motion-fast);
}
.tab-btn:hover { color: var(--text); background: var(--bg-subtle); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Theme Selector dropdown ──────────────────────────────── */
#themeSelector { position: relative; display: none; }
.theme-dropdown {
  display: none;
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  z-index: var(--z-popover);
  min-width: 220px;
}
.theme-dropdown.open { display: block; animation: panelDropIn var(--motion) var(--ease-out); }
.theme-dropdown-title {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
  padding: 6px 10px;
}
.theme-option {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; color: var(--text);
  transition: background var(--motion-fast);
}
.theme-option:hover { background: var(--bg-muted); }
.theme-option.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.theme-swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--hairline); flex-shrink: 0; }

/* ── Detail blocks (record, IG, etc.) ─────────────────────── */
.detail-section { padding: var(--space-4) 0; border-bottom: 1px solid var(--hairline); }
.detail-section:last-child { border-bottom: none; }
.detail-section--mt { margin-top: var(--space-3); }
.detail-section--mt-md { margin-top: var(--space-4); }
.detail-section--mt-lg { margin-top: var(--space-6); }
.detail-section-title {
  font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
  margin-bottom: var(--space-2);
}
.detail-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}
.detail-item { display: flex; flex-direction: column; gap: 2px; }
.detail-item-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.detail-item-value { font-size: 13px; color: var(--text); font-weight: 500; }

/* ── Home ─────────────────────────────────────────────────── */
.home-welcome {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-5);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.home-welcome-left {
  flex: 1; min-width: 0;
  padding: 28px 32px;
  display: flex; flex-direction: column; justify-content: center;
}
.home-welcome-text { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.home-welcome-sub { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }
.home-clock { margin-top: 10px; font-size: 28px; font-weight: 700; letter-spacing: -.02em; color: var(--accent); }
.home-date { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.home-welcome-right {
  width: 380px; flex-shrink: 0;
  padding: 20px 24px;
  border-left: 1px solid var(--hairline);
  background: var(--bg-subtle);
  overflow-y: auto;
  max-height: 280px;
}
.home-welcome-right-title {
  position: sticky; top: 0;
  background: var(--bg-subtle);
  font-size: 13px; font-weight: 700; color: var(--text);
  padding: 8px 0 12px;
  display: flex; align-items: center; gap: 6px;
}
.home-welcome-right-title .material-icons { font-size: 18px; color: var(--accent); }
.home-welcome-pinned { margin-bottom: var(--space-4); }
.home-welcome-pinned-item {
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
  font-size: 12px;
}
.home-welcome-pinned-item:last-child { margin-bottom: 0; }
.home-welcome-pinned-title {
  display: flex; align-items: center; gap: 4px;
  font-weight: 600; color: var(--text);
  margin-bottom: 2px;
}
.home-welcome-pinned-title .material-icons { font-size: 14px; color: var(--accent); }
.home-welcome-pinned-body { color: var(--text-secondary); line-height: 1.4; }
.home-daily-quote {
  padding: 12px 14px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}
.home-daily-quote-text { font-size: 13px; color: var(--text); font-style: italic; line-height: 1.5; margin-bottom: 6px; }
.home-daily-quote-author { font-size: 11px; color: var(--text-muted); font-weight: 600; }

.home-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-5);
}
.home-task-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
}
.home-task-item:last-child { border-bottom: none; }
.home-task-priority { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.home-task-priority.urgent { background: var(--danger); }
.home-task-priority.high   { background: var(--warning); }
.home-task-priority.medium { background: var(--accent); }
.home-task-priority.low    { background: var(--text-soft); }
.home-task-info { flex: 1; min-width: 0; }
.home-task-title { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-task-meta  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.home-task-status {
  font-size: 10.5px; padding: 2px 8px; border-radius: var(--radius-pill); font-weight: 600;
  white-space: nowrap;
}
.home-task-status.pending     { background: var(--c-amber-50); color: var(--c-amber-700); }
.home-task-status.in_progress { background: var(--c-blue-50);  color: var(--c-blue-700); }

.home-announcement-item { padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.home-announcement-item:last-child { border-bottom: none; }
.home-announcement-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 4px;
}
.pin-icon { color: var(--accent); font-size: 14px; }
.home-announcement-body { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.home-announcement-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.home-event-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--hairline);
}
.home-event-item:last-child { border-bottom: none; }
.home-event-date-badge {
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.home-event-date-badge .day { font-size: 16px; font-weight: 700; color: var(--accent); line-height: 1; }
.home-event-date-badge .month { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.home-event-info { flex: 1; min-width: 0; }
.home-event-title { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-event-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.home-team-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-3);
}
.home-team-member {
  text-align: center;
  padding: 14px 8px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  transition: box-shadow var(--motion) var(--ease), transform var(--motion) var(--ease), border-color var(--motion) var(--ease);
  background: var(--surface);
}
.home-team-member:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); border-color: var(--c-slate-300); }
.home-team-avatar {
  width: 48px; height: 48px;
  margin: 0 auto var(--space-2);
  border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; text-transform: uppercase;
  overflow: hidden;
}
.home-team-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.home-team-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-team-role { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Instagram detail / posts ─────────────────────────────── */
.ig-profile-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0; overflow: hidden; }
.ig-profile-card-inner { padding: var(--space-5); }
.ig-profile-row { display: flex; gap: var(--space-4); flex-wrap: wrap; }
.ig-profile-pic, .ig-profile-pic-placeholder {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--bg-muted); color: var(--text-muted);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; text-transform: uppercase;
}
.ig-profile-body { flex: 1; min-width: 240px; }
.ig-profile-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ig-profile-name { font-size: 18px; font-weight: 700; color: var(--text); }
.ig-profile-username { font-size: 14px; color: var(--text-muted); }
.ig-profile-verified, .audit-verified-icon { color: var(--accent); font-size: 16px; }
.ig-profile-business-badge, .ig-profile-category-badge, .ig-profile-platform-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
}
.ig-profile-bio { font-size: 13px; color: var(--text-secondary); line-height: 1.55; margin: 8px 0; white-space: pre-line; }
.ig-profile-link { font-size: 12.5px; color: var(--accent); }
.ig-profile-contact { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: var(--text-secondary); margin-top: 6px; }
.ig-profile-counters {
  display: flex; gap: var(--space-5);
  margin-top: var(--space-3); padding-top: var(--space-3);
  border-top: 1px solid var(--hairline);
}
.ig-profile-counter { display: flex; flex-direction: column; }
.ig-profile-counter-value { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.ig-profile-counter-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.ig-profile-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: var(--space-3); }

.ig-posts-section { margin-top: var(--space-5); }
.ig-posts-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.ig-posts-title-hint { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.ig-posts-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
}
.ig-posts-grid--large { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); }
.ig-post-cell, .ig-post-cell-noimg {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-muted);
  overflow: hidden;
  cursor: pointer;
  border-radius: 2px;
}
.ig-posts-grid--large .ig-post-cell, .ig-posts-grid--large .ig-post-cell-noimg { border-radius: var(--radius-md); }
.ig-post-cell img { width: 100%; height: 100%; object-fit: cover; }
.ig-post-cell-noimg { display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 11px; }
.ig-post-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.7) 100%);
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 8px;
  color: #fff;
  opacity: 0; transition: opacity var(--motion);
}
.ig-post-cell:hover .ig-post-overlay { opacity: 1; }
.ig-post-overlay--full { opacity: 1; padding: 12px; }
.ig-post-overlay-meta {
  display: flex; gap: 12px; font-size: 11px; font-weight: 600;
}
.ig-post-overlay-caption { font-size: 12px; line-height: 1.4; margin-top: 4px; max-height: 36px; overflow: hidden; }
.ig-post-overlay-date { font-size: 10.5px; opacity: .8; margin-top: 2px; }
.ig-post-type-badge, .ig-type-badge {
  position: absolute; top: 6px; right: 6px;
  width: 22px; height: 22px;
  background: rgba(0, 0, 0, .55); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.ig-post-type-badge .material-icons, .ig-type-badge .material-icons { font-size: 14px; }
.ig-post-type-badge--large { width: 28px; height: 28px; }
.ig-post-type-badge--large .material-icons { font-size: 16px; }

.ig-load-posts { display: flex; justify-content: center; margin: var(--space-4) 0; }
.ig-view-all { color: var(--accent); font-size: 12.5px; font-weight: 600; }

.ig-detail-loading, .ig-detail-error, .ig-detail-empty {
  text-align: center; padding: 48px 24px; color: var(--text-muted);
}
.ig-detail-spinner { display: inline-block; margin-bottom: 12px; }
.ig-detail-loading-text { font-size: 13px; }
.ig-detail-error-icon { font-size: 36px; color: var(--danger); }
.ig-detail-error-title { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 8px; }
.ig-detail-error-text { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

.ig-detail-header {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 16px 20px; border-bottom: 1px solid var(--hairline);
}
.ig-detail-author-pic { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.ig-detail-author-name { font-size: 14px; font-weight: 600; color: var(--text); }
.ig-detail-stat-time { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ig-detail-stat-time-text { font-weight: 500; }
.ig-detail-stat-location { font-size: 11px; color: var(--text-muted); }
.ig-detail-media, .ig-detail-media--contain {
  width: 100%; max-height: 540px; object-fit: cover; background: #000;
}
.ig-detail-media--contain { object-fit: contain; }
.ig-detail-stats {
  display: flex; gap: var(--space-5);
  padding: 14px 20px;
  border-bottom: 1px solid var(--hairline);
}
.ig-detail-stat { display: flex; flex-direction: column; }
.ig-detail-stat-value { font-size: 16px; font-weight: 700; color: var(--text); }
.ig-detail-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.ig-detail-caption { padding: var(--space-4) 20px; }
.ig-detail-caption-title, .ig-detail-comments-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.ig-detail-caption-text { font-size: 13px; color: var(--text); line-height: 1.55; white-space: pre-line; }
.ig-detail-hashtags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ig-detail-hashtag, .ig-detail-hashtag-inline {
  padding: 2px 8px; background: var(--accent-soft); color: var(--accent);
  border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 600;
}
.ig-detail-comments { padding: var(--space-4) 20px; border-top: 1px solid var(--hairline); }
.ig-detail-comments-list { display: flex; flex-direction: column; gap: var(--space-3); }
.ig-comment-row { display: flex; gap: 10px; }
.ig-comment-pic, .ig-comment-pic-placeholder {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  object-fit: cover;
  background: var(--bg-muted); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.ig-comment-body { flex: 1; min-width: 0; }
.ig-comment-header { display: flex; align-items: center; gap: 6px; }
.ig-comment-username { font-size: 12.5px; font-weight: 600; color: var(--text); }
.ig-comment-likes { font-size: 11px; color: var(--text-muted); }
.ig-comment-text { font-size: 12.5px; color: var(--text); line-height: 1.5; }
.ig-detail-external-link { color: var(--accent); font-size: 12px; }

/* Follower history (IG profile) chart embed */
.follower-history-chart {
  position: relative;
  width: 100%;
  height: 220px;
  padding: var(--space-3);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
}
.follower-history-meta {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  font-size: 11.5px; color: var(--text-muted);
}

/* Generic transition state modifiers (used by chat msg / panel animations) */
.entering { opacity: 0; transform: translateY(4px); transition: opacity var(--motion) var(--ease), transform var(--motion) var(--ease); }
.entering.active { opacity: 1; transform: translateY(0); }
.exiting { opacity: 1; transition: opacity var(--motion) var(--ease), transform var(--motion) var(--ease); }
.exiting.leave { opacity: 0; transform: translateY(-4px); }

.ig-user-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--space-3); padding: 0 20px var(--space-3); }
.ig-user-stat-card { background: var(--bg-subtle); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; text-align: center; }
.ig-user-stat-value { font-size: 16px; font-weight: 700; color: var(--text); }
.ig-user-stat-label { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; margin-top: 2px; }
.ig-user-posts-meta { padding: 8px 20px; font-size: 12px; color: var(--text-muted); border-bottom: 1px solid var(--hairline); }
.ig-user-posts-rate-note { font-size: 11px; color: var(--warning); }
.ig-user-posts-total { font-weight: 600; color: var(--text); }
.ig-user-posts-error-actions { display: flex; gap: 8px; margin-top: 12px; justify-content: center; }
.ig-user-posts-error-detail { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.ig-user-posts-error-title { font-size: 14px; font-weight: 600; color: var(--text); }

.ig-carousel-wrap { position: relative; }
.ig-carousel-counter {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0, 0, 0, .6); color: #fff;
  padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
}
.ig-carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px;
  background: rgba(0, 0, 0, .55); color: #fff;
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* APC carousel (announcements) */
.apc-wrap { position: relative; }
.apc-slide { display: none; }
.apc-slide.active { display: block; }
.apc-prev, .apc-next, .apc-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.apc-prev { left: -10px; } .apc-next { right: -10px; }
.apc-prev:hover, .apc-next:hover, .apc-btn:hover { background: var(--bg-muted); color: var(--text); }
.apc-dots { display: flex; gap: 4px; justify-content: center; margin-top: 8px; }
.apc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); cursor: pointer; transition: background var(--motion-fast); }
.apc-dot.active { background: var(--accent); }
.apc-counter { font-size: 11px; color: var(--text-muted); }

/* ── Cost-proposal specific ───────────────────────────────── */
.cp-sect { padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: var(--space-3); background: var(--bg-subtle); }
.cp-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: var(--space-2); }
.cp-desc, .cp-letter { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; }
.cp-freq { font-size: 11px; font-weight: 600; color: var(--accent); }
.cp-php, .cp-sgd { font-family: var(--mono); }
.cp-provision-cb { display: flex; align-items: center; gap: 8px; padding: 6px 10px; }
.signatures { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); margin-top: var(--space-4); }
.sig-block { padding: var(--space-3); border: 1px dashed var(--border); border-radius: var(--radius-md); text-align: center; }
.sig-img { max-width: 180px; margin-bottom: var(--space-2); }
.sig-line { border-top: 1px solid var(--text-muted); margin-bottom: 6px; }
.sig-title { font-size: 12px; font-weight: 600; color: var(--text); }
.terms { padding: var(--space-4); background: var(--bg-subtle); border-radius: var(--radius-md); font-size: 12.5px; line-height: 1.55; color: var(--text-secondary); }
.terms-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: var(--space-2); }
.pr-btn { padding: 4px 10px; }
.dl-btn { padding: 4px 10px; }
.fa-row { display: flex; align-items: center; gap: 6px; }
.fa-edit, .fa-modify, .fa-view { padding: 4px; border-radius: var(--radius-xs); cursor: pointer; color: var(--text-muted); }
.fa-edit:hover, .fa-modify:hover, .fa-view:hover { color: var(--accent); background: var(--accent-soft); }

/* ── Sprout (publishing/inbox/listening/analytics) ────────── */
.sp-stat-grid-2col, .sp-stat-grid-4col {
  display: grid; gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.sp-stat-grid-2col { grid-template-columns: repeat(2, 1fr); }
.sp-stat-grid-4col { grid-template-columns: repeat(4, 1fr); }
.sp-stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px;
  box-shadow: var(--shadow-xs);
}
.sp-stat-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.sp-stat-value { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -.02em; line-height: 1.1; margin-top: 4px; }
.sp-stat-value--lg { font-size: 26px; }

.sp-detail-header, .sp-detail-header--lg {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: var(--space-3);
}
.sp-detail-platform-icon, .sp-detail-platform-icon--lg {
  width: 32px; height: 32px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sp-detail-platform-icon--lg { width: 40px; height: 40px; }
.sp-detail-title, .sp-detail-title--md {
  font-size: 14px; font-weight: 600; color: var(--text);
}
.sp-detail-title--md { font-size: 16px; }
.sp-detail-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.sp-detail-status-flex { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sp-detail-status-right { margin-left: auto; }

.sp-content-block, .sp-content-block--lg {
  padding: var(--space-3);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  font-size: 13px; line-height: 1.55; color: var(--text);
}
.sp-content-block--lg { font-size: 14px; }

.sp-engagement-section { margin-top: var(--space-3); }
.sp-engagement-section-title { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.sp-engagement-sm { display: flex; gap: var(--space-4); font-size: 12.5px; color: var(--text-secondary); }
.sp-tags-block { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.sp-hashtags-accent { color: var(--accent); }

.sp-inbox-card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: 6px; }
.sp-inbox-card-content { font-size: 13px; color: var(--text); line-height: 1.5; }
.sp-inbox-card-footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); margin-top: 8px; }
.sp-inbox-card-footer-date { font-size: 11px; color: var(--text-muted); }
.sp-inbox-card-icon { color: var(--accent); }
.sp-inbox-card-name { font-size: 13px; font-weight: 600; color: var(--text); }
.sp-inbox-card-email { font-size: 11.5px; color: var(--text-muted); }
.sp-inbox-card-actions { display: flex; gap: 4px; }
.sp-inbox-email-cell, .sp-inbox-msg-cell { display: flex; flex-direction: column; gap: 2px; }
.sp-listen-author { font-weight: 600; color: var(--text); }
.sp-listen-content-cell { max-width: 320px; }

.sp-notes-section { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--hairline); }
.sp-original-link { font-size: 12px; color: var(--accent); }

.sp-reply-block {
  margin-top: var(--space-3); padding: var(--space-3);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}
.sp-reply-content { font-size: 13px; color: var(--text); line-height: 1.5; }
.sp-reply-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.sp-sentiment-bar {
  display: flex; height: 8px;
  border-radius: var(--radius-pill); overflow: hidden;
  background: var(--bg-muted);
}
.sp-sentiment-bar-pos { background: var(--success); }
.sp-sentiment-bar-neu { background: var(--text-soft); }
.sp-sentiment-bar-neg { background: var(--danger); }
.sp-sentiment-dot, .sp-sentiment-dot--lg {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.sp-sentiment-dot--lg { width: 12px; height: 12px; }
.sp-sentiment-dot--mr { margin-right: 6px; }
.sp-sentiment-dot--positive { background: var(--success); }
.sp-sentiment-dot--neutral  { background: var(--text-soft); }
.sp-sentiment-dot--negative { background: var(--danger); }
.sp-sentiment-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600;
  background: var(--bg-muted);
  color: var(--text-secondary);
}
.sp-topic-keywords, .sp-topic-platforms { display: flex; gap: 4px; flex-wrap: wrap; }
.sp-text-muted { color: var(--text-muted); }
.sp-capitalize { text-transform: capitalize; }

.sentiment-widget { display: flex; flex-direction: column; gap: 8px; }
.sentiment-bar {
  display: flex; height: 8px;
  border-radius: var(--radius-pill); overflow: hidden;
  background: var(--bg-muted);
}
.sentiment-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); }

/* ── Monday-style Boards (kanban: tasks, sprout columns) ─── */
.task-board, .monday-board {
  display: flex; gap: var(--space-3);
  overflow-x: auto;
  padding: var(--space-3) 0;
  min-height: 400px;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
}
.task-column, .monday-col {
  min-width: 300px; max-width: 320px;
  flex: 0 0 300px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  max-height: calc(100vh - 200px);
  scroll-snap-align: start;
  overflow: hidden;
  transition: box-shadow var(--motion);
}
.task-column:hover, .monday-col:hover { box-shadow: var(--shadow-sm); }
.task-column-header, .monday-col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
  font-size: 12.5px; font-weight: 700;
  color: var(--text);
  text-transform: uppercase; letter-spacing: .04em;
  position: sticky; top: 0; z-index: 1;
}
.task-column-title { flex: 1; }
.task-count, .monday-col-count {
  margin-left: auto;
  background: var(--bg-muted);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  font-size: 11px; font-weight: 700;
  color: var(--text-muted);
}
.monday-col-body, .task-list { padding: var(--space-2); overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: var(--space-2); }
.task-card, .monday-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: var(--shadow-xs);
  cursor: grab;
  transition: box-shadow var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast);
}
.task-card:hover, .monday-card:hover { box-shadow: var(--shadow-sm); border-color: var(--c-slate-300); transform: translateY(-1px); }
.task-card.dragging, .monday-card.dragging { opacity: .5; cursor: grabbing; }
.task-column.drag-over, .monday-col.drag-over, .monday-col.dragover { background: var(--accent-soft); border-color: var(--accent); }
.task-card-title, .monday-card-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.task-card-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); margin-top: 6px; flex-wrap: wrap; }
.task-priority { font-size: 10.5px; padding: 1px 6px; border-radius: var(--radius-pill); text-transform: uppercase; font-weight: 700; }
.monday-card--high { border-left: 3px solid var(--warning); }
.monday-card--urgent { border-left: 3px solid var(--danger); }
.monday-card-tag {
  display: inline-flex; padding: 1px 6px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--radius-pill);
  font-size: 10.5px; font-weight: 600;
}
.monday-add-item {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast), border-color var(--motion-fast);
}
.monday-add-item:hover { background: var(--bg-muted); color: var(--text); border-color: var(--c-slate-300); }
.monday-col--draft   .monday-col-head { color: var(--text-muted); }
.monday-col--sent    .monday-col-head { color: var(--accent); }
.monday-col--read    .monday-col-head { color: var(--text-secondary); }
.monday-col--replied .monday-col-head { color: var(--success); }
.monday-col--archived .monday-col-head { color: var(--text-soft); }

/* ── Chat ─────────────────────────────────────────────────── */
.chat-layout {
  display: flex; gap: 0;
  height: calc(100vh - 130px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.chat-sidebar {
  width: 280px;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  background: var(--bg-subtle);
}
[data-theme="dark"] .chat-sidebar { background: var(--surface); }
.chat-main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--surface);
}
.chat-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.chat-title { font-size: 14px; font-weight: 600; color: var(--text); }
.chat-header-actions { display: flex; align-items: center; gap: 4px; }
.chat-messages {
  flex: 1; overflow-y: auto;
  padding: var(--space-4);
  background: var(--bg-subtle);
  display: flex; flex-direction: column; gap: var(--space-2);
}
[data-theme="dark"] .chat-messages { background: var(--bg); }
.chat-message {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 13px; line-height: 1.5;
  word-wrap: break-word;
  position: relative;
}
.chat-message.sent {
  background: var(--accent); color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: var(--radius-sm);
}
.chat-message.received {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  align-self: flex-start;
  border-bottom-left-radius: var(--radius-sm);
}
.chat-message-sender { font-size: 11px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.chat-message-text { white-space: pre-wrap; }
.chat-message-time { font-size: 10.5px; opacity: .65; margin-top: 4px; }
.chat-msg-action { opacity: 0; transition: opacity var(--motion-fast); }
.chat-message:hover .chat-msg-action { opacity: 1; }
.chat-input {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; gap: 8px;
}
.chat-input .input { flex: 1; }
.chat-empty {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-muted);
  gap: 8px;
}
.chat-empty .material-icons { font-size: 40px; opacity: .4; }
.chat-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  margin: 2px 6px;
  transition: background var(--motion-fast);
}
.chat-item:hover { background: var(--bg-muted); }
.chat-item.active { background: var(--accent-soft); }
.chat-item-avatar {
  width: 36px; height: 36px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; text-transform: uppercase;
  flex-shrink: 0;
}
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item-preview { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.chat-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 4px; margin-top: 6px; }
.chat-media-thumb, .chat-media-preview {
  aspect-ratio: 1 / 1;
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
}
.chat-media-thumb img, .chat-media-preview img { width: 100%; height: 100%; object-fit: cover; }
.chat-file-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, .12);
  border-radius: var(--radius-sm);
  font-size: 12px;
}

.typing-indicator {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 11px; color: var(--text-muted);
  align-self: flex-start;
}

/* Floating chat */
.floating-chat-btn {
  position: fixed; bottom: 24px; right: 24px;
  width: 56px; height: 56px;
  background: var(--accent); color: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: var(--z-sticky);
  transition: transform var(--motion-fast), box-shadow var(--motion-fast);
}
.floating-chat-btn:hover { transform: scale(1.05); box-shadow: var(--shadow-xl); }
.floating-chat-btn .material-icons { font-size: 24px; }
.floating-chat-badge {
  position: absolute; top: 6px; right: 6px;
  min-width: 18px; height: 18px;
  background: var(--danger); color: #fff;
  border: 2px solid var(--accent);
  border-radius: var(--radius-pill);
  font-size: 10px; font-weight: 700;
  padding: 0 5px;
  display: flex; align-items: center; justify-content: center;
}
.floating-chat-panel {
  display: none;
  position: fixed; bottom: 90px; right: 24px;
  width: 480px; height: 600px;
  max-height: calc(100vh - 130px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: var(--z-sticky);
  flex-direction: column;
  overflow: hidden;
  animation: panelDropIn var(--motion-slow) var(--ease-out);
}
.floating-chat-panel.open { display: flex; }
.floating-chat-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}
.floating-chat-panel-body { flex: 1; display: flex; min-height: 0; }
.floating-chat-sidebar {
  width: 200px;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.floating-chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* Group call participant */
.gc-participant {
  position: relative;
  background: #222;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}
.gc-participant.local { border: 2px solid var(--accent); }
.gc-participant video { width: 100%; height: 100%; object-fit: cover; }

/* ── Video call ───────────────────────────────────────────── */
.video-call-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, .92);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--motion-slow) var(--ease);
}
.video-call-overlay.minimized {
  inset: auto;
  bottom: 20px; right: 20px;
  width: 320px; height: 240px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.video-call-overlay.minimized .video-call-container { border-radius: var(--radius-lg); }
.video-call-overlay.minimized .video-call-header { padding: 6px 10px; font-size: 12px; }
.video-call-overlay.minimized .video-call-controls { padding: 6px; gap: 6px; }
.video-call-overlay.minimized .video-call-btn { width: 36px; height: 36px; }
.video-call-overlay.minimized .video-call-grid { gap: 0; }
.video-call-overlay.minimized .video-call-participant { border-radius: 0; }

.video-call-container {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  background: #111;
  overflow: hidden;
}
.video-call-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  background: rgba(0, 0, 0, .55);
  color: #fff; font-size: 14px; font-weight: 600;
  flex-shrink: 0; z-index: 1;
}
.video-call-grid {
  flex: 1; display: grid; gap: 8px; padding: 8px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  align-content: center;
  overflow: hidden;
}
.video-call-participant {
  position: relative;
  background: #222;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16 / 9; min-height: 200px;
}
.video-call-participant video { width: 100%; height: 100%; object-fit: cover; }
.video-call-participant.local { border: 2px solid var(--accent); }
.video-call-label {
  position: absolute; bottom: 8px; left: 10px;
  background: rgba(0, 0, 0, .55); color: #fff;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
}
.video-call-controls {
  display: flex; align-items: center; justify-content: center; gap: var(--space-4);
  padding: 16px;
  background: rgba(0, 0, 0, .6);
  flex-shrink: 0;
}
.video-call-btn {
  width: 48px; height: 48px;
  border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .15); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--motion-fast), transform var(--motion-fast);
}
.video-call-btn:hover { background: rgba(255, 255, 255, .25); transform: scale(1.05); }
.video-call-btn.active { background: var(--danger); }
.video-call-btn.hangup { background: var(--danger); }
.video-call-btn.hangup:hover { background: var(--danger-hover); }
.video-call-btn.answer { background: var(--success); }
.video-call-btn.answer:hover { background: var(--success-hover); }

/* Lobby */
.lobby-container { padding: var(--space-6); display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }
.lobby-preview { width: 480px; max-width: 100%; aspect-ratio: 16/9; background: #000; border-radius: var(--radius-lg); overflow: hidden; }
.lobby-preview video { width: 100%; height: 100%; object-fit: cover; }
.lobby-controls { display: flex; gap: var(--space-3); }
.lobby-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-muted); color: var(--text-secondary);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--motion-fast), color var(--motion-fast);
}
.lobby-btn:hover { background: var(--c-slate-200); color: var(--text); }
.lobby-btn--mic.active, .lobby-btn--cam.active { background: var(--danger); color: #fff; border-color: transparent; }
.lobby-btn--join { background: var(--success); color: #fff; border-color: transparent; padding: 0 22px; width: auto; border-radius: var(--radius-pill); }
.lobby-btn--join:hover { background: var(--success-hover); }

/* Incoming call popup */
.incoming-call-popup {
  position: fixed; top: 24px; right: 24px;
  z-index: 10001;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 18px;
  min-width: 320px;
  animation: callSlideIn var(--motion-slow) var(--ease-out);
}
@keyframes callSlideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
.incoming-call-content { display: flex; align-items: center; gap: 12px; }
.incoming-call-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; text-transform: uppercase;
  flex-shrink: 0;
}
.incoming-call-info { flex: 1; min-width: 0; }
.incoming-call-title { font-weight: 700; font-size: 14px; color: var(--text); }
.incoming-call-caller { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.incoming-call-chat { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.incoming-call-actions { display: flex; gap: 10px; flex-shrink: 0; }

.waiting-room-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
}
.waiting-guest { font-size: 13px; font-weight: 500; color: var(--text); }

/* ── WIP Reports ──────────────────────────────────────────── */
.wip-summary-container { margin-bottom: var(--space-5); }
.wip-summary-dashboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--space-3); }
.wip-dashboard-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--motion) var(--ease), transform var(--motion) var(--ease);
}
.wip-dashboard-section:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.wip-dashboard-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--hairline);
}
.wip-dashboard-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text); }
.wip-dashboard-title .material-icons { font-size: 18px; color: var(--accent); }
.wip-dashboard-content { padding: var(--space-4); }
.wip-stat-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
}
.wip-stat-card:last-child { margin-bottom: 0; }
.wip-stat-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.wip-stat-value { font-size: 20px; font-weight: 700; color: var(--accent); letter-spacing: -.01em; }
.wip-stat-label-sm { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.wip-stat-value-sm { font-size: 16px; font-weight: 700; color: var(--text); }
.wip-status-breakdown { background: var(--bg-subtle); border: 1px solid var(--hairline); border-radius: var(--radius-md); padding: 12px 14px; }
.wip-status-items { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.wip-status-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 12px; font-weight: 600; color: var(--text);
}
.wip-status-item .material-icons { font-size: 14px; opacity: .7; }

.wip-progress-bars { display: flex; flex-direction: column; gap: var(--space-3); }
.wip-progress-item { display: flex; flex-direction: column; gap: 6px; }
.wip-progress-label { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--text); }
.wip-progress-count { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.wip-progress-bar {
  width: 100%; height: 8px;
  background: var(--bg-muted);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.wip-progress-fill {
  height: 100%; border-radius: inherit;
  background: var(--accent);
  transition: width var(--motion-slow) var(--ease);
}
.wip-mini-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: var(--radius-pill); }

.wip-user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-3); }
.wip-user-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}
.wip-user-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.wip-user-name { font-size: 13px; font-weight: 600; color: var(--text); }
.wip-user-card-stats { display: flex; gap: var(--space-3); }
.wip-user-stat { display: flex; flex-direction: column; }
.wip-user-status-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.wip-date-group-header {
  font-size: 12px; font-weight: 700; color: var(--text);
  padding: 8px 12px;
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

/* ── Influencer search ────────────────────────────────────── */
.influencer-search { padding: var(--space-4); }
.influencer-search__field { display: flex; gap: 8px; flex-wrap: wrap; }
.influencer-search__input { flex: 1; min-width: 220px; }
.influencer-search__select { min-width: 140px; }
.influencer-search__submit, .influencer-search__reset { white-space: nowrap; }
.influencer-search__results { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); margin-top: var(--space-4); }
.influencer-search__row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--motion-fast), border-color var(--motion-fast);
}
.influencer-search__row:hover { background: var(--bg-subtle); border-color: var(--c-slate-300); }
.influencer-search__empty { text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 13px; }
.influencer-search__meta { font-size: 11.5px; color: var(--text-muted); }

/* Creator card / grid (rising creators / saved-list creators) */
.creator-grid, .trending-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-3); }
.creator-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--motion) var(--ease), border-color var(--motion) var(--ease), transform var(--motion) var(--ease);
}
.creator-card:hover { box-shadow: var(--shadow-md); border-color: var(--c-slate-300); transform: translateY(-1px); }
.creator-card-header { padding: var(--space-3); display: flex; align-items: center; gap: 10px; }
.creator-card-pic, .creator-card-pic-placeholder {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-muted); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; text-transform: uppercase;
  object-fit: cover;
}
.creator-card-info { flex: 1; min-width: 0; }
.creator-card-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.creator-card-username { font-size: 11.5px; color: var(--text-muted); }
.creator-card-badge { display: inline-flex; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 600; }
.creator-card-badge--secondary { background: var(--bg-muted); color: var(--text-muted); }
.creator-card-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 0;
  padding: var(--space-3);
  border-top: 1px solid var(--hairline);
  background: var(--bg-subtle);
}
.creator-card-stat-value { font-size: 14px; font-weight: 700; color: var(--text); text-align: center; }
.creator-card-stat-label { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; text-align: center; }

/* ── Login / auth ─────────────────────────────────────────── */
.auth-body {
  min-height: 100vh;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-muted) 100%);
  padding: var(--space-4);
}
.auth-container { width: min(92vw, 460px); }
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  box-shadow: var(--shadow-xl);
  text-align: center;
}
.auth-card h1 { font-size: 24px; font-weight: 700; margin-bottom: var(--space-2); letter-spacing: -.01em; }
.auth-card .subtitle { color: var(--text-muted); margin-bottom: var(--space-5); font-size: 14px; }
.auth-card .form-grid { display: grid; gap: var(--space-4); text-align: left; }
.auth-card label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.note { font-size: 12px; color: var(--text-muted); margin-top: var(--space-4); }
.subtitle { color: var(--text-muted); }
.login-logo { width: 56px; height: 56px; margin: 0 auto var(--space-4); border-radius: var(--radius-lg); }
.login-field { position: relative; }
.login-btn { width: 100%; justify-content: center; }
.pwd-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  padding: 4px;
}

/* ── Tab forms (multi-step / tabbed forms) ────────────────── */
.tabbed-forms { display: flex; flex-direction: column; }

/* Import wizard / dropzone (CSV import) */
.import-wizard {
  display: flex; flex-direction: column;
  gap: var(--space-4);
}
.import-wizard-steps {
  display: flex; gap: var(--space-2);
  padding: var(--space-3);
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
}
.import-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 48px var(--space-4);
  text-align: center;
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--motion-fast), border-color var(--motion-fast);
}
.import-dropzone:hover, .import-dropzone.dragover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.csv-mapping-select { min-width: 160px; }
.share-user-cb { display: flex; align-items: center; gap: 6px; }

/* Note card (sticky-note style) */
.note-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--motion) var(--ease), transform var(--motion) var(--ease);
}
.note-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.note-card-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.note-card-body { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }
.note-card-meta { font-size: 11px; color: var(--text-muted); margin-top: 8px; display: flex; justify-content: space-between; }

/* KPI title / kpi-card / kpi-body (legacy aliases) */
.kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px; box-shadow: var(--shadow-xs); }
.kpi-title { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi-body { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -.02em; }

/* Avatar circle (used in chat message lists, employees) */
.avatar-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; text-transform: uppercase;
  overflow: hidden; flex-shrink: 0;
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

/* Carousel slide */
.carousel-slide { display: none; }
.carousel-slide.active { display: block; }

/* employee-suggestion (tag suggester) */
.employee-suggestion {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 12px; color: var(--text);
  cursor: pointer;
  transition: background var(--motion-fast);
}
.employee-suggestion:hover { background: var(--accent-soft); }

/* meta-item / meta */
.meta { display: flex; gap: var(--space-3); flex-wrap: wrap; font-size: 11.5px; color: var(--text-muted); }
.meta-item { display: flex; align-items: center; gap: 4px; }

/* Sub / current / right helpers */
.sub { color: var(--text-secondary); font-size: 12.5px; }
.current { font-weight: 700; color: var(--accent); }
.right { float: right; }

/* Material Icons sizing utility */
.material-icons.sm { font-size: 16px; }

/* ── Inline alerts (info / success / warning / danger) ────── */
.alert {
  display: flex; gap: 10px;
  padding: 12px 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(59, 130, 246, .2);
  border-radius: var(--radius-md);
  color: var(--c-blue-700);
  font-size: 13px; line-height: 1.55;
}
.alert .material-icons { font-size: 18px; flex-shrink: 0; }
.alert-info    { background: rgba(59, 130, 246, .06);  border-color: rgba(59, 130, 246, .2);  color: var(--c-blue-700); }
.alert-success { background: rgba(34, 197, 94, .06);   border-color: rgba(34, 197, 94, .25);  color: var(--c-green-700); }
.alert-warning { background: rgba(245, 158, 11, .06);  border-color: rgba(245, 158, 11, .25); color: var(--c-amber-700); }
.alert-danger  { background: rgba(239, 68, 68, .06);   border-color: rgba(239, 68, 68, .25);  color: var(--c-red-700); }
[data-theme="dark"] .alert-info    { color: #93c5fd; }
[data-theme="dark"] .alert-success { color: #86efac; }
[data-theme="dark"] .alert-warning { color: #fcd34d; }
[data-theme="dark"] .alert-danger  { color: #fca5a5; }

.warning-banner {
  display: flex; gap: 10px; padding: 12px 14px;
  background: var(--c-amber-50); border: 1px solid rgba(245, 158, 11, .25);
  border-radius: var(--radius-md);
  color: var(--c-amber-700);
  font-size: 13px;
}

/* ── Login button alt names ───────────────────────────────── */
.login-btn { background: var(--accent); color: #fff; }

/* ── Color helpers (legacy) ───────────────────────────────── */
.blue  { color: var(--accent) !important; }
.green { color: var(--success) !important; }
.amber { color: var(--warning) !important; }
.slate { color: var(--text-muted) !important; }
.text-muted { color: var(--text-muted) !important; }

/* full-width + flush helpers */
.full { width: 100%; }
.flush { padding: 0; }

/* "wide" modal */
.wide { max-width: 800px !important; }

/* "open" generic toggle */
.open { display: block; }

/* form-error / form-help duplicates handled above */

/* ── Responsive (mobile, tablet) ──────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .topbar { padding: 0 var(--space-4); }
  .content { padding: var(--space-4) var(--space-4) var(--space-10); }
  .home-grid { grid-template-columns: 1fr; }
  .home-welcome { flex-direction: column; }
  .home-welcome-right { width: 100%; border-left: none; border-top: 1px solid var(--hairline); max-height: 220px; }
  .form-grid-3col, .form-grid-4col { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .ig-posts-grid { grid-template-columns: repeat(3, 1fr); }
  .floating-chat-panel { width: 380px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .dash { flex-direction: column; }
  .main { margin-left: 0; }

  .sidebar {
    width: 280px;
    transform: translateX(-100%);
    transition: transform var(--motion-slow) var(--ease-out);
    z-index: 400;
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open ~ .sidebar-overlay { display: block; }

  .topbar { padding: 0 12px; gap: 6px; height: 52px; }
  .topbar-title { font-size: 14px; max-width: 50vw; }
  .topbar-actions { gap: 4px; flex-shrink: 0; }
  .topbar-actions .btn { padding: 5px 8px; }
  .topbar-divider { margin: 0 2px; }

  #sidebarToggle { display: flex; }
  #sidebarToggle:hover { background: var(--bg-muted); }

  .content { padding: 14px 12px 80px; }

  /* Larger touch targets on mobile */
  .btn { min-height: 36px; }
  .btn-sm { min-height: 32px; }
  .pager button { min-width: 36px; height: 36px; }
  .modal-x { width: 36px; height: 36px; }

  .card-header { padding: 12px 16px; flex-wrap: wrap; }
  .card-body { padding: 16px; }

  .toolbar { flex-wrap: wrap; gap: 6px; }
  .toolbar .input, .toolbar .select { flex: 1 1 140px; min-width: 0; }

  /* Tables horizontal scroll */
  .card-body.flush { overflow-x: auto; }
  .tbl { min-width: 600px; }

  /* Stats: 2 on tablet, 1 on phone (handled below) */
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid-3col, .form-grid-4col, .form-grid-2col { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }

  /* Modal becomes bottom sheet */
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal-panel, .modal-card {
    width: 100% !important; max-width: 100% !important;
    max-height: 92vh; margin: 0;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    animation: modalInMobile var(--motion-slow) var(--ease-out);
  }
  @keyframes modalInMobile { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
  .modal-foot, .modal-footer { border-radius: 0; }

  .record-detail-panel { width: 100%; max-width: 100%; }
  .record-detail-backdrop { justify-content: stretch; }

  /* Toasts full width */
  .toast-wrap, .sileo-toast-container {
    top: auto; bottom: 16px; right: 12px; left: 12px;
  }
  .toast, .sileo-toast { min-width: 0; max-width: none; width: 100%; }

  .home-grid { grid-template-columns: 1fr; }
  .home-welcome { flex-direction: column; }
  .home-welcome-right { width: 100%; border-left: none; border-top: 1px solid var(--hairline); max-height: 200px; }

  .ig-posts-grid { grid-template-columns: repeat(3, 1fr); }
  .ig-posts-grid--large { grid-template-columns: repeat(2, 1fr); }
  .creator-grid, .trending-grid { grid-template-columns: 1fr; }
  .lists-grid { grid-template-columns: 1fr; }

  .chat-layout { flex-direction: column; height: auto; min-height: 500px; }
  .chat-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 240px; }
  .chat-main { min-height: 380px; }

  .floating-chat-panel { width: calc(100vw - 24px); right: 12px; bottom: 80px; height: calc(100vh - 110px); }
  .floating-chat-sidebar { width: 160px; }
  .floating-chat-btn { width: 50px; height: 50px; bottom: 18px; right: 18px; }

  .video-call-grid { grid-template-columns: 1fr; gap: 4px; padding: 4px; }
  .video-call-participant { min-height: 150px; }
  .video-call-controls { gap: 10px; padding: 10px; }
  .incoming-call-popup { right: 12px; left: 12px; min-width: 0; top: 12px; }
  .lobby-preview { width: 100%; }

  .task-board, .monday-board { gap: 8px; padding: 8px 0; }
  .task-column, .monday-col { min-width: 280px; flex: 0 0 280px; }

  .empty-state { padding: 40px 16px; }
}

@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr; }
  .topbar-divider { display: none; }
  .topbar-user-info { display: none; }
  .topbar-user { gap: 4px; }
  .topbar-avatar { width: 28px; height: 28px; font-size: 11px; }
  .topbar-logout { padding: 4px; }
  .topbar-actions .btn { padding: 4px 6px; font-size: 11.5px; }
  .topbar-title { max-width: 36vw; font-size: 13px; }

  .ig-posts-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 28px 22px; }
  .modal-head, .modal-body, .modal-foot, .modal-footer { padding-left: 16px; padding-right: 16px; }

  .home-welcome-left { padding: 22px 20px; }
  .home-welcome-text { font-size: 18px; }
  .home-clock { font-size: 22px; }

  .sp-stat-grid-2col, .sp-stat-grid-4col { grid-template-columns: 1fr; }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  body { background: #fff; color: #000; }
  .sidebar, .topbar, .modal-backdrop, .toast-wrap, .sileo-toast-container,
  .floating-chat-btn, .floating-chat-panel, #theme-toggle,
  .topbar-tasks-btn, .notification-wrap { display: none !important; }
  .main { margin-left: 0; }
  .card, .stat, .monday-kpi { box-shadow: none; border-color: #e5e7eb; break-inside: avoid; }
  .btn { display: none !important; }
}

/* ── Hidden helper ────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Footer fallback ──────────────────────────────────────── */
footer { padding: var(--space-4); color: var(--text-muted); font-size: 12px; }

/* ── Theme toggle hover (additional polish) ───────────────── */
.theme-selector-btn:hover { background: var(--bg-muted); color: var(--text); }
