/* ── Design tokens ───────────────────────────────────────────── */
:root {
  --gov-green-darkest: #1a5c32;   /* --sidebar / --primary   : hsl(149 56% 23%) */
  --gov-green-dark:    #165029;   /* hover/active darker shade               */
  --gov-green-mid:     #21c45d;   /* --sidebar-accent        : hsl(142 71% 45%) */
  --gov-green-pale:    #d4edda;
  --gov-gold:          #f7c42b;   /* --secondary / --sidebar-primary: hsl(45 93% 57%) */
  --gov-bg:            #f0f4f8;
  --gov-surface:       #ffffff;
  --gov-border:        #e2e8f0;
  --sidebar-full:      260px;
  --sidebar-icon:      64px;
  --header-h:          64px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Roboto, sans-serif; background: var(--gov-bg); color: #1a2e1a; }
a { text-decoration: none; }

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

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-full); background: var(--gov-green-darkest);  /* hsl(149 56% 23%) */
  display: flex; flex-direction: column; position: fixed;
  top: 0; left: 0; height: 100vh; z-index: 200;
  transition: width 0.25s ease, transform 0.25s ease; overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-icon); }
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 12px; border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0; min-height: 64px;
}
.logo-icon { width: 36px; height: 36px; border-radius: 10px; background: rgba(247,196,43,0.2); border: 1.5px solid rgba(247,196,43,0.4); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-icon i { color: var(--gov-gold); font-size: 16px; }
.logo-text { flex: 1; min-width: 0; overflow: hidden; }
.logo-main { display: block; font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; }
.logo-sub  { display: block; font-size: 9px; color: rgba(255,255,255,0.5); letter-spacing: 0.5px; white-space: nowrap; }
.collapse-btn { width: 28px; height: 28px; border: none; background: rgba(255,255,255,0.08); border-radius: 6px; cursor: pointer; color: rgba(255,255,255,0.6); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.15s; }
.collapse-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
.collapse-btn i { font-size: 11px; }
.desktop-only { display: flex !important; }
.mobile-only  { display: none !important; }
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 8px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--gov-green-dark); border-radius: 2px; }
/* nav-item mirrors: text-sidebar-foreground hover:bg-sidebar-accent/20 hover:text-sidebar-accent-foreground
                     w-full justify-start gap-3 h-12 rounded-lg transition-all duration-200
                     inline-flex items-center px-3                                              */
.nav-item {
  display: inline-flex; align-items: center; justify-content: flex-start;
  gap: 12px;                         /* gap-3 = 0.75rem */
  width: 100%;
  height: 48px;                      /* h-12 = 3rem */
  padding: 0 12px;                   /* px-3 = 0.75rem */
  border-radius: 8px;                /* rounded-lg */
  transition: all 200ms;             /* duration-200 */
  color: rgba(255,255,255,0.85);     /* text-sidebar-foreground */
  font-size: 13.5px; font-weight: 500;
  text-decoration: none; white-space: nowrap;
  border: none; background: transparent; cursor: pointer;
}
.nav-item:hover {
  background: rgba(33,196,93,0.20); /* hover:bg-sidebar-accent/20  (#21c45d at 20%) */
  color: #fff;                       /* hover:text-sidebar-accent-foreground */
}
.nav-item.active {
  background: rgba(33,196,93,0.25);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gov-gold);
}
.nav-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer { padding: 8px 0; border-top: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.sidebar-footer form { margin: 0; }
.logout-btn { color: #ef9a9a !important; width: 100%; background: none; border: none; }
.logout-btn:hover { background: rgba(239,154,154,0.08) !important; }
.sidebar.collapsed .logo-text, .sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 0; box-shadow: none; }
.sidebar.collapsed .sidebar-logo { justify-content: center; }
.sidebar.collapsed #collapseIcon { transform: rotate(180deg); }

/* Backdrop */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.52); z-index: 199; backdrop-filter: blur(2px); }
.sidebar-backdrop.open { display: block; }

/* Main area */
.main-area { flex: 1; margin-left: var(--sidebar-full); display: flex; flex-direction: column; min-height: 100vh; transition: margin-left 0.25s ease; min-width: 0; }
.app-shell.collapsed .main-area { margin-left: var(--sidebar-icon); }

/* Header */
.app-header { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); padding: 0 16px 0 20px; background: #fff; border-bottom: 3px solid var(--gov-green-mid); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(13,43,20,0.1); gap: 12px; }
.header-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 1; }
.hamburger-btn { display: none; width: 40px; height: 40px; border: none; background: none; cursor: pointer; color: var(--gov-green-dark); border-radius: 8px; flex-shrink: 0; align-items: center; justify-content: center; }
.hamburger-btn:hover { background: #f0fdf4; }
.hamburger-btn i { font-size: 20px; }
.gov-emblem { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.header-titles { display: flex; flex-direction: column; min-width: 0; }
.prog-name { font-size: 14px; font-weight: 700; color: var(--gov-green-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog-sub  { font-size: 10.5px; color: var(--gov-green-mid); font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; }
.header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.bisp-badge { background: var(--gov-green-dark); color: var(--gov-gold); font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 6px; letter-spacing: 0.5px; }
.badge-org { font-size: 12px; color: #334155; font-weight: 500; }
.user-menu-wrap { position: relative; }
.avatar-btn { background: none; border: none; cursor: pointer; padding: 0; }
.avatar { width: 36px; height: 36px; background: var(--gov-green-dark); color: var(--gov-gold); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; border: 2px solid var(--gov-gold); }
.user-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1px solid var(--gov-border); border-radius: 12px; min-width: 200px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 300; overflow: hidden; }
.user-dropdown.open { display: block; }
.user-info { padding: 12px 16px 8px; border-bottom: 1px solid #f1f5f9; }
.user-info strong { display: block; font-size: 14px; color: var(--gov-green-dark); }
.role-badge { display: inline-block; margin-top: 4px; font-size: 11px; color: var(--gov-green-mid); background: var(--gov-green-pale); padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.dropdown-item { display: flex; align-items: center; gap: 8px; padding: 10px 16px; font-size: 13px; color: #334155; cursor: pointer; transition: background 0.15s; text-decoration: none; background: none; border: none; width: 100%; text-align: left; }
.dropdown-item:hover { background: #f8fafc; }
.dropdown-item i { color: var(--gov-green-mid); width: 16px; }
.dropdown-divider { border-top: 1px solid #f1f5f9; }
.logout-item { color: #ef5350 !important; }
.logout-item i { color: #ef5350 !important; }
.main-content { flex: 1; overflow-x: hidden; }

/* ── LOGIN ───────────────────────────────────────────────────── */
.login-body { margin: 0; padding: 0; min-height: 100vh; display: flex; }

/* Two-panel layout — fills full viewport */
.login-page { width: 100%; min-height: 100vh; display: flex; align-items: stretch; }

/* LEFT: branding panel — takes remaining space */
.login-brand-panel { flex: 1; background: linear-gradient(160deg, #0d2e15 0%, #12401f 45%, #1a5c32 100%); display: flex; align-items: center; justify-content: center; padding: 60px 56px; position: relative; overflow: hidden; }
.login-brand-panel::before { content: ''; position: absolute; top: -100px; right: -100px; width: 400px; height: 400px; border-radius: 50%; background: rgba(255,255,255,0.04); pointer-events: none; }
.login-brand-panel::after  { content: ''; position: absolute; bottom: -80px; left: -80px; width: 300px; height: 300px; border-radius: 50%; background: rgba(255,255,255,0.04); pointer-events: none; }
.lbp-inner { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 24px; max-width: 420px; }
.bisp-login-banner { max-width: 420px; height: auto; object-fit: contain; }
.bisp-fallback { display: flex; align-items: center; gap: 14px; }
.bisp-fb-emblem { width: 54px; height: 54px; border-radius: 14px; background: rgba(255,255,255,0.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.bisp-fb-emblem i { color: #f7c42b; font-size: 22px; }
.bisp-fb-title { font-size: 13px; font-weight: 800; color: #fff; letter-spacing: .5px; line-height: 1.3; }
.bisp-fb-sub   { font-size: 11px; color: rgba(255,255,255,.55); margin-top: 2px; }
.lbp-divider { height: 1px; background: rgba(255,255,255,0.15); }
.lbp-heading { font-size: 28px; font-weight: 800; color: #fff; line-height: 1.35; margin: 0; }
.lbp-desc { font-size: 13.5px; color: rgba(255,255,255,.65); line-height: 1.75; margin: 0; }
.lbp-stats { display: flex; align-items: center; background: rgba(255,255,255,0.07); border-radius: 12px; padding: 16px 0; margin-top: 4px; }
.lbp-stat { display: flex; flex-direction: column; align-items: center; flex: 1; }
.lbp-stat-val { font-size: 24px; font-weight: 800; color: #f7c42b; line-height: 1; }
.lbp-stat-lbl { font-size: 11px; color: rgba(255,255,255,.55); margin-top: 5px; text-transform: uppercase; letter-spacing: .4px; }
.lbp-stat-div { width: 1px; height: 40px; background: rgba(255,255,255,0.18); }

/* RIGHT: form panel — fixed width */
.login-form-panel { width: 460px; flex-shrink: 0; background: #f0f4f8; display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.login-card { background: #fff; border-radius: 20px; padding: 44px 36px; width: 100%; box-shadow: 0 8px 40px rgba(0,0,0,0.10); }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-card-logo { max-height: 56px; width: auto; object-fit: contain; margin-bottom: 12px; }
.login-card-fallback { display: flex; justify-content: center; }
.login-logo-icon { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 12px; background: linear-gradient(135deg, #165029, #1a5c32); display: flex; align-items: center; justify-content: center; }
.login-logo-icon i { color: var(--gov-gold); font-size: 28px; }
.login-title { font-size: 22px; font-weight: 800; color: #0f172a; margin: 0 0 4px; }
.login-sub   { font-size: 13px; color: #64748b; margin: 0; }
.login-error { background: #fee2e2; color: #991b1b; padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.login-form  { display: flex; flex-direction: column; gap: 16px; }
.form-group  { display: flex; flex-direction: column; gap: 5px; }
.form-label  { font-size: 13px; font-weight: 600; color: #374151; }
.form-label i { color: var(--gov-green-mid); margin-right: 4px; }
.form-input  { height: 44px; padding: 0 14px; border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: 14px; outline: none; transition: border-color 0.15s; width: 100%; box-sizing: border-box; }
.form-input:focus { border-color: var(--gov-green-mid); }
.login-btn { height: 46px; background: linear-gradient(135deg, #165029, #1a5c32); color: #fff; border: none; border-radius: 10px; font-size: 15px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; transition: opacity 0.2s; width: 100%; }
.login-btn:hover { opacity: 0.9; }
.login-hint { text-align: center; font-size: 12px; color: #94a3b8; margin: 16px 0 0; }
.login-footer-brand { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; font-size: 11px; color: #94a3b8; }
.lfb-dot { color: #cbd5e1; }

/* Responsive: stack panels on small screens */
@media (max-width: 768px) {
  .login-brand-panel { display: none; }
  .login-form-panel  { width: 100%; background: transparent; }
  .login-card { box-shadow: 0 24px 64px rgba(0,0,0,0.25); }
}

/* ── STATISTICS PAGE ─────────────────────────────────────────── */
.stats-page { display: flex; flex-direction: column; gap: 24px; padding: 24px; }
.page-hero { display: flex; align-items: center; justify-content: space-between; background: linear-gradient(135deg, #12401f, #1a5c32, #2e7a3e); border-radius: 16px; padding: 20px 28px; box-shadow: 0 8px 32px rgba(13,43,20,0.25); flex-wrap: wrap; gap: 16px; }
.hero-left  { display: flex; align-items: center; gap: 16px; }
.hero-badge { width: 52px; height: 52px; background: rgba(247,196,43,0.2); border: 2px solid rgba(247,196,43,0.5); border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.hero-badge i { color: var(--gov-gold); font-size: 22px; }
.hero-title { font-size: 22px; font-weight: 800; color: #fff; margin: 0; }
.hero-sub   { font-size: 12.5px; color: rgba(255,255,255,0.65); margin: 3px 0 0; }
/* Hero period picker */
.hero-period-picker { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; flex-shrink: 0; }
.hpp-presets { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.hpp-btn { padding: 5px 13px; border-radius: 20px; border: 1.5px solid rgba(255,255,255,0.2); background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.7); font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.hpp-btn:hover { background: rgba(255,255,255,0.15); color: #fff; border-color: rgba(255,255,255,0.35); }
.hpp-btn.active { background: var(--gov-gold); color: #12401f; border-color: var(--gov-gold); }
.hpp-dates { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); border-radius: 12px; padding: 8px 12px; }
.hpp-date-field { display: flex; align-items: center; gap: 6px; }
.hpp-lbl { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.55); text-transform: uppercase; white-space: nowrap; }
.hpp-input { height: 30px; padding: 0 8px; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.2); border-radius: 7px; font-size: 12px; color: #fff; outline: none; width: 128px; cursor: pointer; color-scheme: dark; }
.hpp-input:focus { border-color: var(--gov-gold); background: rgba(255,255,255,0.18); }
.hpp-arrow { color: rgba(255,255,255,0.4); font-size: 11px; }

@media (max-width: 900px) {
  .hero-period-picker { align-items: flex-start; width: 100%; }
  .hpp-presets { justify-content: flex-start; }
  .hpp-dates { width: 100%; justify-content: space-between; }
  .hpp-input { width: 110px; }
}
@media (max-width: 560px) {
  .hpp-dates { flex-wrap: wrap; gap: 8px; }
  .hpp-input { width: 130px; }
}
.bell-btn { position: relative; width: 36px; height: 36px; background: rgba(247,196,43,0.15); border: 1px solid rgba(247,196,43,0.4); border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--gov-gold); transition: all 0.2s; }
.bell-btn i { font-size: 16px; }
.bell-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.auto-refresh-indicator { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); border-radius: 10px; color: rgba(255,255,255,0.75); font-size: 12px; white-space: nowrap; }
.auto-refresh-indicator i { font-size: 12px; color: var(--gov-gold); }
.auto-refresh-indicator span { font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; background: #ef5350; border-radius: 50%; border: 1.5px solid #1a5c32; }
.section-label { display: flex; align-items: center; gap: 12px; }
.sl-line { flex: 1; height: 1px; background: linear-gradient(to right, transparent, #cbd5e1, transparent); }
.sl-text { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 1px; white-space: nowrap; }
.cards-row { display: grid; gap: 16px; }
.row-5 { grid-template-columns: repeat(5, 1fr); }
.row-4 { grid-template-columns: repeat(4, 1fr); }
.stat-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.06); display: flex; flex-direction: column; transition: transform 0.2s, box-shadow 0.2s; border: 1px solid rgba(0,0,0,0.05); }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.12); }
.card-top-bar { height: 4px; flex-shrink: 0; }
.card-body    { display: flex; align-items: flex-start; gap: 14px; padding: 18px 18px 14px; }
.card-icon-wrap { width: 50px; height: 50px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-icon-wrap i { font-size: 22px; }
.card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sc-title  { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; line-height: 1.4; display: flex; align-items: center; gap: 5px; }

/* ── Card tooltip ─────────────────────────────────────────── */
.card-tooltip-wrap {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.card-info-icon {
  font-size: 11px;
  color: #94a3b8;
  cursor: pointer;
  transition: color 0.15s;
  text-transform: none;
  letter-spacing: 0;
}
.card-info-icon:hover { color: var(--gov-green-darkest); }

/* Floating popup — appended to <body> by JS, never clipped by card overflow */
#kpi-tooltip-popup {
  display: none;
  position: fixed;
  z-index: 9999;
  max-width: 240px;
  background: #1e293b;
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  padding: 10px 14px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.28);
  pointer-events: none;
  white-space: normal;
  text-transform: none;
  letter-spacing: 0;
}
#kpi-tooltip-popup::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #1e293b;
}
#kpi-tooltip-popup.tip-below::after {
  top: auto; bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #1e293b;
}
.sc-value  { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; margin-top: 2px; }
.sc-unit   { font-size: 13px; font-weight: 700; color: #94a3b8; }
.sc-number { font-size: 28px; font-weight: 800; color: #0f172a; line-height: 1; letter-spacing: -1px; }
.sc-sub-label { font-size: 11px; color: #94a3b8; font-weight: 500; }
.trend-badge { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px 3px 5px; border-radius: 20px; font-size: 11.5px; font-weight: 700; width: fit-content; margin-top: 4px; }
.trend-badge i { font-size: 12px; }
.trend-lbl { font-weight: 400; opacity: 0.8; margin-left: 2px; }
.trend-up   { background: #dcfce7; color: #166534; }
.trend-down { background: #fee2e2; color: #991b1b; }
.sc-subs { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid #f1f5f9; margin: 0 18px; padding: 10px 0 14px; }
.sc-sub  { display: flex; align-items: center; gap: 6px; width: 100%; padding: 2px 0; }
.sub-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sub-lbl { font-size: 11px; color: #94a3b8; font-weight: 500; }
.sub-val { font-size: 13px; font-weight: 700; color: #1e293b; margin-left: auto; padding-right: 8px; }
.progress-bar-wrap { height: 3px; background: #f1f5f9; margin: 0 18px 14px; border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; }
.quick-nav { display: flex; gap: 10px; flex-wrap: wrap; }
.qn-btn { display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; font-size: 13px; font-weight: 600; color: #334155; text-decoration: none; transition: all 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.qn-btn:hover { background: #f0fdf4; border-color: var(--gov-green-mid); color: #12401f; transform: translateY(-1px); }
.qn-icon { width: 32px; height: 32px; background: #f1f5f9; border-radius: 8px; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.qn-icon i { font-size: 15px; color: var(--gov-green-mid); transition: color 0.2s; }
.qn-btn:hover .qn-icon { background: var(--gov-green-mid); }
.qn-btn:hover .qn-icon i { color: #fff; }

/* ── BENEFICIARIES ───────────────────────────────────────────── */
.bene-page { display: flex; flex-direction: column; gap: 20px; padding: 20px 24px 32px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.bc-home { color: var(--gov-green-mid); } .bc-sep { font-size: 10px; color: #94a3b8; } .bc-current { color: #334155; }
.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.kpi-card { border-radius: 14px; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); transition: transform 0.2s; }
.kpi-card:hover { transform: translateY(-2px); }
.kpi-dark  { background: linear-gradient(135deg, #12401f, #1a5c32, #2e7a3e); color: #fff; }
.kpi-light { background: #fff; border: 1px solid #e8ecf0; }
.kpi-header { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.kpi-dark .kpi-label { color: rgba(255,255,255,0.7); } .kpi-light .kpi-label { color: #64748b; }
.kpi-icon-wrap { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,0.12); display: flex; align-items: center; justify-content: center; }
.kpi-icon-wrap i { font-size: 16px; color: rgba(255,255,255,0.85); }
.kpi-icon-wrap.light { background: #fce4ec; } .kpi-icon-wrap.light i { color: #c2185b; }
.kpi-icon-wrap.light.green { background: #e3f2fd; } .kpi-icon-wrap.light.green i { color: #1565c0; }
.kpi-value { font-size: 34px; font-weight: 800; letter-spacing: -1px; line-height: 1; color: #fff; }
.kpi-value.dark { color: #0f172a; }
.kpi-trend { display: inline-flex; align-items: center; gap: 5px; background: rgba(247,196,43,0.2); border: 1px solid rgba(247,196,43,0.35); border-radius: 20px; padding: 3px 10px; width: fit-content; }
.kpi-trend i, .kpi-trend span { font-size: 11.5px; font-weight: 700; color: var(--gov-gold); }
.kpi-subs-dark { display: flex; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 12px; }
.kpi-sub-dark  { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ksd-label { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.55); text-transform: uppercase; }
.ksd-val   { font-size: 18px; font-weight: 700; color: #fff; }
.ksd-divider { width: 1px; background: rgba(255,255,255,0.15); margin: 0 16px; }
.kpi-subs-light { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid #f1f5f9; padding-top: 10px; }
.kpi-sub-light  { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.ksl-label { color: #64748b; font-weight: 500; flex: 1; } .ksl-val { color: #0f172a; font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: #1a5c32; } .dot-teal { background: #00897b; } .dot-blue { background: #1565c0; } .dot-pink { background: #c2185b; }
.filters-bar { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; background: #fff; border: 1px solid #e8ecf0; border-radius: 14px; padding: 16px 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.filter-group { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 160px; }
.filter-label { font-size: 10.5px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; }
.filter-select { height: 38px; padding: 0 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 13px; color: #334155; background: #fff; outline: none; cursor: pointer; }
.filter-select:focus { border-color: var(--gov-green-mid); }
.exec-btn { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 20px; background: linear-gradient(135deg, #165029, #1a5c32); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all 0.2s; box-shadow: 0 2px 8px rgba(26,92,50,0.3); align-self: flex-end; }
.exec-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.table-card { background: #fff; border-radius: 14px; border: 1px solid #e8ecf0; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.table-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 22px 14px; border-bottom: 1px solid #f1f5f9; gap: 12px; flex-wrap: wrap; }
.table-title { font-size: 15px; font-weight: 700; color: #0f172a; margin: 0 0 3px; }
.table-sub   { font-size: 12px; color: #64748b; margin: 0; }
.download-btn { display: flex; align-items: center; gap: 7px; padding: 8px 16px; background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: #334155; text-decoration: none; transition: all 0.2s; white-space: nowrap; }
.download-btn:hover { background: #f0fdf4; border-color: var(--gov-green-mid); }
.download-btn i { color: var(--gov-green-mid); }
.table-wrap { overflow-x: auto; }
.bene-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bene-table th, .bene-table td { padding: 10px 14px; text-align: right; white-space: nowrap; }
.bene-table th:first-child, .bene-table td:first-child { text-align: left; }
.thead-group th { background: #1a5c32; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-align: center; }
.th-province { background: #12401f !important; text-align: left !important; min-width: 180px; vertical-align: middle; }
.th-group { border-left: 1px solid rgba(255,255,255,0.15); }
.th-group.total { background: #1a5c32; } .th-group.active { background: #165029; } .th-group.graduated { background: #12401f; }
.thead-sub th { background: #f8fafc; color: #475569; font-size: 11px; font-weight: 700; border-bottom: 2px solid #e2e8f0; border-left: 1px solid #e8ecf0; text-transform: uppercase; }
.data-row td { border-bottom: 1px solid #f1f5f9; color: #334155; border-left: 1px solid #f8fafc; }
.data-row .td-province { font-weight: 600; color: #1e3a5f; border-left: none; }
.data-row .highlight-cell { background: #fff3cd; color: #7c4f00; font-weight: 600; }
.data-row:hover td { background: #f8fafc; }
.total-row td { background: #12401f; color: #fff; font-weight: 700; font-size: 13px; border-left: 1px solid rgba(255,255,255,0.1); }
.total-row .td-province { color: var(--gov-gold); font-size: 12px; letter-spacing: 0.5px; border-left: none; }

/* ── FEATURE PAGES ───────────────────────────────────────────── */
.feature-page { display: flex; flex-direction: column; gap: 20px; padding: 24px; }
.page-header-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 700; color: #0f172a; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.page-title i { color: var(--gov-green-mid); font-size: 20px; }
.page-sub { font-size: 13px; color: #64748b; margin: 0; }
.coming-soon-card { background: #fff; border-radius: 16px; border: 1px solid #e8ecf0; padding: 48px 32px; text-align: center; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.cs-icon { width: 72px; height: 72px; border-radius: 20px; background: linear-gradient(135deg, #e8f5e9, #d4edda); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.cs-icon i { font-size: 32px; color: var(--gov-green-mid); }
.coming-soon-card h2 { font-size: 20px; font-weight: 700; color: #0f172a; margin: 0 0 8px; }
.coming-soon-card p  { font-size: 14px; color: #64748b; max-width: 400px; margin: 0 auto; }

/* ── WEEKLY SNAPSHOT charts ──────────────────────────────────── */
.kpi-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.kpi-tile { background: #fff; border-radius: 12px; padding: 16px; border: 1px solid #e8ecf0; display: flex; gap: 12px; align-items: center; box-shadow: 0 1px 4px rgba(0,0,0,0.05); transition: transform 0.2s; }
.kpi-tile:hover { transform: translateY(-2px); }
.tile-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: #e8f5e9; }
.tile-icon i { font-size: 20px; }
.tile-info { display: flex; flex-direction: column; }
.tile-label { font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: 0.4px; }
.tile-value { font-size: 20px; font-weight: 800; color: #0f172a; }
.tile-sub   { font-size: 11px; color: #94a3b8; }
.charts-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
.chart-card  { background: #fff; border-radius: 14px; padding: 20px; border: 1px solid #e8ecf0; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.chart-title { font-size: 13px; font-weight: 700; color: var(--gov-green-mid); text-transform: uppercase; letter-spacing: 0.4px; margin: 0 0 16px; border-bottom: 2px solid var(--gov-green-pale); padding-bottom: 8px; }
.chart-wrap { position: relative; height: 280px; width: 100%; }

/* ── RESPONSIVE ──────────────────────────────────────────────── */
.hide-sm { display: inline; }

@media (max-width: 1400px) {
  .row-5 { grid-template-columns: repeat(3, 1fr); }
  .row-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1023px) {
  .hamburger-btn { display: flex; }
  .sidebar { transform: translateX(-260px); width: var(--sidebar-full) !important; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-area { margin-left: 0 !important; }
  .kpi-tiles { grid-template-columns: repeat(3, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .kpi-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 767px) {
  .stats-page, .bene-page, .feature-page, .weekly-page { padding: 12px; gap: 12px; }
  .row-5, .row-4 { grid-template-columns: repeat(2, 1fr); }
  .kpi-tiles { grid-template-columns: repeat(2, 1fr); }
  .hide-sm { display: none; }
  .page-hero { padding: 16px; gap: 12px; }
  .hero-title { font-size: 17px; }
  .hero-period-strip { width: 100%; justify-content: space-between; }
  .hps-range { flex: 1; justify-content: center; }
}

@media (max-width: 560px) {
  .row-5, .row-4, .kpi-row, .kpi-tiles { grid-template-columns: 1fr; }
}

/* ── Period selector bar ─────────────────────────────────────── */
.period-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; background:#fff; border:1px solid #e2e8f0; border-radius:12px; padding:10px 16px; box-shadow:0 1px 4px rgba(0,0,0,.05); }
.period-label { font-size:12px; font-weight:700; color:#64748b; white-space:nowrap; display:flex; align-items:center; gap:6px; }
.period-label i { color:var(--gov-green-mid); }
.period-btn { padding:6px 14px; border-radius:20px; font-size:12.5px; font-weight:600; color:#64748b; background:#f8fafc; border:1.5px solid #e2e8f0; text-decoration:none; transition:all .15s; white-space:nowrap; }
.period-btn:hover { background:#f0fdf4; border-color:var(--gov-green-mid); color:var(--gov-green-dark); }
.period-btn.active { background:var(--gov-green-dark); color:#fff; border-color:var(--gov-green-dark); }
.period-range { margin-left:auto; font-size:12px; color:#94a3b8; font-weight:500; white-space:nowrap; }

/* ── Report section card ─────────────────────────────────────── */
.report-section { background:#fff; border-radius:14px; border:1px solid #e8ecf0; overflow:hidden; box-shadow:0 1px 4px rgba(0,0,0,.05); }
.report-section-header { display:flex; align-items:center; gap:10px; padding:14px 20px; border-bottom:2px solid var(--gov-green-pale); }
.rs-number { width:28px; height:28px; background:var(--gov-green-dark); color:#fff; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; flex-shrink:0; }
.rs-title { font-size:14px; font-weight:700; color:#0f172a; }
.rs-note { font-size:11px; color:#64748b; margin-left:auto; }

/* ── Report table ────────────────────────────────────────────── */
.table-scroll { overflow-x:auto; }
.report-table { width:100%; border-collapse:collapse; font-size:12.5px; min-width:500px; }
.report-table th { background:#1a5c32; color:#fff; padding:9px 12px; font-size:11px; font-weight:700; letter-spacing:.4px; text-align:right; white-space:nowrap; }
.report-table th:first-child { text-align:left; min-width:160px; }
.report-table th.group-header { text-align:center; border-left:1px solid rgba(255,255,255,.2); }
.report-table th.sub-th { background:#165029; }
.report-table td { padding:8px 12px; border-bottom:1px solid #f1f5f9; color:#334155; text-align:right; white-space:nowrap; }
.report-table td:first-child { text-align:left; font-weight:600; color:#1e3a5f; }
.report-table td.center { text-align:center; }
.report-table tr:hover td { background:#f8fafc; }
.report-table tfoot td { background:#12401f; color:#fff; font-weight:700; border-bottom:none; }
.report-table tfoot td:first-child { color:var(--gov-gold); font-size:11px; letter-spacing:.5px; text-transform:uppercase; }
.pct-row td { background:#f0fdf4; color:var(--gov-green-mid); font-weight:700; font-size:12px; }

/* ── Weekly snapshot page ────────────────────────────────────── */
.weekly-page { display:flex; flex-direction:column; gap:20px; padding:20px 24px 40px; }
.report-hero { display:flex; align-items:center; justify-content:space-between; background:linear-gradient(135deg,#12401f,#1a5c32,#2e7a3e); border-radius:14px; padding:18px 24px; flex-wrap:wrap; gap:12px; }
.report-hero-left { display:flex; align-items:center; gap:14px; }
.report-hero-icon { width:46px; height:46px; background:rgba(247,196,43,.2); border:1.5px solid rgba(247,196,43,.4); border-radius:12px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.report-hero-icon i { color:var(--gov-gold); font-size:20px; }
.report-hero-title { font-size:18px; font-weight:800; color:#fff; margin:0 0 2px; }
.report-hero-sub { font-size:12px; color:rgba(255,255,255,.65); margin:0; }
.report-hero-badge { background:rgba(247,196,43,.15); border:1px solid rgba(247,196,43,.35); border-radius:10px; padding:8px 14px; text-align:right; }
.rhb-label { font-size:10px; color:rgba(255,255,255,.6); font-weight:700; text-transform:uppercase; display:block; }
.rhb-value { font-size:14px; color:var(--gov-gold); font-weight:700; }

/* ── Financial / Payments page ───────────────────────────────── */
.fin-topbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; }
.fin-datestrip { display:flex; align-items:center; gap:8px; background:#fff; border:1px solid #e2e8f0; border-radius:10px; padding:7px 14px; box-shadow:0 1px 3px rgba(0,0,0,.05); }
.fds-item { display:flex; align-items:center; gap:5px; }
.fds-label { font-size:11px; font-weight:700; color:#94a3b8; text-transform:uppercase; }
.fds-val   { font-size:13px; font-weight:600; color:#334155; }
.fds-sep   { width:1px; height:18px; background:#e2e8f0; margin:0 4px; }

.fin-kpi-row { display:grid; grid-template-columns:1fr 1fr 1fr; gap:16px; }
.fin-kpi-card { border-radius:12px; padding:22px 24px; display:flex; flex-direction:column; gap:6px; box-shadow:0 2px 8px rgba(0,0,0,.07); transition:transform .2s; }
.fin-kpi-card:hover { transform:translateY(-2px); }
.fin-kpi-dark  { background:linear-gradient(135deg,#12401f,#1a5c32); }
.fin-kpi-light { background:#fff; border:1px solid #e8ecf0; }
.fkc-label { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.5px; color:rgba(255,255,255,.7); }
.fin-kpi-light .fkc-label { color:#64748b; }
.fkc-value { font-size:38px; font-weight:800; color:#fff; letter-spacing:-1.5px; line-height:1.1; }
.fkc-value.dark { color:#0f172a; }
.fkc-unit  { font-size:12px; color:rgba(255,255,255,.55); font-weight:500; }
.fin-kpi-light .fkc-unit { color:#94a3b8; }

/* Financial table specifics */
.fin-table { min-width:900px; }
.fin-th-province { text-align:left !important; min-width:160px; vertical-align:middle; }
.fin-td-province { font-weight:700; color:#1e3a5f; min-width:160px; }
.fin-thead-top th { background:#1a5c32; }
.fin-thead-mid th { background:#165029; }
.fin-thead-sub th { background:#12401f; }

@media (max-width:900px) {
  .fin-kpi-row { grid-template-columns:1fr; }
}
@media (max-width:640px) {
  .fin-datestrip { display:none; }
}

/* ============================================================
   USER MANAGEMENT — Shared Styles
   ============================================================ */

/* Nav group (collapsible sub-menu) */
.nav-group { display: flex; flex-direction: column; }
.nav-group-toggle {
  width: 100%; text-align: left; background: transparent; border: none;
  cursor: pointer; position: relative;
}
.nav-chevron {
  font-size: 10px; margin-left: auto; flex-shrink: 0;
  transition: transform 200ms; color: rgba(255,255,255,.45);
}
.nav-group.open .nav-chevron { transform: rotate(90deg); }
.nav-sub {
  overflow: hidden;
  max-height: 0;
  transition: max-height 250ms ease;
}
.nav-group.open .nav-sub { max-height: 200px; }
.nav-sub-item {
  padding-left: 36px !important;   /* indent under parent */
  font-size: 13px !important;
  color: rgba(255,255,255,.7) !important;
}
.nav-sub-item.active { color: #fff !important; }
.sidebar.collapsed .nav-chevron { display: none; }
.sidebar.collapsed .nav-sub     { display: none; }

/* Nav section divider */
.nav-section-divider {
  padding: 14px 14px 4px;
  overflow: hidden;
}
.nav-section-label {
  font-size: 9.5px;
  font-weight: 700;
  color: rgba(255,255,255,.35);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  white-space: nowrap;
}
.sidebar.collapsed .nav-section-divider { display: none; }

/* Status badges */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.badge-active   { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }

/* Role chip (inline tag) */
.role-chip {
  display: inline-block;
  padding: 2px 8px; border-radius: 6px;
  font-size: 10.5px; font-weight: 700; font-family: monospace;
  background: #eff6ff; color: #1d4ed8;
  border: 1px solid #bfdbfe;
  white-space: nowrap;
}

/* Province tag */
.prov-tag {
  display: inline-block;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
  background: #f0fdf4; color: #166534;
  border: 1px solid #bbf7d0;
}

/* Count badges */
.count-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700;
}
.count-members { background: #eff6ff; color: #1d4ed8; }
.count-roles   { background: #faf5ff; color: #7c3aed; }

/* Permission badge */
.perm-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 700;
  background: #fff7ed; color: #c2410c;
}

/* Action buttons */
.action-btns {
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.action-btn {
  width: 30px; height: 30px;
  border-radius: 7px;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  transition: background .15s, transform .15s, color .15s;
  text-decoration: none;
}
.action-edit   { background: #eff6ff; color: #3b82f6; }
.action-edit:hover   { background: #3b82f6; color: #fff; transform: translateY(-1px); }
.action-delete { background: #fef2f2; color: #ef4444; }
.action-delete:hover { background: #ef4444; color: #fff; transform: translateY(-1px); }

/* User avatar (initials circle in table) */
.um-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gov-green-dark), var(--gov-green-mid));
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; text-transform: uppercase;
}

/* Pagination bar */
.pagination-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid #e8ecf0;
  flex-wrap: wrap; gap: 10px;
}
.pg-info { font-size: 12.5px; color: #64748b; }
.pg-btns { display: flex; gap: 5px; flex-wrap: wrap; }
.pg-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 12px; border-radius: 7px;
  font-size: 12.5px; font-weight: 600;
  background: #f8fafc; border: 1.5px solid #e2e8f0;
  color: #374151; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.pg-btn:hover { background: #f0fdf4; border-color: var(--gov-green-mid); color: var(--gov-green-dark); }
.pg-btn.pg-active { background: var(--gov-green-dark); color: #fff; border-color: var(--gov-green-dark); }

/* ── Upsert form layout ─────────────────────── */
.upsert-form { display: flex; flex-direction: column; gap: 20px; }

.form-section {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8ecf0;
  padding: 20px 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.form-section-title {
  font-size: 14px; font-weight: 700; color: var(--gov-green-dark);
  margin: 0 0 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--gov-green-pale);
  display: flex; align-items: center;
}
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-actions { display: flex; gap: 12px; align-items: center; }

/* Required asterisk */
.req { color: #ef4444; margin-left: 2px; }

/* Field error message */
.field-error { display: block; font-size: 11.5px; color: #dc2626; margin-top: 4px; }

/* ── Checkbox grid ──────────────────────────── */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.checkbox-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 8px;
  border: 1.5px solid #e2e8f0;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  font-size: 13px; color: #374151;
}
.checkbox-item:hover { background: #f8fafc; border-color: var(--gov-green-mid); }
.checkbox-item.checked { background: #f0fdf4; border-color: #86efac; }
.checkbox-item input[type=checkbox] {
  accent-color: var(--gov-green-mid);
  width: 15px; height: 15px; flex-shrink: 0; cursor: pointer;
}
.cb-label { display: flex; align-items: center; gap: 5px; font-size: 12.5px; }

/* ── Permissions group ──────────────────────── */
.perm-group { border: 1px solid #e8ecf0; border-radius: 10px; overflow: hidden; }
.perm-group-header {
  background: #f8fafc; padding: 8px 14px;
  border-bottom: 1px solid #e8ecf0;
}
.perm-group-select-all {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.perm-items-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  padding: 10px 12px; gap: 8px;
}
.perm-item { font-size: 12px; }

/* ── Status toggle ──────────────────────────── */
.status-toggle-wrap {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
}
.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0;
  background: #cbd5e1; border-radius: 24px;
  transition: background .2s;
}
.toggle-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-slider { background: var(--gov-green-mid); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
.toggle-label { font-size: 14px; font-weight: 600; color: #1e293b; }

/* ── Delete confirm modal ───────────────────── */
.um-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex; align-items: center; justify-content: center;
}
.um-modal {
  background: #fff; border-radius: 18px;
  padding: 32px 28px; max-width: 420px; width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: modalIn .2s ease;
}
@keyframes modalIn {
  from { transform: scale(.92); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.um-modal-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin: 0 auto 16px;
}
.um-modal-danger { background: #fee2e2; color: #dc2626; }
.um-modal-title { font-size: 18px; font-weight: 700; color: #1e293b; margin: 0 0 8px; }
.um-modal-body  { font-size: 13.5px; color: #64748b; margin: 0 0 22px; line-height: 1.6; }
.um-modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 900px) {
  .checkbox-grid      { grid-template-columns: repeat(2, 1fr); }
  .perm-items-grid    { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .form-grid-2        { grid-template-columns: 1fr; }
  .checkbox-grid      { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .checkbox-grid      { grid-template-columns: 1fr; }
  .perm-items-grid    { grid-template-columns: 1fr; }
}

/* ============================================================
   PAKISTAN GEOGRAPHIC MAP
   ============================================================ */

/* Map card wrapper */
/* ── Dashboard bottom grid: map left + enrollment chart right ── */
.dash-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1200px) { .dash-bottom-grid { grid-template-columns: 1fr; } }

/* ── Enrollment graph card ─────────────────────────────────── */
.enrol-graph-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8ecf0;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.enrol-graph-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.enrol-graph-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}
.enrol-year-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.enrol-year-lbl {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}
.enrol-year-sel {
  height: 32px;
  padding: 0 28px 0 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12.5px;
  color: #334155;
  background: #f8fafc;
  outline: none;
  cursor: pointer;
  appearance: auto;
}
.enrol-year-sel:focus { border-color: var(--gov-green-darkest); }
.enrol-graph-wrap {
  position: relative;
  height: 320px;
}
.enrol-legend {
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: center;
}
.enrol-leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #475569;
}
.enrol-leg-dot {
  width: 12px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}

.map-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.map-card-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e8ecf0;
  background: linear-gradient(135deg, #1a5c32 0%, #2e7a3e 100%);
}
.map-card-title {
  font-size: 15px; font-weight: 700; color: #fff; margin: 0;
}
.map-card-title i { margin-right: 8px; color: #c9a227; }
.map-card-sub { font-size: 12px; color: rgba(255,255,255,.65); margin: 3px 0 0; }

/* Legend */
.map-legend { display: flex; flex-wrap: wrap; gap: 10px; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: rgba(255,255,255,.8); }
.legend-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* Map layout — map + panel side by side */
.map-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  min-height: 500px;
  position: relative;
}

/* Leaflet map container */
#pakMap {
  height: 500px;
  width: 100%;
  background: #e8f4f0;
  z-index: 1;
}

/* Province summary sidebar */
.map-summary {
  border-left: 1px solid #e8ecf0;
  background: #fafcff;
  padding: 16px;
  overflow-y: auto;
  max-height: 500px;
}
.ms-title {
  font-size: 13px; font-weight: 700; color: #1a5c32;
  margin: 0 0 14px; display: flex; align-items: center; gap: 7px;
}
.ms-title i { color: var(--gov-green-mid); }
.ms-list { display: flex; flex-direction: column; gap: 10px; }
.ms-row {
  cursor: pointer;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.ms-row:hover {
  border-color: var(--gov-green-mid);
  box-shadow: 0 2px 8px rgba(27,67,50,.12);
  transform: translateY(-1px);
}
.ms-row-top { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.ms-dot   { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ms-name  { font-size: 13px; font-weight: 600; color: #1e293b; flex: 1; }
.ms-val   { font-size: 12px; font-weight: 700; color: var(--gov-green-dark); }
.ms-bar-wrap { height: 4px; background: #e8ecf0; border-radius: 4px; margin-bottom: 5px; }
.ms-bar { height: 4px; border-radius: 4px; transition: width .6s ease; }
.ms-sites { font-size: 11px; color: #94a3b8; }
.ms-sites i { margin-right: 3px; }

/* Drill-down panel — slides over map from right */
.geo-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 340px;
  background: #fff;
  border-left: 2px solid var(--gov-green-mid);
  box-shadow: -4px 0 20px rgba(0,0,0,.12);
  display: flex; flex-direction: column;
  transform: translateX(110%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  z-index: 10;
  overflow: hidden;
}
.geo-panel.panel-open { transform: translateX(0); }

.gp-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 16px;
  background: linear-gradient(135deg, #165029, #1a5c32);
  flex-shrink: 0;
}
.panel-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin-bottom: 4px; }
.bc-item { font-size: 10.5px; color: rgba(255,255,255,.6); }
.bc-link { cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.bc-link:hover { color: #c9a227; }
.gp-title { font-size: 14px; font-weight: 700; color: #fff; margin: 0; }
.gp-sub   { font-size: 11.5px; color: rgba(255,255,255,.6); margin: 3px 0 0; }
.gp-close {
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(255,255,255,.15); border: none; color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
  transition: background .15s;
}
.gp-close:hover { background: rgba(255,255,255,.3); }

.gp-body { flex: 1; overflow-y: auto; padding: 12px; }

/* Geo list items */
.geo-list { display: flex; flex-direction: column; gap: 8px; }

.geo-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #e8ecf0;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
}
.geo-item:hover {
  border-color: var(--gov-green-mid);
  background: #f0fdf4;
  transform: translateX(3px);
}
.geo-item-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, #165029, #1a5c32);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px;
}
.geo-icon-tehsil { background: linear-gradient(135deg, #0e7490, #0891b2); }
.geo-icon-uc     { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }

.geo-item-info { flex: 1; min-width: 0; }
.geo-item-name { display: block; font-size: 13px; font-weight: 600; color: #1e293b; }
.geo-item-meta { display: block; font-size: 11px; color: #94a3b8; margin-top: 2px; }

.geo-item-bar { width: 48px; height: 4px; background: #e8ecf0; border-radius: 4px; flex-shrink: 0; }
.geo-bar-fill { height: 4px; background: var(--gov-green-mid); border-radius: 4px; }

.geo-arrow { font-size: 11px; color: #cbd5e1; flex-shrink: 0; }
.geo-item:hover .geo-arrow { color: var(--gov-green-mid); }

/* UC type badge */
.uc-type-badge {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 10px; font-weight: 700;
  background: #eff6ff; color: #1d4ed8;
}

/* Site cards */
.geo-site-card {
  border: 1.5px solid #e8ecf0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  margin-bottom: 8px;
}
.geo-site-card.site-card-inactive { background: #fafafa; border-color: #e8ecf0; opacity: .75; }
.gsc-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.gsc-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.gsc-active   { background: #dcfce7; color: #166534; }
.gsc-inactive { background: #fee2e2; color: #991b1b; }
.gsc-detail { font-size: 11.5px; color: #64748b; margin-top: 4px; }
.gsc-detail i { width: 14px; color: #94a3b8; margin-right: 4px; }

/* Leaflet tooltip override */
.map-tooltip-wrap .leaflet-tooltip {
  background: rgba(15,23,42,.88) !important;
  border: none !important;
  border-radius: 8px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.3) !important;
  padding: 0 !important;
}
.map-tooltip {
  padding: 8px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.map-tooltip strong { font-size: 13px; color: #fff; }
.map-tooltip span   { font-size: 11px; color: rgba(255,255,255,.7); }

/* Site markers */
.site-marker {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; filter: drop-shadow(0 2px 4px rgba(0,0,0,.3));
}
.site-active   { color: #16a34a; }
.site-inactive { color: #dc2626; }

/* Leaflet site popup */
.site-popup strong { display: block; font-size: 13px; color: #1e293b; margin-bottom: 4px; }
.site-popup p { font-size: 11.5px; color: #64748b; margin: 3px 0; }
.sp-active   { font-size: 11px; font-weight: 700; color: #166534; background: #dcfce7; padding: 2px 8px; border-radius: 20px; }
.sp-inactive { font-size: 11px; font-weight: 700; color: #991b1b; background: #fee2e2; padding: 2px 8px; border-radius: 20px; }

/* Province name labels rendered as Leaflet DivIcons */
.prov-label {
  font-size: 10px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
  white-space: nowrap; pointer-events: none;
  text-transform: uppercase; letter-spacing: .5px;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .map-layout { grid-template-columns: 1fr 280px; }
  .geo-panel  { width: 280px; }
}
@media (max-width: 900px) {
  .map-layout { grid-template-columns: 1fr; }
  #pakMap     { height: 400px; }
  .map-summary { border-left: none; border-top: 1px solid #e8ecf0; max-height: 260px; }
  .geo-panel  {
    width: 100%; border-left: none; border-top: 2px solid var(--gov-green-mid);
    top: auto; bottom: 0; height: 55%;
    transform: translateY(110%);
  }
  .geo-panel.panel-open { transform: translateY(0); }
}
@media (max-width: 560px) {
  .map-card-header { flex-direction: column; align-items: flex-start; }
  .map-legend { display: none; }
}
