/* ============================================================
   Safarzing Ops — design system (Oct 2026 redesign).
   Navy sidebar, white cards, gold accents. Older pages keep using the same
   class names (.panel, .stat-card, .btn-*, .badge…), restyled here.
   ============================================================ */
:root {
  --navy: #0F2341; --navy-2: #16304F; --navy-3: #1B3A5E; --ink: #0B1B33;
  --gold: #C98A00; --gold-light: #F2B01E; --gold-soft: #FFF4D6;
  --bg: #F5F7FB; --card: #FFFFFF; --line: #E6EAF1; --line-2: #EEF1F6;
  --text: #15233A; --text-dim: #64748B; --text-faint: #94A3B8;
  --green: #16A34A; --green-bg: #E8F7EE;
  --amber: #D97706; --amber-bg: #FEF3E2;
  --red: #DC2626; --red-bg: #FDECEC;
  --blue: #2563EB; --blue-bg: #E8EFFD;
  --violet: #7C3AED; --violet-bg: #F1EAFE;
  --teal: #0D9488; --teal-bg: #E3F6F4;
  --pink: #DB2777; --pink-bg: #FDE8F1;
  --shadow: 0 1px 2px rgba(15,35,65,.04), 0 4px 14px rgba(15,35,65,.05);
  --radius: 14px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; color: var(--text); }
svg { flex-shrink: 0; }

.app { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar { width: 236px; background: var(--navy); flex-shrink: 0; padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #24406a transparent; }
.brand { color: #fff; font-weight: 800; font-size: 16.5px; letter-spacing: .2px; padding: 2px 6px 18px; border-bottom: 1px solid rgba(255,255,255,.08); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.brand-mark { height: 30px; width: auto; flex-shrink: 0; background: #fff; border-radius: 8px; padding: 3px 5px; }
.brand span { color: var(--gold-light); }
.auth-logo { display: block; height: 54px; width: auto; margin: 0 auto 18px; }
.nav-section { color: #7F93AE; font-size: 10.5px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 14px 12px 6px; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #C3D0E0; font-size: 13.5px; font-weight: 500; margin-bottom: 2px; transition: background .15s, color .15s; }
.nav-item svg { color: #8EA3BF; transition: color .15s; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item:hover svg { color: #fff; }
.nav-item.active { background: var(--gold-light); color: var(--ink); font-weight: 700; box-shadow: 0 6px 16px rgba(242,176,30,.25); }
.nav-item.active svg { color: var(--ink); }
.sidebar-help { margin: 18px 4px 4px; padding: 13px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); display: flex; gap: 11px; align-items: center; color: #fff; }
.sidebar-help b { display: block; font-size: 13px; }
.sidebar-help span { font-size: 11.5px; color: #9FB2CB; }
.sidebar-footer { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 13px; padding: 4px 8px 10px; }
.sidebar-user small { display: block; color: #8EA3BF; font-size: 11.5px; font-weight: 500; }
.logout-link { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border-radius: 10px; color: #F3A3A3; font-size: 13px; font-weight: 600; }
.logout-link:hover { background: rgba(220,38,38,.12); }

/* ---------- Avatars ---------- */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--navy); flex-shrink: 0; letter-spacing: .3px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 64px; height: 64px; font-size: 24px; }
.avatar.c0 { background: #2563EB; } .avatar.c1 { background: #7C3AED; } .avatar.c2 { background: #0D9488; } .avatar.c3 { background: #DB2777; }
.avatar.c4 { background: #EA580C; } .avatar.c5 { background: #16A34A; } .avatar.c6 { background: #0F2341; } .avatar.c7 { background: #CA8A04; }

/* ---------- Main + top bar ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); padding: 12px 28px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 100; }
.topbar h1 { font-size: 19px; margin: 0; color: var(--navy); }
.topbar .sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.top-search { flex: 1; max-width: 560px; display: flex; align-items: center; gap: 10px; background: #F1F4F9; border: 1px solid transparent; border-radius: 11px; padding: 0 12px; height: 42px; color: var(--text-dim); transition: border-color .15s, background .15s; }
.top-search:focus-within { background: #fff; border-color: #C9D5E6; }
.top-search input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; font-size: 13.5px; }
.top-search kbd { font-family: inherit; font-size: 11px; color: var(--text-dim); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.date-pill { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.dropdown { position: relative; }
.dropdown > summary { list-style: none; cursor: pointer; }
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 280px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(15,35,65,.14); padding: 8px; z-index: 300; }
.dropdown-menu a, .dropdown-menu .dd-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; font-size: 13px; }
.dropdown-menu a:hover { background: #F4F6FA; }
.dropdown-menu .dd-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; font-size: 12px; color: var(--text-dim); }
.dropdown-menu .dd-head b { display: block; color: var(--text); font-size: 13.5px; }
.bell { position: relative; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--text); }
.bell:hover { background: #F1F4F9; }
.bell .dot { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; }
.notif-item { align-items: flex-start !important; }
.notif-item .ni-icon { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notif-item small { display: block; color: var(--text-dim); font-size: 11.5px; margin-top: 1px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: 12px; }
.user-chip:hover { background: #F1F4F9; }
.user-chip .uc-name { font-size: 13.5px; font-weight: 700; line-height: 1.2; }
.user-chip .uc-role { font-size: 11.5px; color: var(--text-dim); }
.content { padding: 24px 28px 60px; flex: 1; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -.3px; }
.page-head p { margin: 5px 0 0; color: var(--text-dim); font-size: 14px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-dim); margin-bottom: 12px; }
.crumbs a:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn-primary, .btn-gold { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--gold-light); color: var(--ink); border: none; padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 13px; transition: background .15s, box-shadow .15s; }
.btn-primary:hover, .btn-gold:hover { background: #E5A20F; box-shadow: 0 6px 16px rgba(242,176,30,.28); }
.btn-dark { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--navy); color: #fff; border: none; padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.btn-dark:hover { background: var(--navy-3); }
.btn-green { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #15803D; color: #fff; border: none; padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 13px; }
.btn-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: #fff; border: 1px solid var(--line); padding: 9px 15px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--text); }
.btn-secondary:hover { background: #F7F9FC; border-color: #D5DCE7; }
.btn-sm { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--text); }
.btn-sm:hover { background: #F5F7FA; }
.btn-sm.danger { color: var(--red); border-color: #F6C9C9; }
.btn-sm.danger:hover { background: var(--red-bg); }
.btn-sm.log { background: var(--navy); color: #fff; border-color: var(--navy); }
.icon-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--text); }
.icon-btn:hover { background: #F4F6FA; }
.icon-btn.call { background: var(--blue); border-color: var(--blue); color: #fff; }
.icon-btn.wa { background: #22C55E; border-color: #22C55E; color: #fff; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.card-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.card-head h3 small { font-weight: 500; color: var(--text-dim); font-size: 13px; }
.link-more { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-size: 13px; font-weight: 600; }
.link-more:hover { text-decoration: underline; }
.grid { display: grid; gap: 18px; }
.g-6 { grid-template-columns: repeat(6, minmax(0,1fr)); }
.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-dash-a { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr) minmax(0,1.15fr); }
.g-dash-b { grid-template-columns: minmax(0,1.75fr) minmax(0,1fr); }
.grid > * { min-width: 0; }
.qa-grid.wide { grid-template-columns: repeat(8, minmax(0,1fr)); }
.mb { margin-bottom: 18px; }

/* KPI card: icon, value, label, trend, sparkline */
.kpi { position: relative; padding: 16px 16px 14px; overflow: hidden; }
.kpi-top { display: flex; align-items: center; gap: 12px; }
.kpi-ico { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.kpi-val { font-size: 23px; font-weight: 800; color: var(--ink); letter-spacing: -.3px; line-height: 1.15; }
.kpi-label { font-size: 13px; color: var(--text-dim); margin-top: 2px; }
.kpi-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; margin-top: 12px; }
.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.trend.up { color: var(--green); } .trend.down { color: var(--red); } .trend.flat { color: var(--text-dim); }
.trend small { color: var(--text-dim); font-weight: 500; font-size: 11.5px; }
.spark { display: block; }
.t-blue { background: var(--blue-bg); color: var(--blue); } .t-green { background: var(--green-bg); color: var(--green); }
.t-amber { background: var(--amber-bg); color: var(--amber); } .t-red { background: var(--red-bg); color: var(--red); }
.t-violet { background: var(--violet-bg); color: var(--violet); } .t-teal { background: var(--teal-bg); color: var(--teal); }
.t-pink { background: var(--pink-bg); color: var(--pink); } .t-navy { background: #E6EBF3; color: var(--navy); }

/* Segmented tabs */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button, .seg a { border: 0; background: none; padding: 8px 15px; font-size: 13px; font-weight: 600; color: var(--text-dim); border-right: 1px solid var(--line); }
.seg > :last-child { border-right: 0; }
.seg .on { background: var(--blue); color: #fff; }
.select-sm { height: 36px; padding: 0 30px 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center; -webkit-appearance: none; appearance: none; font-size: 13px; font-weight: 600; color: var(--text); }

/* Chart */
.chart-box { position: relative; height: 240px; padding: 4px 18px 0; }
.chart-box svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-tip { position: absolute; pointer-events: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(15,35,65,.14); padding: 8px 11px; font-size: 12px; white-space: nowrap; display: none; z-index: 5; }
.chart-tip b { display: block; margin-bottom: 3px; font-size: 12px; color: var(--text-dim); font-weight: 600; }
.legend { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; padding: 10px 18px 16px; font-size: 12.5px; color: var(--text-dim); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Funnel */
.funnel-row { display: grid; grid-template-columns: 120px 1fr 92px; align-items: center; gap: 12px; padding: 7px 20px; font-size: 13px; }
.funnel-row .fl { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 500; }
.funnel-row .fl i { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-style: normal; font-size: 12px; font-weight: 800; }
.funnel-track { height: 22px; background: #EEF2F7; border-radius: 5px; overflow: hidden; }
.funnel-fill { height: 100%; border-radius: 5px; }
.funnel-row .fv { font-size: 13px; font-weight: 700; }
.funnel-row .fv small { font-weight: 500; color: var(--text-dim); }

/* Donut */
.donut-wrap { display: flex; align-items: center; gap: 18px; padding: 4px 20px 18px; }
.donut { position: relative; width: 156px; height: 156px; flex-shrink: 0; }
.donut svg { width: 156px; height: 156px; }
.donut .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.donut .center b { font-size: 24px; font-weight: 800; color: var(--ink); }
.donut .center span { font-size: 12px; color: var(--text-dim); }
.donut-legend { flex: 1; min-width: 0; font-size: 12.5px; }
.donut-legend div { display: grid; grid-template-columns: 10px minmax(0,1fr) auto 34px; align-items: center; gap: 8px; padding: 3.5px 0; }
.donut-legend i { width: 10px; height: 10px; border-radius: 50%; }
.donut-legend span { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-legend b { text-align: right; }
.donut-legend em { font-style: normal; color: var(--text-dim); text-align: right; }

/* Mini stat tiles (financial overview) */
.tile { border-radius: 12px; padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.tile .kpi-ico { width: 40px; height: 40px; border-radius: 11px; background: #fff; }
.tile b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.2px; }
.tile span { font-size: 12.5px; color: var(--text-dim); }

/* List rows (renewals, activity, attention) */
.list-row { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid var(--line-2); font-size: 13px; }
.list-row:first-child { border-top: 0; }
.list-row .lr-main { flex: 1; min-width: 0; }
.list-row .lr-main b { display: block; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row .lr-main span { font-size: 12px; color: var(--text-dim); }
.lr-ico { width: 32px; height: 32px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-weight: 800; font-size: 14px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; white-space: nowrap; }

/* Quick actions */
.qa-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; padding: 4px 20px 20px; }
.qa { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px 6px; border: 1px solid var(--line); border-radius: 12px; background: #FBFCFE; font-size: 12.5px; font-weight: 600; text-align: center; transition: border-color .15s, transform .15s, box-shadow .15s; }
.qa:hover { border-color: #CBD5E3; transform: translateY(-1px); box-shadow: var(--shadow); }
.qa .kpi-ico { width: 34px; height: 34px; border-radius: 10px; }

.greet h1 { margin: 0; font-size: 28px; font-weight: 800; color: var(--ink); letter-spacing: -.4px; }
.greet p { margin: 4px 0 0; color: var(--text-dim); font-size: 14.5px; }

/* ---------- Old components (restyled) ---------- */
.stats-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.stat-card { flex: 1; min-width: 160px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 24px; font-weight: 800; color: var(--ink); letter-spacing: -.3px; }
.stat-card .label { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.stat-card.green .num { color: var(--green); }
.stat-card.red .num { color: var(--red); }
.stat-card.gold .num { color: var(--gold); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; box-shadow: var(--shadow); }
.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.panel-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.panel-body { padding: 0; }

table { width: 100%; border-collapse: collapse; }
th { background: #F8FAFD; color: var(--text-dim); font-size: 11px; text-align: left; padding: 11px 16px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 16px; font-size: 13px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFBFD; }
.tbl-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: 4px 10px; border-radius: 7px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge.status-active, .badge.green { background: var(--green-bg); color: var(--green); }
.badge.status-soon, .badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.status-expired, .badge.red { background: var(--red-bg); color: var(--red); }
.badge.status-paused, .badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.violet { background: var(--violet-bg); color: var(--violet); }
.badge.gray { background: #EEF1F5; color: #64748B; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--line); background: #fff; }
.toolbar input[type=text], .toolbar input[type=search], .toolbar select, .toolbar input[type=date], .toolbar input[type=month] { height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); font-size: 13px; background: #fff; }
.toolbar input[type=text], .toolbar input[type=search] { flex: 1; min-width: 200px; }
.toolbar input:focus, .toolbar select:focus { outline: 0; border-color: #A9BBD6; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }

.empty { text-align: center; padding: 50px 20px; color: var(--text-dim); font-size: 13.5px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.field input, .field select, .field textarea { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); font-size: 13.5px; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: #A9BBD6; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 13.5px; font-weight: 600; border: 1px solid transparent; }
.flash-success { background: var(--green-bg); color: #15803D; border-color: #C8EBD5; }
.flash-error { background: var(--red-bg); color: #B91C1C; border-color: #F6CACA; }

.staff-tag { display: inline-flex; align-items: center; gap: 6px; }
.staff-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold-light); }

.remaining-bar-track { width: 90px; height: 6px; background: #EDF1F5; border-radius: 999px; overflow: hidden; margin-top: 4px; }
.remaining-bar-fill { height: 100%; border-radius: 999px; background: var(--gold-light); }

/* Auth pages */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--navy); padding: 20px; }
.auth-card { background: #fff; border-radius: 14px; padding: 36px; width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 20px; color: var(--navy); margin: 0 0 4px; }
.auth-card p { font-size: 13px; color: var(--text-dim); margin: 0 0 24px; }
.auth-card button[type=submit] { width: 100%; margin-top: 8px; padding: 11px; }
.field-error { color: var(--red); font-size: 12.5px; margin-bottom: 10px; }

/* ---------- Modals + side drawers ---------- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(11,27,51,.5); backdrop-filter: blur(2px); align-items: center; justify-content: center; z-index: 400; padding: 20px; }
.modal { background: #fff; border-radius: 16px; padding: 24px 26px; width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; box-shadow: 0 30px 70px rgba(11,27,51,.25); }
.modal.wide { max-width: 720px; }
.modal h2 { margin: 0 0 4px; font-size: 18px; color: var(--ink); }
.modal .modal-sub { font-size: 13px; color: var(--text-dim); margin: 0 0 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.drawer-overlay { display: none; position: fixed; inset: 0; background: rgba(11,27,51,.35); z-index: 400; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: #fff; z-index: 410; box-shadow: -20px 0 50px rgba(11,27,51,.18); transform: translateX(105%); transition: transform .25s ease; display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 12px; }
.drawer-head h2 { margin: 0; font-size: 19px; color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 22px 22px; }
.drawer-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.drawer-foot > * { flex: 1; }
.hint { font-size: 12px; color: var(--text-dim); margin-top: 5px; }

/* ---------- Table extras ---------- */
.cell-main { display: flex; align-items: center; gap: 11px; }
.cell-main b { display: block; color: var(--ink); font-weight: 700; font-size: 13.5px; }
.cell-main small { display: block; color: var(--text-dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: .2px; }
.cell-main .loc { display: flex; align-items: center; gap: 3px; color: var(--text-dim); font-size: 11.5px; margin-top: 1px; text-transform: none; }
.letter { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex-shrink: 0; }
.wa-link { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; color: #16A34A; vertical-align: middle; margin-left: 4px; }
.wa-link:hover { background: var(--green-bg); }
.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; cursor: pointer; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu .dropdown-menu { min-width: 190px; }
.row-menu .dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 8px; font-size: 13px; text-align: left; color: var(--text); }
.row-menu .dropdown-menu button:hover { background: #F4F6FA; }
.row-menu .dropdown-menu .danger { color: var(--red); }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-dim); }
.pager { display: flex; gap: 6px; align-items: center; }
.pager a, .pager span { min-width: 34px; height: 34px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); font-weight: 600; font-size: 13px; }
.pager a:hover { background: #F4F6FA; }
.pager .on { background: var(--navy); border-color: var(--navy); color: #fff; }
.pager .gap { border: 0; background: none; min-width: 16px; }
.result-count { font-size: 13px; color: var(--text-dim); }
.result-count b { color: var(--text); }
.kpi-row { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 16px; margin-bottom: 18px; }
.kpi-row.six { grid-template-columns: repeat(6, minmax(0,1fr)); }
.kpi-row.four { grid-template-columns: repeat(4, minmax(0,1fr)); }
.kpi-row.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.kpi-s { display: flex; align-items: center; gap: 14px; padding: 18px; }
.kpi-s .kpi-ico { width: 52px; height: 52px; border-radius: 14px; }
.kpi-s .kpi-val { font-size: 26px; }
.kpi-s .kpi-sub { font-size: 12.5px; margin-top: 3px; }
.progress { height: 7px; background: #EDF1F6; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
.progress.green > i { background: var(--green); }
@media (max-width: 1280px) { .kpi-row, .kpi-row.six { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 720px) { .kpi-row, .kpi-row.six, .kpi-row.four, .kpi-row.three { grid-template-columns: repeat(2, minmax(0,1fr)); } .kpi-s { padding: 14px; } .kpi-s .kpi-ico { width: 42px; height: 42px; } .kpi-s .kpi-val { font-size: 20px; } }

/* ---------- Login (shared by team + admin) ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; background: #0B1B33; }
.login-hero { position: relative; overflow: hidden; color: #fff; padding: 56px 64px; display: flex; flex-direction: column; }
.login-hero .art { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-hero > *:not(.art) { position: relative; }
.lh-brand { display: flex; align-items: center; gap: 14px; }
.lh-brand img { height: 44px; background: #fff; border-radius: 10px; padding: 4px 6px; }
.lh-brand b { display: block; font-size: 26px; font-weight: 800; letter-spacing: .3px; }
.lh-brand b span { color: var(--gold-light); }
.lh-brand small { display: block; font-size: 11px; letter-spacing: 3px; color: #C9D6E8; margin-top: 3px; }
.lh-copy { margin-top: auto; margin-bottom: auto; max-width: 520px; padding-top: 40px; }
.lh-copy .eyebrow { font-size: 12px; letter-spacing: 5px; color: #C9D6E8; text-transform: uppercase; }
.lh-copy h2 { font-size: clamp(34px, 3.6vw, 54px); line-height: 1.08; margin: 16px 0 0; font-weight: 800; letter-spacing: -.6px; }
.lh-copy h2 span { color: var(--gold-light); }
.lh-copy hr { width: 64px; border: 0; border-top: 2px solid rgba(255,255,255,.35); margin: 26px 0; }
.lh-copy p { font-size: 17px; line-height: 1.6; color: #D8E2EE; margin: 0; }
.lh-pills { display: flex; gap: 12px; flex-wrap: wrap; }
.lh-pill { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 12px; background: rgba(11,27,51,.55); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(6px); }
.lh-pill b { display: block; font-size: 14px; }
.lh-pill small { font-size: 12px; color: #B8C7DA; }
.login-side { display: flex; align-items: center; justify-content: center; padding: 32px 24px; background: linear-gradient(180deg, #F5F7FB, #EDF1F7); }
.login-card { width: 100%; max-width: 470px; background: #fff; border-radius: 20px; padding: 40px 40px 30px; box-shadow: 0 30px 70px rgba(11,27,51,.18); }
.login-card .lc-logo { display: flex; align-items: center; justify-content: center; gap: 12px; }
.login-card .lc-logo img { height: 50px; }
.login-card h1 { text-align: center; font-size: 26px; margin: 20px 0 6px; color: var(--ink); font-weight: 800; }
.login-card .lc-sub { text-align: center; color: var(--text-dim); font-size: 14.5px; margin: 0 0 22px; }
.role-toggle { display: grid; grid-template-columns: 1fr 1fr; background: #F3F5F9; border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin: 8px 0 18px; }
.role-toggle a { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--text); }
.role-toggle a.on { background: #FCEBB7; color: #7A4E00; box-shadow: inset 0 0 0 1px #F2C14E; }
.input-ico { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 0 14px; height: 50px; color: var(--text-dim); background: #fff; }
.input-ico:focus-within { border-color: #A9BBD6; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.input-ico input, .field .input-ico input { flex: 1; min-width: 0; width: auto; border: 0; outline: 0; font-size: 14.5px; background: none; padding: 0; border-radius: 0; box-shadow: none; }
.input-ico button { border: 0; background: none; color: var(--text-dim); padding: 4px; display: flex; }
.login-card .field label { font-size: 13.5px; font-weight: 700; }
.login-card .btn-gold { width: 100%; height: 50px; font-size: 15px; margin-top: 6px; }
.or-line { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 12.5px; margin: 18px 0; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.login-card .btn-secondary { width: 100%; height: 48px; font-size: 14.5px; font-weight: 700; }
.lc-foot { text-align: center; color: var(--text-faint); font-size: 12.5px; margin-top: 22px; }
.forgot { text-align: right; margin: -4px 0 14px; font-size: 13px; }
.forgot summary { color: var(--blue); cursor: pointer; list-style: none; display: inline; font-weight: 600; }
.forgot summary::-webkit-details-marker { display: none; }
.forgot p { text-align: left; background: #F4F7FC; border-radius: 10px; padding: 10px 12px; color: var(--text-dim); margin: 8px 0 0; }
.login-error { background: var(--red-bg); color: #B91C1C; border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .g-6 { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .g-dash-a { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .g-dash-a > :first-child { grid-column: 1 / -1; }
  .g-dash-b { grid-template-columns: minmax(0,1fr); }
  .qa-grid.wide { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (max-width: 1500px) {
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut { margin: 0 auto 6px; }
}
@media (max-width: 1000px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { padding: 36px 28px; min-height: 340px; }
  .lh-copy { padding-top: 26px; }
  .lh-copy h2 { font-size: 34px; }
  .lh-pills { display: none; }
  .g-4, .g-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .content { padding: 18px 14px 60px; }
  .date-pill { display: none; }
}
@media (max-width: 720px) {
  .g-6 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .g-dash-a, .g-dash-b, .g-2 { grid-template-columns: 1fr; }
  .user-chip .uc-text { display: none; }
  .top-search kbd { display: none; }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut { margin: 0 auto; }
  .qa-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .funnel-row { grid-template-columns: 96px 1fr 84px; padding: 7px 14px; }
  .greet h1, .page-head h1 { font-size: 22px; }
  .login-card { padding: 28px 22px 24px; }
}
@media (max-width: 460px) {
  .g-6, .g-4, .g-3 { grid-template-columns: 1fr; }
  .top-search { display: none; }
}

/* Mobile drawer nav — the fixed sidebar becomes a slide-in panel below this
   width, toggled by the hamburger button (assets/js/app.js). */
.mobile-nav-toggle { display: none; background: none; border: none; font-size: 22px; line-height: 1; color: var(--navy); padding: 4px 8px; margin-right: 4px; }
.sidebar-overlay { display: none; }

/* Desktop: the same ☰ button hides/shows the sidebar (html.sb-hidden, saved in localStorage). */
@media (min-width: 781px) {
  .mobile-nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-right: 0; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-size: 19px; cursor: pointer; flex-shrink: 0; }
  .mobile-nav-toggle:hover { background: #F5F7FB; }
  .sidebar { transition: margin-left .25s ease; }
  html.sb-hidden .sidebar { margin-left: -236px; }
}

@media (max-width: 780px) {
  .mobile-nav-toggle { display: inline-block; }
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: auto; z-index: 200; overflow-y: auto;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 2px 0 16px rgba(0,0,0,0.25);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay {
    display: block; position: fixed; inset: 0; background: rgba(16,35,59,0.5);
    z-index: 150; opacity: 0; pointer-events: none; transition: opacity .25s ease;
  }
  .sidebar-overlay.open { opacity: 1; pointer-events: auto; }
  .topbar { padding: 10px 14px; gap: 8px; }
  .topbar h1 { font-size: 16px; }
  .stats-row { gap: 10px; }
  .stat-card { min-width: 140px; padding: 12px 14px; }
  .field-row { flex-direction: column; gap: 0; }
}

/* Responsive tables — collapse into stacked cards below this width, using
   each <td>'s data-th="" attribute as the row label. */
@media (max-width: 720px) {
  .responsive-table thead { display: none; }
  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table tr { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; }
  /* Label stacked above the cell's own content (rather than side-by-side)
     so cells with more than one line/element — buttons, extra rows of
     text — can't overflow the card, whatever they contain. */
  .responsive-table td { padding: 8px 0; border: none; border-bottom: 1px solid #F1F3F6; text-align: left; }
  .responsive-table td:last-child { border-bottom: none; }
  .responsive-table td::before { content: attr(data-th); display: block; font-weight: 700; color: var(--text-dim); font-size: 11px; text-transform: uppercase; margin-bottom: 4px; }
  .responsive-table td[data-th=""]::before { display: none; }
}

/* Lead cards — rich mobile-only card layout for staff/leads.php and the
   KYC submissions list. Desktop keeps the plain <table>; below 860px the
   table is hidden and .lead-cards is shown instead (see desktop-only-table
   below), since this layout needs multi-column sub-grids a table cell
   can't express. */
.desktop-only-table { display: table; }
.lead-cards { display: none; }
.lead-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(16,35,59,0.06); }
.lead-card-head { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.lead-assigned-date { display: flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; color: var(--text-dim); }
.lead-id-badge { background: #EEF1F5; color: var(--text-dim); font-size: 10.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.lead-card-menu { background: none; border: none; color: var(--text-dim); padding: 4px; border-radius: 6px; display: flex; }
.lead-card-menu:hover { background: #F1F3F6; }
.lead-info-2col { display: flex; gap: 14px; margin-bottom: 10px; }
.lead-info-2col > div { flex: 1; min-width: 0; }
.lead-info-full { margin-bottom: 14px; }
@media (max-width: 420px) {
  .lead-actions a, .lead-actions button { font-size: 11.5px; padding: 10px 4px; gap: 4px; }
}
.li-label { display: flex; align-items: center; gap: 5px; color: var(--text-dim); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 4px; }
.li-value { font-size: 14px; font-weight: 700; color: var(--text); word-break: break-word; }
.li-sub { display: flex; align-items: flex-start; gap: 5px; color: var(--text-dim); font-size: 11.5px; margin-top: 3px; word-break: break-word; }
.li-sub svg { flex-shrink: 0; margin-top: 1px; }
.lead-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.lead-actions a, .lead-actions button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 6px; border-radius: 10px; font-size: 12.5px; font-weight: 700; border: none; text-decoration: none; }
.lead-actions .la-call { background: var(--navy); color: #fff; }
.lead-actions .la-whatsapp { background: #25D366; color: #fff; }
.lead-actions .la-history { background: #fff; color: var(--text); border: 1px solid var(--line); }
.lead-pair { display: grid; grid-template-columns: 1fr 1fr; background: #F7F9FB; border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.lead-pair-cell { padding: 12px 14px; }
.lead-pair-cell + .lead-pair-cell { border-left: 1px solid #E7EAEF; }
.lead-pair-cell .lp-label { display: flex; align-items: center; gap: 5px; color: var(--text-dim); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; margin-bottom: 6px; }
.lead-pair-cell .lp-value { font-size: 13.5px; font-weight: 700; color: var(--text); word-break: break-word; }
.lead-pair-cell .lp-value.plain { font-weight: 500; color: var(--text-dim); font-size: 13px; }
.lead-update-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; background: var(--navy); color: #fff; border: none; padding: 13px; border-radius: 10px; font-size: 14px; font-weight: 700; margin-top: 2px; }

@media (max-width: 860px) {
  .desktop-only-table { display: none; }
  .lead-cards { display: block; }
}

/* KYC submissions — simpler read-only card, same visual language as .lead-card. */
.kyc-cards { display: none; }
.kyc-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(16,35,59,0.06); }
.kyc-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.kyc-name { display: flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 700; color: var(--text); }
.kyc-name svg { color: var(--text-dim); flex-shrink: 0; }
.kyc-card-body { display: flex; flex-direction: column; gap: 7px; }
.kyc-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); }
.kyc-row svg { flex-shrink: 0; }

@media (max-width: 720px) {
  .kyc-table-wrap { display: none; }
  .kyc-cards { display: block; }
}

.link-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.link-icon-badge { width: 34px; height: 34px; border-radius: 9px; background: var(--blue-bg); color: var(--blue); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.status-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.status-tab { padding: 8px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: #F1F3F6; color: var(--text-dim); text-decoration: none; white-space: nowrap; }
.status-tab:hover { background: #E4E8EE; }
.status-tab.active { background: var(--navy); color: #fff; }

.team-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.team-card { display: flex; flex-direction: column; align-items: center; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px 16px; text-decoration: none; transition: box-shadow .15s ease, transform .15s ease; }
.team-card:hover { box-shadow: 0 4px 16px rgba(16,35,59,0.1); transform: translateY(-2px); }
.team-card.inactive { opacity: .6; }
.team-card-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 800; margin-bottom: 12px; }
.team-card-name { font-size: 14.5px; font-weight: 700; color: var(--navy); }
.team-card-count { font-size: 12px; color: var(--text-dim); margin-top: 4px; }








/* ---- Staff side (Oct 2026) ---- */
@media (max-width: 860px) { .lead-table-wrap { display: none; } }
.welcome { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 26px 28px; border-radius: 16px; background: linear-gradient(120deg, #0F2341 0%, #183461 60%, #21467F 100%); color: #fff; }
.welcome h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.3px; color: #fff; }
.welcome p { margin: 6px 0 0; font-size: 14px; color: rgba(255,255,255,.78); max-width: 520px; }
.welcome p b { color: #F2B01E; }
.welcome-text { position: relative; z-index: 1; min-width: 0; }
.welcome-art { width: 340px; max-width: 42%; height: auto; flex-shrink: 0; margin: -26px -28px -30px 0; align-self: flex-end; }
@media (max-width: 720px) { .welcome { padding: 20px; } .welcome h1 { font-size: 21px; } .welcome-art { display: none; } }
a.funnel-row { color: inherit; text-decoration: none; }
a.funnel-row:hover .fl { color: var(--blue); }
a.list-row { color: inherit; text-decoration: none; }
a.list-row:hover { background: #F8FAFD; }