/* === variables.css === */
/* Funguka Platform - Design Tokens
   Sourced from the mobile app theme (contexts/ThemeContext + constants). */
:root {
  /* Brand palette */
  --fg-primary: #1D3F8F;
  --fg-primary-600: #17357A;
  --fg-primary-700: #102A63;
  --fg-primary-50: #EEF2FB;
  --fg-primary-100: #DCE4F5;

  /* Sidebar palette (uses app brand blue) */
  --fg-sidebar-bg: linear-gradient(180deg, #1E4494 0%, #162F6E 100%);
  --fg-sidebar-bg-flat: #1A3C88;
  --fg-sidebar-bg-light: var(--fg-primary-600);
  --fg-sidebar-text: rgba(255,255,255,.85);
  --fg-sidebar-text-hover: #fff;
  --fg-sidebar-active-bg: rgba(255,255,255,.18);
  --fg-sidebar-active-text: #fff;
  --fg-sidebar-border: rgba(255,255,255,.1);
  --fg-sidebar-search-bg: rgba(255,255,255,.1);

  --fg-orange: #F97316;
  --fg-orange-600: #E8620A;
  --fg-accent: #E8A520;

  --fg-bg: #F0F4FA;
  --fg-card: #FFFFFF;
  /* Legacy alias — many inline styles use `var(--fg-card-bg, #fff)`.
     Keep it mapped to --fg-card so those surfaces theme correctly
     without having to edit every view file. */
  --fg-card-bg: var(--fg-card);
  --fg-border: #E2E8F0;
  --fg-muted: #F8FAFC;

  --fg-text: #0F172A;
  --fg-text-muted: #64748B;
  --fg-text-soft: #94A3B8;

  --fg-success: #16A34A;
  --fg-success-bg: #DCFCE7;
  --fg-danger:  #DC2626;
  --fg-danger-bg: #FEE2E2;
  --fg-warning: #F59E0B;
  --fg-warning-bg: #FEF3C7;
  --fg-info:    #0EA5E9;
  --fg-info-bg: #E0F2FE;

  /* Layout */
  --fg-sidebar-w: 260px;
  --fg-topbar-h: 64px;
  --fg-radius-sm: 8px;
  --fg-radius: 12px;
  --fg-radius-lg: 16px;

  /* Shadows */
  --fg-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --fg-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  --fg-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);

  /* Typography */
  --fg-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Motion */
  --fg-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Bootstrap overrides */
:root {
  --bs-primary: var(--fg-primary);
  --bs-primary-rgb: 29, 63, 143;
  --bs-body-bg: var(--fg-bg);
  --bs-body-color: var(--fg-text);
  --bs-body-font-family: var(--fg-font);
  --bs-border-color: var(--fg-border);
  --bs-border-radius: var(--fg-radius);
}

/* ==========================================================================
   Dark theme — applied when <html data-theme="dark">.
   We override surface + text tokens only; brand colours stay the same so
   primary buttons / the sidebar gradient keep their identity.
   ========================================================================== */
html[data-theme="dark"] {
  --fg-bg: #0B1220;
  --fg-card: #121A2E;
  --fg-muted: #18223A;
  --fg-border: #243049;

  --fg-text: #E6ECF7;
  --fg-text-muted: #93A4C1;
  --fg-text-soft: #6B7C9A;

  --fg-primary-50:  #1B2750;
  --fg-primary-100: #23336C;

  --fg-success-bg: #0F2E1F;
  --fg-danger-bg:  #3A1418;
  --fg-warning-bg: #3A2A0E;
  --fg-info-bg:    #0E2A3A;

  --fg-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --fg-shadow:    0 6px 18px rgba(0, 0, 0, 0.45);
  --fg-shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);

  --bs-body-bg: var(--fg-bg);
  --bs-body-color: var(--fg-text);
  --bs-border-color: var(--fg-border);
}

html[data-theme="dark"] body { background: var(--fg-bg); color: var(--fg-text); }
html[data-theme="dark"] .fg-topbar { background: var(--fg-card); }
html[data-theme="dark"] .fg-card,
html[data-theme="dark"] .fg-user-menu,
html[data-theme="dark"] .fg-user-menu::before { background: var(--fg-card); border-color: var(--fg-border); }
html[data-theme="dark"] .fg-user,
html[data-theme="dark"] .fg-icon-btn { background: var(--fg-muted); color: var(--fg-text); }
html[data-theme="dark"] .fg-icon-btn:hover { background: var(--fg-primary-100); color: #fff; }
html[data-theme="dark"] .fg-avatar.no-img { background: var(--fg-card); }
html[data-theme="dark"] .fg-bell-count { border-color: var(--fg-card); }
html[data-theme="dark"] .fg-page-head {
  background: linear-gradient(135deg, var(--fg-card) 0%, #17254A 100%);
  border-color: var(--fg-border);
}
html[data-theme="dark"] .fg-page-head h1 { color: #B9CBFF; }
html[data-theme="dark"] .fg-page-head h1 > i {
  background: var(--fg-muted);
  border-color: var(--fg-border);
  color: #B9CBFF;
}
html[data-theme="dark"] .fg-page-head p strong { color: #B9CBFF; }

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
  background: var(--fg-muted);
  color: var(--fg-text);
  border-color: var(--fg-border);
}
html[data-theme="dark"] .form-control::placeholder { color: var(--fg-text-soft); }
html[data-theme="dark"] table { color: var(--fg-text); }
html[data-theme="dark"] .fg-table thead th { background: var(--fg-muted); color: var(--fg-text-muted); }
html[data-theme="dark"] .fg-table tbody tr:hover { background: var(--fg-muted); }

html[data-theme="dark"] .fg-user-menu-item { color: var(--fg-text); }
html[data-theme="dark"] .fg-user-menu-item:hover { background: var(--fg-primary-100); color: #fff; }
html[data-theme="dark"] .fg-user-menu-item:hover i { color: #fff; }

html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .modal-content { background: var(--fg-card); color: var(--fg-text); }

/* ==========================================================================
   Dark-mode sweep — targeted overrides for hardcoded light surfaces that
   weren't using CSS vars. Grouped by area so future work is easy to scope.
   ========================================================================== */

/* Stat cards + inner pill */
html[data-theme="dark"] .fg-stat { background: var(--fg-card); border-color: var(--fg-border); }
html[data-theme="dark"] .fg-stat-foot { background: var(--fg-muted); border-color: var(--fg-border); }
html[data-theme="dark"] .fg-stat-pill { background: var(--fg-border); color: var(--fg-text-muted); }
html[data-theme="dark"] .fg-stat-foot.tone-good .fg-stat-pill { background: rgba(22,163,74,.18); color: #86EFAC; }
html[data-theme="dark"] .fg-stat-foot.tone-bad  .fg-stat-pill { background: rgba(220,38,38,.18); color: #FCA5A5; }
html[data-theme="dark"] .fg-stat-foot.tone-flat .fg-stat-pill { background: var(--fg-border); color: var(--fg-text-soft); }
html[data-theme="dark"] .fg-stat-foot.state-new .fg-stat-pill { background: rgba(29,63,143,.35); color: #B9CBFF; }
html[data-theme="dark"] .fg-stat.accent-orange .fg-stat-icon {
  background: rgba(249,115,22,.15); color: #FDBA74;
}

/* Tables */
html[data-theme="dark"] .fg-table { color: var(--fg-text); }
html[data-theme="dark"] .fg-table th,
html[data-theme="dark"] .fg-table td { border-color: var(--fg-border); }
html[data-theme="dark"] .fg-table tbody tr { background: transparent; }
html[data-theme="dark"] .fg-empty { color: var(--fg-text-soft); }

/* Small pill chips (qty, counters) */
html[data-theme="dark"] .fg-qty-pill { background: var(--fg-muted); color: var(--fg-text); }

/* Profile / change-password info table — the Name/Email/Role rows rendered
   too dark to read. Switch to card background + bright text. */
html[data-theme="dark"] .fg-card table { color: var(--fg-text); }
html[data-theme="dark"] .fg-card table th { background: var(--fg-muted); color: var(--fg-text-muted); border-color: var(--fg-border); font-weight: 600; }
html[data-theme="dark"] .fg-card table td { background: transparent; color: var(--fg-text); border-color: var(--fg-border); }
html[data-theme="dark"] .fg-avatar-role { color: var(--fg-text-muted); }

/* Case-detail sections — "Client's Personal Details" style cards */
html[data-theme="dark"] .fg-case-section { background: var(--fg-card); border-color: var(--fg-border); }
html[data-theme="dark"] .fg-case-section-head { border-color: var(--fg-border); }
html[data-theme="dark"] .fg-case-section-head h3 { color: var(--fg-text); }
html[data-theme="dark"] .fg-case-row { border-color: var(--fg-border); }
html[data-theme="dark"] .fg-case-row.odd  { background: var(--fg-muted); }
html[data-theme="dark"] .fg-case-row.even { background: var(--fg-card); }
html[data-theme="dark"] .fg-case-label { color: var(--fg-text-muted); }
html[data-theme="dark"] .fg-case-value { color: var(--fg-text); }

/* Notification drawer + toast */
html[data-theme="dark"] .fg-drawer { background: var(--fg-card); color: var(--fg-text); }
html[data-theme="dark"] .fg-drawer-head {
  background: linear-gradient(180deg, var(--fg-muted) 0%, var(--fg-card) 100%);
  border-bottom-color: var(--fg-border);
}
html[data-theme="dark"] .fg-drawer-title { color: var(--fg-text); }
html[data-theme="dark"] .fg-drawer-mark,
html[data-theme="dark"] .fg-drawer-close { color: var(--fg-text-muted); }
html[data-theme="dark"] .fg-drawer-mark:hover { background: var(--fg-muted); color: var(--fg-text); }
html[data-theme="dark"] .fg-drawer-body::-webkit-scrollbar-thumb { background: var(--fg-border); }
html[data-theme="dark"] .fg-drawer-empty { color: var(--fg-text-soft); }
html[data-theme="dark"] .fg-drawer-empty i { color: var(--fg-border); }
html[data-theme="dark"] .fg-notif-item { border-bottom-color: var(--fg-border); }
html[data-theme="dark"] .fg-notif-item:hover { background: var(--fg-muted); }
html[data-theme="dark"] .fg-notif-title { color: var(--fg-text); }
html[data-theme="dark"] .fg-notif-body  { color: var(--fg-text-muted); }
html[data-theme="dark"] .fg-notif-time  { color: var(--fg-text-soft); }
html[data-theme="dark"] .fg-drawer-foot { background: var(--fg-muted); border-top-color: var(--fg-border); }
html[data-theme="dark"] .fg-drawer-viewall {
  background: var(--fg-card); border-color: var(--fg-border); color: var(--fg-text);
}
html[data-theme="dark"] .fg-drawer-viewall:hover { background: var(--fg-muted); }
html[data-theme="dark"] .fg-toast { background: var(--fg-card); color: var(--fg-text); }
html[data-theme="dark"] .fg-toast-title { color: var(--fg-text); }
html[data-theme="dark"] .fg-toast-body  { color: var(--fg-text-muted); }

/* Analytics / Reports — tab bar, section chips, active-range badge */
html[data-theme="dark"] .fg-range-badge { background: rgba(29,63,143,.22); color: #B9CBFF; }
html[data-theme="dark"] .fg-sec-chip { background: var(--fg-muted); border-color: var(--fg-border); color: var(--fg-text); }
html[data-theme="dark"] .fg-sec-chip.is-active { background: var(--fg-primary); color: #fff; border-color: var(--fg-primary); }
html[data-theme="dark"] .fg-sec-chip-dot { box-shadow: 0 0 0 2px var(--fg-card); }

/* YouTube-style search + filter pill (used on forms/clients/notifications) */
html[data-theme="dark"] .fg-yt-search-input {
  background: var(--fg-muted); color: var(--fg-text); border-color: var(--fg-border);
}
html[data-theme="dark"] .fg-yt-search-input::placeholder { color: var(--fg-text-soft); }
html[data-theme="dark"] .fg-yt-filter-btn {
  background: var(--fg-muted); border-color: var(--fg-border); color: var(--fg-text-muted);
}
html[data-theme="dark"] .fg-yt-filter-btn:hover,
html[data-theme="dark"] .fg-yt-filter-btn.has-filter {
  background: var(--fg-primary-100); color: #fff; border-color: var(--fg-primary);
}
html[data-theme="dark"] .fg-filter-drop {
  background: var(--fg-card); border-color: var(--fg-border);
}
html[data-theme="dark"] .fg-filter-opt {
  background: var(--fg-muted); border-color: var(--fg-border); color: var(--fg-text-muted);
}
html[data-theme="dark"] .fg-filter-opt:hover { background: var(--fg-primary-100); color: #fff; }
html[data-theme="dark"] .fg-filter-opt.active { background: var(--fg-primary); color: #fff; border-color: var(--fg-primary); }
html[data-theme="dark"] .fg-active-filter { background: rgba(29,63,143,.25); color: #B9CBFF; }
html[data-theme="dark"] .fg-active-filter .fg-af-x { background: rgba(29,63,143,.4); color: #fff; }

/* Action icons in table rows (view / edit / delete) */
html[data-theme="dark"] .btn-view,
html[data-theme="dark"] .btn-edit  { background: var(--fg-muted); color: var(--fg-text); }
html[data-theme="dark"] .btn-view:hover  { background: rgba(14,165,233,.2); color: #7DD3FC; }
html[data-theme="dark"] .btn-edit:hover  { background: rgba(245,158,11,.2); color: #FCD34D; }
html[data-theme="dark"] .btn-delete      { background: rgba(220,38,38,.15); color: #FCA5A5; }
html[data-theme="dark"] .btn-delete:hover{ background: rgba(220,38,38,.3);  color: #fff; }

/* Events / Education preview surfaces */
html[data-theme="dark"] .fg-media-item,
html[data-theme="dark"] .fg-media-upload-zone,
html[data-theme="dark"] .fg-pdf-preview,
html[data-theme="dark"] .fg-preview-frame { background: var(--fg-muted); border-color: var(--fg-border); }
html[data-theme="dark"] .ig-card,
html[data-theme="dark"] [style*="background:#fff"],
html[data-theme="dark"] [style*="background: #fff"] { background-color: var(--fg-card) !important; }
html[data-theme="dark"] [style*="color:#0F172A"],
html[data-theme="dark"] [style*="color: #0F172A"] { color: var(--fg-text) !important; }
html[data-theme="dark"] [style*="border: 1px solid #e8e8e8"],
html[data-theme="dark"] [style*="border:1px solid #e8e8e8"] { border-color: var(--fg-border) !important; }

/* Bootstrap button-light / btn-outline-* — make them readable on dark.
   Every interactive state is covered so Bootstrap's :hover/:focus/:active
   rules (which land at higher specificity in some Bootstrap builds) can't
   flash a hardcoded white back in on press. */
html[data-theme="dark"] .btn.btn-light,
html[data-theme="dark"] .btn-light,
html[data-theme="dark"] a.btn-light,
html[data-theme="dark"] button.btn-light {
  background-color: var(--fg-muted);
  color: var(--fg-text);
  border-color: var(--fg-border);
}
html[data-theme="dark"] .btn.btn-light:hover,
html[data-theme="dark"] .btn-light:hover,
html[data-theme="dark"] .btn.btn-light:focus,
html[data-theme="dark"] .btn-light:focus,
html[data-theme="dark"] .btn.btn-light:active,
html[data-theme="dark"] .btn-light:active,
html[data-theme="dark"] .btn.btn-light.active,
html[data-theme="dark"] .btn-light:focus-visible {
  background-color: var(--fg-border);
  color: var(--fg-text);
  border-color: var(--fg-border);
  box-shadow: 0 0 0 3px rgba(29,63,143,.25);
}
html[data-theme="dark"] .btn.btn-light:disabled,
html[data-theme="dark"] .btn-light.disabled {
  background-color: var(--fg-muted);
  color: var(--fg-text-soft);
  border-color: var(--fg-border);
  opacity: .6;
}
html[data-theme="dark"] .btn-secondary {
  background-color: var(--fg-muted);
  color: var(--fg-text);
  border-color: var(--fg-border);
}
html[data-theme="dark"] .btn-secondary:hover,
html[data-theme="dark"] .btn-secondary:focus,
html[data-theme="dark"] .btn-secondary:active {
  background-color: var(--fg-border);
  color: var(--fg-text);
  border-color: var(--fg-border);
}
html[data-theme="dark"] .btn-outline-primary { color: #B9CBFF; border-color: var(--fg-primary); background-color: transparent; }
html[data-theme="dark"] .btn-outline-primary:hover,
html[data-theme="dark"] .btn-outline-primary:focus,
html[data-theme="dark"] .btn-outline-primary:active { background-color: var(--fg-primary); color: #fff; border-color: var(--fg-primary); }
html[data-theme="dark"] .btn-outline-secondary {
  color: var(--fg-text-muted); border-color: var(--fg-border); background-color: var(--fg-muted);
}
html[data-theme="dark"] .btn-outline-secondary:hover,
html[data-theme="dark"] .btn-outline-secondary:focus,
html[data-theme="dark"] .btn-outline-secondary:active { background-color: var(--fg-border); color: var(--fg-text); border-color: var(--fg-border); }

/* Bootstrap alerts / badges / nav-tabs */
html[data-theme="dark"] .alert-info    { background: rgba(14,165,233,.15); color: #7DD3FC; border-color: rgba(14,165,233,.3); }
html[data-theme="dark"] .alert-success { background: rgba(22,163,74,.15);  color: #86EFAC; border-color: rgba(22,163,74,.3); }
html[data-theme="dark"] .alert-warning { background: rgba(245,158,11,.15); color: #FCD34D; border-color: rgba(245,158,11,.3); }
html[data-theme="dark"] .alert-danger  { background: rgba(220,38,38,.15);  color: #FCA5A5; border-color: rgba(220,38,38,.3); }
html[data-theme="dark"] .nav-tabs { border-bottom-color: var(--fg-border); }
html[data-theme="dark"] .nav-tabs .nav-link { color: var(--fg-text-muted); }
html[data-theme="dark"] .nav-tabs .nav-link:hover { border-color: var(--fg-border) var(--fg-border) transparent; color: var(--fg-text); }
html[data-theme="dark"] .nav-tabs .nav-link.active {
  background: var(--fg-card); color: #B9CBFF;
  border-color: var(--fg-border) var(--fg-border) var(--fg-card);
}
html[data-theme="dark"] .pagination .page-link {
  background: var(--fg-card); color: var(--fg-text); border-color: var(--fg-border);
}
html[data-theme="dark"] .pagination .page-item.active .page-link { background: var(--fg-primary); border-color: var(--fg-primary); color: #fff; }
html[data-theme="dark"] .pagination .page-item.disabled .page-link { color: var(--fg-text-soft); }

/* Card headers with h3 titles (form sections, event cards, etc.) */
html[data-theme="dark"] .fg-card-head h3,
html[data-theme="dark"] .fg-card h3 { color: var(--fg-text); }
html[data-theme="dark"] .fg-card-head small,
html[data-theme="dark"] .fg-card small { color: var(--fg-text-muted); }
html[data-theme="dark"] .fg-muted { color: var(--fg-text-muted) !important; }
html[data-theme="dark"] .text-muted { color: var(--fg-text-muted) !important; }
html[data-theme="dark"] hr { border-color: var(--fg-border); opacity: .6; }
html[data-theme="dark"] .form-label { color: var(--fg-text); }
html[data-theme="dark"] .form-text  { color: var(--fg-text-muted); }
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus { border-color: var(--fg-primary); box-shadow: 0 0 0 3px rgba(29,63,143,.25); }

/* Priority banner (legal officer assignments) — softer green glow in dark */
html[data-theme="dark"] .fg-priority-banner {
  background:
    radial-gradient(circle at 100% 0%, rgba(22,163,74,.18) 0, rgba(22,163,74,0) 240px),
    linear-gradient(135deg, var(--fg-card) 0%, #112A1C 100%);
  border-color: rgba(22,163,74,.35);
}
html[data-theme="dark"] .fg-priority-banner-head strong { color: #86EFAC; }
html[data-theme="dark"] .fg-priority-item { background: var(--fg-muted); border-color: var(--fg-border); }
html[data-theme="dark"] .fg-priority-item.is-unread { border-color: #16A34A; }
html[data-theme="dark"] .fg-priority-title { color: var(--fg-text); }
html[data-theme="dark"] a.fg-priority-title:hover { color: #B9CBFF; }
html[data-theme="dark"] .fg-priority-tag { background: rgba(22,163,74,.2); color: #86EFAC; }
html[data-theme="dark"] .fg-notif-priority-row { box-shadow: inset 3px 0 0 #16A34A; }
html[data-theme="dark"] .fg-notif-unread-row { background: rgba(29,63,143,.18); }
html[data-theme="dark"] .fg-notif-priority-row.fg-notif-unread-row { background: rgba(22,163,74,.10); }
html[data-theme="dark"] .fg-notif-tbl-icon.primary { background: rgba(29,63,143,.22); color: #B9CBFF; }
html[data-theme="dark"] .fg-notif-tbl-icon.warning { background: rgba(245,158,11,.18); color: #FCD34D; }
html[data-theme="dark"] .fg-notif-tbl-icon.success { background: rgba(22,163,74,.18);  color: #86EFAC; }
html[data-theme="dark"] .fg-notif-tbl-icon.danger  { background: rgba(220,38,38,.18);  color: #FCA5A5; }
html[data-theme="dark"] .fg-notif-tbl-icon.info    { background: rgba(14,165,233,.18); color: #7DD3FC; }

/* Sidebar footer — sits on the same gradient as the sidebar itself, but
   the user info block + sign-out button needed softer borders and a bit
   more contrast so it doesn't bleed into the body edge in dark mode. */
html[data-theme="dark"] .fg-sidebar-footer { border-top-color: rgba(255,255,255,.08); background: rgba(0,0,0,.18); }
html[data-theme="dark"] .fg-sidebar-user { border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.04); }
html[data-theme="dark"] .fg-sidebar-user-name { color: #fff; }
html[data-theme="dark"] .fg-sidebar-user-email { color: rgba(255,255,255,.7); }
html[data-theme="dark"] .fg-sidebar-logout {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.12);
  color: rgba(255,255,255,.9);
}
html[data-theme="dark"] .fg-sidebar-logout:hover { background: rgba(239,68,68,.22); color: #fff; border-color: rgba(239,68,68,.4); }
html[data-theme="dark"] .fg-sidebar-copy { color: rgba(255,255,255,.45); }
html[data-theme="dark"] .fg-sidebar-search-input { background: rgba(255,255,255,.08); color: #fff; }
html[data-theme="dark"] .fg-sidebar-search-input::placeholder { color: rgba(255,255,255,.55); }

/* Sidebar body itself — slightly darker gradient so dark-mode content feels
   anchored to a deeper navy instead of clashing with the light brand blue. */
html[data-theme="dark"] .fg-sidebar {
  background: linear-gradient(180deg, #0F2360 0%, #081747 100%);
  border-right: 1px solid rgba(255,255,255,.04);
}
html[data-theme="dark"] .fg-nav-section { color: rgba(255,255,255,.55); }
html[data-theme="dark"] .fg-sidebar-backdrop { background: rgba(0,0,0,.65); }

/* Settings page cards */
html[data-theme="dark"] .fg-theme-card,
html[data-theme="dark"] .fg-lang-card,
html[data-theme="dark"] .fg-notif-cat { background: var(--fg-card); border-color: var(--fg-border); }
html[data-theme="dark"] .fg-notif-cat:hover { background: var(--fg-muted); border-color: var(--fg-primary); }
html[data-theme="dark"] .fg-switch-track { background: var(--fg-border); }
html[data-theme="dark"] .fg-notif-cat-meta strong { color: var(--fg-text); }
html[data-theme="dark"] .fg-lang-card strong { color: var(--fg-text); }

/* Status / category badges (.fg-badge success/danger/warning/info/primary)
   used on event cards, education cards, notifications, tables, etc. In
   dark mode the plain `--fg-success/danger/…` text on `--fg-*-bg` surfaces
   is too dim (dark-on-dark). Swap to brighter glyph colors + slightly more
   opaque tints so "Posted", "Draft", "Scheduled", category pills and
   everything else read clearly over dark backgrounds. */
html[data-theme="dark"] .fg-badge         { border: 1px solid transparent; }
html[data-theme="dark"] .fg-badge.success { background: rgba(22,163,74,.18);  color: #86EFAC; border-color: rgba(22,163,74,.35); }
html[data-theme="dark"] .fg-badge.danger  { background: rgba(220,38,38,.18);  color: #FCA5A5; border-color: rgba(220,38,38,.35); }
html[data-theme="dark"] .fg-badge.warning { background: rgba(245,158,11,.18); color: #FCD34D; border-color: rgba(245,158,11,.35); }
html[data-theme="dark"] .fg-badge.info    { background: rgba(14,165,233,.18); color: #7DD3FC; border-color: rgba(14,165,233,.35); }
html[data-theme="dark"] .fg-badge.primary { background: rgba(29,63,143,.3);   color: #B9CBFF; border-color: rgba(29,63,143,.45); }
/* Cover category chip sitting over event images keeps the readable white
   when there's a photo behind it; the glass blur from the inline style
   keeps it crisp. But when there's no photo (fallback logo state) the
   card uses .fg-cover-cat → .fg-badge.primary, so the override above
   already handles that. */

/* "Officer Attended the Client" + "Assigned Officer" — bottom cards on
   form detail and male-champion detail pages. The light theme uses a
   pastel-green gradient with dark-green label text which becomes
   unreadable on dark surfaces. */
html[data-theme="dark"] .fg-case-officer {
  background: linear-gradient(135deg, rgba(22,163,74,.14) 0%, var(--fg-card) 80%);
  border-color: rgba(22,163,74,.35);
}
html[data-theme="dark"] .fg-case-officer-label { color: #86EFAC; }
html[data-theme="dark"] .fg-case-officer-name  { color: var(--fg-text); }

/* Reports / analytics tab strip + KPI cards + loading bar. These all
   live in analytics/index.php as inline <style> blocks using the alias
   --fg-card-bg which now resolves to --fg-card in dark mode, so the
   containers theme. The tweaks below add a few extra touches (hover,
   border, muted hover bg) that the inline block didn't bake in. */
html[data-theme="dark"] .fg-analytics-tabs { background: var(--fg-card); border-color: var(--fg-border); }
html[data-theme="dark"] .fg-atab:hover     { background: rgba(87,132,226,.12); color: #B9CBFF; }
html[data-theme="dark"] .fg-atab.active    { background: var(--fg-primary); color: #fff; box-shadow: 0 2px 8px rgba(29,63,143,.35); }
html[data-theme="dark"] .fg-kpi-card       { background: var(--fg-card); border-color: var(--fg-border); }
html[data-theme="dark"] .fg-kpi-card .fg-kpi-val { color: #B9CBFF; }
html[data-theme="dark"] .fg-kpi-card .fg-kpi-lbl { color: var(--fg-text-muted); }
html[data-theme="dark"] .fg-loader-bar     { background: var(--fg-card); border-color: var(--fg-border); }
html[data-theme="dark"] .fg-loader-text    { color: var(--fg-text-muted); }
html[data-theme="dark"] .fg-chart-export   { background: rgba(148,163,184,.14); color: var(--fg-text-muted); }
html[data-theme="dark"] .fg-chart-export:hover { background: var(--fg-primary); color: #fff; }

/* Event / male-champion detail + edit YouTube-Studio-style top bar.
   `--fg-card-bg` alias covers the background; we still need to darken
   the delete button hover so it doesn't flash a pastel-red plate. */
html[data-theme="dark"] .fg-detail-bar { background: var(--fg-card); border-color: var(--fg-border); }
html[data-theme="dark"] .fg-bar-title h1 { color: var(--fg-text); }
html[data-theme="dark"] .fg-btn-delete { background: transparent; color: #FCA5A5; border-color: rgba(220,38,38,.4); }
html[data-theme="dark"] .fg-btn-delete:hover { background: rgba(220,38,38,.18); color: #fff; }



/* === global.css === */
/* Funguka Platform - Global styles */
*, *::before, *::after { box-sizing: border-box; }

/* Slightly tighter base — gives the dashboard the same airy feel
   that 90% browser zoom used to provide, without forcing the user
   to zoom manually. All rem-based sizes scale with this. */
html { font-size: 13px; }
@media (min-width: 1600px) { html { font-size: 13.5px; } }
@media (max-width: 540px)  { html { font-size: 12.5px; } }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--fg-font);
  background: var(--fg-bg);
  color: var(--fg-text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--fg-primary); text-decoration: none; }
a:hover { color: var(--fg-primary-600); }

h1, h2, h3, h4, h5, h6 {
  color: var(--fg-text);
  font-weight: 600;
  letter-spacing: -0.01em;
}

::selection { background: var(--fg-primary-100); color: var(--fg-primary-700); }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 10px;
  border: 2px solid var(--fg-bg);
}
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* Layout shell */
.fg-app {
  display: flex;
  min-height: 100vh;
}
.fg-main {
  flex: 1;
  margin-left: var(--fg-sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.fg-content {
  flex: 1;
  padding: 24px 32px 48px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 992px) {
  .fg-main { margin-left: 0; }
  .fg-content { padding: 16px 16px 32px; }
}

/* Utility */
.fg-muted { color: var(--fg-text-muted); }
.fg-soft  { color: var(--fg-text-soft); }
.fg-gap-2 { gap: 0.5rem; }
.fg-gap-3 { gap: 1rem; }

/* Page header — canonical styling lives in components.css */


/* === components.css === */
/* Funguka Platform - Reusable UI components */

/* -------- Pagination bar -------- */
.fg-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  background: var(--fg-card);
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius-lg);
}
.fg-pagination .pagination { flex-wrap: wrap; }
.fg-pagination .page-link {
  color: var(--fg-primary);
  border-color: var(--fg-border);
  padding: 4px 10px;
  font-size: .8rem;
}
.fg-pagination .page-item.active .page-link {
  background: var(--fg-primary);
  border-color: var(--fg-primary);
  color: #fff;
}


/* -------- Card --------
   No scaling / translating on hover — the user explicitly asked for
   stable cards. We only subtly deepen the shadow and shift the border. */
.fg-card {
  background: var(--fg-card);
  border-radius: var(--fg-radius-lg);
  border: 1px solid var(--fg-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .03);
  padding: 22px 26px;
  position: relative;
}
.fg-card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--fg-border);
}
.fg-card-head:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.fg-card-head h3 { margin: 0; font-size: .95rem; font-weight: 600; color: var(--fg-text); letter-spacing: -0.005em; }

/* -------- Stats grid --------
   Flex-based row: all cards share the row equally and only wrap
   when each child would shrink below a readable minimum.
   This keeps them on ONE row on desktop like big SaaS dashboards. */
.fg-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.fg-stats-grid > * {
  flex: 1 1 0;
  min-width: 158px;
  min-height: 0;
}
@media (max-width: 1100px) {
  .fg-stats-grid > * { flex-basis: calc(33.333% - 10px); }
}
@media (max-width: 768px) {
  .fg-stats-grid { gap: 10px; }
  .fg-stats-grid > * { flex-basis: calc(50% - 5px); }
}
@media (max-width: 380px) {
  .fg-stats-grid > * { flex-basis: 100%; }
}

/* -------- Rich stat card (with comparison footer) -------- */
.fg-stat--rich {
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  padding: 0;
  min-height: 130px;
  overflow: visible;
}
.fg-stat--rich .fg-stat-main {
  padding: 14px 16px 10px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.fg-stat--rich .fg-stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.fg-stat--rich .fg-stat-label { margin: 0; }
.fg-stat--rich .fg-stat-value { font-size: 1.55rem; margin-top: 2px; }
.fg-stat--rich .fg-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 13px;
}
.fg-stat-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-top: 1px solid var(--fg-border);
  background: #f8fafc;
  font-size: .65rem;
  min-width: 0;
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}
.fg-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .62rem;
  background: #e2e8f0;
  color: #475569;
  flex-shrink: 0;
  white-space: nowrap;
}
.fg-stat-pill > i { font-size: 9px; }
.fg-stat-foot.tone-good  .fg-stat-pill { background: #dcfce7; color: #166534; }
.fg-stat-foot.tone-bad   .fg-stat-pill { background: #fee2e2; color: #991b1b; }
.fg-stat-foot.tone-flat  .fg-stat-pill { background: #f1f5f9; color: #64748b; }
.fg-stat-foot.state-new  .fg-stat-pill { background: #dbeafe; color: #1d4ed8; }
.fg-stat-compare {
  color: var(--fg-text-muted);
  min-width: 0;
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 540px) {
  .fg-stat--rich .fg-stat-value { font-size: 1.4rem; }
  .fg-stat-foot { padding: 5px 8px; font-size: .62rem; }
  .fg-stat--rich .fg-stat-main { padding: 12px 14px 8px; }
}

/* -------- Stat card -------- */
.fg-stat {
  background: var(--fg-card);
  border-radius: var(--fg-radius-lg);
  padding: 16px 18px;
  border: 1px solid var(--fg-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 92px;
}
.fg-stat-label {
  color: var(--fg-text-muted);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fg-stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--fg-text);
  margin: 6px 0 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.fg-stat-delta { font-size: .78rem; color: var(--fg-success); margin-top: 4px; }
.fg-stat-delta.down { color: var(--fg-danger); }
.fg-stat-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--fg-primary-50);
  color: var(--fg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fg-stat-icon svg { width: 18px; height: 18px; }
.fg-stat.accent-orange  .fg-stat-icon { background: #FEF3E7; color: var(--fg-orange); }
.fg-stat.accent-success .fg-stat-icon { background: var(--fg-success-bg); color: var(--fg-success); }
.fg-stat.accent-info    .fg-stat-icon { background: var(--fg-info-bg); color: var(--fg-info); }
.fg-stat.accent-warning .fg-stat-icon { background: var(--fg-warning-bg); color: var(--fg-warning); }

/* -------- Buttons -------- */
.btn {
  border-radius: var(--fg-radius-sm);
  font-weight: 500;
  padding: .55rem 1.05rem;
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--fg-primary);
  border-color: var(--fg-primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--fg-primary-600);
  border-color: var(--fg-primary-600);
  color: #fff;
}
.btn-outline-primary {
  color: var(--fg-primary);
  border-color: var(--fg-border);
  background: var(--fg-card);
}
.btn-outline-primary:hover {
  background: var(--fg-primary-50);
  color: var(--fg-primary);
  border-color: var(--fg-primary-100);
}
.btn-outline-secondary {
  background: var(--fg-card);
  border-color: var(--fg-border);
  color: var(--fg-text-muted);
}
.btn-outline-secondary:hover {
  background: var(--fg-muted);
  border-color: var(--fg-border);
  color: var(--fg-text);
}
.btn-outline-danger {
  color: var(--fg-danger);
  border-color: #FECACA;
  background: var(--fg-card);
}
.btn-outline-danger:hover {
  background: var(--fg-danger-bg);
  color: var(--fg-danger);
  border-color: #FCA5A5;
}

/* -------- Form controls -------- */
.form-control, .form-select {
  border-radius: var(--fg-radius-sm);
  border: 1px solid var(--fg-border);
  padding: .6rem .85rem;
  font-size: .9rem;
  background: var(--fg-card);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--fg-primary);
  box-shadow: 0 0 0 3px rgba(29, 63, 143, .12);
  outline: none;
}
.form-label, label { font-weight: 500; font-size: .85rem; color: var(--fg-text); margin-bottom: 4px; }

/* -------- Tables (POS-style, borrowed from POS/sales reference) -------- */
/* Clipping + border-radius live on .table-responsive (below). Stacking a
   second `overflow: hidden` + border-radius here used to corrupt paint
   while .fg-main's margin-left was mid-transition on sidebar collapse —
   columns would render transparent/empty until the browser rerasterised. */
.fg-table {
  width: 100%;
  background: var(--fg-card);
  border-collapse: collapse;
  border: 1px solid var(--fg-border);
}
.fg-table th, .fg-table td {
  padding: 10px 12px;
  text-align: left;
  font-size: .85rem;
  border: 1px solid #E5E7EB;
  vertical-align: middle;
}
.fg-table thead th {
  background: #F8FAFC;
  color: #64748B;
  font-weight: 700;
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .04em;
  border-bottom: 2px solid var(--fg-border);
}
.fg-table tbody tr { transition: background-color .12s; }
.fg-table tbody tr:hover { background: #F9FAFB; }

/* S/N column — always first, centered, muted */
.fg-table th.fg-sn,
.fg-table td.fg-sn {
  width: 52px;
  text-align: center;
  color: var(--fg-text-soft);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Numeric columns — monospaced for alignment */
.fg-table .fg-num {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Qty pill — matches POS bg-gray-100 pill */
.fg-qty-pill {
  background: #F3F4F6;
  color: #374151;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 700;
  display: inline-block;
}

/* -------- Action icon buttons (POS DNA: 32x32 rounded, colored soft bg, invert on hover) -------- */
.fg-actions {
  white-space: nowrap;
  display: inline-flex;
  gap: 4px;
  justify-content: center;
}
.btn-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all .2s;
  font-size: .8rem;
  text-decoration: none;
}
.btn-icon svg { width: 14px; height: 14px; }
.btn-icon > i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; font-size: 13px; line-height: 1;
}
.btn-view   { background: #E0F2FE; color: #0284C7; }
.btn-view:hover   { background: #0284C7; color: #fff; }
.btn-edit   { background: #FEF3C7; color: #D97706; }
.btn-edit:hover   { background: #D97706; color: #fff; }
.btn-delete { background: #FEE2E2; color: #DC2626; }
.btn-delete:hover { background: #DC2626; color: #fff; }
.btn-open   { background: var(--fg-primary-50); color: var(--fg-primary); }
.btn-open:hover   { background: var(--fg-primary); color: #fff; }

/* Header add-button (POS style plus icon) */
.btn-add-primary {
  background: var(--fg-primary);
  color: #fff;
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .88rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  box-shadow: 0 1px 2px rgba(15,23,42,.08), 0 4px 12px rgba(29,63,143,.18);
  transition: all .2s;
  text-decoration: none;
}
.btn-add-primary:hover { background: var(--fg-primary-600); color: #fff; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(15,23,42,.1), 0 6px 18px rgba(29,63,143,.25); }

/* Stat card trend text */
.fg-trend { font-size: .74rem; font-weight: 600; margin-top: .5rem; display: flex; align-items: center; gap: 4px; }
.fg-trend.up   { color: var(--fg-success); }
.fg-trend.down { color: var(--fg-danger); }
.fg-trend i, .fg-trend svg { width: 12px; height: 12px; }

/* Super-admin row highlight */
.fg-super-row { background: linear-gradient(90deg, rgba(249,115,22,.04), transparent 60%); }
.fg-super-row:hover { background: linear-gradient(90deg, rgba(249,115,22,.08), #F9FAFB 60%) !important; }

/* ==========================================================================
   RESPONSIVE BEHAVIOUR — tables + cards + page head + search filters
   The dashboard must feel native on every device width from 320px up.
   ========================================================================== */

/* ==========================================================================
   Page head — consistent, premium title block used on every page.
   Uniform size across all pages; brand-blue accent bar; responsive from 320px up.
   ========================================================================== */
.fg-page-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  padding: 18px 22px 18px 26px;
  /* Layered background: corner glow + brand tint. Using background
     layers (not a pseudo-element with z-index:-1) avoids creating a
     new stacking context that would trap Bootstrap modals/dropdowns
     rendered from inside the page head. */
  background:
    radial-gradient(circle at 100% 0%, rgba(29,63,143,.08) 0, rgba(29,63,143,0) 200px),
    linear-gradient(135deg, #ffffff 0%, var(--fg-primary-50) 100%);
  border: 1px solid var(--fg-primary-100);
  border-radius: var(--fg-radius-lg);
  box-shadow: var(--fg-shadow-sm);
}
/* Brand-blue accent bar on the left edge */
.fg-page-head::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--fg-primary) 0%, var(--fg-primary-700) 100%);
  border-top-left-radius: var(--fg-radius-lg);
  border-bottom-left-radius: var(--fg-radius-lg);
}
.fg-page-head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}
.fg-page-head h1 {
  margin: 0 0 6px;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--fg-primary);
  letter-spacing: -0.015em;
  line-height: 1.22;
  display: flex;
  align-items: center;
  gap: 10px;
}
.fg-page-head h1 > i {
  font-size: 1rem;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff;
  color: var(--fg-primary);
  border: 1px solid var(--fg-primary-100);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(29,63,143,.08);
  flex: 0 0 auto;
  margin-right: 2px;
}
.fg-page-head p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--fg-text-muted);
}
.fg-page-head p strong {
  color: var(--fg-primary);
  font-weight: 600;
}

/* Tablet */
@media (max-width: 991.98px) {
  .fg-page-head { padding: 16px 20px 16px 24px; margin-bottom: 18px; }
  .fg-page-head h1 { font-size: 1.25rem; }
  .fg-page-head p  { font-size: 0.85rem; }
  .fg-page-head h1 > i { width: 32px; height: 32px; font-size: 0.9rem; }
}

/* Phone */
@media (max-width: 575.98px) {
  .fg-page-head {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px 14px 20px;
    border-radius: var(--fg-radius);
    margin-bottom: 16px;
  }
  .fg-page-head::before { border-radius: 0; }
  .fg-page-head h1 { font-size: 1.1rem; gap: 8px; }
  .fg-page-head h1 > i { width: 28px; height: 28px; font-size: 0.82rem; border-radius: 8px; }
  .fg-page-head p { font-size: 0.8rem; }
  .fg-page-head .btn,
  .fg-page-head .btn-add-primary,
  .fg-page-head .fg-badge { width: 100%; justify-content: center; }
  .fg-page-head .d-flex { width: 100%; flex-wrap: wrap; }
}

/* Filter card (search + filters row) — columns collapse to full width on phones */
.fg-card .row.g-2 > [class*="col-"] { margin-bottom: 4px; }
@media (max-width: 767.98px) {
  .fg-card .row.g-2 > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
}

/* Cards: reduce padding on phones so content isn't cramped */
@media (max-width: 575.98px) {
  .fg-card { padding: 16px; border-radius: var(--fg-radius); }
  .fg-card.p-0 { padding: 0; }
  .fg-stat { padding: 16px; min-height: auto; }
  .fg-stat-value { font-size: 1.5rem; }
}

/* Table wrapper: allow horizontal scroll at all widths. Owns the
   rounded-corner clip so inner cells can't re-introduce a competing
   clip region. */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--fg-radius-lg);
}
.table-responsive .fg-table { min-width: 640px; }

/* ==========================================================================
   Mobile table → card pattern (< 640px)
   Every <td> gets a data-label attribute (via CSS ::before from the <th>)
   so each row becomes a stack of label:value pairs — works WITHOUT touching
   any markup thanks to data-label being optional.
   ========================================================================== */
@media (max-width: 639.98px) {
  .fg-table,
  .fg-table thead,
  .fg-table tbody,
  .fg-table tr,
  .fg-table th,
  .fg-table td { display: block; width: 100%; }

  .table-responsive .fg-table { min-width: 0; }

  .fg-table thead { display: none; } /* labels move into each cell */

  .fg-table tbody tr {
    background: var(--fg-card);
    border: 1px solid var(--fg-border);
    border-radius: var(--fg-radius);
    margin-bottom: 12px;
    padding: 8px 4px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
  }
  .fg-table tbody tr:hover { background: var(--fg-card); }

  .fg-table tbody td {
    border: none;
    border-bottom: 1px dashed var(--fg-border);
    padding: 10px 14px;
    text-align: right;
    font-size: .88rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 40px;
  }
  .fg-table tbody td:last-child { border-bottom: none; }

  /* Label injected from data-label attribute (set per-view via PHP or via JS) */
  .fg-table tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    text-transform: uppercase;
    font-size: .68rem;
    letter-spacing: .04em;
    color: var(--fg-text-muted);
    flex: 0 0 auto;
    text-align: left;
  }
  .fg-table tbody td:not([data-label])::before { content: none; }

  /* S/N becomes a small corner chip */
  .fg-table tbody td.fg-sn {
    position: absolute;
    right: 12px;
    top: 8px;
    width: auto;
    padding: 2px 10px;
    background: var(--fg-primary-50);
    color: var(--fg-primary);
    border-radius: 999px;
    font-size: .72rem;
    min-height: auto;
    justify-content: center;
  }
  .fg-table tbody td.fg-sn::before { content: 'S/N'; margin-right: 4px; }
  .fg-table tbody tr { position: relative; padding-top: 28px; }

  /* Actions row: center buttons */
  .fg-actions { justify-content: flex-end; width: 100%; }
}

/* Topbar search: keep usable on phones */
@media (max-width: 575.98px) {
  .fg-search { width: 100% !important; max-width: none; }
}

/* -------- Breakdown list (left label / thin rail / right count) --------
   Used by dashboards + reports to render any grouped data ("Cases by
   status", "Cases by sex", "Cases by region", etc.) as a clean vertical
   list. Each row: coloured dot → label → share-of-total rail → count.
   Share rail uses `currentColor` on its fill so the row's dot colour
   flows through — just set `color: #xxx` on the row to theme it. */
.fg-status-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}
.fg-status-row {
  display: grid;
  grid-template-columns: 10px minmax(72px, auto) 1fr 44px;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--fg-border, #e2e8f0);
  transition: background .15s;
}
.fg-status-row:last-child { border-bottom: none; }
.fg-status-row:hover { background: rgba(148, 163, 184, 0.05); }
.fg-status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: currentColor;
}
.fg-status-label {
  font-size: .85rem;
  font-weight: 500;
  color: var(--fg-text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fg-status-rail {
  display: block;
  height: 4px;
  background: rgba(148, 163, 184, .15);
  border-radius: 999px;
  overflow: hidden;
}
.fg-status-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: currentColor;
  transition: width .28s ease;
}
.fg-status-count {
  font-size: .95rem;
  font-weight: 700;
  color: var(--fg-text, #0f172a);
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', 'Inter', sans-serif;
}

/* -------- Badges --------
   Text colours are intentionally *darker* than the brand tokens. The
   previous palette (e.g. #F59E0B on #FEF3C7) only hit ~2.5:1 — badges
   read as washed-out/transparent inside table cells on dashboards that
   don't define a per-view override. These values clear WCAG AA for
   small text on every pastel surface we use. A 1px border in the same
   family adds a visible edge so the pill stays legible on a hovered
   row (which lightens the background). Dark-mode variants in
   variables.css take over via [data-theme="dark"] with higher
   specificity. */
.fg-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.4;
  background: var(--fg-muted);
  color: var(--fg-text);
}
.fg-badge.success { background: var(--fg-success-bg); color: #14532D; border-color: #86EFAC; }
.fg-badge.danger  { background: var(--fg-danger-bg);  color: #7F1D1D; border-color: #FCA5A5; }
.fg-badge.warning { background: var(--fg-warning-bg); color: #78350F; border-color: #FCD34D; }
.fg-badge.info    { background: var(--fg-info-bg);    color: #0C4A6E; border-color: #7DD3FC; }
.fg-badge.primary { background: var(--fg-primary-100); color: var(--fg-primary); border-color: rgba(29,63,143,.25); }

/* Inside a data table, .fg-badge collapses to plain tinted text. The
   column reads like every other column (same typeface, same weight,
   same text colour) and only the soft background tint signals the
   status family. Applies across every .fg-table in the app — admin,
   legal-officer, MEO, CLO, forms list, clients, staff, male-champions,
   analytics — without touching any view file. Status/sex icons drop
   out so the column is purely textual. `!important` is required
   because inline per-view overrides (e.g. forms/index.php
   .fg-row-status-badge) and the dark-theme rules in variables.css
   would otherwise reintroduce the pill palette. */
.fg-table .fg-badge,
.fg-table tbody td .fg-badge {
  display: inline;
  padding: 2px 6px;
  border: 0 !important;
  border-radius: 4px;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  line-height: inherit;
  vertical-align: baseline;
  color: inherit !important;
}
.fg-table .fg-badge > i { display: none; }
.fg-table .fg-badge.success { background: var(--fg-success-bg) !important; }
.fg-table .fg-badge.danger  { background: var(--fg-danger-bg)  !important; }
.fg-table .fg-badge.warning { background: var(--fg-warning-bg) !important; }
.fg-table .fg-badge.info    { background: var(--fg-info-bg)    !important; }
.fg-table .fg-badge.primary { background: var(--fg-primary-100) !important; }

/* -------- Flash messages -------- */
.fg-flash {
  padding: 12px 18px;
  border-radius: var(--fg-radius);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: .9rem;
  border: 1px solid transparent;
}
.fg-flash.success { background: var(--fg-success-bg); color: var(--fg-success); border-color: #BBF7D0; }
.fg-flash.error   { background: var(--fg-danger-bg);  color: var(--fg-danger); border-color: #FECACA; }
.fg-flash.info    { background: var(--fg-info-bg);    color: var(--fg-info); border-color: #BAE6FD; }

/* -------- Empty state -------- */
.fg-empty {
  text-align: center;
  padding: 56px 16px;
  color: var(--fg-text-muted);
  font-size: .9rem;
}
.fg-empty svg { width: 44px; height: 44px; opacity: .4; margin-bottom: 12px; }

/* -------- Chart container -------- */
.fg-chart {
  position: relative;
  width: 100%;
}
.fg-chart-sm { height: 220px; }
.fg-chart-md { height: 260px; }
.fg-chart-lg { height: 320px; }

/* ═══════════════════════════════════════════════════════════════
   Case detail — sectioned tiles with striped rows
   ═══════════════════════════════════════════════════════════════ */
.fg-case-section {
  background: #fff;
  border: 1px solid var(--fg-border);
  border-radius: 14px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.fg-case-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--fg-primary-50) 0%, #fff 100%);
  border-bottom: 1px solid var(--fg-border);
}
.fg-case-section-head h3 {
  margin: 0;
  font-size: .98rem;
  font-weight: 700;
  color: var(--fg-text);
  letter-spacing: -.01em;
}
.fg-case-section-head > i {
  color: var(--fg-primary);
  font-size: 1rem;
}
.fg-case-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--fg-primary), #2952b3);
  color: #fff;
  font-weight: 800;
  font-size: .82rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px -4px rgba(29,63,143,.5);
}
.fg-case-rows { display: flex; flex-direction: column; }
.fg-case-row {
  display: grid;
  grid-template-columns: minmax(200px, 38%) 1fr;
  gap: 12px;
  padding: 11px 18px;
  font-size: .87rem;
  border-bottom: 1px solid #f1f5f9;
}
.fg-case-row:last-child { border-bottom: 0; }
.fg-case-row.odd  { background: #fafbfd; }
.fg-case-row.even { background: #fff; }
.fg-case-label {
  color: var(--fg-text-muted);
  font-weight: 600;
}
.fg-case-value {
  color: var(--fg-text);
  word-break: break-word;
}

/* Officer-attended footer */
.fg-case-officer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-top: 4px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ecfdf5 0%, #fff 80%);
  border: 1px solid #a7f3d0;
}
.fg-case-officer-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  box-shadow: 0 6px 14px -6px rgba(16,185,129,.55);
}
.fg-case-officer-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #047857;
  font-weight: 700;
}
.fg-case-officer-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg-text);
  margin-top: 2px;
}

@media (max-width: 640px) {
  .fg-case-row {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 10px 14px;
  }
  .fg-case-label { font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
  .fg-case-section-head { padding: 12px 14px; }
}

/* Pen edit button on case section header */
.fg-case-section-head { position: relative; }
.fg-case-edit-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--fg-border);
  background: #fff;
  color: var(--fg-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: .78rem;
  transition: all .15s;
  box-shadow: 0 2px 6px -2px rgba(15,23,42,.12);
  z-index: 2;
}
.fg-case-edit-btn:hover {
  background: var(--fg-primary);
  color: #fff;
  border-color: var(--fg-primary);
  transform: translateY(-1px);
}
/* When the pen is present, reserve space on the right so the title doesn't overlap */
.fg-case-section-head:has(.fg-case-edit-btn) { padding-right: 52px; }

/* Edit-mode form rows reuse the striped layout */
.fg-case-edit .fg-case-row { align-items: center; }
.fg-case-edit .form-control,
.fg-case-edit .form-select { font-size: .85rem; }
.fg-case-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  background: #fafbfd;
  border-top: 1px solid var(--fg-border);
}

/* Live character counter under text/textarea inputs */
.fg-case-value { position: relative; }
.fg-case-counter {
  display: block;
  margin-top: 2px;
  font-size: .7rem;
  color: #8a93a6;
  text-align: right;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.fg-case-counter.is-near { color: #d97706; }
.fg-case-counter.is-full { color: #dc2626; font-weight: 600; }

/* Month separator rows inside fg-table */
.fg-table tbody tr.fg-month-sep { background: linear-gradient(90deg, #eef2ff 0%, #f8fafc 100%); }
.fg-table tbody tr.fg-month-sep:hover { background: linear-gradient(90deg, #eef2ff 0%, #f8fafc 100%); }
.fg-table tbody tr.fg-month-sep td {
  font-weight: 700;
  color: var(--fg-primary);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .78rem;
  padding: 10px 14px;
  border-top: 2px solid var(--fg-primary);
  border-bottom: 1px solid #e5e7eb;
}

/* -------- Legal officer dashboard bits -------- */
.fg-gender-split { display: flex; flex-direction: column; gap: 14px; padding: 4px 2px; }
.fg-gender-row { display: grid; grid-template-columns: 140px 1fr 48px; align-items: center; gap: 10px; }
.fg-gender-label { font-size: .82rem; font-weight: 600; color: var(--fg-text); display: flex; align-items: center; gap: 6px; }
.fg-gender-label .fg-muted { font-weight: 500; color: var(--fg-muted); margin-left: 2px; }
.fg-gender-pct { text-align: right; font-weight: 700; font-size: .85rem; color: var(--fg-text); }
.fg-bar { height: 10px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.fg-bar-fill { height: 100%; border-radius: 999px; transition: width .4s ease; }
.fg-bar-fill.bg-info { background: #0ea5e9; }
.fg-bar-fill.bg-warning { background: #f59e0b; }

.fg-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fg-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; background: #f8fafc; border: 1px solid var(--fg-border); border-radius: 8px; font-size: .85rem; }
.fg-list li strong { color: var(--fg-primary); font-size: .9rem; }
.fg-empty { padding: 18px; text-align: center; color: var(--fg-muted); font-size: .85rem; }



/* === sidebar.css === */
/* Funguka Platform - Sidebar */

/* ── Base ──────────────────────────────────────────────────── */
.fg-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--fg-sidebar-w);
  background: var(--fg-sidebar-bg);
  color: var(--fg-sidebar-text);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: width .25s ease;
  border-right: none;
  overflow: hidden;
}
.fg-main { transition: margin-left .25s ease; }

/* Scrollable body (everything below brand) */
.fg-sidebar-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
.fg-sidebar-body::-webkit-scrollbar { width: 4px; }
.fg-sidebar-body::-webkit-scrollbar-track { background: transparent; }
.fg-sidebar-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 10px; }

/* ── Brand (logo only, centered) ───────────────────────────── */
.fg-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
  position: relative;
  min-height: 64px;
}
.fg-brand-logo {
  width: 160px;
  height: auto;
  max-height: 52px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.2));
}

/* Collapse toggle */
.fg-collapse-btn {
  position: absolute;
  top: 50%; right: 12px;
  transform: translateY(-50%);
  width: 26px; height: 26px;
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: background .15s, color .15s;
  padding: 0;
}
.fg-collapse-btn:hover {
  background: rgba(255,255,255,.15);
  color: #fff;
}

/* ── Search (solid, clear) ─────────────────────────────────── */
.fg-sidebar-search {
  padding: 14px 14px 6px;
}
.fg-sidebar-search-wrap { position: relative; }
.fg-sidebar-search-wrap > i {
  position: absolute; left: 11px; top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: rgba(255,255,255,.5);
  pointer-events: none;
}
.fg-sidebar-search-input {
  width: 100%;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 9px 12px 9px 32px;
  color: #fff;
  font-size: .8rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.fg-sidebar-search-input::placeholder { color: rgba(255,255,255,.4); }
.fg-sidebar-search-input:focus {
  border-color: rgba(255,255,255,.3);
  background: rgba(255,255,255,.12);
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}

/* ── Nav list ──────────────────────────────────────────────── */
.fg-nav {
  list-style: none;
  margin: 0;
  padding: 6px 10px;
  flex: 1;
}

/* Section label */
.fg-nav-section {
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(255,255,255,.4);
  padding: 18px 12px 8px;
  margin: 0;
  font-weight: 700;
  line-height: 1;
  list-style: none;
}
.fg-nav-section:first-child { padding-top: 8px; }

/* ── Nav item ──────────────────────────────────────────────── */
.fg-nav-item { margin: 2px 0; padding: 0; list-style: none; }

.fg-nav-item > a,
.fg-nav-item > .fg-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--fg-sidebar-text);
  border-radius: 8px;
  font-size: .84rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: background .18s, color .18s;
  position: relative;
}
.fg-nav-item > a:hover,
.fg-nav-item > .fg-nav-link:hover {
  background: rgba(255,255,255,.1);
  color: #fff;
}

/* Icon */
.fg-nav-item > a > i:first-child,
.fg-nav-item > .fg-nav-link > i:first-child {
  width: 20px;
  font-size: 15px;
  text-align: center;
  flex-shrink: 0;
  opacity: .85;
  color: inherit;
  transition: opacity .15s;
}
.fg-nav-item > a:hover > i:first-child,
.fg-nav-item > .fg-nav-link:hover > i:first-child { opacity: 1; }

/* Active */
.fg-nav-item.active > a,
.fg-nav-item.active > .fg-nav-link {
  background: rgba(255,255,255,.15);
  color: #fff;
  font-weight: 600;
}
.fg-nav-item.active > a > i:first-child,
.fg-nav-item.active > .fg-nav-link > i:first-child {
  color: #fff;
  opacity: 1;
}

/* ── Badge ─────────────────────────────────────────────────── */
.fg-badge {
  margin-left: auto;
  min-width: 20px; height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #ef4444;
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

/* Assignments badge — rendered by the .fg-badge rule above (red, 10px
   radius, 20px tall), so this class only needs to add the spacing that
   keeps it clear of the trailing chevron on the "All Cases" parent row. */
.fg-assign-badge { margin-right: 6px; }
.fg-assign-badge[hidden] { display: none !important; }

/* ── Chevron ───────────────────────────────────────────────── */
.fg-chevron {
  margin-left: auto !important;
  width: auto !important;
  font-size: 10px !important;
  opacity: .4 !important;
  transition: transform .25s ease;
  flex-shrink: 0;
}
.fg-has-sub.open > .fg-nav-link > .fg-chevron {
  transform: rotate(90deg);
  opacity: .7 !important;
}

/* ── Sub-menu ──────────────────────────────────────────────── */
.fg-sub {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  max-height: 0;
  transition: max-height .3s ease;
}
.fg-has-sub.open > .fg-sub {
  max-height: 250px;
}
.fg-sub .fg-nav-item > a {
  padding: 7px 12px 7px 43px;
  font-size: .78rem;
  color: rgba(255,255,255,.65);
  gap: 0;
}
.fg-sub .fg-nav-item > a:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}
.fg-sub .fg-nav-item.active > a {
  color: var(--fg-sidebar-active-text);
  background: var(--fg-sidebar-active-bg);
}
.fg-sub .fg-nav-item > a::before {
  content: "";
  position: absolute;
  left: 24px; top: 50%;
  transform: translateY(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  transition: background .15s;
}
.fg-sub .fg-nav-item > a:hover::before { background: rgba(255,255,255,.4); }
.fg-sub .fg-nav-item.active > a::before { background: var(--fg-sidebar-active-text); }

/* ── Iconed sub-menu (Preline-inspired, with guide rail) ───────────
   Clean + minimal. A single thin vertical white line on the left
   groups the sub-items under their parent. No dots, no tree stubs.
   Active item still gets a soft pill so the selection reads clearly. */
.fg-sub.fg-sub-iconed {
  position: relative;
  padding: 4px 8px 6px 8px;
  margin-top: 2px;
}
/* The vertical "guide rail" — sits just inside the sub-menu's left edge
   and runs the full height of the sub-list, with faint gradient fades
   at the ends so it feels refined instead of pasted on. */
.fg-sub.fg-sub-iconed::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 6px;
  bottom: 6px;
  width: 1.5px;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0)   0%,
    rgba(255,255,255,.22) 14%,
    rgba(255,255,255,.22) 86%,
    rgba(255,255,255,0)   100%
  );
  border-radius: 2px;
  pointer-events: none;
  display: block;
}
.fg-sub.fg-sub-iconed .fg-nav-item { position: relative; }
/* Active row highlights its own segment of the rail — a small brighter
   bar overlays the thin line just to the left of the pill. */
.fg-sub.fg-sub-iconed .fg-nav-item.active::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 6px;
  bottom: 6px;
  width: 3px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(255,255,255,.35);
  pointer-events: none;
  display: block;
}

.fg-sub.fg-sub-iconed .fg-nav-item > a {
  display: flex;
  align-items: center;
  gap: 12px;                 /* breathing room between icon + label */
  padding: 9px 12px 9px 36px;/* indent so label aligns under parent text */
  font-size: .8rem;
  color: rgba(255,255,255,.62);
  border-radius: 8px;
  transition: background .15s, color .15s;
  position: relative;
}
/* Horizontal branch from the vertical rail to the row's icon. Replaces
   the inherited bullet dot (::before) outright; ::after stays hidden. */
.fg-sub.fg-sub-iconed .fg-nav-item > a::before {
  content: "";
  position: absolute;
  left: 12px;        /* meets the rail (rail sits at x=20 on <ul>) */
  top: 50%;
  width: 22px;       /* stops just before the icon */
  height: 1.5px;
  background: rgba(255,255,255,.22);
  border-radius: 2px;
  transform: translateY(-50%);
  pointer-events: none;
  display: block;
  opacity: 1;
  transition: background .15s;
}
.fg-sub.fg-sub-iconed .fg-nav-item > a:hover::before {
  background: rgba(255,255,255,.45);
}
/* Active item: keep the existing vertical bar (::after on <li>) and
   brighten its horizontal branch to match. */
.fg-sub.fg-sub-iconed .fg-nav-item.active > a::before {
  background: #fff;
}
.fg-sub.fg-sub-iconed .fg-nav-item > a::after { display: none; }

.fg-sub.fg-sub-iconed .fg-nav-item > a:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}
.fg-sub.fg-sub-iconed .fg-nav-item.active > a {
  background: rgba(255,255,255,.1);
  color: #fff;
  font-weight: 500;
}
/* Icon: small + muted so it complements rather than competes with the
   label — the label is what the user reads and clicks. */
.fg-sub.fg-sub-iconed .fg-sub-icon {
  width: 16px;
  font-size: 12px;
  color: currentColor;
  opacity: .55;
  text-align: center;
  flex-shrink: 0;
  transition: opacity .15s;
}
.fg-sub.fg-sub-iconed .fg-nav-item > a:hover .fg-sub-icon,
.fg-sub.fg-sub-iconed .fg-nav-item.active > a .fg-sub-icon { opacity: 1; }

/* ── Footer (WHITE background, slideable) ──────────────────── */
.fg-sidebar-footer {
  background: #fff;
  padding: 12px 14px 14px;
  border-top: none;
  transition: padding .25s ease;
}

.fg-sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 8px;
  transition: background .15s;
  overflow: hidden;
}
.fg-sidebar-user:hover { background: rgba(0,0,0,.04); }

.fg-sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--fg-primary), var(--fg-primary-600));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  overflow: hidden;
}
.fg-sidebar-avatar img { width: 100%; height: 100%; object-fit: cover; }

.fg-sidebar-user-info {
  overflow: hidden;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  transition: opacity .2s ease, max-width .25s ease;
}
.fg-sidebar-user-name {
  font-size: .78rem; font-weight: 600; color: var(--fg-text);
  overflow: hidden; text-overflow: ellipsis;
  line-height: 1.3;
}
.fg-sidebar-user-email {
  font-size: .65rem; color: var(--fg-text-muted);
  overflow: hidden; text-overflow: ellipsis;
}

.fg-sidebar-logout {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fef2f2;
  color: #dc2626;
  text-decoration: none;
  font-weight: 600;
  font-size: .78rem;
  transition: background .2s, color .2s;
  overflow: hidden;
}
.fg-sidebar-logout:hover {
  background: #fee2e2;
  color: #b91c1c;
}
.fg-sidebar-logout > i { font-size: 13px; width: 20px; text-align: center; flex-shrink: 0; }

.fg-sidebar-copy {
  text-align: center;
  font-size: .56rem;
  color: var(--fg-text-soft);
  margin-top: 8px;
}

/* ══ Collapsed (desktop) ══════════════════════════════════════ */
@media (min-width: 993px) {

  .fg-app.sidebar-collapsed .fg-sidebar { width: 68px; }
  .fg-app.sidebar-collapsed .fg-main  { margin-left: 68px; }

  /* Brand — small logo */
  .fg-app.sidebar-collapsed .fg-brand {
    padding: 12px 0;
  }
  .fg-app.sidebar-collapsed .fg-brand-logo { width: 36px; }
  .fg-app.sidebar-collapsed .fg-collapse-btn { display: none; }

  /* Search hidden */
  .fg-app.sidebar-collapsed .fg-sidebar-search { display: none; }

  /* Nav */
  .fg-app.sidebar-collapsed .fg-nav { padding: 6px 8px; }
  .fg-app.sidebar-collapsed .fg-nav-section { display: none; }

  .fg-app.sidebar-collapsed .fg-nav-item > a,
  .fg-app.sidebar-collapsed .fg-nav-item > .fg-nav-link {
    justify-content: center;
    padding: 10px 0;
    gap: 0;
    border-radius: 10px;
  }
  .fg-app.sidebar-collapsed .fg-nav-item > a > span,
  .fg-app.sidebar-collapsed .fg-nav-item > .fg-nav-link > span,
  .fg-app.sidebar-collapsed .fg-chevron { display: none !important; }

  .fg-app.sidebar-collapsed .fg-nav-item > a > i:first-child,
  .fg-app.sidebar-collapsed .fg-nav-item > .fg-nav-link > i:first-child {
    font-size: 17px; width: auto;
  }

  /* Badge → dot. MUST stay scoped to .fg-sidebar — this rule was once
     unscoped and, at viewports ≥993px, collapsed every .fg-badge on the
     page (Status/Sex pills in every data table) into an 8px dot
     position:absolute'd to the corner of the nearest positioned
     ancestor. Columns appeared empty the instant the sidebar was
     collapsed. Keep the .fg-sidebar ancestor. */
  .fg-app.sidebar-collapsed .fg-sidebar .fg-badge {
    position: absolute; top: 4px; right: 6px;
    min-width: 8px; height: 8px; padding: 0; font-size: 0;
  }

  /* ── Sub-menu flyout (appears on hover when collapsed) ───── */
  .fg-app.sidebar-collapsed .fg-has-sub {
    position: relative;
  }
  .fg-app.sidebar-collapsed .fg-sub {
    display: block !important;
    position: absolute;
    left: calc(100% + 6px);
    top: 0;
    min-width: 180px;
    max-height: none;
    background: #1e293b;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 8px 30px rgba(0,0,0,.45);
    z-index: 300;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-8px);
    transition: opacity .15s, transform .15s;
  }
  .fg-app.sidebar-collapsed .fg-has-sub:hover > .fg-sub {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
  }

  /* Flyout header (parent label) */
  .fg-app.sidebar-collapsed .fg-sub::before {
    content: attr(data-parent);
    display: block;
    padding: 4px 10px 6px;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: rgba(255,255,255,.35);
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 4px;
  }

  /* Flyout items reset */
  .fg-app.sidebar-collapsed .fg-sub .fg-nav-item > a {
    padding: 7px 12px;
    font-size: .78rem;
    color: rgba(255,255,255,.65);
    border-radius: 6px;
    white-space: nowrap;
  }
  .fg-app.sidebar-collapsed .fg-sub .fg-nav-item > a::before,
  .fg-app.sidebar-collapsed .fg-sub .fg-nav-item > a::after {
    display: none;
  }
  /* Hide the tree spine + active glow when the sub-menu renders as a
     flyout; flyout padding is different and the tree lines don't align. */
  .fg-app.sidebar-collapsed .fg-sub.fg-sub-iconed::before,
  .fg-app.sidebar-collapsed .fg-sub.fg-sub-iconed .fg-nav-item.active::after {
    display: none;
  }
  .fg-app.sidebar-collapsed .fg-sub.fg-sub-iconed .fg-nav-item > a {
    padding: 7px 12px;
  }
  .fg-app.sidebar-collapsed .fg-sub.fg-sub-iconed .fg-sub-icon {
    width: 18px;
    margin-right: 2px;
  }
  .fg-app.sidebar-collapsed .fg-sub .fg-nav-item > a:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
  }
  .fg-app.sidebar-collapsed .fg-sub .fg-nav-item.active > a {
    background: rgba(59,130,246,.2);
    color: #60a5fa;
  }

  /* Tooltip for regular items (NOT sub-menu parents) */
  .fg-app.sidebar-collapsed .fg-nav-item:not(.fg-has-sub) > a::after,
  .fg-app.sidebar-collapsed .fg-has-sub > .fg-nav-link::after {
    content: attr(data-label);
    position: absolute;
    left: calc(100% + 14px); top: 50%;
    transform: translateY(-50%) translateX(-6px);
    background: #1e293b;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: .74rem; font-weight: 500;
    white-space: nowrap;
    opacity: 0; pointer-events: none;
    transition: opacity .15s, transform .15s;
    z-index: 200;
    box-shadow: 0 4px 20px rgba(0,0,0,.4);
    border: 1px solid rgba(255,255,255,.08);
  }
  .fg-app.sidebar-collapsed .fg-nav-item:not(.fg-has-sub) > a:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
  /* Hide tooltip on parent when flyout is open */
  .fg-app.sidebar-collapsed .fg-has-sub:hover > .fg-nav-link::after {
    opacity: 0 !important;
  }

  /* Footer collapsed — avatar only, logout icon only */
  .fg-app.sidebar-collapsed .fg-sidebar-footer { padding: 10px 8px; }
  .fg-app.sidebar-collapsed .fg-sidebar-user {
    justify-content: center; padding: 6px 0; margin-bottom: 6px;
  }
  .fg-app.sidebar-collapsed .fg-sidebar-user-info {
    max-width: 0; opacity: 0; overflow: hidden;
  }
  .fg-app.sidebar-collapsed .fg-sidebar-avatar { width: 32px; height: 32px; }
  .fg-app.sidebar-collapsed .fg-sidebar-logout {
    justify-content: center; padding: 10px 0; gap: 0;
  }
  .fg-app.sidebar-collapsed .fg-sidebar-logout > span {
    max-width: 0; opacity: 0; overflow: hidden; display: inline-block;
  }
  .fg-app.sidebar-collapsed .fg-sidebar-copy { display: none; }
}

/* ══ Mobile drawer ════════════════════════════════════════════ */
@media (max-width: 992px) {
  .fg-sidebar {
    transform: translateX(-100%);
    transition: transform .3s var(--fg-ease);
    box-shadow: 4px 0 24px rgba(0,0,0,.3);
    border-right: none;
  }
  .fg-sidebar.open { transform: translateX(0); }

  .fg-sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 99;
    opacity: 0; pointer-events: none;
    transition: opacity .3s;
    backdrop-filter: blur(2px);
  }
  .fg-sidebar-backdrop.open { opacity: 1; pointer-events: auto; }

  .fg-collapse-btn { display: none; }
}


/* === topbar.css === */
/* Funguka Platform - Topbar */
.fg-topbar {
  height: var(--fg-topbar-h);
  background: var(--fg-card);
  border-bottom: 1px solid var(--fg-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(8px);
}
.fg-topbar-left { display: flex; align-items: center; gap: 16px; }
.fg-topbar-toggle,
.fg-topbar-expand {
  background: none; border: none; color: var(--fg-text-muted); padding: 8px 10px;
  border-radius: var(--fg-radius-sm);
  cursor: pointer;
  font-size: 15px;
  transition: background-color .15s, color .15s;
  display: none;
  align-items: center; justify-content: center;
}
.fg-topbar-toggle:hover,
.fg-topbar-expand:hover { background: var(--fg-muted); color: var(--fg-text); }

/* Show expand button only when sidebar is collapsed (desktop) */
.fg-app.sidebar-collapsed .fg-topbar-expand { display: inline-flex; }

.fg-search {
  position: relative;
  width: 320px;
  max-width: 40vw;
}
.fg-search input {
  width: 100%;
  border: 1px solid var(--fg-border);
  background: var(--fg-muted);
  border-radius: 999px;
  padding: 9px 16px 9px 40px;
  font-size: .88rem;
  transition: all .2s;
}
.fg-search input:focus {
  outline: none;
  background: var(--fg-card);
  border-color: var(--fg-primary);
  box-shadow: 0 0 0 3px rgba(29,63,143,.12);
}
.fg-search svg,
.fg-search > i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--fg-text-muted);
  font-size: 14px; display: flex; align-items: center; justify-content: center;
}

.fg-topbar-right { display: flex; align-items: center; gap: 8px; }
.fg-icon-btn {
  background: none; border: none; padding: 9px;
  color: var(--fg-text-muted);
  border-radius: var(--fg-radius-sm);
  cursor: pointer;
  position: relative;
  transition: all .2s;
}
.fg-icon-btn:hover { background: var(--fg-primary-50); color: var(--fg-primary); }
.fg-icon-btn svg { width: 20px; height: 20px; }
.fg-icon-btn > i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; font-size: 17px; line-height: 1;
}
.fg-icon-btn .fg-dot {
  position: absolute; top: 7px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--fg-orange);
  border: 2px solid var(--fg-card);
}
/* Numeric unread count on the bell */
.fg-bell { position: relative; }
.fg-bell-count {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 20px; height: 20px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  color: #fff;
  font-size: 11px; font-weight: 800; line-height: 1;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(220, 38, 38, .45), 0 0 0 1px rgba(0, 0, 0, .04);
  pointer-events: none;
  transform-origin: top center;
  letter-spacing: -.01em;
}
.fg-bell-count.is-pulse {
  animation: fgBellPulse .6s ease-out;
}
@keyframes fgBellPulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.fg-bell.has-new > i {
  animation: fgBellShake .9s ease-in-out;
}
@keyframes fgBellShake {
  0%,100% { transform: rotate(0); }
  15% { transform: rotate(-18deg); }
  30% { transform: rotate(14deg); }
  45% { transform: rotate(-10deg); }
  60% { transform: rotate(6deg); }
  75% { transform: rotate(-3deg); }
}

.fg-user {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
}
.fg-user:hover { background: var(--fg-primary-50); }
.fg-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--fg-primary), var(--fg-orange));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
}
.fg-user-name { font-size: .88rem; font-weight: 600; line-height: 1.1; }
.fg-user-role { font-size: .72rem; color: var(--fg-text-muted); }

@media (max-width: 992px) {
  .fg-topbar { padding: 0 16px; }
  .fg-topbar-toggle { display: inline-flex; }
  .fg-topbar-expand { display: none !important; }
  .fg-search { width: 180px; }
  .fg-user-meta { display: none; }
}


/* === loader.css === */
/* ═══════════════════════════════════════════════════════════════
   Funguka AppLoader — matches mobile AppLoader.tsx
   Outer ring spins clockwise, inner ring spins opposite,
   brand-blue circle pulses with WiLDAF logo inside.
   ═══════════════════════════════════════════════════════════════ */

.fg-loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity .2s ease;
}
.fg-loader-overlay.is-visible {
  display: flex;
  opacity: 1;
}

.fg-loader {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Outer arc — clockwise, 1.1s/turn */
.fg-loader::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 5px solid #1D3F8F;
  border-top-color: transparent;
  border-right-color: rgba(29, 63, 143, .33);
  animation: fg-spin 1.1s linear infinite;
}

/* Inner arc — counter-clockwise, 1.7s/turn */
.fg-loader::after {
  content: "";
  position: absolute;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 4px solid transparent;
  border-bottom-color: rgba(29, 63, 143, .55);
  border-left-color: rgba(29, 63, 143, .27);
  animation: fg-spin-rev 1.7s linear infinite;
}

/* Pulsing brand circle with logo */
.fg-loader-core {
  position: relative;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #1D3F8F;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
  animation: fg-pulse 1.4s ease-in-out infinite;
  z-index: 1;
}
.fg-loader-core img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* Inline variant (no overlay) — drop inside cards while refreshing */
.fg-loader.fg-loader-sm { width: 56px; height: 56px; }
.fg-loader.fg-loader-sm::before { border-width: 3px; }
.fg-loader.fg-loader-sm::after { width: 38px; height: 38px; border-width: 2.5px; }
.fg-loader.fg-loader-sm .fg-loader-core { width: 28px; height: 28px; }
.fg-loader.fg-loader-sm .fg-loader-core img { width: 20px; height: 20px; }

@keyframes fg-spin {
  to { transform: rotate(360deg); }
}
@keyframes fg-spin-rev {
  to { transform: rotate(-360deg); }
}
@keyframes fg-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}


/* === notifications.css === */
/* ═══════════════════════════════════════════════════════════════
   Funguka Notifications — slide-in drawer (Hostinger style)
   + legacy toast styles
   ═══════════════════════════════════════════════════════════════ */

/* ── Toast (live SSE) ───────────────────────────────────────── */
.fg-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  min-width: 280px;
  max-width: 360px;
  background: #fff;
  border: 1px solid var(--fg-border, #e5e7eb);
  border-left: 4px solid #1D3F8F;
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
  z-index: 10000;
  animation: fg-toast-in .35s ease;
}
.fg-toast.removing { animation: fg-toast-out .35s ease forwards; }
.fg-toast-title { font-weight: 700; font-size: .92rem; color: #0f172a; margin-bottom: 4px; }
.fg-toast-body  { font-size: .85rem; color: #475569; line-height: 1.4; }
@keyframes fg-toast-in  { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fg-toast-out { to { opacity: 0; transform: translateY(20px); } }

/* ── Backdrop ───────────────────────────────────────────────── */
.fg-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 1090;
}
.fg-drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Drawer panel ───────────────────────────────────────────── */
.fg-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 100vw;
  background: #fff;
  box-shadow: -16px 0 40px rgba(15, 23, 42, .18);
  transform: translateX(105%);
  transition: transform .32s cubic-bezier(.22, 1, .36, 1);
  z-index: 1100;
  display: flex;
  flex-direction: column;
}
.fg-drawer.is-open {
  transform: translateX(0);
}

.fg-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid #eef0f4;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}
.fg-drawer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.02rem;
  font-weight: 700;
  color: #0f172a;
}
.fg-drawer-title > i {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(29, 63, 143, .1);
  color: #1D3F8F;
  font-size: 14px;
}
.fg-drawer-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: #ef4444;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
}
.fg-drawer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fg-drawer-mark,
.fg-drawer-close {
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background-color .15s, color .15s;
}
.fg-drawer-mark:hover,
.fg-drawer-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.fg-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}
.fg-drawer-body::-webkit-scrollbar { width: 6px; }
.fg-drawer-body::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }

.fg-drawer-loading {
  display: flex;
  justify-content: center;
  padding: 60px 0;
}

.fg-drawer-empty {
  text-align: center;
  padding: 60px 24px;
  color: #94a3b8;
}
.fg-drawer-empty i {
  font-size: 38px;
  margin-bottom: 12px;
  display: block;
  color: #cbd5e1;
}
.fg-drawer-empty p { margin: 0; font-size: .9rem; }

.fg-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background-color .15s;
  position: relative;
}
.fg-notif-item:hover { background: #f8fafc; }
.fg-notif-item.is-unread { background: rgba(29, 63, 143, .04); }
.fg-notif-item.is-unread::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1D3F8F;
  transform: translateY(-50%);
}
.fg-notif-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(29, 63, 143, .1);
  color: #1D3F8F;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.fg-notif-icon.type-form     { background: rgba(245, 158, 11, .12); color: #d97706; }
.fg-notif-icon.type-assign   { background: rgba(16, 185, 129, .12); color: #059669; }
.fg-notif-icon.type-warning  { background: rgba(239, 68, 68, .12);  color: #dc2626; }
.fg-notif-content { flex: 1; min-width: 0; }
.fg-notif-title {
  font-size: .9rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 3px;
  line-height: 1.35;
}
.fg-notif-body {
  font-size: .8rem;
  color: #64748b;
  line-height: 1.4;
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.fg-notif-time {
  font-size: .72rem;
  color: #94a3b8;
}

.fg-drawer-foot {
  padding: 14px 20px;
  border-top: 1px solid #eef0f4;
  background: #f8fafc;
}
.fg-drawer-viewall {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  color: #1D3F8F;
  font-weight: 600;
  font-size: .85rem;
  text-decoration: none;
  transition: all .15s;
}
.fg-drawer-viewall:hover {
  background: #1D3F8F;
  color: #fff;
  border-color: #1D3F8F;
}

/* ── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 540px) {
  .fg-drawer { width: 100vw; }
}


/* === animations.css === */
/* Funguka Platform - Animations (success/failure modals + transitions) */
@keyframes fg-fade-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes fg-fade-out  { from { opacity: 1; } to { opacity: 0; } }
@keyframes fg-slide-up  { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fg-slide-down{ from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fg-pop       { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }

/* --- Tick modal --- */
.fg-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 9999;
  animation: fg-fade-in .3s var(--fg-ease);
}
.fg-modal-overlay.show { display: flex; }
.fg-modal-overlay.hide { animation: fg-fade-out .25s var(--fg-ease) forwards; }

.fg-modal {
  background: var(--fg-card);
  border-radius: 20px;
  padding: 36px 32px 28px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: var(--fg-shadow-lg);
  animation: fg-pop .5s var(--fg-ease);
}
.fg-modal-icon {
  width: 84px; height: 84px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.fg-modal.success .fg-modal-icon { background: var(--fg-success-bg); }
.fg-modal.error   .fg-modal-icon { background: var(--fg-danger-bg); }
.fg-modal.confirm .fg-modal-icon { background: rgba(249, 115, 22, .14); }
.fg-modal.confirm.danger .fg-modal-icon { background: var(--fg-danger-bg); }
.fg-modal-icon svg { width: 48px; height: 48px; }
.fg-modal.success .fg-modal-icon svg { color: var(--fg-success); }
.fg-modal.error   .fg-modal-icon svg { color: var(--fg-danger); }
.fg-modal.confirm .fg-modal-icon svg { color: #F97316; }
.fg-modal.confirm.danger .fg-modal-icon svg { color: var(--fg-danger); }

/* Warning exclamation icon used by confirm modal. Uses a stroked line + dot
   under the same stroke-dash animation as the check/cross marks. */
.fg-warn-mark {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke-width: 5;
  stroke-linecap: round;
  fill: none;
  animation: fg-stroke .5s .5s var(--fg-ease) forwards;
}

.fg-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.fg-modal-actions .btn { min-width: 120px; }
.fg-modal-actions .btn-ghost {
  background: transparent;
  color: var(--fg-text-muted);
  border: 1px solid rgba(148, 163, 184, .35);
}
.fg-modal-actions .btn-ghost:hover { background: rgba(148, 163, 184, .12); }
.fg-modal-actions .btn-danger {
  background: var(--fg-danger);
  color: #fff;
  border: none;
}
.fg-modal-actions .btn-danger:hover { filter: brightness(.94); }

/* Animated check / cross drawing */
.fg-check-circle, .fg-cross-circle {
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  stroke-width: 3;
  stroke-miterlimit: 10;
  fill: none;
  animation: fg-stroke .7s var(--fg-ease) forwards;
}
.fg-check-mark, .fg-cross-mark {
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  stroke-width: 4;
  stroke-linecap: round;
  fill: none;
  animation: fg-stroke .4s .7s var(--fg-ease) forwards;
}
@keyframes fg-stroke { to { stroke-dashoffset: 0; } }

.fg-modal h3 { margin: 0 0 8px; font-size: 1.25rem; }
.fg-modal p  { margin: 0 0 20px; color: var(--fg-text-muted); font-size: .92rem; }
.fg-modal .btn { min-width: 120px; }

/* Loader */
.fg-spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(29,63,143,.15);
  border-top-color: var(--fg-primary);
  border-radius: 50%;
  animation: fg-spin .8s linear infinite;
  display: inline-block;
}
@keyframes fg-spin { to { transform: rotate(360deg); } }

/* Page-enter animation */
.fg-page-enter { animation: fg-slide-up .5s var(--fg-ease); }

/* Notification toast (live from SSE) */
.fg-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--fg-card);
  padding: 14px 18px;
  border-radius: var(--fg-radius);
  box-shadow: var(--fg-shadow-lg);
  border-left: 4px solid var(--fg-primary);
  max-width: 360px;
  z-index: 9998;
  animation: fg-slide-in-right .5s var(--fg-ease);
}
@keyframes fg-slide-in-right { from { transform: translateX(400px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.fg-toast.removing { animation: fg-slide-out-right .4s var(--fg-ease) forwards; }
@keyframes fg-slide-out-right { to { transform: translateX(400px); opacity: 0; } }
.fg-toast-title { font-weight: 600; font-size: .92rem; }
.fg-toast-body  { font-size: .82rem; color: var(--fg-text-muted); margin-top: 2px; }


