/* =====================================================================
   Hernz Nueva Ecija — Admin UI
   Layout: fixed navy sidebar + white top bar + card grid (Unity Life style)
   Brand: Hernz navy + gold, blue for primary actions
   ===================================================================== */
:root {
  --navy-950: #0a1a3a;
  --navy-900: #0f2452;
  --navy-800: #16306a;
  --navy-700: #1f3d80;
  --gold: #e9a91a;
  --gold-soft: #fff4dc;
  --blue: #1d63d8;
  --blue-600: #1854bb;
  --blue-soft: #e8f0fd;
  --green: #16a36b;
  --green-soft: #e3f6ee;
  --orange: #f08a1c;
  --orange-soft: #fff0e0;
  --purple: #7357e8;
  --purple-soft: #efebfd;
  --red: #dc3545;
  --red-soft: #fde8ea;
  --teal: #13a7b5;
  --gray: #8a95a8;
  --bg: #f3f6fb;
  --card: #ffffff;
  --line: #e4e9f2;
  --line-soft: #eef2f8;
  --text: #17233d;
  --text-2: #3b4863;
  --muted: #7182a0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 36, 82, .04), 0 4px 16px rgba(16, 36, 82, .05);
  --font-head: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-body: "DM Sans", "Segoe UI", system-ui, sans-serif;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; color: var(--text); text-wrap: balance; }
img { max-width: 100%; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------------------------------------------------------- SHELL */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
  color: #cdd8f0; display: flex; flex-direction: column;
  transition: transform .2s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; color: #fff; }
.brand img { width: 46px; height: auto; }
.brand .brand-name { font-family: var(--font-head); font-weight: 700; font-size: 21px; letter-spacing: .02em; line-height: 1; }
.brand .brand-sub { font-size: 10.5px; letter-spacing: .32em; color: var(--gold); margin-top: 5px; font-weight: 600; }
.brand:hover { text-decoration: none; }

.nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: #7f93bd; padding: 16px 10px 6px; text-transform: uppercase; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 9px;
  color: #d5def2; font-weight: 500; font-size: 13.5px; margin: 2px 0;
}
.nav-link svg { width: 19px; height: 19px; flex: none; opacity: .9; }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(29, 99, 216, .35); }
.nav-link .count {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--gold); color: var(--navy-950); font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.nav-link.active .count { background: #fff; color: var(--blue); }

.sidebar-banner {
  margin: 8px 14px 16px; border-radius: 12px; padding: 16px 16px 58px; flex: none; position: relative; overflow: hidden;
  background:
    radial-gradient(120% 80% at 80% 0%, rgba(233,169,26,.45), transparent 60%),
    linear-gradient(160deg, #1f3d80 0%, #0f2452 70%);
  color: #fff; font-family: var(--font-head); font-weight: 600; font-size: 15px; line-height: 1.35;
}
.sidebar-banner small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 11.5px; color: #c8d4ee; margin-top: 6px; }
.sidebar-banner svg.fields { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 64px; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 68px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 28px;
}
.icon-btn.menu-btn { display: none; }
.search { flex: 1; max-width: 640px; position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); }
.search input {
  width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px 0 42px;
  font: inherit; color: var(--text); background: #fff;
}
.search input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2); background: transparent; border: 0; cursor: pointer;
}
.icon-btn:hover { background: var(--bg); text-decoration: none; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .dot {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; position: relative; cursor: pointer; border: 0; background: none; font: inherit; color: inherit; text-align: left; }
.user-chip:hover { background: var(--bg); }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 600; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--navy-700), var(--blue));
}
.avatar.sm { width: 34px; height: 34px; font-size: 12px; }
.user-chip .who strong { display: block; font-size: 13.5px; }
.user-chip .who span { font-size: 11.5px; color: var(--muted); }
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(16,36,82,.14); padding: 6px; z-index: 50;
}
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 8px; color: var(--text);
  font: inherit; border: 0; background: none; cursor: pointer; text-align: left;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg); text-decoration: none; }
.dropdown-menu svg { width: 17px; height: 17px; color: var(--muted); }
.dropdown-menu .head { padding: 10px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.dropdown-menu .notif { align-items: flex-start; }
.dropdown-menu .notif small { display: block; color: var(--muted); font-size: 11.5px; }

.content { padding: 26px 28px 40px; flex: 1; }
.footer { padding: 16px 28px 24px; color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------- PAGE HEADER */
.page-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .ph-icon { width: 30px; height: 30px; color: var(--navy-800); margin-top: 3px; }
.page-head h1 { font-size: 25px; font-weight: 700; }
.page-head p { margin: 4px 0 0; color: var(--blue); font-size: 14px; }
.page-head .ph-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-date { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13.5px; }
.page-date svg { width: 17px; height: 17px; color: var(--navy-800); }
.breadcrumb { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--muted); }

/* ---------------------------------------------------------- GRID */
.grid { display: grid; gap: 18px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.g-split { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.g-dash { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) 340px; align-items: start; }
.span-2 { grid-column: span 2; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.mt { margin-top: 18px; }

/* ---------------------------------------------------------- CARDS */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 6px; flex-wrap: wrap; }
.card-head svg.ch-icon { width: 20px; height: 20px; color: var(--navy-800); }
.card-head h3 { font-size: 15.5px; font-weight: 600; }
.card-head .ch-right { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: 12.5px; }
.card-body { padding: 14px 20px 20px; }
.card-body.flush { padding: 6px 0 4px; }
.card.tinted-blue { background: linear-gradient(180deg, #f6f9ff, #fff); }

.stat { display: flex; gap: 16px; padding: 20px; align-items: flex-start; }
.stat-icon {
  width: 54px; height: 54px; border-radius: 13px; flex: none; display: flex; align-items: center; justify-content: center; color: #fff;
}
.stat-icon svg { width: 27px; height: 27px; }
.si-blue { background: linear-gradient(135deg, #3b8bff, #1d5fd8); box-shadow: 0 8px 18px rgba(29,95,216,.28); }
.si-green { background: linear-gradient(135deg, #2fcf8a, #12a065); box-shadow: 0 8px 18px rgba(18,160,101,.28); }
.si-orange { background: linear-gradient(135deg, #ffb347, #f07c12); box-shadow: 0 8px 18px rgba(240,124,18,.28); }
.si-purple { background: linear-gradient(135deg, #9a82ff, #6a4fe0); box-shadow: 0 8px 18px rgba(106,79,224,.28); }
.si-gold { background: linear-gradient(135deg, #f5c04a, #dc9a0e); box-shadow: 0 8px 18px rgba(220,154,14,.28); }
.si-red { background: linear-gradient(135deg, #ff7a85, #dc3545); box-shadow: 0 8px 18px rgba(220,53,69,.25); }
.si-teal { background: linear-gradient(135deg, #3fd0dc, #0f9aa8); box-shadow: 0 8px 18px rgba(15,154,168,.25); }
.si-navy { background: linear-gradient(135deg, #2f4f99, #12264f); box-shadow: 0 8px 18px rgba(18,38,79,.25); }
.stat .label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.stat .value { font-family: var(--font-head); font-size: 25px; font-weight: 700; margin: 4px 0 6px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat .delta { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.stat .delta svg { width: 14px; height: 14px; }
.stat .vs { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }
.up { color: var(--green); }
.down { color: var(--red); }
.stat.bg-blue { background: linear-gradient(180deg, #f5f9ff, #fff); }
.stat.bg-green { background: linear-gradient(180deg, #f3fbf7, #fff); }
.stat.bg-orange { background: linear-gradient(180deg, #fff8ef, #fff); }
.stat.bg-purple { background: linear-gradient(180deg, #f7f5ff, #fff); }

.mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.mini { border: 1px solid var(--line); border-radius: 11px; padding: 14px; background: #fbfcfe; min-width: 0; }
.mini .mi-icon { width: 34px; height: 34px; border-radius: 9px; color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.mini .mi-icon svg { width: 18px; height: 18px; }
.mini .ml { font-size: 12px; color: var(--text-2); }
.mini .mv { font-family: var(--font-head); font-weight: 700; font-size: 17px; margin: 3px 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------------------------------------------------------- TABLES */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); background: #f6f8fc;
  padding: 11px 16px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--text-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafcff; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .strong { color: var(--text); font-weight: 600; }
.table .cell-user { display: flex; align-items: center; gap: 10px; }
.table .cell-user small { display: block; color: var(--muted); font-size: 11.5px; }
.empty { text-align: center; padding: 38px 20px; color: var(--muted); }
.empty svg { width: 38px; height: 38px; color: #c2cbdb; margin-bottom: 8px; }

/* ---------------------------------------------------------- PILLS */
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  white-space: nowrap; line-height: 1.3;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.p-green { background: var(--green-soft); color: #0e8053; }
.p-orange { background: var(--orange-soft); color: #c4630a; }
.p-blue { background: var(--blue-soft); color: var(--blue-600); }
.p-red { background: var(--red-soft); color: #bb2533; }
.p-gray { background: #eef1f6; color: #5e6b82; }
.p-purple { background: var(--purple-soft); color: #5a3fd0; }
.p-gold { background: var(--gold-soft); color: #9a6a00; }
.p-teal { background: #e1f6f8; color: #0b7f8a; }
.tag { display: inline-block; padding: 3px 8px; border-radius: 6px; background: #eef2f8; font-size: 11.5px; color: var(--text-2); font-weight: 500; }

/* ---------------------------------------------------------- BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 9px;
  font: 600 13px var(--font-body); border: 1px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); }
.btn-navy { background: var(--navy-900); color: #fff; }
.btn-navy:hover { background: var(--navy-800); }
.btn-gold { background: var(--gold); color: var(--navy-950); }
.btn-gold:hover { background: #d99a0f; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { background: #0f8b59; }
.btn-danger { background: #fff; color: var(--red); border-color: #f3c3c8; }
.btn-danger:hover { background: var(--red-soft); }
.btn-light { background: #fff; color: var(--text); border-color: var(--line); }
.btn-light:hover { background: var(--bg); }
.btn-ghost { background: transparent; color: var(--blue); padding: 0 8px; }
.btn-ghost:hover { background: var(--blue-soft); }
.btn-sm { height: 31px; padding: 0 11px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.link-sm { font-size: 12.5px; font-weight: 500; }

/* ---------------------------------------------------------- QUICK ACTIONS */
.qa-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.qa {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center;
  border: 1px solid var(--line); border-radius: 11px; padding: 18px 8px; color: var(--text-2); font-size: 12px; font-weight: 500;
  background: #fbfcff; min-height: 96px;
}
.qa svg { width: 26px; height: 26px; color: var(--blue); }
.qa:hover { border-color: #b9cdf3; background: var(--blue-soft); text-decoration: none; color: var(--text); }

/* ---------------------------------------------------------- ACTIVITY FEED */
.feed { list-style: none; margin: 0; padding: 0 20px 8px; }
.feed li { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.feed li:last-child { border-bottom: 0; }
.feed .f-icon { width: 38px; height: 38px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; color: #fff; }
.feed .f-icon svg { width: 18px; height: 18px; }
.feed .f-title { font-size: 13px; color: var(--text); font-weight: 500; line-height: 1.35; }
.feed .f-meta { font-size: 11.5px; color: var(--blue); margin-top: 2px; }
.feed .f-time { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ---------------------------------------------------------- CHARTS / LEGENDS */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.chart-box { position: relative; height: 260px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { position: relative; width: 170px; height: 170px; flex: none; }
.donut .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.donut .center strong { font-family: var(--font-head); font-size: 24px; font-variant-numeric: tabular-nums; }
.donut .center span { font-size: 12px; color: var(--text-2); }
.donut-legend { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.donut-legend li { display: flex; gap: 10px; font-size: 13px; color: var(--text); }
.donut-legend i { width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; flex: none; }
.donut-legend small { display: block; color: var(--muted); font-size: 12px; }

/* ---------------------------------------------------------- PROMO / BANNER */
.promo {
  border-radius: var(--radius); overflow: hidden; color: #fff; padding: 22px; position: relative; min-height: 180px;
  background:
    radial-gradient(90% 70% at 85% 35%, rgba(255, 196, 77, .75), rgba(233, 140, 26, .25) 45%, transparent 70%),
    linear-gradient(135deg, #12264f 0%, #1f3d80 55%, #304f9a 100%);
}
.promo h3 { color: #fff; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.promo h3 img { width: 34px; }
.promo p { margin: 12px 0 18px; font-size: 13.5px; color: #e3eafa; max-width: 230px; line-height: 1.5; }
.promo svg.fields { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 56px; }

/* ---------------------------------------------------------- FORMS */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.input, .select, textarea.input {
  width: 100%; height: 40px; border: 1px solid #d6deeb; border-radius: 9px; padding: 0 12px; font: inherit; color: var(--text); background: #fff;
}
textarea.input { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
.input.is-invalid, .select.is-invalid { border-color: var(--red); }
.error { color: var(--red); font-size: 12px; margin-top: 5px; }
.input-group { display: flex; }
.input-group .addon { display: flex; align-items: center; padding: 0 12px; border: 1px solid #d6deeb; border-right: 0; border-radius: 9px 0 0 9px; background: #f6f8fc; color: var(--text-2); font-weight: 600; }
.input-group .input { border-radius: 0 9px 9px 0; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--text-2); }
.check input { margin-top: 3px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; flex-wrap: wrap; }
.section-title { font-family: var(--font-head); font-size: 13.5px; font-weight: 600; color: var(--navy-800); margin: 4px 0 -2px; grid-column: 1 / -1; padding-top: 6px; }

/* Filter bar */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line-soft); }
.filters .input, .filters .select { height: 36px; width: auto; min-width: 150px; font-size: 13px; }
.filters .grow { flex: 1; min-width: 200px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 14px 20px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--line); color: var(--text-2); background: #fff;
}
.chip b { font-weight: 700; color: var(--muted); font-size: 11.5px; }
.chip:hover { border-color: #b9cdf3; text-decoration: none; }
.chip.on { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }
.chip.on b { color: var(--gold); }

/* ---------------------------------------------------------- DETAIL LISTS */
.dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 11px 16px; font-size: 13.5px; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.amount-hero { font-family: var(--font-head); font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 18px 26px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.timeline li.done::before { background: var(--green); }
.timeline li.now::before { background: var(--gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.timeline li.bad::before { background: var(--red); }
.timeline li::after { content: ""; position: absolute; left: 10px; top: 18px; bottom: 0; width: 2px; background: var(--line-soft); }
.timeline li:last-child::after { display: none; }
.timeline small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.progress { height: 8px; background: var(--line-soft); border-radius: 6px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #4f8ff0); border-radius: 6px; }

/* ---------------------------------------------------------- ALERTS & TOASTS */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; font-size: 13.5px; margin-bottom: 18px; border: 1px solid; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-success { background: #ecfaf3; border-color: #bfe9d4; color: #0e6e47; }
.alert-error { background: #fdeef0; border-color: #f5c7cc; color: #a31f2c; }
.alert-warn { background: #fff7e8; border-color: #f5dcaa; color: #8a5a00; }
.alert-info { background: var(--blue-soft); border-color: #c5d8f8; color: var(--blue-600); }
.alert ul { margin: 0; padding-left: 18px; }

/* ---------------------------------------------------------- DIALOG */
dialog.modal { border: 0; border-radius: 14px; padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(10, 26, 58, .25); color: var(--text); }
dialog.modal::backdrop { background: rgba(10, 26, 58, .45); }
.modal-head { display: flex; align-items: center; padding: 18px 22px 8px; }
.modal-head h3 { font-size: 16.5px; }
.modal-head button { margin-left: auto; }
.modal-body { padding: 8px 22px 6px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px 20px; }

/* ---------------------------------------------------------- PAGINATION */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.pagination .pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pagination a, .pagination span.pg { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; border: 1px solid var(--line); color: var(--text-2); background: #fff; }
.pagination a:hover { border-color: var(--blue); text-decoration: none; }
.pagination .current { background: var(--blue); border-color: var(--blue); color: #fff; }
.pagination .disabled { opacity: .45; }

/* ---------------------------------------------------------- AUTH */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background:
    radial-gradient(70% 50% at 75% 30%, rgba(255, 190, 70, .55), transparent 70%),
    linear-gradient(160deg, #1f3d80 0%, #0f2452 55%, #0a1a3a 100%);
}
.auth-art .logo-white { width: 180px; }
.auth-art h2 { color: #fff; font-size: 34px; line-height: 1.2; max-width: 440px; }
.auth-art p { color: #cfdaf2; max-width: 420px; font-size: 15px; line-height: 1.6; }
.auth-art svg.fields { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 160px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .logo { width: 150px; display: block; margin: 0 auto 14px; }
.auth-card h1 { font-size: 24px; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 6px 0 26px; }
.auth-card .field { margin-bottom: 14px; }
.auth-card.wide { max-width: 620px; }

/* ---------------------------------------------------------- PORTAL */
.wallet-card {
  border-radius: 16px; padding: 24px; color: #fff; position: relative; overflow: hidden; min-height: 190px;
  background:
    radial-gradient(60% 80% at 100% 0%, rgba(233,169,26,.55), transparent 60%),
    linear-gradient(135deg, #12264f, #1f3d80 70%, #2b55a8);
}
.wallet-card .wc-label { font-size: 13px; color: #c9d6f2; }
.wallet-card .wc-amount { font-family: var(--font-head); font-size: 36px; font-weight: 700; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.wallet-card .wc-code { font-size: 12.5px; color: #c9d6f2; letter-spacing: .08em; }
.wallet-card .wc-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.wallet-card .btn-light { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }
.wallet-card .btn-light:hover { background: rgba(255,255,255,.2); }
.pkg-card { display: flex; flex-direction: column; }
.pkg-card .pkg-price { font-family: var(--font-head); font-size: 26px; font-weight: 700; color: var(--navy-900); }
.pkg-card ul { padding-left: 18px; margin: 10px 0; color: var(--text-2); font-size: 13px; line-height: 1.7; }
.pkg-card .pkg-foot { margin-top: auto; padding: 16px 20px 20px; }

/* ---------------------------------------------------------- ACCOUNT TYPES */
.acct-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.acct-type { display: flex; gap: 10px; align-items: flex-start; border: 1px solid #d6deeb; border-radius: 10px; padding: 12px 14px; cursor: pointer; background: #fff; }
.acct-type:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 1px var(--blue); }
.acct-type input { margin-top: 3px; }
.acct-type strong { display: block; font-size: 13.5px; color: var(--text); }
.acct-type small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; line-height: 1.4; }
.type-fkp { background: #e1f6f8; color: #0b7f8a; }
.type-retailer { background: var(--gold-soft); color: #9a6a00; }
.type-regular { background: #eef1f6; color: #5e6b82; }

/* ---------------------------------------------------------- MATRIX */
.matrix td, .matrix th { text-align: center; }
.matrix td:first-child, .matrix th:first-child { text-align: left; }
.yes { color: var(--green); font-weight: 700; }
.no { color: #c5cdda; }

/* ---------------------------------------------------------- RESPONSIVE */
@media (max-height: 940px) { .sidebar-banner { display: none; } }
.overlay { display: none; }
@media (max-width: 1360px) {
  .g-dash { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .g-dash > .side-col { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
}
@media (max-width: 1100px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .overlay.open { display: block; position: fixed; inset: 0; background: rgba(10,26,58,.4); z-index: 35; }
  .main { margin-left: 0; }
  .icon-btn.menu-btn { display: inline-flex; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .content { padding: 18px max(16px, env(safe-area-inset-left, 0px)) 32px max(16px, env(safe-area-inset-right, 0px)); }
  .topbar { padding: 0 12px; gap: 8px; }
  .user-chip .who, .user-chip .chev { display: none; }
  .g-4, .g-3, .g-2, .g-split, .g-dash, .g-dash > .side-col { grid-template-columns: minmax(0, 1fr); }
  .donut-wrap { justify-content: center; }
  .span-2 { grid-column: auto; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .dl { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .dl dd { margin-bottom: 10px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .qa-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-head h1 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Products grouped by product line, flavors listed under each */
.flavor-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; min-width: 210px; }
.flavor-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px dashed var(--line-soft); }
.flavor-list li:last-child { border-bottom: 0; }
.flavor-list a { color: var(--text); }
.flavor-list a:hover { color: var(--blue); }
.flavor-list .fl-stock { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; color: var(--text-2); font-weight: 600; white-space: nowrap; }
.flavor-list .pill { font-size: 10.5px; padding: 1px 7px; }
.product-table td { vertical-align: top; }
#pickerTable tr.picker-group td { background: #f6f8fc; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
#pickerTable tr.picker-group:hover td { background: #f6f8fc; }
#pickerTable tr.picker-flavor td:first-child { padding-left: 30px; }

/* Products list: click a product to open its details */
.product-table tr.product-row { cursor: pointer; }
.product-table tr.product-row:hover td { background: #f3f7fe; }
.product-table tr.product-row:focus-visible td { background: #f3f7fe; }
.product-table tr.product-row td { vertical-align: middle; }
.product-table tr.product-row svg { width: 18px; height: 18px; vertical-align: middle; }
dialog.modal.modal-lg { width: min(640px, calc(100vw - 32px)); }
.modal-table { border: 1px solid var(--line); border-radius: 10px; max-height: 50vh; overflow: auto; }
.modal-table .table td, .modal-table .table th { padding: 9px 12px; }

/* Product photos (admin) */
.ph-cell { display: flex; align-items: center; gap: 10px; }
.ph-thumb { width: 46px; height: 46px; border-radius: 10px; overflow: hidden; flex: none; display: grid; place-items: center; background: #f3f6fb; border: 1px solid var(--line); }
.ph-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-thumb svg { width: 18px; height: 18px; color: #b4c0d6; }
.ph-actions { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.ph-actions form { margin: 0; }
.ph-btn { font: inherit; font-size: 12px; font-weight: 600; color: var(--blue); background: none; border: 0; padding: 0; cursor: pointer; }
.ph-btn:hover { text-decoration: underline; }
.ph-remove { color: var(--muted); }
.ph-remove:hover { color: var(--red, #d33); }
dialog.modal.modal-lg { width: min(720px, calc(100vw - 32px)); }
.ph-large { width: 100%; max-width: 260px; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #f3f6fb; border: 1px solid var(--line); display: grid; place-items: center; }
.ph-large img { width: 100%; height: 100%; object-fit: cover; }
.ph-large svg { width: 34px; height: 34px; color: #b4c0d6; }

/* Logistics */
.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--gold); color: var(--navy-950); font-size: 11px; font-weight: 700; }
a.lg-stat { color: inherit; text-decoration: none; border: 2px solid transparent; transition: border-color .15s; }
a.lg-stat:hover { border-color: var(--line); text-decoration: none; }
a.lg-stat.on { border-color: var(--blue); }

/* FKP onboarding */
.flow-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 6px; }
.flow-step { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; color: var(--text-2); text-decoration: none; position: relative; }
.flow-step:hover { background: #f6f8fc; text-decoration: none; }
.flow-step.on { background: var(--blue-soft); }
.flow-step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--navy-900); color: var(--gold); font-weight: 700; font-size: 12px; }
.flow-step strong { display: block; font-size: 13px; color: var(--text); line-height: 1.25; }
.flow-step small { display: block; font-size: 11.5px; color: var(--muted); }
.flow-step b { margin-left: auto; font-family: var(--font-head); font-size: 18px; color: var(--navy-800); font-variant-numeric: tabular-nums; }
.cred-card { border: 2px solid var(--green); background: #f3fbf7; margin-bottom: 18px; }
.cred-card code { background: #fff; border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; }
.mini-steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
@media (max-width: 1100px) { .flow-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .flow-strip { grid-template-columns: minmax(0, 1fr); } }

/* ID viewer modal */
.link-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--blue); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.link-btn:hover { text-decoration: underline; }
.link-btn svg { width: 16px; height: 16px; }
.id-view { border: 1px solid var(--line); border-radius: 12px; background: #f6f8fc; display: grid; place-items: center; overflow: hidden; min-height: 240px; }
.id-view img { display: block; max-width: 100%; max-height: 65vh; object-fit: contain; }
.id-view iframe { width: 100%; height: 65vh; border: 0; background: #fff; }

/* Logistics documents */
.docs-inputs { display: flex; flex-direction: column; gap: 8px; }
.docs-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.docs-head svg { width: 16px; height: 16px; color: var(--navy-800); }
.doc-drop { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1.5px dashed #c9d3e6; border-radius: 10px; cursor: pointer; background: #fafcff; transition: border-color .15s, background .15s; }
.doc-drop:hover { border-color: var(--blue); }
.doc-drop.has { border-style: solid; border-color: var(--green); background: #f3fbf7; }
.doc-drop .doc-title { font-weight: 600; font-size: 13px; color: var(--text); }
.doc-drop input[type=file] { font-size: 12.5px; margin-top: 4px; max-width: 100%; }
.doc-files:empty { display: none; }
.docs-add { border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 10px; }
.doc-group + .doc-group { margin-top: 14px; }
.doc-group-title { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.doc-thumb { font: inherit; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; text-align: left; transition: border-color .15s, box-shadow .15s; }
.doc-thumb:hover { border-color: var(--blue); box-shadow: 0 4px 12px rgba(15,36,82,.1); }
.doc-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #f3f6fb; }
.doc-pdf { aspect-ratio: 1; display: grid; place-items: center; align-content: center; gap: 4px; background: #fdf1f1; color: #b4232f; }
.doc-pdf svg { width: 28px; height: 28px; }
.doc-pdf b { font-size: 11px; }
.doc-name { font-size: 11px; color: var(--text-2); padding: 5px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Kiosk products picker */
#kiPicker tr.picker-group td { background: #f6f8fc; padding-top: 9px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
#kiPicker tr.picker-group:hover td { background: #f6f8fc; }
#kiPicker tr.picker-flavor td:first-child { padding-left: 30px; }
#kiPicker tr.picked td { background: #f3fbf7; }
.load-check { width: 17px; height: 17px; accent-color: var(--green); cursor: pointer; }
.item-chips { list-style: none; margin: 8px 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.item-chips li { font-size: 12.5px; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: #f3f6fb; border: 1px solid var(--line); color: var(--text-2); }
.item-chips b { color: var(--navy-800); }

/* FKP membership code */
.member-code { font-family: var(--font-head); font-size: 30px; font-weight: 700; letter-spacing: .18em; text-align: center; padding: 14px; border-radius: 12px; background: var(--gold-soft, #fff4dc); color: var(--navy-900); border: 2px dashed #e9c675; user-select: all; }
.member-link { display: flex; gap: 8px; margin-top: 10px; }
.member-link .input { flex: 1; min-width: 0; font-size: 12.5px; height: 34px; }
.more-opts summary { cursor: pointer; font-size: 13px; color: var(--blue); }

.flow-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .flow-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .flow-strip { grid-template-columns: minmax(0, 1fr); } }

/* Freezers: QR, map */
.qr-box svg { width: 100%; height: 100%; display: block; }
.freezer-card { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: start; }
.fz-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.fz-map { height: 240px; border-top: 1px solid var(--line-soft); }
.map-box { height: 280px; border-radius: 10px; border: 1px solid var(--line); z-index: 0; }
.map-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.fmap-wrap { position: relative; }
.fmap { height: 560px; border-top: 1px solid var(--line-soft); z-index: 0; }
.fmap-legend { position: absolute; left: 12px; bottom: 22px; z-index: 500; background: rgba(255,255,255,.95); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; box-shadow: 0 4px 12px rgba(15,36,82,.15); }
.fmap-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.d-deployed { background: #12a065; } .d-in_transit { background: #6a4fe0; } .d-for_deployment { background: #e9a91a; }
.fpin { background: none; border: 0; }
.fpin-dot { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--c); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.fpin-dot.planned { opacity: .75; border-style: dashed; }
.fpop { font-size: 13px; line-height: 1.5; min-width: 180px; }
.fpop .muted { color: var(--muted); }
@media (max-width: 700px) { .freezer-card { grid-template-columns: minmax(0, 1fr); } .fmap { height: 420px; } }

/* FKP application header card */
.app-hero { display: flex; align-items: center; gap: 18px; padding: 20px 22px; margin-bottom: 20px; border-left: 4px solid var(--gold); }
.app-hero-icon { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy-800), var(--navy-950)); color: var(--gold); }
.app-hero-icon svg { width: 26px; height: 26px; }
.app-hero-main { flex: 1; min-width: 0; }
.app-hero-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.app-hero-top h1 { font-size: 24px; margin: 0; }
.app-hero-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 13px; color: var(--text-2); }
.app-hero-meta span { display: inline-flex; align-items: center; gap: 5px; }
.app-hero-meta svg { width: 15px; height: 15px; color: var(--muted); }
.app-hero-meta .tag svg { color: var(--navy-800); }
.app-hero-actions { display: flex; gap: 8px; flex: none; }
@media (max-width: 700px) { .app-hero { flex-wrap: wrap; } .app-hero-actions { width: 100%; } }

.app-hero-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-600, #b7791f); margin-bottom: 2px; }

/* Bigger product details modal */
dialog.modal.modal-product { width: min(1400px, 92vw); max-width: 92vw; max-height: 90vh; }
dialog.modal.modal-product[open] { display: flex; flex-direction: column; height: 88vh; }
@media (max-width: 700px) { dialog.modal.modal-product { width: calc(100vw - 16px); max-width: calc(100vw - 16px); } dialog.modal.modal-product[open] { height: calc(100vh - 16px); } }
.modal-product .modal-head { padding: 22px 28px 10px; }
.modal-product .modal-head h3 { font-size: 22px; }
.modal-product .modal-body { padding: 10px 28px 8px; gap: 18px; flex: 1; overflow: auto; }
.modal-product .modal-foot { padding: 18px 28px 24px; border-top: 1px solid var(--line-soft); }
.modal-product .dl { grid-template-columns: 140px minmax(0, 1fr) !important; font-size: 14.5px; gap: 12px 18px; }
.modal-product .modal-table { max-height: none; }
.modal-product .modal-table .table td, .modal-product .modal-table .table th { padding: 14px 18px; font-size: 14px; }
.modal-product .ph-thumb { width: 72px; height: 72px; border-radius: 12px; }
.modal-product .ph-btn { font-size: 13px; }

/* Notifications (bell) */
.dropdown-menu:has(.notif-list) { width: min(400px, calc(100vw - 24px)); }
.notif-list { max-height: min(460px, 70vh); overflow-y: auto; }
.dropdown-menu .notif { gap: 11px; padding: 9px 10px; }
.notif .ni { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; box-shadow: none !important; }
.dropdown-menu .notif .ni svg { width: 16px; height: 16px; color: #fff; }
.notif .nt { min-width: 0; line-height: 1.35; }
.notif .nt b { display: block; font-size: 13px; font-weight: 600; }
.notif .nt small { white-space: normal; }
.notif .nt small.ago { font-size: 11px; opacity: .8; margin-top: 1px; }
.dropdown-menu a.notif-all { justify-content: center; font-weight: 600; color: var(--primary, #1d63d8); border-top: 1px solid var(--line-soft); border-radius: 0 0 8px 8px; margin-top: 4px; }
.inbox-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); color: var(--text); align-items: flex-start; }
.inbox-item:hover { background: var(--bg); text-decoration: none; }
.inbox-item .ni { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.inbox-item .ni svg { width: 18px; height: 18px; color: #fff; }
.inbox-item .nt { flex: 1; min-width: 0; }
.inbox-item .nt b { display: block; }
.inbox-item .go { align-self: center; }
