/* =================== DiGi Prasaran — flat green & white =================== */
:root {
  /* core system */
  --primary: #0D863B;
  --primary-dark: #095B36;
  --accent: #27A13B;        /* bright brand green: fills, sent status */
  --primary-tint: #e6f4ea;
  --line: #e1ebe4;
  --bg: #f3f9f4;

  /* legacy token names, remapped to the flat system */
  --ink: #1c2b22;
  --paper: var(--bg);
  --card: #ffffff;
  --yellow: #fef3c7;   /* soft amber tint */
  --pink: #ffe4e6;     /* soft rose tint */
  --blue: #e0f2fe;     /* soft sky tint */
  --green: var(--primary);
  --orange: #ffedd5;   /* soft orange tint */
  --purple: #ede9fe;   /* soft violet tint */
  --red: #dc2626;
  --muted: #64748b;
  --border: 1px solid var(--line);
  --shadow: 0 1px 2px rgba(16, 40, 28, 0.05);
  --shadow-sm: none;
  --radius: 12px;
  --display: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* helpers */
  --line-strong: #cfdcd4;
  --surface-2: #f8fbf9;
  --red-dark: #b91c1c;
  --red-tint: #fee2e2;
  --amber-tint: #fef3c7;
  --amber-dark: #92400e;
  --blue-tint: #e0f2fe;
  --blue-dark: #075985;
  --gray-tint: #f1f5f9;
  --gray-dark: #475569;
  --focus: 0 0 0 3px rgba(13, 134, 59, 0.3);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: clamp(26px, 4vw, 34px); }
h2 { font-size: 22px; font-weight: 650; }
h3 { font-size: 17px; font-weight: 600; }
a { color: var(--primary-dark); }
a:hover { color: var(--primary); }
p { margin: 0 0 12px; }
code, .mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 0.9em; }
code { background: var(--primary-tint); color: var(--primary-dark); padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- primitives ---------- */
.card {
  background: var(--card); border: var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.card.flat { box-shadow: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 14px/1.2 var(--body); color: #fff; text-decoration: none; cursor: pointer;
  background: var(--primary); border: 1px solid var(--primary); border-radius: 8px;
  padding: 10px 18px; box-shadow: none;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
  white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn:active { background: #0a4f2f; border-color: #0a4f2f; }
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn:disabled:hover { background: var(--primary); border-color: var(--primary); }
/* primary variants */
.btn.pink, .btn.green, .btn.yellow { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.pink:hover, .btn.green:hover, .btn.yellow:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
/* secondary variants */
.btn.white, .btn.blue, .btn.purple { background: #fff; border-color: var(--line-strong); color: var(--primary-dark); }
.btn.white:hover, .btn.blue:hover, .btn.purple:hover { background: var(--primary-tint); border-color: var(--primary); color: var(--primary-dark); }
.btn.white:disabled:hover { background: #fff; border-color: var(--line-strong); }
/* danger */
.btn.red { background: var(--red); border-color: var(--red); color: #fff; }
.btn.red:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none; box-shadow: var(--focus);
}

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field > span small { font-weight: 400; color: var(--muted); }
.field small { display: block; color: var(--muted); margin-top: 4px; font-size: 13px; }
input[type='text'], input[type='email'], input[type='password'], input[type='tel'], input[type='number'],
input[type='search'], textarea, select {
  width: 100%; font: 15px var(--body); color: var(--ink);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px;
  box-shadow: none; transition: border-color 120ms, box-shadow 120ms;
}
input::placeholder, textarea::placeholder { color: #94a3b8; }
input[type='text']:focus, input[type='email']:focus, input[type='password']:focus, input[type='tel']:focus,
input[type='number']:focus, input[type='search']:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--primary); box-shadow: var(--focus);
}
textarea { min-height: 150px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; margin-top: 3px; }

/* status pills: tinted background + darker text */
.pill {
  display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1.4 var(--body);
  letter-spacing: 0.01em; border: 0; border-radius: 999px; padding: 3px 10px;
  background: var(--gray-tint); color: var(--gray-dark); white-space: nowrap;
}
.pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.pill.draft, .pill.cancelled, .pill.skipped, .pill.paused { background: var(--gray-tint); color: var(--gray-dark); }
.pill.queued, .pill.running, .pill.sending { background: var(--blue-tint); color: var(--blue-dark); }
.pill.running::before, .pill.sending::before { animation: blink 1s steps(2) infinite; }
.pill.completed, .pill.sent, .pill.ready { background: var(--primary-tint); color: #0a4f2f; }
.pill.failed, .pill.disconnected, .pill.not_connected, .pill.action_required { background: var(--red-tint); color: var(--red-dark); }
.pill.invalid, .pill.pending, .pill.qr_ready, .pill.initializing, .pill.authenticating, .pill.created { background: var(--amber-tint); color: var(--amber-dark); }
@keyframes blink { 50% { opacity: 0.25; } }

.alert { border: 1px solid transparent; border-radius: 10px; padding: 12px 14px; font-weight: 500; margin-bottom: 16px; }
.alert.error { background: var(--red-tint); border-color: #fecaca; color: #7f1d1d; }
.alert.warn { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.alert.info { background: #f0f9ff; border-color: #bae6fd; color: #0c4a6e; }
.alert.ok { background: #f0f8f2; border-color: #c4e6cf; color: var(--primary-dark); }

.progress { height: 12px; border: 0; border-radius: 999px; background: #e8efeb; overflow: hidden; display: flex; }
.progress > i { display: block; height: 100%; transition: width 400ms ease-out; }
.progress > i.sent { background: var(--accent); }
.progress > i.failed { background: #ef4444; }
.progress > i.invalid { background: #f59e0b; }
.progress > i.skipped { background: #cbd5e1; }
.progress.thin { height: 6px; }

/* ---------- layout ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.topbar { border-bottom: var(--border); background: #fff; position: sticky; top: 0; z-index: 10; }
.topbar .container { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.logo { font: 700 18px var(--display); color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em; flex: none; }
.logo:hover { color: var(--ink); }
.logo img { display: block; height: 38px; width: auto; max-width: 60vw; }
.logo-tag { display: inline-flex; align-items: center; background: var(--primary-tint); color: var(--primary-dark); font: 600 12px/1 var(--body); padding: 5px 10px; border-radius: 999px; letter-spacing: 0.02em; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.nav a { font-weight: 500; font-size: 14px; color: var(--gray-dark); text-decoration: none; padding: 7px 12px; border: 0; border-radius: 8px; transition: background-color 120ms, color 120ms; }
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a.active { background: var(--primary-tint); color: var(--primary-dark); font-weight: 600; box-shadow: none; }
.nav .pill { margin: 0 4px; }
main { padding: 32px 0 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { color: var(--muted); margin: 0; }
.page-head a.muted { text-decoration: none; font-size: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 20px; }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid.main-side { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.stack > * + * { margin-top: 20px; }
.muted { color: var(--muted); }
a.muted:hover { color: var(--primary-dark); }
.hidden { display: none !important; }

/* stat cards: white surface, coloured accent bar on the left */
.stat { padding: 18px 18px 18px 20px; position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.stat .label { font-weight: 600; font-size: 13px; color: var(--muted); }
.stat .value { font: 700 30px/1.15 var(--display); margin-top: 6px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: 13px; }
.stat.green::before { background: var(--primary); }
.stat.yellow::before { background: #14b8a6; }
.stat.pink::before { background: #ef4444; }
.stat.blue::before { background: #0ea5e9; }
.stat.purple::before { background: var(--accent); }
.stat.orange::before { background: #f59e0b; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: var(--border); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; padding: 11px 14px; white-space: nowrap; border-bottom: var(--border); }
td { padding: 12px 14px; border-top: var(--border); vertical-align: middle; }
tbody tr:first-child td { border-top: 0; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f0f8f2; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { text-align: center; padding: 48px 20px; }
.empty .big { font: 700 48px var(--display); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { font: 500 13px var(--body); color: var(--gray-dark); background: #fff; border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; cursor: pointer; transition: background-color 120ms, color 120ms, border-color 120ms; }
.tabs button:hover { border-color: var(--primary); color: var(--primary-dark); }
.tabs button.active { background: var(--primary-tint); border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.tabs button:focus-visible { box-shadow: var(--focus); outline: none; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 10px; flex-wrap: wrap; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { background: var(--primary); color: #fff; border-right: 0; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.auth-hero h1 { font-size: clamp(34px, 5vw, 56px); color: #fff; letter-spacing: -0.02em; }
.auth-hero p { color: var(--primary-tint); }
.auth-hero .tag { display: inline-block; background: rgba(255, 255, 255, 0.16); color: #fff; border-radius: 999px; padding: 5px 12px; font-weight: 600; font-size: 13px; }
.hero-logo { display: block; max-width: min(320px, 100%); height: auto; margin-bottom: 20px; background: #fff; padding: 12px 16px; border-radius: 12px; }
.auth-hero ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.auth-hero li { background: rgba(255, 255, 255, 0.12); color: #fff; border-radius: 10px; padding: 12px 16px; font-weight: 500; }
.auth-hero a { color: #fff; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--bg); }
.auth-form .card { width: 100%; max-width: 440px; padding: 28px; }

/* ---------- onboarding / QR ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
.steps .step { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 14px; color: var(--muted); padding: 8px 14px 8px 8px; border: var(--border); border-radius: 999px; background: #fff; }
.steps .step b { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gray-tint); color: var(--gray-dark); font-size: 13px; }
.steps .step.done { color: var(--primary-dark); }
.steps .step.done b { background: var(--primary); color: #fff; }
.steps .step.current { background: var(--primary-tint); border-color: var(--primary); color: var(--primary-dark); font-weight: 600; }
.steps .step.current b { background: var(--primary); color: #fff; }
.qr-box { width: 300px; height: 300px; max-width: 100%; border: var(--border); border-radius: var(--radius); background: #fff; display: grid; place-items: center; box-shadow: var(--shadow); margin: 0 auto; overflow: hidden; }
.qr-box img { width: 100%; height: 100%; image-rendering: pixelated; }
.qr-box .wait { text-align: center; padding: 20px; font-weight: 500; color: var(--muted); }
.spinner { width: 36px; height: 36px; border: 3px solid var(--primary-tint); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
ol.howto { padding-left: 22px; margin: 0; }
ol.howto li { margin-bottom: 8px; }
ol.howto li::marker { color: var(--primary); font-weight: 600; }
.connected-badge { font: 700 56px var(--display); text-align: center; color: var(--primary); }

/* ---------- broadcast composer ---------- */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { font: 500 12px ui-monospace, Consolas, monospace; color: var(--primary-dark); background: var(--primary-tint); border: 1px solid transparent; border-radius: 6px; padding: 3px 8px; cursor: pointer; transition: border-color 120ms, background-color 120ms; }
.chip:hover { border-color: var(--primary); background: #c4e6cf; }
/* a <label>, so it must be forced to block or its border breaks per line */
.dropzone { display: block; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: 28px; text-align: center; background: var(--surface-2); cursor: pointer; transition: background-color 120ms, border-color 120ms; }
.dropzone.over, .dropzone:hover { background: #f0f8f2; border-color: var(--primary); }
.dropzone input { display: none; }
.dropzone.has-file, .dropzone.bad-file { border-style: solid; border-width: 1px; padding: 14px 16px; text-align: left; box-shadow: none; }
.dropzone.has-file { background: #f0f8f2; border-color: #c4e6cf; }
.dropzone.bad-file { background: #fef2f2; border-color: #fecaca; }
.dropzone.has-file #drop-text, .dropzone.bad-file #drop-text { display: flex; align-items: center; gap: 14px; }
.dropzone.has-file:hover { background: var(--primary-tint); border-color: var(--primary); }
.file-ico { font-size: 24px; width: 46px; height: 46px; flex: none; display: grid; place-items: center; background: #fff; border: var(--border); border-radius: 10px; }
.sheet-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.mini { border: 0; border-radius: 8px; padding: 6px 12px; font-weight: 500; font-size: 14px; background: var(--gray-tint); color: var(--gray-dark); box-shadow: none; }
.mini b { font: 700 16px var(--display); margin-right: 4px; }
.mini.green { background: var(--primary-tint); color: #0a4f2f; }
.mini.red { background: var(--red-tint); color: var(--red-dark); }
.mini.grey { background: var(--gray-tint); color: var(--gray-dark); }
.table-wrap.scroll { max-height: 380px; overflow: auto; box-shadow: none; }
.table-wrap.scroll th { position: sticky; top: 0; z-index: 1; }
.table-wrap.scroll td { padding: 9px 14px; }
tr.dim td { background: #fafbfa; color: var(--muted); }
.phone-preview { background: #efeae2; border: var(--border); border-radius: var(--radius); padding: 18px; min-height: 160px; }
.bubble { background: #d9fdd3; color: #111b21; border: 0; border-radius: 10px 10px 2px 10px; padding: 8px 10px 6px; max-width: 92%; margin-left: auto; white-space: pre-wrap; word-wrap: break-word; box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13); font-size: 14.5px; }
.bubble .time { display: block; text-align: right; font-size: 11px; color: #667781; margin-top: 2px; }
.estimate { background: var(--primary-tint); color: var(--primary-dark); border: 0; border-radius: 10px; padding: 12px 14px; font-weight: 500; }
.message-box { white-space: pre-wrap; word-wrap: break-word; background: var(--surface-2); border: var(--border); border-radius: 10px; padding: 12px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.kv dt { font-weight: 600; color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }

/* ---------- toast ---------- */
#toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 160%); z-index: 50; transition: transform 200ms ease-out; max-width: calc(100vw - 32px); }
#toast.show { transform: translate(-50%, 0); }
#toast .alert { box-shadow: 0 8px 24px rgba(16, 40, 28, 0.12); margin: 0; }

@media (max-width: 900px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.cols-3, .grid.cols-2, .grid.main-side { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 20px; }
}
@media (max-width: 520px) {
  .logo img { height: 30px; }
  .hero-logo { max-width: 240px; }
  .container { padding: 0 16px; }
  .grid.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .stat .value { font-size: 26px; }
  .card { padding: 16px; }
  main { padding: 24px 0 48px; }
  .nav { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}

/* ---------- editable recipient list ---------- */
.dropzone.compact { border-style: dashed; padding: 12px 16px; text-align: left; background: var(--surface-2); }
.dropzone.compact #drop-text { display: flex; align-items: center; gap: 14px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center; font-size: 14px; cursor: pointer; color: var(--gray-dark);
  background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: none;
  transition: background-color 120ms, border-color 120ms, color 120ms;
}
.icon-btn:hover { background: var(--primary-tint); border-color: var(--primary); color: var(--primary-dark); }
.icon-btn:active { background: #c4e6cf; }
.icon-btn.green { background: var(--primary); border-color: var(--primary); color: #fff; }
.icon-btn.green:hover { background: var(--primary-dark); }
.icon-btn.red:hover { background: var(--red-tint); border-color: #fca5a5; color: var(--red-dark); }
tr.editing td { background: #f0f8f2; padding: 8px 10px; }
tr.editing input { padding: 6px 8px; font-size: 14px; min-width: 110px; }

/* =================== admin panel =================== */
.admin-bar { background: #fff; color: var(--ink); border-top: 3px solid var(--primary-dark); border-bottom: var(--border); }
.admin-bar .logo, .admin-bar .logo:hover { color: var(--ink); }
/* admin nav inherits the client nav look; the dark-green top rule + Admin tag mark the panel */
.admin-bar .nav a.switch { opacity: 0.8; font-weight: 500; }
.nav a.admin-link { background: var(--primary-dark); color: #fff; }
.nav a.admin-link:hover { background: #0a4f2f; color: #fff; }
.stat .value .of { font: 500 16px var(--body); color: var(--muted); }
.mini-kpis .stat { padding: 14px 16px 14px 18px; }
.mini-kpis .stat .value { font-size: 22px; }
.warn-text { color: var(--red-dark); font-weight: 600; }
table.plain { font-size: 14px; }
table.plain td { border-top: var(--border); padding: 8px 4px; }
table.plain tr:first-child td { border-top: 0; }
.note-box { white-space: pre-wrap; background: var(--surface-2); border: var(--border); border-radius: 8px; padding: 10px 12px; margin-top: 6px; min-height: 44px; }

/* attention list — status colours always paired with an icon + label */
.attention { margin-bottom: 20px; }
.attention h3 .count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 12px; background: var(--red-tint); color: var(--red-dark); font: 700 12px var(--body); margin-left: 6px; padding: 0 7px; }
.attention ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.attention li { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; padding: 10px 12px; }
.attention li.lvl-critical { background: #fef2f2; border-color: #fecaca; border-left-color: #dc2626; }
.attention li.lvl-serious { background: #fff7ed; border-color: #fed7aa; border-left-color: #ea580c; }
.attention li.lvl-warning { background: #fffbeb; border-color: #fde68a; border-left-color: #d97706; }
.attention .lvl { font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }

/* timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-top: var(--border); }
.timeline li:first-child { border-top: 0; }
.timeline .t-ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: 0; border-radius: 8px; background: var(--primary-tint); font-size: 14px; }
.timeline li.bad .t-ico { background: var(--red-tint); }
.timeline .t-body { min-width: 0; }
.timeline .t-detail { font-size: 14px; word-break: break-word; }

/* chart: single-series columns, hairline grid, hover tooltip */
.chart-card { display: flex; flex-direction: column; gap: 14px; }
.chart { display: flex; gap: 8px; height: 220px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 12px; color: var(--muted); text-align: right; padding-bottom: 22px; min-width: 28px; font-variant-numeric: tabular-nums; }
.chart-y span { transform: translateY(-50%); }
.chart-y span:last-child { transform: translateY(50%); }
.chart-plot { position: relative; flex: 1; min-width: 0; }
.chart-grid { position: absolute; inset: 0 0 22px 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid i { display: block; height: 1px; background: #edf2ef; }
.chart-grid i:last-child { background: var(--line-strong); }
.chart-cols { position: absolute; inset: 0; display: flex; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding-bottom: 22px; position: relative; cursor: default; outline: none; }
.chart-bar { width: min(24px, 60%); background: var(--primary); border-radius: 4px 4px 0 0; transition: background-color 120ms; }
.chart-col.hover .chart-bar, .chart-col:focus-visible .chart-bar { background: var(--primary-dark); }
.chart-col:focus-visible { background: #f0f8f2; box-shadow: none; }
.chart-x { position: absolute; bottom: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--ink); color: #fff; border: 0; border-radius: 8px; box-shadow: 0 4px 12px rgba(16, 40, 28, 0.15); padding: 6px 10px; font-size: 13px; line-height: 1.4; pointer-events: none; white-space: nowrap; z-index: 2; }
.chart-tip .muted { color: #cbd5e1; }
.chart-table summary { cursor: pointer; font-weight: 500; font-size: 14px; color: var(--muted); }
.chart-table table { margin-top: 8px; font-size: 14px; }
.chart-table th { padding: 6px 10px; }
.chart-table td { padding: 6px 10px; border-top: var(--border); }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 30, 22, 0.45); display: grid; place-items: center; padding: 16px; z-index: 40; }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 48px rgba(16, 40, 28, 0.18); }
.cred { display: grid; gap: 10px; background: #f0f8f2; border: 1px solid #c4e6cf; border-radius: 10px; padding: 14px; }
.cred div { display: flex; flex-direction: column; }
.cred b { word-break: break-all; }

@media (max-width: 900px) {
  .attention li { grid-template-columns: 1fr; }
}

/* =================== phone input: flag + dial code + number =================== */
.pi-wrap { position: relative; }
.phone-input { display: flex; align-items: stretch; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: none; transition: border-color 120ms, box-shadow 120ms, background-color 120ms; }
.phone-input:focus-within { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
.phone-input.invalid { border-color: #ef4444; background: #fef2f2; }
.phone-input.invalid:focus-within { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
.pi-country {
  display: flex; align-items: center; gap: 7px; flex: none; cursor: pointer;
  font: 500 14px var(--body); color: var(--ink); background: var(--surface-2);
  border: 0; border-right: 1px solid var(--line); border-radius: 7px 0 0 7px; padding: 0 10px 0 12px;
}
.pi-country:hover { background: var(--primary-tint); }
.pi-country:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--primary); }
.pi-dial { font-variant-numeric: tabular-nums; }
.pi-caret { font-size: 10px; opacity: 0.6; }
.phone-input .fi, .phone-label .fi, .pi-list .fi { width: 1.4em; line-height: 1.05em; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12); flex: none; }
.phone-input input.pi-number { flex: 1; min-width: 0; border: 0; background: transparent; box-shadow: none; outline: none; padding: 10px 12px; font-variant-numeric: tabular-nums; letter-spacing: 0.2px; }
.phone-input input.pi-number:focus { box-shadow: none; }
.pi-ok { display: none; align-self: center; margin-right: 10px; width: 20px; height: 20px; place-items: center; border-radius: 50%; background: var(--primary); color: #fff; border: 0; font-size: 11px; font-weight: 700; }
.phone-input.valid .pi-ok { display: grid; }
.pi-msg { display: block; min-height: 0; margin-top: 4px; font-size: 13px; }
.pi-msg.err { color: var(--red-dark); font-weight: 500; }
.pi-menu {
  position: fixed; z-index: 60; width: 320px; max-width: calc(100vw - 16px);
  background: #fff; border: var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(16, 40, 28, 0.14); padding: 8px;
}
.phone-input .pi-menu input.pi-search { width: 100%; padding: 8px 10px; font-size: 14px; margin-bottom: 6px; min-width: 0; }
.pi-list { list-style: none; margin: 0; padding: 0; max-height: 270px; overflow-y: auto; }
.pi-list li[data-iso] { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 6px; cursor: pointer; font-size: 14px; }
.pi-list li[data-iso]:hover { background: var(--surface-2); }
.pi-list li.active { background: var(--primary-tint); color: var(--primary-dark); }
.pi-list li.current .pi-name { font-weight: 600; }
.pi-list .pi-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-list .pi-code { color: var(--muted); font-variant-numeric: tabular-nums; }
.pi-list .pi-sep { border-top: var(--border); margin: 6px 0; }
.pi-list .pi-none { padding: 10px; color: var(--muted); text-align: center; }
.pi-wrap.compact .pi-country { padding: 0 8px; font-size: 13px; gap: 5px; }
.pi-wrap.compact .phone-input input.pi-number { padding: 6px 8px; font-size: 14px; }
.pi-wrap.compact .pi-ok { width: 18px; height: 18px; margin-right: 6px; }
td.phone-cell { min-width: 250px; }
.phone-label { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }

/* =================== admin sign-in =================== */
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--primary-dark); }
.admin-login .card { width: 100%; max-width: 420px; padding: 28px; border: 0; box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25); }
.admin-login-badge { display: inline-block; background: var(--primary-tint); color: var(--primary-dark); font-weight: 600; font-size: 12px; padding: 4px 10px; border-radius: 999px; margin-bottom: 14px; }
.admin-bar .nav a.me { border: 1px solid var(--line); }
.weak-banner { background: #fffbeb; color: #78350f; border-bottom: 1px solid #fde68a; font-weight: 500; padding: 10px 0; }
.weak-banner a { color: #78350f; }
