/* Brand themes: set on <html data-brand="..."> from config. */
:root, [data-brand="guru_pay"] {
  --bg: #F7F5F0; --panel: #FFFFFF; --panel-2: #FBFAF7; --line: #E7E2D8; --text: #1E2124; --muted: #6B6A66;
  --accent: #B8914F; --accent-ink: #FFFFFF; --accent-soft: #F3EADB; --side: #1E2124; --side-text: #E9E4DA;
  --side-muted: #9B968C; --side-active: #2B2F33; --ok: #2F7D4F; --warn: #B7791F; --bad: #B4423C;
  --grad: linear-gradient(135deg, #CFAB6C, #A77F3D);
  --font-head: "Space Grotesk", Inter, system-ui, sans-serif;
}
[data-brand="og_insurance"] {
  --bg: #060A18; --panel: #0D1330; --panel-2: #10183A; --line: #1F2A55; --text: #E8ECFF; --muted: #8E98C4;
  --accent: #5A7CF5; --accent-ink: #FFFFFF; --accent-soft: rgba(90,124,245,.14); --side: #050816; --side-text: #DCE3FF;
  --side-muted: #7480B0; --side-active: #121A3D; --ok: #3DD68C; --warn: #F2B45A; --bad: #F2706A;
  --grad: linear-gradient(135deg, #3EC8F0, #8B3DF0);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2 { font-family: var(--font-head, Inter); letter-spacing: -.01em; margin: 0; }
h2 { font-size: 22px; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 12px; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; outline: none; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 9px 14px; font-weight: 600; }
.btn.primary { background: var(--grad); color: var(--accent-ink); }
.btn.ghost { background: var(--panel); border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--accent); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.wide { width: 100%; margin-top: 6px; }
.link { background: none; border: 0; color: var(--accent); padding: 4px; }

/* Login */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 10% -10%, var(--accent-soft), transparent), var(--bg); }
.login-card { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 32px; text-align: center; }
.login-card form { display: grid; gap: 12px; text-align: left; margin-top: 18px; }
.login-card label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
.login-card h1 { font-size: 22px; margin-top: 12px; }
.brand-logo { height: 28px; width: auto; }
.brand-logo.lg { height: 56px; }
.msg { min-height: 18px; font-size: 13px; color: var(--muted); margin: 0; }

/* Shell */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100%; }
.side { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; font-family: var(--font-head, Inter); font-weight: 700; font-size: 16px; }
.side nav { display: grid; gap: 4px; }
.nav { display: flex; gap: 10px; align-items: center; text-align: left; background: none; border: 0; color: var(--side-muted); padding: 10px 12px; border-radius: 10px; font-weight: 500; }
.nav:hover { color: var(--side-text); }
.nav.active { background: var(--side-active); color: var(--side-text); box-shadow: inset 3px 0 0 var(--accent); }
.ico { width: 16px; text-align: center; opacity: .8; }
.side-foot { margin-top: auto; display: grid; gap: 4px; padding: 10px; color: var(--side-muted); }
.main { padding: 26px 30px 40px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; }
.head-actions { display: flex; gap: 8px; }

/* KPIs */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--grad); }
.kpi b { display: block; font: 700 24px/1.1 var(--font-head, Inter); margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.filters input#f-search { flex: 1 1 220px; }
.filters select, .filters input { min-width: 0; }
.check { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; }

/* Table */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: auto; }
.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--panel-2); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
.grid td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover { background: var(--accent-soft); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.biz { font-weight: 600; } .sub { color: var(--muted); font-size: 12px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill.hot { background: rgba(180,66,60,.12); color: var(--bad); }
.pill.ok { background: rgba(47,125,79,.12); color: var(--ok); }
.pill.dim { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin-top: 12px; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* Drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100%); background: var(--panel); border-left: 1px solid var(--line); padding: 26px; overflow: auto; z-index: 20; box-shadow: -20px 0 50px rgba(0,0,0,.12); }
.drawer .close { position: absolute; top: 14px; right: 14px; font-size: 18px; color: var(--muted); }
.drawer h3 { font: 700 20px/1.2 var(--font-head, Inter); margin: 0 30px 6px 0; }
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 16px 0; font-size: 13px; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; word-break: break-word; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 18px 0 8px; }
pre.raw { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 12px; overflow: auto; max-height: 300px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
a { color: var(--accent); }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; gap: 8px; overflow-x: auto; padding: 10px 12px; }
  .side nav { display: flex; } .side-foot { display: none; } .side-brand { padding: 0 8px 0 0; }
  .main { padding: 16px; } .kpis { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .page-head { flex-direction: column; align-items: flex-start; }
}

.grid td:nth-child(5), .grid td:nth-child(6) { white-space: nowrap; }
