/* === 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;
  --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);
}


/* === 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 */
.fg-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.fg-page-head h1 { font-size: 1.6rem; margin: 0 0 4px; }
.fg-page-head p  { color: var(--fg-text-muted); margin: 0; }


/* === 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) -------- */
.fg-table {
  width: 100%;
  background: var(--fg-card);
  border-collapse: collapse;
  border: 1px solid var(--fg-border);
  border-radius: var(--fg-radius-lg);
  overflow: hidden;
}
.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: stack title + action button vertically on small screens */
.fg-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.fg-page-head h1 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); margin: 0; }
.fg-page-head p  { margin: 2px 0 0; color: var(--fg-text-muted); font-size: .85rem; }
@media (max-width: 575.98px) {
  .fg-page-head { flex-direction: column; align-items: stretch; }
  .fg-page-head .btn-add-primary,
  .fg-page-head .fg-badge { width: 100%; justify-content: center; }
}

/* 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 — first line of defence */
.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; }
}

/* -------- Badges -------- */
.fg-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.4;
}
.fg-badge.success { background: var(--fg-success-bg); color: var(--fg-success); }
.fg-badge.danger  { background: var(--fg-danger-bg);  color: var(--fg-danger); }
.fg-badge.warning { background: var(--fg-warning-bg); color: var(--fg-warning); }
.fg-badge.info    { background: var(--fg-info-bg);    color: var(--fg-info); }
.fg-badge.primary { background: var(--fg-primary-100); color: var(--fg-primary); }

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

/* ── 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); }

/* ── 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 */
  .fg-app.sidebar-collapsed .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 {
    display: none;
  }
  .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; }


