/* ============================================================
   OFFLY — Design System v1.0
   Liquid Glass · SaaS Modern · Mobile-first
   Paleta oficial: #0F172A · #4F46E5 · #2563EB · #22C55E
                   #14B8A6 · #F59E0B · #EF4444 · #F8FAFC
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ─────────────────────────────────────────────
   1. CSS CUSTOM PROPERTIES
───────────────────────────────────────────── */
:root {
  /* Brand colors */
  --color-navy:       #0F172A;
  --color-indigo:     #4F46E5;
  --color-indigo-h:   #4338CA;
  --color-indigo-l:   #EEF2FF;
  --color-blue:       #2563EB;
  --color-blue-l:     #DBEAFE;
  --color-green:      #22C55E;
  --color-green-l:    #DCFCE7;
  --color-teal:       #14B8A6;
  --color-teal-l:     #CCFBF1;
  --color-amber:      #F59E0B;
  --color-amber-l:    #FEF3C7;
  --color-red:        #EF4444;
  --color-red-l:      #FEE2E2;
  --color-purple:     #8B5CF6;
  --color-purple-l:   #EDE9FE;
  --color-gray-bg:    #F8FAFC;

  /* Neutral 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 */
  --color-success: var(--color-green);
  --color-warning: var(--color-amber);
  --color-danger:  var(--color-red);
  --color-info:    var(--color-blue);

  /* Status badges */
  --status-pending:     var(--color-amber);
  --status-approved:    var(--color-green);
  --status-rejected:    var(--color-red);
  --status-conflict:    var(--color-red);
  --status-preapproved: var(--color-blue);
  --status-draft:       var(--gray-400);
  --status-exception:   var(--color-purple);
  --status-cancelled:   var(--gray-600);

  /* Typography */
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text-xs:     0.75rem;
  --text-sm:     0.875rem;
  --text-base:   1rem;
  --text-lg:     1.125rem;
  --text-xl:     1.25rem;
  --text-2xl:    1.5rem;
  --text-3xl:    1.875rem;
  --fw-light:    300;
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-extrabold:800;

  /* 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;

  /* Border radius */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-2xl:  28px;
  --radius-full: 9999px;

  /* Liquid Glass — light surfaces */
  --glass-bg:          rgba(255, 255, 255, 0.72);
  --glass-bg-hover:    rgba(255, 255, 255, 0.88);
  --glass-border:      rgba(255, 255, 255, 0.55);
  --glass-blur:        blur(20px);
  --glass-blur-heavy:  blur(40px);
  --glass-shadow:      0 8px 32px rgba(15, 23, 42, 0.08), 0 1px 0 rgba(255,255,255,0.6) inset;
  --glass-shadow-hover:0 16px 48px rgba(15, 23, 42, 0.12), 0 1px 0 rgba(255,255,255,0.8) inset;

  /* Liquid Glass — dark surfaces (sidebar) */
  --glass-dark-bg:     rgba(15, 23, 42, 0.82);
  --glass-dark-border: rgba(255, 255, 255, 0.08);
  --glass-dark-hover:  rgba(255, 255, 255, 0.06);

  /* Elevations */
  --shadow-xs: 0 1px 2px rgba(15,23,42,0.05);
  --shadow-sm: 0 2px 8px rgba(15,23,42,0.07);
  --shadow-md: 0 4px 16px rgba(15,23,42,0.10);
  --shadow-lg: 0 8px 32px rgba(15,23,42,0.12);
  --shadow-xl: 0 16px 48px rgba(15,23,42,0.15);

  /* Layout */
  --sidebar-w: 220px;
  --topbar-h:  64px;
}

/* ─────────────────────────────────────────────
   2. RESET & BASE
───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  color: var(--gray-800);
  background-color: var(--gray-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* ─────────────────────────────────────────────
   3. LIQUID GLASS CARD
───────────────────────────────────────────── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--glass-shadow);
  transition: box-shadow 0.25s ease, background 0.25s ease, transform 0.2s ease;
}
.glass:hover {
  background: var(--glass-bg-hover);
  box-shadow: var(--glass-shadow-hover);
}
.glass-sm {
  border-radius: var(--radius-lg);
}
.glass-xs {
  border-radius: var(--radius-md);
}
.glass-dark {
  background: var(--glass-dark-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-dark-border);
  box-shadow: var(--shadow-xl);
}

/* ─────────────────────────────────────────────
   4. SIDEBAR NAVIGATION
───────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--glass-dark-bg);
  backdrop-filter: var(--glass-blur-heavy);
  -webkit-backdrop-filter: var(--glass-blur-heavy);
  border-right: 1px solid var(--glass-dark-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  padding: var(--space-6) 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-logo {
  padding: 0 var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--glass-dark-border);
  margin-bottom: var(--space-4);
}
.sidebar-logo img {
  height: 32px;
  width: auto;
}
.sidebar-logo-text {
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  color: #fff;
  letter-spacing: -0.3px;
}
.sidebar-logo-sub {
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-top: 2px;
}

.sidebar-section {
  padding: 0 var(--space-3);
  margin-bottom: var(--space-2);
}
.sidebar-section-label {
  font-size: 10px;
  font-weight: var(--fw-semibold);
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: var(--space-3) var(--space-3) var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--gray-400);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  transition: background 0.15s, color 0.15s;
  position: relative;
  margin-bottom: 2px;
}
.nav-item:hover {
  background: var(--glass-dark-hover);
  color: #fff;
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(79,70,229,0.35) 0%, rgba(37,99,235,0.20) 100%);
  color: #fff;
  border: 1px solid rgba(79,70,229,0.25);
}
.nav-item.active .nav-icon { color: var(--color-indigo); filter: drop-shadow(0 0 6px rgba(79,70,229,0.6)); }

.nav-icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke-width: 1.8;
}
.nav-badge {
  margin-left: auto;
  background: var(--color-red);
  color: #fff;
  font-size: 10px;
  font-weight: var(--fw-bold);
  border-radius: var(--radius-full);
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 0 8px rgba(239,68,68,0.5);
}

.sidebar-footer {
  margin-top: auto;
  padding: var(--space-4) var(--space-3) 0;
  border-top: 1px solid var(--glass-dark-border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-user:hover { background: var(--glass-dark-hover); }
.sidebar-user-name {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: #fff;
}
.sidebar-user-role {
  font-size: var(--text-xs);
  color: var(--gray-400);
}

/* ─────────────────────────────────────────────
   5. MAIN LAYOUT
───────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
  background: var(--gray-50);
}
/* Subtle mesh gradient background */
.layout::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(79,70,229,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(20,184,166,0.05) 0%, transparent 60%),
    var(--gray-50);
  z-index: 0;
  pointer-events: none;
}

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.topbar {
  height: var(--topbar-h);
  padding: 0 var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(248,250,252,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(226,232,240,0.8);
  position: sticky;
  top: 0;
  z-index: 50;
}

.page-content {
  padding: var(--space-8);
}

/* ─────────────────────────────────────────────
   6. KPI CARDS
───────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.kpi-card {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.kpi-icon-wrap {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.kpi-label {
  font-size: var(--text-sm);
  color: var(--gray-500);
  font-weight: var(--fw-medium);
}
.kpi-value {
  font-size: var(--text-3xl);
  font-weight: var(--fw-extrabold);
  color: var(--gray-900);
  line-height: 1;
  letter-spacing: -1px;
}
.kpi-value.danger { color: var(--color-red); }
.kpi-sub {
  font-size: var(--text-xs);
  color: var(--gray-400);
}

/* ─────────────────────────────────────────────
   7. CALENDAR GRID (cobertura de personal)
───────────────────────────────────────────── */
.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}
.cal-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  color: var(--gray-800);
}
.cal-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.cal-month {
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--gray-800);
  min-width: 120px;
  text-align: center;
}
.cal-btn {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--gray-600);
  transition: all 0.15s;
  backdrop-filter: blur(8px);
}
.cal-btn:hover {
  background: var(--color-indigo);
  color: #fff;
  border-color: var(--color-indigo);
}

.cal-select {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--gray-700);
  cursor: pointer;
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-2) 0;
}
.cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  min-height: 52px;
  padding: var(--space-1);
}
.cal-day:hover { transform: scale(1.04); box-shadow: var(--shadow-md); }
.cal-day.empty { cursor: default; }
.cal-day.empty:hover { transform: none; box-shadow: none; }

.cal-day-num {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--gray-700);
  line-height: 1;
  margin-bottom: 4px;
}
.cal-day.empty .cal-day-num { color: var(--gray-300); }
.cal-day.weekend .cal-day-num { color: var(--gray-400); }

.cal-pct {
  font-size: 11px;
  font-weight: var(--fw-bold);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  line-height: 1;
}
/* Coverage levels */
.cal-day.optimal  { background: rgba(34,197,94,0.08); }
.cal-day.optimal .cal-pct  { background: rgba(34,197,94,0.15); color: #16a34a; }
.cal-day.caution  { background: rgba(245,158,11,0.08); }
.cal-day.caution .cal-pct  { background: rgba(245,158,11,0.15); color: #d97706; }
.cal-day.risk     { background: rgba(239,68,68,0.08); }
.cal-day.risk .cal-pct     { background: rgba(239,68,68,0.15); color: #dc2626; }
.cal-day.nodata   { background: rgba(148,163,184,0.06); }
.cal-day.nodata .cal-day-num { color: var(--gray-300); }

.cal-legend {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}
.cal-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--gray-500);
}
.cal-legend-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────
   8. BUTTONS
───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  transition: all 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
  border: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--color-indigo) 0%, var(--color-blue) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(79,70,229,0.35), 0 1px 0 rgba(255,255,255,0.15) inset;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-indigo-h) 0%, #1d4ed8 100%);
  box-shadow: 0 6px 20px rgba(79,70,229,0.45);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: var(--glass-bg);
  color: var(--gray-700);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
}
.btn-ghost:hover {
  background: var(--glass-bg-hover);
  color: var(--gray-900);
  border-color: var(--gray-300);
}
.btn-danger {
  background: linear-gradient(135deg, var(--color-red) 0%, #dc2626 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  border-radius: var(--radius-sm);
}
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* ─────────────────────────────────────────────
   9. STATUS BADGES
───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.01em;
}
.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}
.badge-pending    { background: var(--color-amber-l);  color: #b45309; }
.badge-approved   { background: var(--color-green-l);  color: #15803d; }
.badge-rejected   { background: var(--color-red-l);    color: #b91c1c; }
.badge-conflict   { background: var(--color-red-l);    color: #b91c1c; }
.badge-preapproved{ background: var(--color-blue-l);   color: #1d4ed8; }
.badge-draft      { background: var(--gray-100);       color: var(--gray-500); }
.badge-exception  { background: var(--color-purple-l); color: #6d28d9; }
.badge-critical   { background: var(--color-red-l);    color: #b91c1c; }
.badge-medium     { background: var(--color-amber-l);  color: #b45309; }
.badge-low        { background: var(--color-blue-l);   color: #1d4ed8; }

/* ─────────────────────────────────────────────
   10. AVATAR
───────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--text-xs);
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.avatar-sm  { width: 28px; height: 28px; font-size: 10px; }
.avatar-md  { width: 36px; height: 36px; font-size: var(--text-xs); }
.avatar-lg  { width: 44px; height: 44px; font-size: var(--text-sm); }
.avatar-xl  { width: 56px; height: 56px; font-size: var(--text-base); }

/* Avatar color palette (by initials hash) */
.av-indigo  { background: linear-gradient(135deg, #4F46E5, #7C3AED); }
.av-blue    { background: linear-gradient(135deg, #2563EB, #0EA5E9); }
.av-green   { background: linear-gradient(135deg, #22C55E, #10B981); }
.av-amber   { background: linear-gradient(135deg, #F59E0B, #F97316); }
.av-red     { background: linear-gradient(135deg, #EF4444, #E11D48); }
.av-teal    { background: linear-gradient(135deg, #14B8A6, #06B6D4); }
.av-purple  { background: linear-gradient(135deg, #8B5CF6, #EC4899); }

/* ─────────────────────────────────────────────
   11. DONUT CHART (SVG-based)
───────────────────────────────────────────── */
.donut-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}
.donut-svg-wrap {
  position: relative;
  flex-shrink: 0;
}
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.donut-center-value {
  font-size: var(--text-2xl);
  font-weight: var(--fw-extrabold);
  color: var(--gray-900);
  line-height: 1;
}
.donut-center-label {
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-top: 2px;
}
.donut-legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}
.donut-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.donut-legend-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.donut-legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.donut-legend-label {
  font-size: var(--text-sm);
  color: var(--gray-600);
}
.donut-legend-value {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--gray-700);
}

/* ─────────────────────────────────────────────
   12. LIST ITEMS (conflictos, personas, acciones)
───────────────────────────────────────────── */
.list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s;
}
.list-item:hover { background: rgba(79,70,229,0.04); }
.list-item + .list-item {
  border-top: 1px solid rgba(226,232,240,0.6);
}
.list-item-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.list-item-main { flex: 1; min-width: 0; }
.list-item-title {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-sub {
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-top: 1px;
}
.list-item-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────
   13. SECTION CARD (panel con título)
───────────────────────────────────────────── */
.section-card {
  padding: var(--space-6);
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}
.section-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.section-link {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--color-indigo);
  transition: color 0.15s;
}
.section-link:hover { color: var(--color-indigo-h); }

/* ─────────────────────────────────────────────
   14. FORM ELEMENTS
───────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-5); }
.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}
.form-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--gray-800);
  background: rgba(255,255,255,0.85);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-input:focus {
  border-color: var(--color-indigo);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
  background: #fff;
}
.form-input::placeholder { color: var(--gray-400); }
.form-hint {
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-top: var(--space-1);
}

/* ─────────────────────────────────────────────
   15. LOGIN CARD
───────────────────────────────────────────── */
.login-bg {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 30% 20%, rgba(79,70,229,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 80% 80%, rgba(20,184,166,0.12) 0%, transparent 60%),
    var(--color-navy);
  padding: var(--space-8);
}
.login-card {
  width: 100%;
  max-width: 420px;
  padding: var(--space-10);
}

/* ─────────────────────────────────────────────
   16. MOBILE LAYOUT
───────────────────────────────────────────── */
.mobile-layout {
  max-width: 390px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--gray-100);
  position: relative;
  overflow-x: hidden;
}

.mobile-header {
  background: linear-gradient(160deg, var(--color-navy) 0%, #1a2744 100%);
  padding: var(--space-6) var(--space-5) var(--space-10);
  position: relative;
  overflow: hidden;
}
.mobile-header::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(79,70,229,0.25) 0%, transparent 70%);
  pointer-events: none;
}
.mobile-header::after {
  content: '';
  position: absolute;
  bottom: -20px; left: 10px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(20,184,166,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.mobile-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  position: relative;
  z-index: 1;
}
.mobile-logo {
  height: 28px;
  width: auto;
}
.mobile-logo-text {
  font-size: var(--text-xl);
  font-weight: var(--fw-extrabold);
  color: #fff;
  letter-spacing: -0.5px;
}

.mobile-greeting {
  position: relative;
  z-index: 1;
}
.mobile-greeting h2 {
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  color: #fff;
  letter-spacing: -0.4px;
}
.mobile-greeting p {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  margin-top: 4px;
}

.mobile-body {
  padding: 0 var(--space-4);
  margin-top: calc(-1 * var(--space-6));
  position: relative;
  z-index: 2;
  padding-bottom: 100px; /* room for bottom nav */
}

.mobile-card {
  background: #fff;
  border-radius: var(--radius-2xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--space-4);
}

.mobile-section-title {
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--gray-800);
  margin-bottom: var(--space-3);
}

/* Quick Actions grid */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-2);
  border-radius: var(--radius-lg);
  background: var(--gray-50);
  border: 1.5px solid var(--gray-100);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.quick-action:hover {
  background: var(--color-indigo-l);
  border-color: rgba(79,70,229,0.2);
  transform: translateY(-2px);
}
.quick-action-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.quick-action-label {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  color: var(--gray-600);
  line-height: 1.2;
}

/* Balance cards */
.balance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.balance-item {
  text-align: center;
  padding: var(--space-4) var(--space-2);
  border-radius: var(--radius-lg);
  background: var(--gray-50);
}
.balance-label {
  font-size: 11px;
  font-weight: var(--fw-semibold);
  margin-bottom: var(--space-2);
}
.balance-value {
  font-size: var(--text-3xl);
  font-weight: var(--fw-extrabold);
  color: var(--gray-900);
  line-height: 1;
}
.balance-unit {
  font-size: var(--text-xs);
  color: var(--gray-400);
  margin-top: 4px;
}

/* Bottom Navigation */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 390px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: var(--space-3) var(--space-2);
  padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom));
  z-index: 100;
  box-shadow: 0 -8px 32px rgba(15,23,42,0.08);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-md);
  transition: all 0.15s;
  position: relative;
}
.bottom-nav-icon {
  font-size: 22px;
  line-height: 1;
}
.bottom-nav-label {
  font-size: 10px;
  font-weight: var(--fw-semibold);
  color: var(--gray-400);
}
.bottom-nav-item.active .bottom-nav-label { color: var(--color-indigo); }
.bottom-nav-item.active .bottom-nav-icon { filter: none; }
.bottom-nav-fab {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-indigo) 0%, var(--color-blue) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  box-shadow: 0 4px 20px rgba(79,70,229,0.45);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: -20px;
}
.bottom-nav-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(79,70,229,0.55);
}

/* ─────────────────────────────────────────────
   17. TABLE
───────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
tbody td {
  padding: var(--space-4);
  font-size: var(--text-sm);
  color: var(--gray-700);
  border-bottom: 1px solid rgba(226,232,240,0.5);
  vertical-align: middle;
}
tbody tr:hover td { background: rgba(79,70,229,0.02); }
tbody tr:last-child td { border-bottom: none; }

/* ─────────────────────────────────────────────
   18. NOTIFICATIONS DOT
───────────────────────────────────────────── */
.notif-btn {
  position: relative;
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  backdrop-filter: blur(8px);
  transition: all 0.15s;
  cursor: pointer;
}
.notif-btn:hover { background: var(--glass-bg-hover); color: var(--gray-900); }
.notif-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--color-red);
  border: 2px solid white;
  box-shadow: 0 0 6px rgba(239,68,68,0.5);
}
.notif-badge {
  position: absolute;
  top: 4px; right: 4px;
  min-width: 18px; height: 18px;
  border-radius: var(--radius-full);
  background: var(--color-red);
  color: #fff;
  font-size: 10px;
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid white;
}

/* ─────────────────────────────────────────────
   19. YEAR SELECTOR (topbar)
───────────────────────────────────────────── */
.year-selector {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s;
}
.year-selector:hover { background: var(--glass-bg-hover); }

/* ─────────────────────────────────────────────
   20. EMPTY STATE
───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-8);
  text-align: center;
}
.empty-state-icon { font-size: 48px; margin-bottom: var(--space-4); opacity: 0.4; }
.empty-state-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  color: var(--gray-700);
  margin-bottom: var(--space-2);
}
.empty-state-sub { font-size: var(--text-sm); color: var(--gray-400); }

/* ─────────────────────────────────────────────
   21. SCROLLBAR
───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ─────────────────────────────────────────────
   22. UTILITY CLASSES
───────────────────────────────────────────── */
.flex        { display: flex; }
.flex-col    { display: flex; flex-direction: column; }
.items-center{ align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--space-4); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.text-gray { color: var(--gray-500); }
.text-navy  { color: var(--color-navy); }
.fw-semi   { font-weight: var(--fw-semibold); }
.fw-bold   { font-weight: var(--fw-bold); }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.w-full   { width: 100%; }
.ml-auto  { margin-left: auto; }

/* ─────────────────────────────────────────────
   23. RESPONSIVE
───────────────────────────────────────────── */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  :root { --sidebar-w: 64px; }
  .nav-item span, .sidebar-logo-text, .sidebar-logo-sub,
  .sidebar-section-label, .sidebar-user-name, .sidebar-user-role,
  .nav-badge { display: none; }
  .nav-item { justify-content: center; padding: var(--space-3); }
  .nav-icon { width: 22px; height: 22px; }
  .sidebar-logo { padding: 0 var(--space-3) var(--space-5); }
  .page-content { padding: var(--space-5); }
}
@media (max-width: 768px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .topbar { padding: 0 var(--space-5); }
}
