@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url(/reseller/fonts/pjs-600.woff2) format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-display: swap; src: url(/reseller/fonts/pjs-800.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 400; font-display: swap; src: url(/reseller/fonts/pop-400.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-display: swap; src: url(/reseller/fonts/pop-500.woff2) format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-display: swap; src: url(/reseller/fonts/pop-600.woff2) format("woff2"); }

:root {
  --blue: #002882;
  --blue-2: #0a3aa8;
  --blue-soft: #e8edf9;
  --yellow: #FFE600;
  --ink: #111111;
  --ink-2: #4a5061;
  --ink-3: #7a8091;
  --line: #e3e6ee;
  --canvas: #F7F7F7;
  --white: #ffffff;
  --good: #0c7a45;
  --good-soft: #e3f5ec;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --warn: #8a5a00;
  --warn-soft: #fff6d6;
  --radius: 10px;
  --head: "Plus Jakarta Sans", system-ui, sans-serif;
  --body: "Poppins", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 400 14px/1.5 var(--body); color: var(--ink); background: var(--canvas); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--blue); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- sign-in ---------- */
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 520px) 1fr; }
.gate-side { background: var(--blue); color: #fff; padding: 48px 44px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.gate-side::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--yellow); }
.gate-brand { display: flex; align-items: center; gap: 12px; font: 800 22px var(--head); }
.gate-brand img { width: 44px; height: 44px; border-radius: 12px; }
.gate-side h1 { font: 800 40px/1.1 var(--head); margin: 0 0 16px; letter-spacing: -0.5px; }
.gate-side p { color: #c9d4f2; max-width: 36ch; margin: 0; }
.locks { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; color: #dfe6fb; }
.locks li { display: flex; gap: 10px; align-items: baseline; }
.locks b { color: var(--yellow); font-weight: 600; min-width: 1.2em; }
.gate-main { display: grid; place-items: center; padding: 32px; }
.gate-card { width: 100%; max-width: 400px; }
.steps { display: flex; gap: 6px; margin-bottom: 28px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.steps span.on { background: var(--blue); }
.gate-card h2 { font: 800 26px/1.2 var(--head); margin: 0 0 6px; color: var(--blue); }
.gate-card .sub { color: var(--ink-2); margin: 0 0 24px; }
.code-input { font: 600 30px var(--head); letter-spacing: 10px; text-align: center; width: 100%; padding: 14px; border: 2px solid var(--line); border-radius: var(--radius); background: #fff; }
.code-input:focus { border-color: var(--blue); outline: none; }
.qr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: inline-block; }
.qr svg { display: block; width: 200px; height: 200px; }
.secret { font: 600 13px/1.6 ui-monospace, Menlo, monospace; word-break: break-all; background: var(--blue-soft); padding: 8px 10px; border-radius: 8px; color: var(--blue); }
.recovery { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font: 600 15px ui-monospace, Menlo, monospace; background: var(--warn-soft); padding: 14px; border-radius: var(--radius); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { background: var(--blue); color: #dbe3fa; padding: 20px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 18px; font: 800 17px var(--head); color: #fff; }
.side-brand img { width: 32px; height: 32px; border-radius: 9px; }
.side-group { margin: 14px 10px 6px; font-size: 12px; color: #93a6dc; }
.side a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 8px; color: #dbe3fa; text-decoration: none; font-weight: 500; position: relative; }
.side a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.side a.on { background: rgba(255,255,255,0.12); color: #fff; }
.side a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--yellow); }
.badge { background: var(--yellow); color: var(--blue); font-weight: 700; font-size: 11px; border-radius: 99px; padding: 1px 7px; }
.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(255,255,255,0.12); font-size: 12px; color: #93a6dc; }
.side-foot button { background: none; border: 0; color: #fff; padding: 6px 0; cursor: pointer; font-weight: 600; }
.main { padding: 28px 36px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { font: 800 28px/1.15 var(--head); margin: 0; letter-spacing: -0.3px; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); max-width: 70ch; }
.btn.menu-btn { display: none; }

/* ---------- pieces ---------- */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.panel h2 { font: 800 17px var(--head); margin: 0 0 4px; }
.panel .hint { color: var(--ink-3); margin: 0 0 14px; font-size: 13px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-bottom: 20px; overflow: hidden; }
.kpi { padding: 16px 18px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi .l { color: var(--ink-2); font-size: 13px; }
.kpi .v { font: 800 24px/1.2 var(--head); margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .s { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.pos { color: var(--good); }
.neg { color: var(--bad); }

label.f { display: grid; gap: 5px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
input.i, select.i, textarea.i { border: 1px solid #cfd4e0; border-radius: 8px; padding: 9px 11px; background: #fff; min-width: 0; }
input.i:focus, select.i:focus, textarea.i:focus { border-color: var(--blue); outline: 2px solid var(--blue-soft); }
textarea.i { min-height: 120px; resize: vertical; }
.btn { border: 0; border-radius: 8px; padding: 10px 16px; font-weight: 600; cursor: pointer; background: var(--blue); color: #fff; display: inline-flex; align-items: center; gap: 8px; }
.btn:hover { background: var(--blue-2); }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn.ghost { background: #fff; color: var(--blue); border: 1px solid #cfd4e0; }
.btn.ghost:hover { background: var(--blue-soft); }
.btn.danger { background: var(--bad); }
.btn.go { background: var(--yellow); color: var(--blue); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.wide { width: 100%; justify-content: center; padding: 13px; }
.link { background: none; border: 0; color: var(--blue); font-weight: 600; cursor: pointer; padding: 0; }

.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
.t th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fbfbfd; white-space: nowrap; }
.t td { padding: 10px 12px; border-bottom: 1px solid #f0f2f6; vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: #f6f8fd; }
.t .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t .muted { color: var(--ink-3); }
.t tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.empty { padding: 28px; text-align: center; color: var(--ink-3); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eef0f5; color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 12px; }
.toolbar .grow { flex: 1; }
.more { text-align: center; padding: 12px; }

/* statement — the P&L read-out */
.stmt { font-variant-numeric: tabular-nums; }
.stmt .ln { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.stmt .ln span:first-child { color: var(--ink-2); }
.stmt .ln.sub { padding-left: 16px; font-size: 13px; }
.stmt .ln.total { border-bottom: 0; border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 12px; font: 800 20px var(--head); }
.stmt .ln.total span:first-child { color: var(--ink); }
.stmt .ln.mid { font-weight: 600; border-bottom: 1px solid var(--line); }
.stmt .ln.mid span:first-child { color: var(--ink); }

.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

.drawer-bg { position: fixed; inset: 0; background: rgba(10, 20, 50, 0.35); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100vw); background: var(--canvas); z-index: 41; overflow-y: auto; padding: 24px; box-shadow: -12px 0 40px rgba(0,0,0,0.15); }
.drawer-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 16px; }
.drawer-head h2 { font: 800 22px var(--head); margin: 0; }
.x { background: #fff; border: 1px solid var(--line); border-radius: 8px; width: 36px; height: 36px; cursor: pointer; font-size: 18px; }
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; font-size: 13px; }
dl.kv dt { color: var(--ink-3); }
dl.kv dd { margin: 0; word-break: break-word; }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 60; max-width: 90vw; box-shadow: 0 8px 24px rgba(0,0,0,0.2); }
.toast.bad { background: var(--bad); }
.note { background: var(--warn-soft); border-left: 4px solid #e0b400; padding: 12px 14px; border-radius: 8px; color: #5c4300; margin-bottom: 16px; font-size: 13px; }
.note.blue { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.preview { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 12px; background: #f2f4f9; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--ink-2); border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--blue); border-color: var(--yellow); }
.tpl { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.tpl button { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer; }
.tpl button.on { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.tpl b { display: block; color: var(--blue); }
.tpl small { color: var(--ink-3); }

@media (max-width: 900px) {
  .gate { grid-template-columns: 1fr; }
  .gate-side { padding: 28px 24px 36px; }
  .gate-side h1 { font-size: 28px; }
  .locks { display: none; }
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; width: 260px; transform: translateX(-100%); transition: transform 0.2s; }
  .side.open { transform: none; }
  .btn.menu-btn { display: inline-flex; margin-bottom: 12px; }
  .main { padding: 18px 16px 60px; }
  .grid2 { grid-template-columns: 1fr; }
  dl.kv { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* reseller portal extras */
pre.code { background: #0f1630; color: #e6ebff; border-radius: 10px; padding: 12px 14px; font: 500 12.5px/1.6 ui-monospace, Menlo, monospace; overflow-x: auto; margin: 8px 0; white-space: pre; max-width: 100%; }
.row pre.code { margin: 0; flex: 1; min-width: 0; }
.bar { height: 10px; border-radius: 99px; background: var(--blue-soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--blue); border-radius: 99px; }
.perks { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
