/* ==================================================
   F Campus — Design System v3.0
   Inspired by Application Recruitment Dashboard
   ================================================== */

/* --- CSS Variables — Light Theme --- */
:root {
  /* Main surfaces */
  --bg-primary: #ffffff;
  --bg-secondary: #eef6ff;
  --bg-tertiary: #e8f1fb;

  /* Text */
  --text-primary: #0f2744;
  --text-secondary: #5b6b82;
  --text-muted: #8b9bb0;

  /* Borders / shadows */
  --border-color: #e2e8f0;
  --border-light: #edf1f6;
  --shadow-color: rgba(15, 23, 42, 0.06);
  --shadow-lg: rgba(15, 23, 42, 0.12);

  /* Primary brand */
  --accent-color: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: rgba(37, 99, 235, 0.12);

  /* Status colors */
  --success-color: #16a34a;
  --success-bg: #ecfdf3;
  --success-border: #bbf7d0;

  --warning-color: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;

  --error-color: #dc2626;
  --error-bg: #fef2f2;
  --error-border: #fecaca;

  --info-color: #2563eb;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;

  /* Sidebar */
  --sidebar-bg: #0d2744;
  --sidebar-text: #c5d4e8;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --sidebar-active: #2f7bff;
  --sidebar-width: 248px;

  /* Header */
  --navbar-height: 64px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --transition: 0.2s ease;

  /* Badge colors */
  --badge-admin-bg: #6366f1;
  --badge-admin-text: #ffffff;

  --badge-hr-bg: #0891b2;
  --badge-hr-text: #ffffff;

  --badge-success-bg: #dcfce7;
  --badge-success-text: #166534;

  --badge-danger-bg: #fee2e2;
  --badge-danger-text: #991b1b;

  --badge-warning-bg: #fef3c7;
  --badge-warning-text: #92400e;

  --badge-info-bg: #dbeafe;
  --badge-info-text: #1e40af;

  /* Z-index */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal: 1050;
  --z-toast: 1080;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  /* Color aliases */
  --warning: #d97706;
  --shadow: 0 2px 8px rgba(15, 23, 42, 0.06);

  /* Dashboard aliases */
  --dash-blue: #2563eb;
  --dash-green: #16a34a;
  --dash-amber: #d97706;
  --dash-red: #dc2626;
  --dash-cyan: #06b6d4;
  --dash-purple: #8b5cf6;

  --dash-bg: #eef6ff;
  --dash-surface: #ffffff;
  --dash-border: #e2e8f0;
  --dash-text: #0f2744;
  --dash-muted: #5b6b82;

  /* Short aliases */
  --border: #e2e8f0;
  --bg: #ffffff;
  --muted: #5b6b82;
  --primary: #2563eb;

  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;

  --success: #16a34a;
  --amber: #d97706;
  --green: #16a34a;
  --red: #dc2626;
  --blue: #2563eb;

  --surface-alt: #f6f8fc;
  --warning-light: #fffbeb;

  --font-size-sm: 0.8125rem;
  --font-size-xs: 0.75rem;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
  /* Main surfaces */
  --bg-primary: #182131;
  --bg-secondary: #101827;
  --bg-tertiary: #202c3f;

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #a8b3c5;
  --text-muted: #718096;

  /* Borders / shadows */
  --border-color: #334155;
  --border-light: #273449;
  --shadow-color: rgba(0, 0, 0, 0.28);
  --shadow-lg: rgba(0, 0, 0, 0.45);

  /* Primary */
  --accent-color: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-light: rgba(129, 140, 248, 0.15);

  /* Status */
  --success-color: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.10);
  --success-border: rgba(74, 222, 128, 0.28);

  --warning-color: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.10);
  --warning-border: rgba(251, 191, 36, 0.28);

  --error-color: #f87171;
  --error-bg: rgba(248, 113, 113, 0.10);
  --error-border: rgba(248, 113, 113, 0.28);

  --info-color: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.10);
  --info-border: rgba(96, 165, 250, 0.28);

  /* Sidebar */
  --sidebar-bg: #0f1a2b;
  --sidebar-text: #b8c4d6;
  --sidebar-hover: #1d2d46;
  --sidebar-active: #818cf8;

  /* Badges */
  --badge-admin-bg: #818cf8;
  --badge-admin-text: #111827;

  --badge-hr-bg: #22d3ee;
  --badge-hr-text: #111827;

  --badge-success-bg: rgba(74, 222, 128, 0.15);
  --badge-success-text: #4ade80;

  --badge-danger-bg: rgba(248, 113, 113, 0.15);
  --badge-danger-text: #f87171;

  --badge-warning-bg: rgba(251, 191, 36, 0.15);
  --badge-warning-text: #fbbf24;

  --badge-info-bg: rgba(96, 165, 250, 0.15);
  --badge-info-text: #60a5fa;

  /* Dashboard aliases */
  --dash-blue: #60a5fa;
  --dash-green: #4ade80;
  --dash-amber: #fbbf24;
  --dash-red: #f87171;
  --dash-cyan: #22d3ee;
  --dash-purple: #a78bfa;

  --dash-bg: #101827;
  --dash-surface: #182131;
  --dash-border: #334155;
  --dash-text: #f1f5f9;
  --dash-muted: #a8b3c5;

  /* Short aliases */
  --border: #334155;
  --bg: #182131;
  --muted: #a8b3c5;
  --primary: #818cf8;

  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.10);
  --danger-border: rgba(248, 113, 113, 0.28);

  --warning: #fbbf24;
  --success: #4ade80;
  --amber: #fbbf24;
  --green: #4ade80;
  --red: #f87171;
  --blue: #60a5fa;

  --surface-alt: #202c3f;
  --warning-light: rgba(251, 191, 36, 0.10);

  --font-size-sm: 0.8125rem;
  --font-size-xs: 0.75rem;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: linear-gradient(180deg, #eaf4ff 0%, #f7fbff 48%, #eef6ff 100%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

body,
.card,
.stat-card,
.health-card,
.form-card,
.table-container,
.navbar {
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}
a { color: var(--accent-color); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }
::selection { background: var(--accent-light); color: var(--accent-color); }
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.3; color: var(--text-primary); }

/* --- Layout --- */
.app-layout { display: flex; min-height: 100vh; }
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  width: calc(100% - var(--sidebar-width));
}
.content-area {
  flex: 1;
  padding: 20px 24px 32px;
  margin-top: var(--navbar-height);
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background:
    linear-gradient(
      180deg,
      #0b2340 0%,
      #0d2744 42%,
      #0a1e36 100%
    );
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: var(--z-fixed);
  overflow-y: auto;
  transition:
    width var(--transition),
    transform var(--transition),
    background-color var(--transition);
}
.sidebar-header {
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(37,99,235,0.35);
}
.sidebar-logo img.sidebar-logo-image { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.sidebar-brand-wrap { min-width: 0; display: flex; flex-direction: column; }
.sidebar-brand { font-size: 1.05rem; font-weight: 800; color: #fff; white-space: nowrap; letter-spacing: -0.02em; }
.sidebar-tagline { font-size: 0.68rem; color: rgba(197,212,232,0.72); white-space: nowrap; }
.sidebar-nav { flex: 1; padding: 10px 12px 16px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
.sidebar-section-label {
  padding: 14px 12px 6px;
  font-size: 0.68rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: rgba(255,255,255,0.38);
  font-weight: 700;
}
.sidebar-link,
.sidebar .sidebar-link {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin: 2px 0;
  color: var(--sidebar-text);
  font-size: 0.875rem;
  line-height: 1.4;
  transition: all var(--transition);
  border: none !important;
  width: calc(100%) !important;
  box-sizing: border-box;
  text-align: left;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  background: transparent !important;
  border-radius: 12px !important;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-shadow: none !important;
  font-weight: 500;
}
.sidebar-link:hover,
.sidebar .sidebar-link:hover { background: var(--sidebar-hover) !important; color: #fff !important; }
.sidebar-link.active,
.sidebar .sidebar-link.active {
  background: linear-gradient(90deg, #2f7bff 0%, #3b8bff 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(47,123,255,0.35) !important;
}
.sidebar-link .icon { width: 20px; text-align: center; font-size: 1.05rem; flex-shrink: 0; }

/* Sidebar submenu */
.sidebar-submenu { display: none; }
.sidebar-link.submenu-toggle { cursor: pointer; }
.sidebar-link.submenu-toggle .arrow { margin-left: auto; font-size: 0.7rem; transition: transform var(--transition); }
.sidebar-link.submenu-toggle.open .arrow { transform: rotate(90deg); }
.sidebar-submenu.open { display: block; }
.sidebar-submenu .sidebar-link { padding-left: 42px; font-size: 0.8rem; min-height: 36px; }
.sidebar-submenu .sidebar-link:hover { background: var(--sidebar-hover); }

/* Sidebar footer */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px 16px 18px;
}
.sidebar-footer-quote {
  color: rgba(255,255,255,0.72);
  font-size: 0.78rem;
  line-height: 1.45;
  font-weight: 600;
}
.sidebar-footer-quote small { display: block; font-weight: 500; opacity: 0.7; margin-top: 4px; }

/* Mobile sidebar */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: calc(var(--z-fixed) - 1); }
.sidebar-backdrop.active { display: block; }

/* --- Navbar --- */
.navbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--navbar-height);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226,232,240,0.9);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: calc(var(--z-fixed) - 1);
  box-shadow: 0 8px 24px rgba(15, 39, 68, 0.04);
  gap: 16px;
}
.navbar-left { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.navbar-page-title { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); margin: 0; }
.navbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.navbar-clock { font-size: 0.78rem; color: var(--text-secondary); font-variant-numeric: tabular-nums; text-align: right; line-height: 1.25; }
.navbar-clock strong { display: block; color: var(--text-primary); font-weight: 700; }
.navbar-user { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 999px; background: #f4f7fb; }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #06b6d4); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
}
.user-info { display: flex; flex-direction: column; line-height: 1.2; }
.user-name { font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.user-role { font-size: 0.7rem; color: var(--text-secondary); }
.sidebar-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  background: #f4f7fb; border: 1px solid var(--border-color);
  width: 38px; height: 38px; border-radius: 12px;
  font-size: 18px; color: var(--text-secondary); cursor: pointer;
}

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: all var(--transition);
  white-space: nowrap; text-decoration: none;
  line-height: 1.4;
}
.btn-primary { background: var(--accent-color); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary { background: var(--bg-tertiary); color: var(--text-primary); border-color: var(--border-color); }
.btn-secondary:hover { background: var(--border-color); }
.btn-danger { background: var(--error-color); color: #fff; }
.btn-danger:hover { background: #b91c1c; color: #fff; }
.btn-success { background: var(--success-color); color: #fff; }
.btn-success:hover { background: #15803d; color: #fff; }
.btn-warning { background: var(--warning-color); color: #fff; }
.btn-warning:hover { background: #b45309; color: #fff; }
.btn-info { background: var(--info-color); color: #fff; }
.btn-info:hover { background: #1d4ed8; color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 0.8rem; }
.btn-theme-sm {
  background: var(--bg-tertiary); border: 1px solid var(--border-color);
  border-radius: 50%; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.1rem; color: var(--text-primary);
  transition: all var(--transition);
}
.btn-theme-sm:hover { background: var(--border-color); }

/* --- Tables --- */
.table-container {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: visible;
  position: relative;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead { background: var(--bg-secondary); }
.data-table td { position: relative; }
.data-table tr { position: relative; }
.data-table td { position: relative; }
.data-table th {
  padding: 12px 16px; text-align: left;
  font-size: 0.8rem; font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary); font-size: 0.875rem;
}
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover { background: var(--bg-secondary); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table code { background: var(--bg-tertiary); padding: 2px 6px; border-radius: 4px; font-size: 0.8rem; }
.empty-state { text-align: center; color: var(--text-muted); padding: 40px 16px !important; }
.actions-cell { display: flex; gap: 6px; }

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
  white-space: nowrap;
}
.badge-admin { background: var(--badge-admin-bg); color: var(--badge-admin-text); }
.badge-hr { background: var(--badge-hr-bg); color: var(--badge-hr-text); }
.badge-success { background: var(--badge-success-bg); color: var(--badge-success-text); }
.badge-danger { background: var(--badge-danger-bg); color: var(--badge-danger-text); }
.badge-warning { background: var(--badge-warning-bg); color: var(--badge-warning-text); }
.badge-info { background: var(--badge-info-bg); color: var(--badge-info-text); }
.badge-primary { background: var(--accent-light); color: var(--accent-color); }
.badge-secondary { background: var(--bg-tertiary); color: var(--text-secondary); }

/* --- Cards --- */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 2px 8px var(--shadow-color);
  overflow: visible;
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}
.card:hover {
  box-shadow: 0 6px 18px var(--shadow-lg);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border-light);
}
.card-header h3 { font-size: 0.95rem; font-weight: 600; display: flex; align-items: center; gap: 8px; margin: 0; }
.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }
.card-footer {
  padding: 12px 20px; border-top: 1px solid var(--border-light);
  background: var(--bg-secondary);
  display: flex; align-items: center; gap: 8px;
}

/* --- Stat Cards (Dashboard Widgets) --- */
.stat-card {
  background: linear-gradient(135deg, var(--kpi-from, #3b82f6) 0%, var(--kpi-to, #60a5fa) 100%);
  border: none;
  border-radius: 20px;
  padding: 18px 18px 16px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  color: #fff;
  min-height: 132px;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.16);
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-grid > :nth-child(7n+1) { --kpi-from:#3b82f6; --kpi-to:#60a5fa; }
.stat-grid > :nth-child(7n+2) { --kpi-from:#10b981; --kpi-to:#34d399; }
.stat-grid > :nth-child(7n+3) { --kpi-from:#ec4899; --kpi-to:#f472b6; }
.stat-grid > :nth-child(7n+4) { --kpi-from:#f59e0b; --kpi-to:#fbbf24; }
.stat-grid > :nth-child(7n+5) { --kpi-from:#8b5cf6; --kpi-to:#a78bfa; }
.stat-grid > :nth-child(7n+6) { --kpi-from:#f97316; --kpi-to:#fb7185; }
.stat-grid > :nth-child(7n) { --kpi-from:#334155; --kpi-to:#64748b; }
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(15, 39, 68, 0.18);
  color: #fff;
}
.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  background: rgba(255,255,255,0.22) !important;
  color: #fff !important;
  transition: transform var(--transition);
}
.stat-card:hover .stat-icon { transform: scale(1.05); }
.stat-card .stat-icon.blue,
.stat-card .stat-icon.green,
.stat-card .stat-icon.red,
.stat-card .stat-icon.amber,
.stat-card .stat-icon.purple,
.stat-card .stat-icon.cyan { background: rgba(255,255,255,0.22) !important; color: #fff !important; }
.stat-card .stat-value {
  font-size: 1.7rem; font-weight: 800;
  color: #fff; line-height: 1;
}
.stat-card .stat-label { font-size: 0.8rem; color: rgba(255,255,255,0.92); margin-top: 0; font-weight: 600; }
.stat-card .stat-trend, .stat-card div[style] { font-size: 0.74rem; margin-top: 2px; color: rgba(255,255,255,0.8) !important; }
.stat-card .stat-trend.up, .stat-card .stat-trend.down { color: rgba(255,255,255,0.88); }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px; margin-bottom: 24px;
}

/* --- Page Header --- */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 16px;
}
.page-header h1 { font-size: 1.5rem; font-weight: 700; margin: 0; }
.page-header h2 { font-size: 1.25rem; font-weight: 600; margin: 0; }
.page-header .page-description { font-size: 0.85rem; color: var(--text-secondary); margin-top: 2px; }
.page-actions { display: flex; gap: 10px; flex-shrink: 0; align-items: center; flex-wrap: wrap; }

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  list-style: none; margin-bottom: 8px; padding: 0;
  font-size: 0.8rem; color: var(--text-secondary);
}
.breadcrumb li { display: flex; align-items: center; gap: 6px; }
.breadcrumb li + li::before { content: '/'; color: var(--text-muted); margin-right: 4px; }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent-color); }
.breadcrumb .active { color: var(--text-primary); font-weight: 500; }

/* --- Forms --- */
.form-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; margin-bottom: 6px;
  font-weight: 500; color: var(--text-primary); font-size: 0.875rem;
}
.form-control {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-primary); color: var(--text-primary);
  font-size: 0.9rem; transition: border-color var(--transition);
  box-sizing: border-box;
}
.form-control:focus {
  outline: none; border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-light);
}
textarea.form-control { min-height: 100px; resize: vertical; padding: 10px 14px; }
select.form-control { appearance: auto; }
.form-check { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.875rem; }
.form-check input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent-color); cursor: pointer; }
.form-help { display: block; margin-top: 4px; color: var(--text-muted); font-size: 0.8rem; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px 20px; margin-bottom: 16px; }
.form-row:last-child { margin-bottom: 0; }
.errorlist { list-style: none; padding: 0; margin: 4px 0 0 0; }
.errorlist li { color: var(--error-color); font-size: 0.8rem; }

/* --- Alerts --- */
.alert {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-md);
  margin-bottom: 16px; font-size: 0.875rem;
}
.alert-success { background: var(--success-bg); border: 1px solid var(--success-border); color: var(--success-color); }
.alert-error, .alert-danger { background: var(--error-bg); border: 1px solid var(--error-border); color: var(--error-color); }
.alert-warning { background: var(--warning-bg); border: 1px solid var(--warning-border); color: var(--warning-color); }
.alert-info { background: var(--info-bg); border: 1px solid var(--info-border); color: var(--info-color); }
.alert-icon { font-size: 1rem; flex-shrink: 0; }
.alert-close {
  margin-left: auto; background: none; border: none;
  font-size: 1.2rem; cursor: pointer; opacity: 0.5; color: inherit;
}
.alert-close:hover { opacity: 1; }

/* --- Filter Bar --- */
.filter-bar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 0; flex-wrap: wrap;
}
.filter-bar .form-control { width: auto; min-width: 160px; }
.filter-bar .search-input { flex: 1; min-width: 200px; }

/* --- Dropdown --- */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  display: none; position: absolute; top: 100%; right: 0;
  z-index: 9999;
  min-width: 180px; background: var(--bg-primary);
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px var(--shadow-lg); padding: 6px; margin-top: 4px;
}
.dropdown-menu.flip { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 4px; }
.dropdown-menu.show { display: block; }
.dropdown-header {
  padding: 8px 12px 4px; font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; color: var(--text-muted);
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; font-size: 0.8rem; color: var(--text-primary);
  border-radius: var(--radius-sm); transition: all var(--transition);
  text-decoration: none;
}
.dropdown-item:hover { background: var(--bg-secondary); }
.dropdown-item.text-danger { color: var(--error-color); }
.item-icon { font-size: 1rem; width: 18px; text-align: center; color: var(--text-muted); }
.dropdown-divider { height: 1px; background: var(--border-light); margin: 4px 0; }

/* --- Tabs --- */
.detail-tabs {
  display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
}
.tab-btn {
  padding: 10px 20px; background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  cursor: pointer; font-size: 0.875rem; font-weight: 500;
  color: var(--text-secondary); transition: all 0.2s;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--accent-color); border-bottom-color: var(--accent-color); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Pagination --- */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 16px;
}
.pagination-info { font-size: 0.85rem; color: var(--text-secondary); }

/* --- Info Grid (Detail Pages) --- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.info-item { display: flex; flex-direction: column; gap: 4px; }
.info-label {
  font-size: 0.8rem; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.03em;
}
.info-value { font-size: 1rem; font-weight: 500; color: var(--text-primary); }

/* --- Health Grid --- */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.health-card {
  background: var(--bg-primary); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); padding: 16px;
  transition: box-shadow var(--transition);
}
.health-card:hover { box-shadow: 0 4px 12px var(--shadow-lg); }
.health-card .health-head { display: flex; align-items: center; justify-content: space-between; }
.health-card .health-name {
  font-size: 0.75rem; color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.health-card .health-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.health-card .health-value { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); margin-top: 7px; }
.health-card .health-sub { font-size: 0.75rem; color: var(--text-muted); }
.health-progress { height: 7px; border-radius: 999px; background: var(--border-color); overflow: hidden; margin-top: 11px; }
.health-progress-bar { height: 100%; border-radius: 999px; transition: width 0.9s ease; }

/* --- Wizard Stepper --- */
.stepper { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 24px; }
.step {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  background: var(--bg-primary); transition: all var(--transition);
}
.step.active { border-color: var(--accent-color); box-shadow: 0 0 0 3px var(--accent-light); }
.step.done { border-color: var(--success-border); background: var(--success-bg); }
.step-num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
  background: var(--border-color); color: var(--text-muted);
}
.step.active .step-num { background: var(--accent-color); color: #fff; }
.step.done .step-num { background: var(--success-color); color: #fff; }
.step-name { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }

/* --- Modals --- */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: var(--z-modal); }
.modal-backdrop.show { display: flex; align-items: center; justify-content: center; }
.modal {
  display: none; position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-primary); border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  z-index: calc(var(--z-modal) + 1);
  max-width: 90vw; max-height: 85vh; overflow-y: auto;
}
.modal.show { display: block; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border-light);
}
.modal-header h3 { font-size: 1rem; font-weight: 600; margin: 0; }
.modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted); padding: 4px; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 20px; border-top: 1px solid var(--border-light);
}

/* --- Toasts --- */
.toast-container {
  position: fixed; top: 16px; right: 16px;
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-md);
  background: var(--bg-primary); border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px var(--shadow-lg);
  font-size: 0.875rem; min-width: 280px;
  animation: slideIn 0.3s ease;
}
.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-close { background: none; border: none; font-size: 1.1rem; cursor: pointer; color: var(--text-muted); padding: 2px; }
.toast.success { border-left: 3px solid var(--success-color); }
.toast.error { border-left: 3px solid var(--error-color); }
.toast.warning { border-left: 3px solid var(--warning-color); }
.toast.info { border-left: 3px solid var(--info-color); }
@keyframes slideIn { from { opacity: 0; transform: translateX(100%); } to { opacity: 1; transform: translateX(0); } }

/* --- Spinner --- */
.spinner { width: 24px; height: 24px; border: 3px solid var(--border-color); border-top-color: var(--accent-color); border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block; }
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Utilities --- */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-center { text-align: center; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.8125rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex-1 { flex: 1; }
.w-100 { width: 100%; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
hr { border: none; border-top: 1px solid var(--border-color); margin: 16px 0; }
code { background: var(--bg-tertiary); padding: 2px 6px; border-radius: 4px; font-size: 0.8rem; }
img { max-width: 100%; }
.d-none { display: none !important; }
.p-0 { padding: 0 !important; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #475569; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #64748b; }

/* Sidebar scrollbar — transparent track, visible thumb on hover */
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }
.sidebar { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .sidebar { width: 60px; }
  .sidebar-brand, .sidebar-tagline, .sidebar-brand-wrap, .sidebar-section-label, .sidebar-link span:not(.icon),
  .sidebar-submenu, .sidebar-footer { display: none; }
  .sidebar-link { justify-content: center; padding: 12px; }
  .sidebar-link .arrow { display: none; }
  .main-content { margin-left: 60px; }
  .navbar { left: 60px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .navbar-right .user-info { display: none; }
}
@media (max-width: 767px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop.active { display: block; }
  .main-content { margin-left: 0; }
  .navbar { left: 0; padding: 0 12px; }
  .sidebar-toggle { display: flex; }
  .navbar-right .user-info { display: none; }
  .navbar-right .navbar-clock { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .page-actions { width: 100%; flex-wrap: wrap; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-bar .form-control { min-width: 100%; }
  .form-row { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .navbar, .sidebar-backdrop { display: none !important; }
  .main-content { margin: 0 !important; }
  .content-area { margin-top: 0 !important; padding: 0 !important; }
}

/* --- Auth Pages (Login, Forgot Password, etc.) --- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  padding: 20px;
}
.auth-container { width: 100%; max-width: 420px; }
.auth-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 36px 32px 32px;
}
.auth-header { text-align: center; margin-bottom: 28px; }
.auth-logo {
  width: 56px; height: 56px;
  background: var(--accent-color);
  border-radius: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800; color: #fff;
  margin-bottom: 16px;
}
.auth-header h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 6px; color: var(--text-primary); }
.auth-header p { font-size: 0.9rem; color: var(--text-secondary); margin: 0; }
.required { color: var(--error-color); }

/* --- Legacy Utility Classes (compatibility) --- */
.dash-cell-avatar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dash-avatar {
  width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0;
}
.dash-cell-strong { font-weight: 600; }
.dash-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-cell-name { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-tnum { font-variant-numeric: tabular-nums; }
.dash-row-link { cursor: pointer; }
.dash-row-link:hover td { background: var(--bg-secondary); }
.dash-check { width: 18px; height: 18px; accent-color: var(--accent-color); cursor: pointer; }
.dash-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.dash-stack { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.dash-insight { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.dash-insight:last-child { border-bottom: none; }
.dash-insight-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dash-insight-label { flex: 1; min-width: 0; font-size: 0.85rem; color: var(--text-primary); }
.dash-insight-value { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); min-width: 56px; text-align: right; white-space: nowrap; }
.dash-form-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--border-color); }
.dash-card-list { padding: 8px 0; }
.dash-kpi-trend { font-size: 0.75rem; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; }
.dash-kpi-trend.up { color: var(--success-color); background: var(--success-bg); }
.dash-kpi-trend.down { color: var(--error-color); background: var(--error-bg); }
.dash-kpi-trend.flat { color: var(--text-muted); background: var(--bg-tertiary); }
.dash-dropzone { border: 2px dashed var(--border-color); border-radius: 12px; padding: 22px 16px; text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.dash-dropzone:hover, .dash-dropzone.dragover { border-color: var(--accent-color); background: var(--accent-light); }
.dash-section-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
@media (max-width: 1199px) { .dash-cols { grid-template-columns: 1fr; } }
@media (max-width: 767px) { .dash-cols { grid-template-columns: 1fr; } }

/* --- Additional Missing Utility Classes --- */
.empty-icon { font-size: 2rem; margin-bottom: 8px; color: var(--text-muted); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; color: #fff; flex-shrink: 0; }
.list-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.activity-icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; flex-shrink: 0; }
.activity-meta { font-size: 0.8rem; color: var(--text-muted); }
.tt-slot-cell { min-width: 100px; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.progress { height: 8px; border-radius: 99px; background: var(--border-color); overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; transition: width 0.6s ease; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: none; padding: 8px 16px; border-radius: var(--radius-md); cursor: pointer; font-size: 0.875rem; }
.btn-ghost:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.dash-activity-icon { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--text-primary); font-size: 0.875rem; }
.list-item { display: flex; align-items: center; gap: 8px; }
.list-label { font-size: 0.85rem; }
.cell-avatar { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-strong { font-weight: 600; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.user-row:last-child { border-bottom: none; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick-action { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: var(--radius-md); color: var(--text-primary); font-size: 0.85rem; font-weight: 500; text-decoration: none; transition: all var(--transition); }
.quick-action:hover { border-color: var(--accent-color); color: var(--accent-color); }
.section-title { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin: 0 0 14px; }
.section-sub { font-size: 0.8rem; color: var(--text-muted); font-weight: 400; }
.chart-container { height: 260px; width: 100%; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--bg-secondary); }
.tnum { font-variant-numeric: tabular-nums; }
.review-item { padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.review-item:last-child { border-bottom: none; }

/* --- Button Loading Spinner --- */
.btn-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
.btn-secondary .btn-spinner,
.btn-theme-sm .btn-spinner {
  border-color: rgba(0,0,0,0.2);
  border-top-color: var(--text-primary);
}
@keyframes btnSpin {
  to { transform: rotate(360deg); }
}
button:disabled, a:disabled {
  pointer-events: none;
}

/* --- Profile Page --- */
.dash-profile-head {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 4px var(--shadow-color);
}
.dash-profile-head-main {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.dash-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563EB, #8B5CF6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}
.dash-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dash-online-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #22C55E;
  border: 2px solid #fff;
}
.dash-profile-head-info {
  flex: 1;
  min-width: 0;
}
.dash-profile-head-info h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text-primary);
}
.dash-profile-head-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.dash-profile-head-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
@media (max-width: 767px) {
  .dash-profile-head-main { flex-direction: column; text-align: center; }
  .dash-profile-head-meta { justify-content: center; }
  .dash-profile-head-actions { justify-content: center; }
}

/* Summary Grid */
.dash-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 991px) { .dash-summary-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575px) { .dash-summary-grid { grid-template-columns: 1fr; } }
.dash-summary-tile {
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}
.dash-summary-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.dash-summary-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* Photo Upload */
.dash-photo-upload {
  text-align: center;
}
.dash-photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 18px;
  padding: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: 0 0 50% 50%;
}
.dash-profile-avatar:hover .dash-photo-overlay {
  opacity: 1;
}
.dash-drop {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.dash-drop:hover, .dash-drop.dragover {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

/* Activity */
.dash-activity {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}
.dash-activity:last-child {
  border-bottom: none;
}
.dash-activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  flex-shrink: 0;
}
.dash-activity-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.dash-activity-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Activity/Login Items --- */
.dash-login {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}
.dash-login:last-child {
  border-bottom: none;
}
.dash-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.dash-login-main {
  flex: 1;
  min-width: 0;
}
.dash-login-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-login-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.dash-login-badge {
  flex-shrink: 0;
}
.dash-login-time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ==================================================
   Aegis shell — global page chrome
   ================================================== */
.navbar-search {
  flex: 1;
  max-width: 560px;
  position: relative;
}
.navbar-search input {
  width: 100%;
  height: 42px;
  border: 1px solid #e2e8f0;
  background: #f7faff;
  border-radius: 999px;
  padding: 0 44px 0 40px;
  font-size: 0.88rem;
  color: var(--text-primary);
}
.navbar-search input:focus {
  outline: none;
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37,99,235,0.12);
}
.navbar-search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #94a3b8; pointer-events: none;
}
.navbar-search-kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 0.68rem; color: #64748b; background: #fff;
  border: 1px solid #e2e8f0; border-radius: 8px; padding: 2px 7px;
  font-weight: 700;
}
.navbar-icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid #e8eef6; background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  color: #475569; position: relative; cursor: pointer;
  text-decoration: none;
}
.navbar-icon-btn:hover { background: #f8fafc; color: var(--accent-color); }
.navbar-bell-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 18px; height: 18px; border-radius: 99px;
  background: #ef4444; color: #fff; font-size: 0.65rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  border: 2px solid #fff;
}
.navbar-heading { display: none; }
.page-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.page-description:empty { display: none; }
.card, .form-card, .table-container {
  border-radius: 18px;
  border-color: rgba(226,232,240,0.9);
  box-shadow: 0 10px 24px rgba(15, 39, 68, 0.05);
}
.btn { border-radius: 12px; font-weight: 600; }
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  box-shadow: 0 8px 16px rgba(37,99,235,0.22);
}
.data-table thead { background: #f8fbff; }
.health-grid > :nth-child(4n+1) { background: #ecfdf5; }
.health-grid > :nth-child(4n+2) { background: #eff6ff; }
.health-grid > :nth-child(4n+3) { background: #fdf2f8; }
.health-grid > :nth-child(4n) { background: #fffbeb; }
.quick-action {
  border: none;
  color: #fff;
  font-weight: 700;
  border-radius: 16px;
  min-height: 76px;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 16px rgba(37,99,235,0.14);
}
.quick-actions > :nth-child(4n+1) { background: linear-gradient(135deg,#2563eb,#3b82f6); }
.quick-actions > :nth-child(4n+2) { background: linear-gradient(135deg,#10b981,#34d399); }
.quick-actions > :nth-child(4n+3) { background: linear-gradient(135deg,#8b5cf6,#a78bfa); }
.quick-actions > :nth-child(4n) { background: linear-gradient(135deg,#f59e0b,#fbbf24); }
.quick-action:hover { color: #fff; filter: brightness(1.05); }
.cmd-overlay {
  display: none; position: fixed; inset: 0; background: rgba(15,39,68,0.35);
  z-index: 2000; align-items: flex-start; justify-content: center; padding-top: 12vh;
}
.cmd-overlay.show { display: flex; }
.cmd-panel {
  width: min(640px, 92vw); background: #fff; border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15,39,68,0.2); overflow: hidden;
}
.cmd-panel input {
  width: 100%; border: 0; padding: 16px 18px; font-size: 1rem; outline: none;
  background: transparent; color: var(--text-primary);
}
.cmd-results { max-height: 360px; overflow: auto; border-top: 1px solid var(--border-color); }
.cmd-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: var(--text-primary); text-decoration: none;
}
.cmd-item:hover, .cmd-item.active { background: #eff6ff; color: var(--accent-color); }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid #e8eef6; background: #fff; cursor: pointer; color: #475569;
}
.navbar-actions { display: none; }
body.page-dashboard .page-header { display: none; }
.role-switcher { padding: 8px 8px 12px; }
.role-switcher-label { font-size: 0.68rem; color: rgba(255,255,255,0.45); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.role-switcher-select { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.12); }
[data-theme="dark"] body {
  background: #0f172a;
}
[data-theme="dark"] .navbar {
  background: rgba(24,33,49,0.92);
}
[data-theme="dark"] .navbar-search input,
[data-theme="dark"] .navbar-icon-btn,
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .navbar-user {
  background: #1e293b; border-color: #334155; color: #e2e8f0;
}
[data-theme="dark"] .cmd-panel { background: #182131; }
@media (max-width: 1100px) {
  .navbar-search { max-width: 280px; }
  .navbar-search-kbd { display: none; }
}
@media (max-width: 767px) {
  .navbar-search { display: none; }
  .navbar-clock { display: none !important; }
}
