/* ============================================================
   DACCAA Portal — Modern Dashboard Design System v2
   ============================================================ */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */

:root {
  /* Brand Colors */
  --brand-50: #e0f4ff;
  --brand-100: #b3e4f5;
  --brand-200: #7fd4ec;
  --brand-300: #4bc3e3;
  --brand-400: #1fb6da;
  --brand-500: #0099cc;
  --brand-600: #006699;
  --brand-700: #004f76;
  --brand-800: #003854;
  --brand-900: #002133;

  /* Neutral — cool grey scale */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  /* Semantic — Success */
  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;

  /* Semantic — Warning */
  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;

  /* Semantic — Error */
  --error-50: #fef2f2;
  --error-100: #fee2e2;
  --error-500: #ef4444;
  --error-600: #dc2626;
  --error-700: #b91c1c;

  /* Light Theme Surfaces */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-accent: linear-gradient(135deg, #f0f9ff, #e0f2fe);

  /* Light Theme Text */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;

  /* Light Theme Borders */
  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-dark: #94a3b8;

  /* Sidebar */
  --sidebar-bg: #ffffff;
  --sidebar-border: #e2e8f0;
  --sidebar-text: #64748b;
  --sidebar-hover-bg: #f0f9ff;
  --sidebar-active-bg: #e0f4ff;
  --sidebar-active-text: #0099cc;

  /* Shadows — lighter, more refined */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm:
    0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:
    0 4px 12px rgba(15, 23, 42, 0.07), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg:
    0 8px 24px rgba(15, 23, 42, 0.09), 0 4px 8px rgba(15, 23, 42, 0.05);
  --shadow-xl:
    0 16px 40px rgba(15, 23, 42, 0.11), 0 8px 16px rgba(15, 23, 42, 0.06);
  --shadow-2xl:
    0 24px 64px rgba(15, 23, 42, 0.14), 0 12px 24px rgba(15, 23, 42, 0.08);

  /* Brand-tinted shadows */
  --shadow-brand: 0 4px 14px rgba(0, 153, 204, 0.22);
  --shadow-brand-lg: 0 8px 28px rgba(0, 153, 204, 0.3);

  /* Typography */
  --font-sans:
    "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display:
    "Space Grotesk", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  --font-mono:
    "SF Mono", Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Font sizes */
  --text-xs: 0.6875rem; /* 11px */
  --text-sm: 0.8125rem; /* 13px */
  --text-base: 0.9375rem; /* 15px */
  --text-lg: 1.0625rem; /* 17px */
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.375rem;

  /* Font weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  --font-extrabold: 800;

  /* Line heights */
  --leading-none: 1;
  --leading-tight: 1.2;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* Border Radius */
  --radius-sm: 0.375rem; /* 6px  */
  --radius-md: 0.5rem; /* 8px  */
  --radius-lg: 0.75rem; /* 12px */
  --radius-xl: 1rem; /* 16px */
  --radius-2xl: 1.25rem; /* 20px */
  --radius-3xl: 1.5rem; /* 24px */
  --radius-full: 9999px;

  /* Animation */
  --duration-fast: 120ms;
  --duration-base: 200ms;
  --duration-slow: 300ms;
  --duration-slower: 500ms;

  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.45, 0, 0.55, 1);

  /* Layout dimensions */
  --sidebar-width: 260px;
  --topbar-height: 64px;

  /* Legacy compatibility */
  --brand: var(--brand-500);
  --brand-dark: var(--brand-700);
  --bg: var(--bg-secondary);
  --text: var(--text-primary);
  --muted: var(--text-tertiary);
  --card: var(--bg-primary);
  --border: var(--border-light);
  --danger: var(--error-500);
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-accent: linear-gradient(135deg, #1e293b, #293548);

  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-tertiary: #64748b;

  --border-light: #1e293b;
  --border-medium: #334155;
  --border-dark: #475569;

  --sidebar-bg: #0f172a;
  --sidebar-border: #1e293b;
  --sidebar-text: #94a3b8;
  --sidebar-hover-bg: rgba(0, 153, 204, 0.08);
  --sidebar-active-bg: rgba(0, 153, 204, 0.15);
  --sidebar-active-text: #38bdf8;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.55), 0 4px 8px rgba(0, 0, 0, 0.45);
  --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.65), 0 8px 16px rgba(0, 0, 0, 0.5);
  --shadow-2xl:
    0 24px 64px rgba(0, 0, 0, 0.75), 0 12px 24px rgba(0, 0, 0, 0.55);

  --shadow-brand: 0 4px 14px rgba(0, 153, 204, 0.18);
  --shadow-brand-lg: 0 8px 28px rgba(0, 153, 204, 0.24);

  --success-500: #4ade80;
  --warning-500: #fbbf24;
  --error-500: #f87171;

  /* Legacy */
  --bg: var(--bg-secondary);
  --text: var(--text-primary);
  --muted: var(--text-tertiary);
  --card: var(--bg-primary);
  --border: var(--border-light);
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition:
    background-color var(--duration-base) var(--ease-out),
    color var(--duration-base) var(--ease-out);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  font-family: var(--font-display);
  font-weight: var(--font-bold);
  line-height: var(--leading-tight);
  color: var(--text-primary);
  letter-spacing: -0.025em;
}

h1 {
  font-size: var(--text-3xl);
}
h2 {
  font-size: var(--text-2xl);
}
h3 {
  font-size: var(--text-xl);
}
h4 {
  font-size: var(--text-lg);
}

p {
  margin-top: 0;
  line-height: var(--leading-relaxed);
}

a {
  color: var(--brand-600);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--brand-700);
}

[data-theme="dark"] a {
  color: var(--brand-400);
}
[data-theme="dark"] a:hover {
  color: var(--brand-300);
}

/* ============================================================
   3. LAYOUT UTILITIES
   ============================================================ */

.container {
  max-width: none;
  margin: 0 auto;
  width: 100%;
  padding: 0 var(--space-6);
}

.row {
  display: flex;
  gap: var(--space-4);
}
.between {
  justify-content: space-between;
}
.center {
  align-items: center;
}
.wrap {
  flex-wrap: wrap;
}

/* App Shell */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   4. SIDEBAR
   ============================================================ */

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--duration-slow) var(--ease-smooth);
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.sidebar::-webkit-scrollbar {
  width: 3px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-full);
}

[data-theme="dark"] .sidebar {
  background: var(--sidebar-bg);
  border-right-color: var(--sidebar-border);
}

/* Sidebar Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-5);
  border-bottom: 1px solid var(--sidebar-border);
  height: var(--topbar-height);
  text-decoration: none;
  transition: background var(--duration-base) var(--ease-out);
  flex-shrink: 0;
}

.sidebar-brand:hover {
  background: var(--sidebar-hover-bg);
  text-decoration: none;
  opacity: 1;
}

.sidebar-brand .logo {
  width: auto;
  height: 34px;
  max-width: 160px;
  display: block;
  object-fit: contain;
}

/* Sidebar Nav */
.sidebar-nav {
  padding: var(--space-3) var(--space-3) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar-nav-label {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-tertiary);
  padding: var(--space-4) var(--space-3) var(--space-2);
  margin-top: var(--space-2);
  display: block;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--sidebar-text);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: all var(--duration-base) var(--ease-out);
  text-decoration: none;
  position: relative;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar-nav a i {
  font-size: 1.05rem;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
  color: var(--text-tertiary);
  transition: color var(--duration-base) var(--ease-out);
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover-bg);
  color: var(--brand-600);
  text-decoration: none;
}

.sidebar-nav a:hover i {
  color: var(--brand-500);
}

.sidebar-nav a.active {
  background: var(--sidebar-active-bg);
  color: var(--brand-600);
  font-weight: var(--font-semibold);
}

.sidebar-nav a.active i {
  color: var(--brand-500);
}

.sidebar-nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 3px;
  background: var(--brand-500);
  border-radius: 0 var(--radius-full) var(--radius-full) 0;
}

[data-theme="dark"] .sidebar-nav a.active {
  background: var(--sidebar-active-bg);
  color: var(--brand-300);
}

[data-theme="dark"] .sidebar-nav a.active i,
[data-theme="dark"] .sidebar-nav a:hover i {
  color: var(--brand-400);
}

[data-theme="dark"] .sidebar-nav a:hover {
  color: var(--brand-300);
}

.sidebar-nav hr {
  border: none;
  border-top: 1px solid var(--sidebar-border);
  margin: var(--space-3) 0;
}

/* ============================================================
   5. MAIN WRAPPER & TOPBAR
   ============================================================ */

.main-wrap {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
  transition: margin-left var(--duration-slow) var(--ease-smooth);
}

.topbar {
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  height: var(--topbar-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  gap: var(--space-3);
  box-shadow: var(--shadow-xs);
  transition: background var(--duration-base) var(--ease-out);
}

[data-theme="dark"] .topbar {
  background: var(--bg-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
}

/* Mobile Nav Button */
.mobile-nav-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 0;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  font-size: 1.2rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.mobile-nav-btn:hover {
  background: var(--sidebar-hover-bg);
  border-color: var(--brand-400);
  color: var(--brand-600);
}

/* User Pill */
.user-pill {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3) var(--space-2) var(--space-2);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  min-height: 40px;
}

.user-pill:hover {
  border-color: var(--brand-400);
  background: var(--sidebar-hover-bg);
  box-shadow: var(--shadow-sm);
}

.user-pill strong {
  color: var(--text-primary);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
}

.user-pill-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.user-pill span {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.user-pill .avatar {
  flex-shrink: 0;
}

.topbar .user-pill img.avatar {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  border-radius: 9999px !important;
  object-fit: cover;
  display: block;
}

/* Profile Menu */
.profile-menu {
  position: relative;
}

.sidebar-notify-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--error-600);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
}

.profile-menu-toggle {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
}

.profile-menu-toggle i {
  color: var(--text-tertiary);
  font-size: var(--text-base);
  margin-left: var(--space-1);
}

.profile-menu-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 200px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  display: none;
  z-index: 260;
  animation: dropdownFadeIn var(--duration-base) var(--ease-out);
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.profile-menu.open .profile-menu-dropdown {
  display: grid;
  gap: 2px;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  border: 0;
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
  text-decoration: none;
  font-size: var(--text-sm);
  text-align: left;
  font-family: var(--font-sans);
  transition: all var(--duration-fast) var(--ease-out);
}

.profile-menu-item i {
  color: var(--text-tertiary);
  font-size: 1rem;
  width: 16px;
  text-align: center;
}

.profile-menu-item:hover {
  background: var(--sidebar-hover-bg);
  color: var(--text-primary);
  text-decoration: none;
}

.profile-menu-item:hover i {
  color: var(--brand-500);
}

.profile-menu-item-button {
  cursor: pointer;
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  padding: 0;
}

.theme-toggle:hover {
  background: var(--sidebar-hover-bg);
  border-color: var(--brand-400);
  box-shadow: var(--shadow-sm);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  transition: all var(--duration-base) var(--ease-out);
}

.theme-toggle:hover svg {
  color: var(--brand-500);
  transform: rotate(20deg);
}

/* Main Content Area */
.main-content {
  padding: var(--space-6) var(--space-8);
  flex: 1;
  max-width: none;
  width: 100%;
  min-width: 0;
}

/* Sidebar Overlay (Mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 999;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn var(--duration-base) var(--ease-out);
}

.sidebar-overlay.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================================================
   6. BRANDING & LOGOS
   ============================================================ */

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: var(--font-bold);
  font-size: var(--text-lg);
  color: var(--text-primary);
  transition: opacity var(--duration-base) var(--ease-out);
}

.brand .brand-text {
  display: none;
}

.brand:hover {
  text-decoration: none;
  opacity: 0.85;
}

.logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
}

.logo-theme-light {
  display: block;
}

.logo-theme-dark {
  display: none !important;
}

[data-theme="dark"] .logo-theme-light {
  display: none !important;
}

[data-theme="dark"] .logo-theme-dark {
  display: block !important;
}

:root:not([data-theme="dark"]) .brand.light-logo-missing .brand-text {
  display: inline;
}

[data-theme="dark"] .brand.dark-logo-missing .brand-text {
  display: inline;
}

/* ============================================================
   7. GUEST LAYOUT
   ============================================================ */

.guest-body {
  background: var(--bg-secondary);
}

.guest-header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
  height: 72px;
  display: flex;
  align-items: center;
  transition: all var(--duration-base) var(--ease-out);
}

.guest-header .container {
  height: 100%;
  padding-top: 0;
  padding-bottom: 0;
}

.guest-header .logo {
  height: 42px;
  width: auto;
}

/* ============================================================
   8. HERO — Landing Page
   ============================================================ */

.hero-card {
  margin: var(--space-12) auto;
  max-width: 1060px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-3xl);
  padding: var(--space-10) var(--space-12);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-10);
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--brand-500) 0%,
    var(--brand-400) 50%,
    var(--brand-600) 100%
  );
}

.hero-card::after {
  content: "";
  position: absolute;
  top: -120px;
  right: -120px;
  width: 360px;
  height: 360px;
  background: radial-gradient(
    circle,
    rgba(0, 153, 204, 0.07) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-card h1 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: var(--font-extrabold);
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.hero-card > div:first-child > p {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  line-height: var(--leading-relaxed);
}

.hero-metrics {
  display: grid;
  gap: var(--space-3);
  align-content: center;
}

.hero-metrics article {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  transition: all var(--duration-base) var(--ease-out);
}

.hero-metrics article:hover {
  border-color: var(--brand-300);
  background: var(--sidebar-hover-bg);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.hero-metrics strong {
  color: var(--brand-600);
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.hero-metrics strong::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--brand-500);
  flex-shrink: 0;
}

.hero-metrics span {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-normal);
}

[data-theme="dark"] .hero-metrics strong {
  color: var(--brand-400);
}

.landing-page {
  margin: var(--space-8) auto var(--space-12);
  display: grid;
  gap: var(--space-5);
  max-width: 1140px;
}

.landing-hero-shell {
  position: relative;
}

.landing-hero-shell::before,
.landing-hero-shell::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}

.landing-hero-shell::before {
  width: 300px;
  height: 300px;
  top: -86px;
  right: -76px;
  background: radial-gradient(
    circle,
    rgba(0, 153, 204, 0.2) 0%,
    rgba(0, 153, 204, 0) 70%
  );
}

.landing-hero-shell::after {
  width: 230px;
  height: 230px;
  left: -78px;
  bottom: -52px;
  background: radial-gradient(
    circle,
    rgba(0, 102, 153, 0.16) 0%,
    rgba(0, 102, 153, 0) 72%
  );
}

.landing-hero-grid {
  background: linear-gradient(
    165deg,
    var(--bg-primary) 0%,
    var(--bg-secondary) 145%
  );
  border: 1px solid var(--border-light);
  border-radius: 30px;
  padding: var(--space-10);
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
  gap: var(--space-8);
  box-shadow: 0 30px 70px rgba(15, 25, 36, 0.12);
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.landing-hero-grid::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--brand-500) 0%,
    var(--brand-400) 40%,
    var(--brand-600) 100%
  );
}

.landing-kicker {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: var(--font-bold);
  color: var(--brand-600);
}

.landing-hero-copy h1 {
  margin-bottom: var(--space-3);
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 17ch;
}

.landing-lead {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 58ch;
  margin-bottom: var(--space-6);
}

.landing-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.landing-cta-row .btn {
  min-height: 44px;
}

.landing-cta-row .btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
}

.landing-cta-row .btn-ghost:hover {
  border-color: var(--border-medium);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.landing-trust-row {
  margin-top: var(--space-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.landing-trust-row span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.8rem;
}

.landing-trust-row i {
  color: var(--brand-600);
}

.landing-hero-panel {
  border: 1px solid rgba(0, 153, 204, 0.24);
  border-radius: var(--radius-3xl);
  background: linear-gradient(
    180deg,
    rgba(0, 153, 204, 0.1) 0%,
    rgba(0, 102, 153, 0.02) 100%
  );
  padding: var(--space-5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] .landing-hero-panel {
  background: linear-gradient(
    180deg,
    rgba(0, 153, 204, 0.2) 0%,
    rgba(0, 153, 204, 0.04) 100%
  );
  border-color: rgba(0, 153, 204, 0.35);
  box-shadow: none;
}

.landing-hero-panel-head {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.landing-hero-panel-head p {
  margin: 0;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-700);
  font-weight: var(--font-bold);
}

[data-theme="dark"] .landing-hero-panel-head p {
  color: var(--brand-300);
}

.landing-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #24d27f;
  box-shadow: 0 0 0 6px rgba(36, 210, 127, 0.18);
}

.landing-kpi-grid {
  display: grid;
  gap: var(--space-3);
}

.landing-kpi-grid article {
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(0, 153, 204, 0.15);
  border-radius: var(--radius-xl);
  padding: var(--space-3) var(--space-4);
  display: grid;
  gap: var(--space-1);
}

[data-theme="dark"] .landing-kpi-grid article {
  background: rgba(10, 18, 25, 0.65);
  border-color: rgba(0, 153, 204, 0.22);
}

.landing-kpi-grid strong {
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
}

.landing-kpi-grid span {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.landing-strip {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  padding: var(--space-5) var(--space-6);
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: center;
}

.landing-strip-copy h2 {
  margin: 0 0 var(--space-1);
  font-size: var(--text-xl);
}

.landing-strip-copy p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.landing-strip-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
}

.landing-strip-points span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.landing-strip-points i {
  color: var(--brand-600);
}

.landing-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.landing-feature-card {
  background: linear-gradient(
    180deg,
    var(--bg-primary) 0%,
    var(--bg-secondary) 125%
  );
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-5);
  transition:
    transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out);
}

.landing-feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-300);
}

.landing-feature-card h3 {
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
}

.landing-feature-card h3 i {
  color: var(--brand-600);
  font-size: var(--text-lg);
}

.landing-feature-card p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
}

.landing-workflow {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.landing-workflow h2 {
  margin-bottom: var(--space-4);
  font-size: var(--text-2xl);
}

.landing-workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.landing-workflow-grid article {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  padding: var(--space-4);
}

.landing-workflow-grid article span {
  display: inline-flex;
  min-width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  align-items: center;
  justify-content: center;
  background: rgba(0, 153, 204, 0.14);
  color: var(--brand-700);
  font-weight: var(--font-bold);
  margin-bottom: var(--space-3);
}

[data-theme="dark"] .landing-workflow-grid article span {
  color: var(--brand-300);
}

.landing-workflow-grid h3 {
  margin-bottom: var(--space-2);
  font-size: var(--text-base);
}

.landing-workflow-grid p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.landing-bottom-cta {
  background: linear-gradient(
    120deg,
    var(--brand-700) 0%,
    var(--brand-500) 100%
  );
  border-radius: var(--radius-2xl);
  padding: var(--space-7);
  color: #fff;
  display: flex;
  justify-content: space-between;
  gap: var(--space-5);
  align-items: center;
  box-shadow: var(--shadow-xl);
}

.landing-bottom-cta h2 {
  color: #fff;
  margin: 0 0 var(--space-2);
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  max-width: 22ch;
}

.landing-bottom-cta p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

.landing-bottom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: flex-end;
}

.landing-bottom-actions .btn {
  background: #fff;
  border-color: #fff;
  color: var(--brand-700);
}

.landing-bottom-actions .btn:hover {
  background: rgba(255, 255, 255, 0.9);
}

.landing-bottom-actions .btn.btn-outline {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.62);
}

.landing-bottom-actions .btn.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
}

.portal-landing {
  margin: var(--space-6) auto var(--space-12);
  display: grid;
  gap: var(--space-8);
  max-width: 1180px;
}

.portal-landing-hero {
  position: relative;
  background: #0b1120;
  border-radius: 28px;
  overflow: hidden;
  min-height: 640px;
}

.portal-landing-bg {
  position: absolute;
  inset: 0;
}

.portal-landing-bg .blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.32;
  animation: portalFloat 8s ease-in-out infinite;
}

.portal-landing-bg .blob-a {
  width: 340px;
  height: 340px;
  background: #0099cc;
  top: -80px;
  left: -80px;
}

.portal-landing-bg .blob-b {
  width: 420px;
  height: 420px;
  background: #006699;
  top: 10%;
  right: -140px;
  animation-delay: 1.8s;
}

.portal-landing-bg .blob-c {
  width: 280px;
  height: 280px;
  background: #3b82f6;
  bottom: -120px;
  left: 20%;
  animation-delay: 3.1s;
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-size: 42px 42px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
}

.portal-landing-container {
  position: relative;
  z-index: 1;
  padding: var(--space-12) var(--space-10);
}

.portal-landing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  align-items: center;
  gap: var(--space-8);
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: #d8f4ff;
  background: rgba(0, 153, 204, 0.15);
  border: 1px solid rgba(77, 184, 255, 0.35);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.8rem;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: var(--space-4);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4db8ff;
  box-shadow: 0 0 0 6px rgba(77, 184, 255, 0.2);
}

.portal-landing-copy h1 {
  color: #fff;
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  max-width: 16ch;
}

.portal-subtitle {
  color: #9aa7bd;
  font-size: clamp(1rem, 1.5vw, 1.2rem);
  max-width: 58ch;
  margin-top: var(--space-4);
  margin-bottom: var(--space-6);
}

.portal-cta-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.portal-landing-copy .btn {
  min-height: 48px;
}

.portal-landing-copy .btn.btn-outline {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.portal-landing-copy .btn.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.55);
}

.portal-lockline {
  margin-top: var(--space-4);
  color: #7fc6de;
  font-size: var(--text-sm);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.portal-landing-mockup {
  position: relative;
  min-height: 500px;
}

.portal-window {
  background: #111827;
  border: 1px solid #2a3343;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 153, 204, 0.2);
  overflow: hidden;
}

.portal-window-top {
  height: 38px;
  border-bottom: 1px solid #2a3343;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
}

.portal-window-top span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3a4558;
}

.portal-window-top em {
  margin-left: auto;
  color: #6f7f99;
  font-style: normal;
  font-size: var(--text-xs);
}

.portal-window-body {
  display: grid;
  grid-template-columns: 165px 1fr;
  min-height: 420px;
}

.portal-window-body aside {
  border-right: 1px solid #2a3343;
  padding: 18px 14px;
}

.mock-logo {
  width: 90px;
  height: 10px;
  border-radius: 6px;
  background: #354157;
  margin-bottom: 18px;
}

.mock-nav {
  height: 34px;
  border-radius: 10px;
  background: #253045;
  margin-bottom: 8px;
}

.mock-nav.active {
  background: rgba(0, 153, 204, 0.2);
  border: 1px solid rgba(0, 153, 204, 0.35);
}

.portal-window-body main {
  padding: 18px;
}

.mock-header {
  width: 170px;
  height: 16px;
  border-radius: 8px;
  background: #36445c;
  margin-bottom: 16px;
}

.mock-progress-card {
  background: #0f1729;
  border: 1px solid #2a3343;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 14px;
}

.mock-progress-head {
  width: 180px;
  height: 10px;
  border-radius: 8px;
  background: #394a64;
  margin-bottom: 11px;
}

.mock-progress-track {
  background: #1c273b;
  border-radius: 999px;
  height: 7px;
  overflow: hidden;
}

.mock-progress-track span {
  display: block;
  width: 82%;
  height: 100%;
  border-radius: 999px;
  background: #00a7e0;
}

.mock-mini-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mock-mini {
  height: 98px;
  border-radius: 12px;
  background: #0f1729;
  border: 1px solid #2a3343;
}

.floating-note {
  position: absolute;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 14px;
  padding: 0.75rem 0.95rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

.floating-note i {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #006699;
  background: rgba(0, 153, 204, 0.12);
}

.floating-note strong {
  display: block;
  font-size: var(--text-sm);
  color: #0f172a;
}

.floating-note span {
  display: block;
  color: #475569;
  font-size: var(--text-xs);
}

.floating-a {
  right: -18px;
  top: 110px;
  animation: portalFloat 5.5s ease-in-out infinite;
}

.floating-b {
  left: -22px;
  bottom: 110px;
  animation: portalFloat 6.5s ease-in-out infinite;
  animation-delay: 1.4s;
}

.portal-landing-section {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
}

.portal-landing-section-head {
  text-align: center;
  max-width: 740px;
  margin: 0 auto var(--space-7);
}

.portal-landing-section-head h2 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  margin-bottom: var(--space-2);
}

.portal-landing-section-head p {
  color: var(--text-secondary);
}

.portal-features-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.portal-feature-card {
  border: 1px solid var(--border-light);
  background: linear-gradient(
    180deg,
    var(--bg-primary) 0%,
    var(--bg-secondary) 130%
  );
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.portal-feature-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.portal-feature-card h3 i {
  color: var(--brand-600);
}

.portal-feature-card p {
  color: var(--text-secondary);
  margin: 0;
}

.portal-landing-cta {
  background: linear-gradient(
    125deg,
    var(--brand-700) 0%,
    var(--brand-500) 100%
  );
  border-radius: var(--radius-2xl);
  padding: var(--space-8);
  color: #fff;
  text-align: center;
}

.portal-landing-cta h2 {
  color: #fff;
  margin-bottom: var(--space-2);
  font-size: clamp(1.6rem, 2.6vw, 2.7rem);
}

.portal-landing-cta p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0 auto var(--space-5);
  max-width: 62ch;
}

.portal-landing-cta .portal-cta-row {
  justify-content: center;
}

.portal-landing-cta .btn.btn-outline {
  border-color: rgba(255, 255, 255, 0.6);
  color: #fff;
  background: transparent;
}

.portal-landing-cta .btn.btn-outline:hover {
  border-color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: all 0.75s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

.delay-100 {
  transition-delay: 0.1s;
}

.delay-200 {
  transition-delay: 0.2s;
}

@keyframes portalFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ============================================================
   9. CARDS
   ============================================================ */

.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition:
    box-shadow var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out);
  position: relative;
  min-width: 0;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

/* Cards Grid — stat cards row */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

/* Stat Card */
.stat-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: all var(--duration-base) var(--ease-out);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-400));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-slow) var(--ease-spring);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-200);
}

.stat-card:hover::after {
  transform: scaleX(1);
}

.stat-card h3 {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-tertiary);
  margin: 0 0 var(--space-3) 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--font-sans);
}

.stat-card p {
  font-size: 2.25rem;
  font-weight: var(--font-extrabold);
  margin: 0 0 var(--space-3);
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  font-family: var(--font-display);
}

.stat-card-tax p {
  background: linear-gradient(135deg, var(--error-500), var(--error-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .stat-card p {
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .stat-card-tax p {
  background: linear-gradient(135deg, var(--error-500), var(--error-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: var(--space-4);
  color: #fff;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  box-shadow: var(--shadow-brand);
  transition:
    transform var(--duration-base) var(--ease-spring),
    box-shadow var(--duration-base) var(--ease-out);
}

.stat-card:hover .stat-card-icon {
  transform: scale(1.08) rotate(-4deg);
  box-shadow: var(--shadow-brand-lg);
}

.stat-card-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--brand-600);
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.stat-card-link:hover {
  gap: var(--space-2);
  color: var(--brand-700);
  text-decoration: none;
}

[data-theme="dark"] .stat-card-link {
  color: var(--brand-400);
}
[data-theme="dark"] .stat-card-link:hover {
  color: var(--brand-300);
}

.monthly-flow-card .monthly-flow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.monthly-flow-card.monthly-flow-card-three .monthly-flow-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.monthly-flow-card .monthly-flow-item {
  display: grid;
  gap: var(--space-1);
}

.monthly-flow-card .monthly-flow-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  font-weight: var(--font-semibold);
}

.monthly-flow-card .monthly-flow-item strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.1;
  font-weight: var(--font-extrabold);
}

.monthly-flow-card .monthly-flow-item-income strong {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.monthly-flow-card .monthly-flow-item-expense strong {
  background: linear-gradient(135deg, var(--error-500), var(--error-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.monthly-flow-card .monthly-flow-item-draft strong {
  background: linear-gradient(135deg, #0aa178, #066a54);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .monthly-flow-card .monthly-flow-item-income strong {
  background: linear-gradient(135deg, var(--brand-400), var(--brand-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .monthly-flow-card .monthly-flow-item-expense strong {
  background: linear-gradient(135deg, var(--error-500), var(--error-700));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="dark"] .monthly-flow-card .monthly-flow-item-draft strong {
  background: linear-gradient(135deg, #19c997, #0f8f6d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card-meeting-preview {
  display: grid;
  gap: 2px;
  margin-top: var(--space-2);
}

.stat-card-meeting-preview strong {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  line-height: 1.3;
}

.stat-card-meeting-preview span {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.35;
}

.stat-card-meeting-preview-highlight {
  margin-top: var(--space-1);
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgba(0, 153, 204, 0.2);
  border-radius: var(--radius-md);
  background: linear-gradient(
    135deg,
    rgba(0, 153, 204, 0.1),
    rgba(0, 153, 204, 0.03)
  );
}

[data-theme="dark"] .stat-card-meeting-preview-highlight {
  border-color: rgba(56, 189, 248, 0.28);
  background: linear-gradient(
    135deg,
    rgba(56, 189, 248, 0.16),
    rgba(56, 189, 248, 0.06)
  );
}

.dashboard-passkey-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid rgba(0, 153, 204, 0.35);
  background:
    radial-gradient(circle at 90% 20%, rgba(0, 153, 204, 0.2), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(15, 23, 42, 0.08), transparent 40%),
    var(--bg-primary);
}

.dashboard-passkey-banner-copy h2 {
  margin: 0 0 var(--space-2);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
}

.dashboard-passkey-banner-copy h2 i {
  color: var(--brand-600);
}

.dashboard-passkey-banner-copy p {
  margin: 0;
  color: var(--text-secondary);
  max-width: 70ch;
}

/* 2-col grid */
.auth-grid,
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-5);
}

.grid-2 > * {
  min-width: 0;
}

/* ============================================================
   10. BUTTONS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-5);
  height: 40px;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  font-family: var(--font-sans);
  line-height: 1;
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--duration-base) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
  background: var(--brand-500);
  color: #fff;
  border-color: var(--brand-500);
  box-shadow: 0 1px 3px rgba(0, 153, 204, 0.22);
  min-height: 40px;
}

.btn i {
  font-size: 1rem;
  flex-shrink: 0;
}

.btn:hover {
  background: var(--brand-600);
  border-color: var(--brand-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-brand);
  text-decoration: none;
  color: #fff;
}

.btn:active {
  transform: translateY(0);
  box-shadow: none;
}

.btn-outline {
  background: transparent;
  color: var(--brand-600);
  border-color: var(--border-medium);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--sidebar-hover-bg);
  border-color: var(--brand-400);
  color: var(--brand-700);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .btn-outline {
  color: var(--brand-400);
  border-color: var(--border-medium);
}

[data-theme="dark"] .btn-outline:hover {
  background: var(--sidebar-hover-bg);
  border-color: var(--brand-500);
  color: var(--brand-300);
}

.btn-danger {
  background: var(--error-500);
  border-color: var(--error-500);
  color: #fff;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.22);
}

.btn-danger:hover {
  background: var(--error-600);
  border-color: var(--error-600);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
  color: #fff;
}

.link-btn {
  border: none;
  background: none;
  color: var(--brand-600);
  cursor: pointer;
  padding: 0;
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  font-weight: var(--font-medium);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

.link-btn:hover {
  color: var(--brand-700);
  text-decoration: underline;
  text-underline-offset: 3px;
}

[data-theme="dark"] .link-btn {
  color: var(--brand-400);
}
[data-theme="dark"] .link-btn:hover {
  color: var(--brand-300);
}

.inline-form {
  display: inline-flex;
  gap: var(--space-3);
  align-items: center;
  flex-wrap: wrap;
}

.row-edit {
  display: inline-block;
}

.row-edit summary {
  list-style: none;
  display: inline-block;
}

.row-edit summary::-webkit-details-marker {
  display: none;
}

.row-edit-form {
  margin-top: var(--space-3);
}

.row-inline-action {
  margin-top: var(--space-2);
}

.subscription-overview-list {
  margin-top: var(--space-3);
  margin-bottom: var(--space-4);
}

.subscription-panel-actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: flex-start;
}

.subscription-cancel-actions {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.subscription-cancel-box {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-light);
  display: grid;
  gap: var(--space-3);
}

.subscription-cancel-box p {
  margin: 0;
}

.subscription-cancel-button {
  width: 100%;
}

/* ============================================================
   11. FORMS
   ============================================================ */

.form-grid {
  display: grid;
  gap: var(--space-4);
}

.form-grid label {
  display: grid;
  gap: var(--space-2);
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

input,
select,
textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  transition: all var(--duration-base) var(--ease-out);
  outline: none;
  min-height: 42px;
  line-height: var(--leading-normal);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-medium);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(0, 153, 204, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--bg-tertiary);
  border-color: var(--border-medium);
  color: var(--text-primary);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(0, 153, 204, 0.15);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.checkbox-inline {
  display: inline-flex !important;
  gap: var(--space-3);
  align-items: center;
  font-weight: var(--font-medium) !important;
}

.checkbox-inline input {
  width: auto;
  min-height: auto;
}

.attendee-checkbox-list {
  display: grid;
  gap: var(--space-2);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-secondary);
}

.attendee-checkbox {
  display: flex !important;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) 0;
}

/* ============================================================
   12. TABLES
   ============================================================ */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-sm);
}

thead {
  background: var(--bg-secondary);
}

thead th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: var(--font-semibold);
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: var(--text-xs);
  border-bottom: 1.5px solid var(--border-light);
  white-space: nowrap;
}

tbody tr {
  transition: background var(--duration-fast) var(--ease-out);
}

tbody tr:hover {
  background: var(--sidebar-hover-bg);
}

[data-theme="dark"] tbody tr:hover {
  background: var(--sidebar-hover-bg);
}

tbody td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
  vertical-align: middle;
}

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

tbody td a {
  color: var(--brand-600);
  font-weight: var(--font-medium);
  font-size: var(--text-xs);
  padding: 2px 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--duration-fast) var(--ease-out);
  text-decoration: none;
}

tbody td a:hover {
  background: var(--sidebar-hover-bg);
  border-color: var(--brand-400);
  color: var(--brand-700);
  text-decoration: none;
}

.table-scroller {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: auto;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  max-width: 100%;
  width: 100%;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
}

.table-scroller table {
  min-width: 720px;
  border-radius: 0;
  overflow: hidden;
}

.pagination {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.pagination-meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.pagination-links {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-primary);
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
}

.pagination-link:hover {
  border-color: var(--brand-400);
  background: var(--sidebar-hover-bg);
  color: var(--brand-700);
  text-decoration: none;
}

.pagination-link.is-active {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}

.pagination-link.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ============================================================
   13. BADGES & STATUS
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  white-space: nowrap;
}

.status-paid,
.status-active,
.status-resolved,
.status-completed {
  background: var(--success-50);
  color: var(--success-700);
  border-color: rgba(34, 197, 94, 0.25);
}

[data-theme="dark"] .status-paid,
[data-theme="dark"] .status-active,
[data-theme="dark"] .status-resolved,
[data-theme="dark"] .status-completed {
  background: rgba(74, 222, 128, 0.1);
  color: var(--success-500);
  border-color: rgba(74, 222, 128, 0.25);
}

.status-overdue,
.status-cancelled,
.status-closed {
  background: var(--error-50);
  color: var(--error-600);
  border-color: rgba(239, 68, 68, 0.25);
}

[data-theme="dark"] .status-overdue,
[data-theme="dark"] .status-cancelled,
[data-theme="dark"] .status-closed {
  background: rgba(248, 113, 113, 0.1);
  color: var(--error-500);
  border-color: rgba(248, 113, 113, 0.25);
}

.status-draft,
.status-open,
.status-triage,
.status-in_progress,
.status-scheduled,
.status-pending {
  background: rgba(0, 153, 204, 0.08);
  color: var(--brand-700);
  border-color: rgba(0, 153, 204, 0.22);
}

[data-theme="dark"] .status-draft,
[data-theme="dark"] .status-open,
[data-theme="dark"] .status-triage,
[data-theme="dark"] .status-in_progress,
[data-theme="dark"] .status-scheduled,
[data-theme="dark"] .status-pending {
  background: rgba(0, 153, 204, 0.12);
  color: var(--brand-300);
  border-color: rgba(0, 153, 204, 0.28);
}

.status-sent,
.status-unpaid {
  background: #fff4e8;
  color: #9a4a00;
  border-color: #f2c9a0;
}

[data-theme="dark"] .status-sent,
[data-theme="dark"] .status-unpaid {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.32);
}

/* ============================================================
   14. ALERTS
   ============================================================ */

.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-xl);
  border: 1px solid;
  margin-bottom: var(--space-4);
  animation: slideDown var(--duration-slow) var(--ease-out);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert i {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-success {
  background: var(--success-50);
  border-color: rgba(34, 197, 94, 0.35);
  color: var(--success-700);
}

[data-theme="dark"] .alert-success {
  background: rgba(74, 222, 128, 0.08);
  color: var(--success-500);
  border-color: rgba(74, 222, 128, 0.25);
}

.alert-error {
  background: var(--error-50);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--error-700);
}

[data-theme="dark"] .alert-error {
  background: rgba(248, 113, 113, 0.08);
  color: var(--error-500);
  border-color: rgba(248, 113, 113, 0.25);
}

/* ============================================================
   15. PROGRESS BARS
   ============================================================ */

.progress {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--brand-400) 0%,
    var(--brand-600) 100%
  );
  border-radius: var(--radius-full);
  transition: width var(--duration-slower) var(--ease-smooth);
  position: relative;
  overflow: hidden;
}

.progress span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: shimmerProgress 2s ease infinite;
  background-size: 200% 100%;
}

@keyframes shimmerProgress {
  from {
    background-position: -200% 0;
  }
  to {
    background-position: 200% 0;
  }
}

/* ============================================================
   16. UTILITY CLASSES
   ============================================================ */

.muted {
  color: var(--text-tertiary);
}

.simple-list {
  margin: 0;
  padding-left: var(--space-5);
}

.section-lead {
  margin: -4px 0 var(--space-6);
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

/* ============================================================
   17. AVATARS
   ============================================================ */

.avatar {
  border-radius: var(--radius-full);
  object-fit: cover;
  display: inline-block;
  border: 2px solid var(--bg-primary);
  background: var(--bg-tertiary);
  flex-shrink: 0;
}

.avatar-xs {
  width: 20px;
  height: 20px;
}
.avatar-sm {
  width: 28px;
  height: 28px;
}
.avatar-md {
  width: 36px;
  height: 36px;
}
.avatar-lg {
  width: 64px;
  height: 64px;
}

.inline-avatar {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.profile-avatar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
}

.holiday-admin-identity {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.holiday-admin-identity-text {
  display: grid;
  gap: 2px;
  line-height: 1.25;
}

.holiday-admin-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.holiday-admin-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  font-size: var(--text-sm);
  line-height: 1;
}

.holiday-starts-soon {
  color: var(--error-600);
  font-weight: var(--font-bold);
}

.holiday-type-pill-booked {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.25);
  color: var(--text-primary);
}

.holiday-type-pill-bank {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.28);
  color: var(--text-primary);
}

.admin-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin: 0 0 var(--space-4);
}

.admin-calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.admin-calendar-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.admin-calendar-dot-meeting {
  background: var(--brand-500);
}

.admin-calendar-dot-holiday {
  background: var(--success-500);
}

.admin-calendar-dot-bank-holiday {
  background: var(--warning-500);
}

.admin-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.admin-calendar-weekday {
  text-align: center;
  font-weight: var(--font-semibold);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding: var(--space-2) 0;
}

.admin-calendar-day {
  min-height: 146px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.admin-calendar-day-empty {
  background: var(--bg-secondary);
}

.admin-calendar-day-today {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 1px rgba(0, 153, 204, 0.2) inset;
}

.admin-calendar-day-number {
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.admin-calendar-events {
  display: grid;
  gap: 4px;
}

.admin-calendar-event {
  display: grid;
  gap: 2px;
  font-size: 12px;
  line-height: 1.3;
  padding: 6px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  border: 1px solid transparent;
  overflow: hidden;
}

.admin-calendar-event-meeting {
  background: rgba(0, 153, 204, 0.12);
  border-color: rgba(0, 153, 204, 0.24);
}

.admin-calendar-event-holiday {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.25);
}

.admin-calendar-event-bank-holiday {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.28);
}

.admin-calendar-more {
  color: var(--text-secondary);
  font-size: 12px;
  padding-left: 2px;
}

.admin-calendar-event-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.admin-calendar-event-icon {
  font-size: 13px;
  line-height: 1;
}

.admin-calendar-event-title {
  font-weight: var(--font-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-calendar-event-meta {
  color: var(--text-secondary);
  white-space: normal;
  overflow-wrap: anywhere;
}

.admin-calendar-attendees {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.admin-calendar-attendee-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: var(--radius-full);
  padding: 2px 7px 2px 4px;
  font-size: 11px;
  line-height: 1.2;
  border: 1px solid transparent;
  max-width: 100%;
}

.admin-calendar-attendee-pill-admin {
  background: rgba(0, 153, 204, 0.18);
  border-color: rgba(0, 153, 204, 0.3);
  color: #004f76;
}

.admin-calendar-attendee-pill-client {
  background: rgba(100, 116, 139, 0.16);
  border-color: rgba(100, 116, 139, 0.28);
  color: var(--gray-700);
}

.admin-calendar-attendee-avatar {
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.7);
  flex: 0 0 auto;
}

.admin-calendar-table-meta {
  display: grid;
  gap: 2px;
}

/* ============================================================
   18. MEETING CARDS
   ============================================================ */

.meeting-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
}

.meeting-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
}

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

.meeting-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.meeting-card h3 {
  margin: 0;
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

.meeting-company {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  font-weight: var(--font-semibold);
}

.meeting-meta {
  margin: var(--space-3) 0;
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.meeting-meta div {
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
}

.meeting-meta dt {
  min-width: 65px;
  margin: 0;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  font-weight: var(--font-semibold);
}

.meeting-meta dd {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.meeting-with-label {
  margin: var(--space-3) 0 var(--space-2);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  font-weight: var(--font-semibold);
}

.meeting-attendees {
  margin: 0;
}

.meeting-people {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.meeting-person {
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  padding: 3px 10px 3px 4px;
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

.meeting-person-admin {
  background: rgba(0, 153, 204, 0.08);
  border-color: rgba(0, 153, 204, 0.25);
  color: var(--brand-700);
}

.meeting-person-client {
  background: var(--bg-secondary);
  border-color: var(--border-light);
  color: var(--text-secondary);
}

[data-theme="dark"] .meeting-person-admin {
  background: rgba(0, 153, 204, 0.15);
  border-color: rgba(0, 153, 204, 0.35);
  color: var(--brand-300);
}

.meeting-actions {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.meeting-actions a {
  font-size: var(--text-xs) !important;
  padding: 3px 10px !important;
}

.meeting-edit {
  margin-top: var(--space-3);
}

.meeting-location-field {
  position: relative;
}

.meeting-location-dropdown {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
  box-shadow: var(--shadow-lg);
}

.meeting-location-option {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 10px 14px;
  color: var(--text-primary);
  cursor: pointer;
  font-size: var(--text-sm);
  font-family: var(--font-sans);
}

.meeting-location-option:hover,
.meeting-location-option:focus-visible {
  background: var(--sidebar-hover-bg);
  outline: none;
}

/* ============================================================
   19. DRIVE / FILE MANAGER
   ============================================================ */

.drive-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.drive-upload-launch {
  margin-top: var(--space-4);
}

.drive-upload-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out);
  z-index: 1200;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.drive-upload-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.drive-upload-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(480px, 100%);
  height: 100vh;
  background: var(--bg-primary);
  border-left: 1px solid var(--border-light);
  box-shadow: var(--shadow-2xl);
  padding: var(--space-6);
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-smooth);
  z-index: 1210;
  overflow-y: auto;
}

.drive-upload-panel.open {
  transform: translateX(0);
}

.drive-upload-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border-light);
}

.drive-upload-panel-head h3 {
  margin: 0;
}

.drive-preview {
  position: sticky;
  top: calc(var(--topbar-height) + var(--space-5));
}

.drive-preview h3 {
  margin-bottom: var(--space-3);
}

.drive-preview-frame {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  min-height: 240px;
  overflow: hidden;
  margin-bottom: var(--space-4);
}

.drive-preview-image,
.drive-preview-iframe {
  width: 100%;
  height: 340px;
  display: block;
  border: 0;
}

.drive-preview-image {
  object-fit: contain;
  background: var(--bg-secondary);
}

.drive-preview-placeholder {
  min-height: 240px;
  display: grid;
  place-items: center;
  gap: var(--space-3);
  text-align: center;
  color: var(--text-secondary);
  padding: var(--space-6);
}

.drive-preview-placeholder i {
  font-size: 2.5rem;
  color: var(--text-tertiary);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.tag-list .badge {
  background: rgba(0, 153, 204, 0.08);
  color: var(--brand-700);
  border-color: rgba(0, 153, 204, 0.2);
}

.filing-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

[data-theme="dark"] .tag-list .badge {
  background: rgba(0, 153, 204, 0.12);
  color: var(--brand-300);
  border-color: rgba(0, 153, 204, 0.25);
}

.upload-progress-list {
  margin-top: var(--space-4);
  display: grid;
  gap: var(--space-2);
}

.upload-progress-item {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  padding: var(--space-3);
}

.upload-progress-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}

.upload-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.upload-progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand-400), var(--brand-600));
  transition: width var(--duration-base) var(--ease-out);
  border-radius: var(--radius-full);
}

.upload-progress-item.is-failed .upload-progress-bar span {
  background: linear-gradient(90deg, var(--error-500), var(--error-600));
}

.upload-progress-item.is-done .upload-progress-bar span {
  background: linear-gradient(90deg, var(--success-500), var(--success-600));
}

.is-active-file td {
  background: rgba(0, 153, 204, 0.04);
}

[data-theme="dark"] .is-active-file td {
  background: rgba(0, 153, 204, 0.08);
}

.drive-file-link {
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  background: none !important;
  border: none !important;
  padding: 0 !important;
  display: inline !important;
}

.drive-file-link i {
  margin-right: var(--space-2);
  color: var(--text-tertiary);
}

.drive-file-link:hover {
  color: var(--brand-600);
  text-decoration: none;
  background: none !important;
}

.drive-file-link.is-selected {
  color: var(--brand-600);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none !important;
}

.file-row-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ============================================================
   20. ANALYTICS & CHARTS
   ============================================================ */

.visitors-chart-wrap {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  padding: var(--space-4);
  overflow: hidden;
}

.visitors-chart {
  display: block;
  width: 100%;
  height: 200px;
}

.visitors-chart-line {
  stroke: var(--brand-600);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-theme="dark"] .visitors-chart-line {
  stroke: var(--brand-400);
}

.visitors-chart-meta {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* ============================================================
   21. SUPPORT REQUESTS
   ============================================================ */

.support-request-hero {
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

.support-request-hero::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 250px;
  height: 250px;
  background: radial-gradient(
    circle,
    rgba(0, 153, 204, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.support-request-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.support-request-eyebrow {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: var(--font-semibold);
}

.support-request-head h2 {
  margin: 0;
}

.support-request-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-shrink: 0;
}

.support-request-badges .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.support-request-description {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

.support-waiting-pill {
  border-width: 1px;
  border-style: solid;
}

.support-waiting-daccaa {
  background: rgba(0, 153, 204, 0.08);
  border-color: rgba(0, 153, 204, 0.25);
  color: var(--brand-700);
}

[data-theme="dark"] .support-waiting-daccaa {
  background: rgba(0, 153, 204, 0.15);
  border-color: rgba(0, 153, 204, 0.35);
  color: var(--brand-300);
}

.support-waiting-client {
  background: var(--bg-secondary);
  border-color: var(--border-medium);
  color: var(--text-secondary);
}

.support-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.support-meta-pill {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  transition: all var(--duration-base) var(--ease-out);
}

.support-meta-pill:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.meeting-show-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.meeting-show-breadcrumb a {
  color: var(--brand-600);
  font-weight: var(--font-medium);
}

.meeting-show-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 90% 10%,
      rgba(0, 153, 204, 0.14),
      transparent 45%
    ),
    radial-gradient(circle at 5% 80%, rgba(15, 23, 42, 0.06), transparent 40%),
    var(--bg-primary);
  border: 1px solid var(--border-light);
}

.meeting-show-hero-top {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: flex-start;
}

.meeting-show-hero-top h1 {
  margin: 0;
  font-size: clamp(1.4rem, 1.9vw, 2rem);
}

.meeting-show-company {
  margin: var(--space-2) 0 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
}

.meeting-show-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-full);
  padding: 8px 12px;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid transparent;
}

.meeting-show-status-scheduled {
  background: rgba(0, 153, 204, 0.15);
  color: var(--brand-700);
  border-color: rgba(0, 153, 204, 0.35);
}

.meeting-show-status-completed {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success-700);
  border-color: rgba(34, 197, 94, 0.32);
}

.meeting-show-status-cancelled {
  background: rgba(239, 68, 68, 0.13);
  color: var(--error-700);
  border-color: rgba(239, 68, 68, 0.28);
}

.meeting-show-hero-metrics {
  margin-top: var(--space-4);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-3);
}

.meeting-show-metric {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  backdrop-filter: blur(2px);
}

[data-theme="dark"] .meeting-show-metric {
  background: rgba(15, 23, 42, 0.4);
}

.meeting-show-metric span {
  display: block;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 2px;
}

.meeting-show-metric strong {
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.meeting-show-hero-actions {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.meeting-show-grid {
  margin-top: var(--space-4);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-4);
}

.meeting-show-panel h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xl);
}

.meeting-show-panel h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-base);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.meeting-show-attendee-sections {
  display: grid;
  gap: var(--space-4);
}

.meeting-show-attendee-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.meeting-show-attendee-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  padding: 4px 10px 4px 4px;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

.meeting-show-attendee-pill.is-admin {
  background: rgba(0, 153, 204, 0.14);
  border-color: rgba(0, 153, 204, 0.3);
  color: var(--brand-700);
}

.meeting-show-attendee-pill.is-client {
  background: rgba(100, 116, 139, 0.14);
  border-color: rgba(100, 116, 139, 0.28);
  color: var(--gray-700);
}

.meeting-show-attendee-pill .avatar {
  width: 22px;
  height: 22px;
  border-width: 1px;
}

.meeting-show-logistics-list {
  display: grid;
  gap: var(--space-3);
}

.meeting-show-logistics-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: var(--space-2);
  align-items: start;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  padding: var(--space-3);
}

.meeting-show-logistics-item i {
  color: var(--brand-600);
  font-size: 1rem;
  line-height: 1.2;
}

.meeting-show-logistics-item span {
  display: block;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 2px;
}

.meeting-show-logistics-item strong {
  color: var(--text-primary);
  font-size: var(--text-sm);
  line-height: 1.35;
}

.meeting-show-notes {
  grid-column: 1 / -1;
}

.meeting-show-notes p {
  margin: 0;
  white-space: pre-wrap;
  line-height: var(--leading-relaxed);
}

.meeting-show-admin-notes {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-light);
  display: grid;
  gap: var(--space-2);
}

.meeting-show-admin-notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.meeting-show-admin-notes-head h3 {
  margin: 0;
  font-size: var(--text-base);
}

.meeting-show-admin-notes textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
}

.meeting-show-admin-notes-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  color: var(--success-700);
  border: 1px solid rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
  border-radius: var(--radius-full);
  padding: 4px 8px;
}

.meeting-show-admin-notes-status.is-saving {
  color: var(--brand-700);
  border-color: rgba(0, 153, 204, 0.32);
  background: rgba(0, 153, 204, 0.12);
}

.meeting-show-admin-notes-status.is-error {
  color: var(--error-700);
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
}

.meeting-show-spin {
  animation: meetingShowSpin 0.9s linear infinite;
}

@keyframes meetingShowSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.support-meta-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 153, 204, 0.1);
  color: var(--brand-600);
  flex-shrink: 0;
}

.support-meta-icon i {
  display: block;
  line-height: 1;
  font-size: 1rem;
}

[data-theme="dark"] .support-meta-icon {
  background: rgba(0, 153, 204, 0.15);
  color: var(--brand-400);
}

.support-meta-pill > div > span {
  display: block;
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: var(--font-semibold);
  margin-bottom: 2px;
}

.support-meta-pill > div > strong {
  color: var(--text-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
}

.support-tools {
  margin-top: var(--space-4);
}

.support-tools h3 {
  margin: 0 0 var(--space-3);
}

.support-tools-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.support-tool-panel {
  width: 100%;
}

.support-tool-panel summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.support-tool-panel summary::-webkit-details-marker {
  display: none;
}

.support-tool-panel[open] summary {
  margin-bottom: var(--space-3);
}

.support-tool-form {
  margin-bottom: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
}

.support-tools-top h2 {
  margin: 0 0 var(--space-3);
}

.support-tools-top .support-tools-buttons {
  align-items: flex-start;
}

.support-tools-top .support-tool-panel {
  width: auto;
}

.support-tools-top .support-tool-panel[open] {
  width: 100%;
}

/* ============================================================
   22. MESSAGE THREADS
   ============================================================ */

.thread-feed {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.thread-item {
  margin: 0;
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  background: var(--bg-primary);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--duration-fast) var(--ease-out);
}

.thread-item:hover {
  box-shadow: var(--shadow-sm);
}

.thread-item:last-child {
  border-bottom: 1px solid var(--border-light);
}

.thread-item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.thread-item-author {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.thread-item-time {
  font-size: var(--text-xs);
  white-space: nowrap;
  color: var(--text-tertiary);
}

.thread-item-body {
  margin: 0;
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

.thread-item-attachment {
  margin: var(--space-3) 0 0;
}

.message-item {
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-4) 0;
}

.message-item header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.message-item:last-child {
  border-bottom: none;
}

.sms-threads-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: var(--space-4);
  min-height: 560px;
}

.sms-thread-list {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  background: var(--bg-secondary);
  padding: var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  height: clamp(540px, 76vh, 860px);
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sms-thread-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-2);
}

.sms-thread-list-head h2 {
  margin: 0;
  font-size: var(--text-lg);
}

.sms-thread-list-head-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.sms-thread-list-head-actions .btn {
  padding: 6px 10px;
  min-height: 32px;
  font-size: var(--text-xs);
}

.sms-thread-new-form {
  display: grid;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-primary);
}

.sms-thread-new-form[hidden] {
  display: none !important;
}

.sms-thread-new-form label {
  margin: 0;
}

.sms-thread-row {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  color: inherit;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.sms-thread-row:hover {
  background: var(--bg-primary);
  border-color: var(--border-light);
  color: inherit;
}

.sms-thread-row.active {
  background: rgba(0, 153, 204, 0.08);
  border-color: rgba(0, 153, 204, 0.22);
}

.sms-thread-row-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sms-thread-row-avatar .avatar {
  border-color: var(--bg-secondary);
}

.sms-thread-row-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.sms-thread-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.sms-thread-row-head strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sms-thread-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--error-600);
  flex-shrink: 0;
}

.sms-thread-row-head .muted {
  font-size: var(--text-xs);
  white-space: nowrap;
}

.sms-thread-preview {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sms-thread-alpha-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
}

.sms-thread-panel {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  background: var(--bg-primary);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  height: clamp(540px, 76vh, 860px);
  min-height: 0;
  overflow: hidden;
}

.sms-thread-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border-light);
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-4);
}

.sms-thread-panel-head h2 {
  margin: 0;
}

.sms-thread-panel-head p {
  margin: var(--space-1) 0 0;
}

.sms-thread-panel-person {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.sms-thread-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-tertiary);
  gap: var(--space-2);
}

.sms-thread-empty i {
  font-size: 2rem;
}

.sms-bubble-feed {
  display: grid;
  gap: var(--space-3);
  align-content: start;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: var(--space-1);
}

.sms-bubble-row {
  display: flex;
}

.sms-bubble-row.inbound {
  justify-content: flex-start;
}

.sms-bubble-row.outbound {
  justify-content: flex-end;
}

.sms-bubble {
  max-width: none;
  width: fit-content;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
}

.sms-bubble-wrap {
  display: grid;
  gap: var(--space-2);
  width: fit-content;
  min-width: min(260px, 100%);
  max-width: min(40%, 560px);
}

.sms-bubble.inbound {
  background: var(--bg-secondary);
}

.sms-bubble.outbound {
  background: rgba(0, 153, 204, 0.1);
  border-color: rgba(0, 153, 204, 0.25);
}

.sms-bubble p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.sms-bubble footer {
  margin-top: var(--space-2);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}

.sms-bubble-status {
  text-transform: lowercase;
}

.sms-read-receipts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.sms-bubble-row.inbound .sms-read-receipts {
  justify-content: flex-start;
}

.sms-bubble-row.outbound .sms-read-receipts {
  justify-content: flex-end;
}

.sms-read-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 6px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(0, 153, 204, 0.32);
  background: rgba(0, 153, 204, 0.14);
  color: var(--brand-700);
  font-size: var(--text-xs);
  line-height: 1;
}

.sms-read-pill i {
  font-size: 0.95rem;
}

.sms-read-pill .avatar {
  border-color: rgba(255, 255, 255, 0.7);
}

.sms-thread-reply-form {
  margin-top: 0;
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-4);
  display: grid;
  gap: var(--space-3);
  flex: 0 0 auto;
  background: var(--bg-primary);
}

.sms-thread-reply-form.is-disabled {
  opacity: 0.65;
}

.sms-thread-reply-form.is-disabled .btn {
  cursor: not-allowed;
}

.sms-thread-reply-blocked {
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.34);
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.sms-thread-reply-form label {
  margin: 0;
}

.sms-thread-reply-form fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  display: grid;
  gap: var(--space-3);
}

.sms-thread-reply-form textarea {
  min-height: 96px;
}

.sms-thread-reply-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.sms-thread-reply-toolbar .btn.active {
  background: rgba(0, 153, 204, 0.12);
  border-color: rgba(0, 153, 204, 0.28);
  color: var(--brand-700);
}

.sms-thread-template-panel {
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}

.sms-thread-template-panel label {
  margin: 0;
}

.sms-thread-reply-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.sms-thread-reply-actions .muted {
  margin: 0;
}

/* ============================================================
   23. SKELETON / LOADING
   ============================================================ */

.dashboard-skeleton-list {
  display: grid;
  gap: var(--space-3);
}

.dashboard-skeleton-line {
  display: block;
  height: 14px;
  border-radius: var(--radius-full);
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 0%,
    var(--bg-secondary) 50%,
    var(--bg-tertiary) 100%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s ease infinite;
}

.dashboard-skeleton-line:nth-child(2) {
  width: 85%;
}
.dashboard-skeleton-line:nth-child(3) {
  width: 68%;
}

@keyframes skeletonShimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

/* ============================================================
   24. PAGE ANIMATIONS
   ============================================================ */

.page-fade-in {
  animation: pageFadeIn var(--duration-slow) var(--ease-out);
}

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

/* ============================================================
   25. INVOICE
   ============================================================ */

.invoice-modern {
  border: 1px solid #c8e6f4;
  background: linear-gradient(155deg, #ddeeff 0%, #ffffff 32%, #f6fbff 100%);
  box-shadow: 0 12px 28px rgba(0, 102, 153, 0.08);
}

.invoice-modern-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid rgba(0, 153, 204, 0.2);
}

.invoice-modern-kicker {
  margin: 0 0 var(--space-1);
  color: #006699;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: var(--font-semibold);
}

.invoice-modern-head h2 {
  margin: 0;
  color: #0f172a;
}

.invoice-modern-meta {
  margin-top: var(--space-5);
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-modern-panel {
  padding: var(--space-4);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(0, 153, 204, 0.18);
  background: rgba(255, 255, 255, 0.8);
}

.invoice-modern-panel h3 {
  margin-top: 0;
  margin-bottom: var(--space-3);
  color: #006699;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.invoice-modern-company {
  margin: 0 0 var(--space-2);
  color: #0f172a;
  font-weight: var(--font-semibold);
  font-size: var(--text-lg);
}

.invoice-modern-panel p {
  margin: 0;
  color: var(--text-secondary);
}

.invoice-modern-list {
  margin: 0;
}

.invoice-modern-list div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-2) 0;
  border-bottom: 1px dashed rgba(0, 153, 204, 0.2);
}

.invoice-modern-list div:last-child {
  border-bottom: 0;
}

.invoice-modern-list dt {
  font-weight: var(--font-medium);
  color: var(--text-secondary);
}

.invoice-modern-list dd {
  margin: 0;
  color: #0f172a;
  font-weight: var(--font-semibold);
}

.invoice-modern-breakdown {
  margin-top: var(--space-5);
  border: 1px solid rgba(0, 153, 204, 0.18);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: #ffffff;
}

.invoice-modern-breakdown table {
  width: 100%;
  border-collapse: collapse;
}

.invoice-modern-breakdown thead th {
  background: rgba(0, 153, 204, 0.1);
  color: #006699;
  border-bottom: 1px solid rgba(0, 153, 204, 0.18);
}

.invoice-modern-breakdown tbody td {
  border-bottom: 1px solid rgba(0, 153, 204, 0.12);
}

.invoice-modern-breakdown tbody tr:last-child td {
  border-bottom: 0;
}

.invoice-modern-amount {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.invoice-modern-total td {
  font-weight: var(--font-bold);
  background: rgba(0, 102, 153, 0.08);
  color: #003f5f;
}

.invoice-modern-foot {
  margin-top: var(--space-5);
  border-top: 1px solid rgba(0, 153, 204, 0.2);
  padding-top: var(--space-4);
  color: var(--text-secondary);
}

.invoice-modern-foot p {
  margin: 0 0 var(--space-3);
}

.invoice-modern-foot p:last-child {
  margin-bottom: 0;
}

.invoice-modern-legal {
  font-size: var(--text-xs);
  line-height: 1.5;
  color: #006699;
}

.invoice-payment-candidate-list {
  display: grid;
  gap: var(--space-3);
  max-height: 52vh;
  overflow-y: auto;
  padding-right: var(--space-1);
}

.invoice-payment-candidate {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  background: var(--bg-secondary);
}

.invoice-payment-candidate input[type="radio"] {
  margin-top: 2px;
  width: 16px;
  min-height: 16px;
}

.invoice-payment-candidate strong {
  display: block;
  margin-bottom: var(--space-1);
}

.invoice-payment-candidate.is-disabled {
  opacity: 0.58;
}

.invoice-row-number-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: var(--font-semibold);
  text-decoration: none;
}

.invoice-row-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.invoice-row-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.invoice-month-count {
  color: var(--text-tertiary);
}

.btn:not(.btn-outline) .invoice-month-count {
  color: rgba(255, 255, 255, 0.88);
}

.invoice-edit-actions {
  margin-top: var(--space-2);
}

#invoice-edit-panel {
  width: min(1100px, max(50vw, 760px));
}

.invoice-edit-save-btn {
  width: 100%;
  justify-content: center;
}

.invoice-edit-danger-zone {
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border-light);
}

.invoice-edit-danger-title {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--error-600);
}

.invoice-edit-delete-btn {
  width: 100%;
  justify-content: center;
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--error-600);
  background: rgba(239, 68, 68, 0.04);
}

.invoice-edit-delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.58);
  color: var(--error-700);
}

[data-theme="dark"] .invoice-edit-danger-title {
  color: #fca5a5;
}

[data-theme="dark"] .invoice-edit-delete-btn {
  border-color: rgba(252, 165, 165, 0.35);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
}

[data-theme="dark"] .invoice-edit-delete-btn:hover {
  border-color: rgba(252, 165, 165, 0.55);
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

/* ============================================================
   26. RESPONSIVE
   ============================================================ */

/* Phones / small tablets */
@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card {
    padding: var(--space-4);
  }

  .main-content {
    padding: var(--space-4);
  }

  h1 {
    font-size: var(--text-2xl);
  }
  h2 {
    font-size: var(--text-xl);
  }
  h3 {
    font-size: var(--text-lg);
  }

  .hero-card {
    padding: var(--space-6);
    margin: var(--space-6) auto;
  }

  .hero-card h1 {
    font-size: var(--text-2xl);
  }

  .landing-hero-grid {
    padding: var(--space-6);
    border-radius: var(--radius-2xl);
  }

  .landing-hero-copy h1 {
    font-size: var(--text-3xl);
  }

  .landing-lead {
    font-size: var(--text-base);
  }

  .landing-strip {
    padding: var(--space-4);
  }

  .landing-bottom-cta {
    padding: var(--space-5);
  }

  .landing-feature-grid {
    grid-template-columns: 1fr;
  }

  .landing-workflow-grid {
    grid-template-columns: 1fr;
  }

  .portal-landing {
    margin-top: var(--space-4);
    gap: var(--space-5);
  }

  .portal-landing-hero {
    min-height: 0;
    border-radius: 20px;
  }

  .portal-landing-container {
    padding: var(--space-6);
  }

  .portal-landing-copy h1 {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  .portal-subtitle {
    margin-bottom: var(--space-5);
  }

  .portal-window-body {
    grid-template-columns: 1fr;
  }

  .portal-window-body aside {
    display: none;
  }

  .portal-landing-section {
    padding: var(--space-5);
  }

  .portal-features-grid {
    grid-template-columns: 1fr;
  }

  .portal-landing-cta {
    padding: var(--space-5);
  }

  .floating-note {
    display: none;
  }
}

/* Tablets */
@media (max-width: 768px) {
  .cards-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-2xl);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-wrap {
    margin-left: 0;
    width: 100%;
  }

  .mobile-nav-btn {
    display: inline-flex;
  }

  .auth-grid,
  .grid-2,
  .hero-card,
  .landing-hero-grid {
    grid-template-columns: 1fr;
  }

  .landing-strip,
  .landing-bottom-cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .landing-strip-points,
  .landing-bottom-actions {
    justify-content: flex-start;
  }

  .portal-landing-grid {
    grid-template-columns: 1fr;
  }

  .portal-landing-mockup {
    min-height: 0;
  }

  .portal-landing-section-head {
    margin-bottom: var(--space-5);
  }

  .table-scroller table {
    font-size: var(--text-xs);
    min-width: 640px;
  }

  .invoice-row-number-link {
    min-height: 42px;
    padding: 8px 10px;
    border-radius: var(--radius-lg);
  }

  .invoice-row-actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-2);
    min-width: 132px;
  }

  .invoice-row-action-link {
    min-height: 42px;
    padding: 10px 12px;
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: var(--font-semibold);
  }

  .invoice-modern-meta {
    grid-template-columns: 1fr;
  }

  th,
  td {
    padding: var(--space-3);
  }

  .sidebar-nav a {
    padding: var(--space-3);
    font-size: var(--text-sm);
  }

  .topbar {
    padding: 0 var(--space-4);
  }

  .main-content {
    padding: var(--space-4);
  }

  .section-lead {
    font-size: var(--text-sm);
  }

  .support-request-head {
    flex-direction: column;
  }

  .support-request-badges {
    justify-content: flex-start;
  }

  .support-meta-grid {
    grid-template-columns: 1fr 1fr;
  }

  .admin-calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-calendar-weekday {
    display: none;
  }

  .drive-layout {
    grid-template-columns: 1fr;
  }

  .drive-preview {
    position: static;
  }

  .drive-upload-panel {
    width: 100%;
  }

  #invoice-edit-panel {
    width: 100%;
  }

  .sms-threads-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .sms-thread-list,
  .sms-thread-panel {
    min-height: 0;
  }

  .sms-thread-list,
  .sms-thread-panel {
    height: min(72vh, calc(100vh - 220px));
  }

  .sms-bubble {
    max-width: 100%;
  }

  .sms-bubble-wrap {
    width: 100%;
  }

  .meeting-show-hero-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .meeting-show-hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .meeting-show-hero-actions {
    width: 100%;
  }

  .meeting-show-hero-actions .btn {
    flex: 1 1 calc(50% - var(--space-2));
    justify-content: center;
  }

  .meeting-show-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-passkey-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-passkey-banner .btn {
    width: 100%;
    justify-content: center;
  }

  .user-pill-meta {
    display: none;
  }
}

/* Medium — small desktop */
@media (min-width: 769px) and (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .support-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-content {
    padding: var(--space-5) var(--space-6);
  }
}

/* Ensure single-column stats on very small phones */
@media (max-width: 480px) {
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .meeting-show-hero-metrics {
    grid-template-columns: 1fr;
  }

  .meeting-show-hero-actions .btn {
    flex: 1 1 100%;
  }
}

/* Large desktop */
@media (min-width: 1280px) {
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================================
   27. PRINT
   ============================================================ */

@media print {
  .sidebar,
  .topbar,
  .mobile-nav-btn,
  .theme-toggle {
    display: none !important;
  }

  .main-wrap {
    margin-left: 0;
    width: 100%;
  }

  body {
    background: white;
    color: black;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* ============================================================
   28. KNOWLEDGE BASE
   ============================================================ */

.kb-support-card p {
  margin: 0;
}

.kb-filter-form {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: end;
}

.kb-layout-grid {
  align-items: start;
}

.kb-article-list {
  display: grid;
  gap: var(--space-3);
}

.kb-article-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  background: color-mix(in srgb, var(--card-bg) 92%, var(--bg-secondary) 8%);
}

.kb-article-card h3 {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
}

.kb-article-card p {
  margin: 0 0 var(--space-3);
}

.kb-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.kb-category-pills .badge {
  background: rgba(0, 153, 204, 0.14);
  color: var(--brand-700);
  border-color: rgba(0, 153, 204, 0.35);
  border-radius: var(--radius-full);
}

[data-theme="dark"] .kb-category-pills .badge {
  background: rgba(56, 189, 248, 0.2);
  color: #bae6fd;
  border-color: rgba(56, 189, 248, 0.4);
}

.kb-article-stats {
  margin-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.kb-popular-list {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: var(--space-3);
}

.kb-popular-list li {
  display: grid;
  gap: 2px;
}

.kb-article-view h1 {
  margin-bottom: var(--space-3);
}

.kb-article-markdown {
  margin-top: var(--space-4);
  line-height: 1.65;
}

.kb-article-markdown img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.kb-article-markdown pre {
  overflow: auto;
  padding: var(--space-3);
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.kb-article-markdown code {
  font-family:
    "SF Mono", SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

.kb-feedback-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.kb-feedback-issue-form {
  margin-top: var(--space-3);
  display: none;
}

.kb-feedback-issue-form.is-open {
  display: grid;
  gap: var(--space-3);
}

.kb-admin-article-meta p {
  margin: var(--space-2) 0 0;
}

.EasyMDEContainer .CodeMirror,
.EasyMDEContainer .CodeMirror-scroll {
  min-height: 360px;
}

@media (max-width: 768px) {
  .kb-filter-form {
    grid-template-columns: 1fr;
  }
}
