/* ==========================================================================
   EBMP · Executive Bulk Messaging Platform  —  Professional design system
   Palette: deep navy + parliamentary gold on light grey, white surfaces.
   ========================================================================== */

:root {
  /* Brand */
  --navy-950:#071227; --navy-900:#0a1a3a; --navy-800:#0e2350; --navy-700:#143066;
  --navy-600:#1d3f85; --navy-500:#2854a8;
  --gold:#e6ae2a; --gold-strong:#d99a12; --gold-soft:#f6e6b8; --gold-bg:#fdf6e3;
  --blue:#2456e0; --blue-soft:#e8efff; --blue-ink:#1b3ea8;
  --green:#179a5b; --green-soft:#e3f6ec; --red:#d6363c; --red-soft:#fdeaea;
  --orange:#d9820b; --orange-soft:#fdf0dc;

  /* Neutrals */
  --ink:#16233d; --ink-2:#3d4c68; --muted:#6b7a96; --faint:#9aa8c2;
  --line:#e2e8f4; --line-2:#eef2fa;
  --surface:#ffffff; --page:#eef1f8; --page-grad:radial-gradient(1100px 500px at 85% -10%, #e8eefa 0%, transparent 60%), linear-gradient(180deg,#eef1f8,#e9edf6);

  --r-s:8px; --r-m:12px; --r-l:18px; --r-xl:24px;
  --shadow-s:0 1px 2px rgba(13,26,54,.06),0 1px 3px rgba(13,26,54,.05);
  --shadow-m:0 4px 14px rgba(13,26,54,.08),0 1px 3px rgba(13,26,54,.05);
  --shadow-l:0 20px 50px -12px rgba(13,26,54,.25);
  --font:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}

* { box-sizing:border-box; }
html,body { margin:0; padding:0; }
html { -webkit-text-size-adjust:100%; }
body {
  font-family:var(--font); color:var(--ink); background:var(--page-grad);
  font-size:14px; line-height:1.5; -webkit-font-smoothing:antialiased; min-height:100vh;
}
a { color:var(--blue); text-decoration:none; }
a:hover { text-decoration:underline; }
h1,h2,h3,h4 { margin:0; font-weight:800; letter-spacing:-.01em; }
p { margin:0; }
button { font-family:inherit; }
::-webkit-scrollbar { width:10px; height:10px; }
::-webkit-scrollbar-thumb { background:#c8d2e4; border-radius:8px; border:2px solid transparent; background-clip:content-box; }
::-webkit-scrollbar-thumb:hover { background:#aeb9d0; background-clip:content-box; border:2px solid transparent; }

/* ===================== APP SHELL ===================== */
#app { min-height:100vh; }
.app-hidden { display:none !important; }

.topbar {
  position:sticky; top:0; z-index:40; height:64px; display:flex; align-items:center; gap:14px;
  padding:0 20px; background:rgba(255,255,255,.9); backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
}
.brand { display:flex; align-items:center; gap:12px; min-width:0; }
.brand-badge {
  width:38px; height:38px; border-radius:11px; display:grid; place-items:center; flex:0 0 auto;
  background:linear-gradient(135deg,#0a1a3a,#1d3f85); color:var(--gold); font-weight:900; font-size:15px;
  box-shadow:inset 0 0 0 1.5px rgba(230,174,42,.55), var(--shadow-s); letter-spacing:.5px;
}
.brand-name { font-weight:800; color:var(--navy-900); font-size:14px; letter-spacing:-.01em; white-space:nowrap; }
.brand-sub { font-size:9.5px; font-weight:700; letter-spacing:2.2px; color:var(--gold-strong); text-transform:uppercase; }
.topbar-spacer { flex:1; }
.top-actions { display:flex; align-items:center; gap:10px; }

.api-pill { display:flex; align-items:center; gap:7px; font-size:11px; font-weight:600; color:var(--muted);
  border:1px solid var(--line); padding:5px 10px; border-radius:999px; background:#fff; }
.dot { width:8px; height:8px; border-radius:50%; display:inline-block; }
.dot.ok { background:#22c55e; box-shadow:0 0 0 3px rgba(34,197,94,.16); }
.dot.bad { background:var(--red); box-shadow:0 0 0 3px rgba(214,54,60,.16); }
.dot.warn { background:var(--gold); box-shadow:0 0 0 3px rgba(230,174,42,.2); }

.icon-btn {
  width:38px; height:38px; border-radius:10px; border:1px solid var(--line); background:#fff; color:var(--muted);
  display:grid; place-items:center; cursor:pointer; transition:.15s;
}
.icon-btn:hover { color:var(--navy-900); border-color:#c6d2e8; background:#f6f8fd; }
.icon-btn svg { width:19px; height:19px; }

.user-chip { display:flex; align-items:center; gap:9px; padding:4px 12px 4px 5px; border-radius:999px;
  background:#fff; border:1px solid var(--line); }
.avatar { width:30px; height:30px; border-radius:50%; background:linear-gradient(135deg,var(--navy-800),var(--navy-500));
  color:#fff; display:grid; place-items:center; font-weight:800; font-size:12px; }
.user-chip .u-name { font-weight:700; font-size:12px; color:var(--navy-900); max-width:120px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Layout row */
.shell { display:flex; min-height:calc(100vh - 64px); }

/* ===================== SIDEBAR ===================== */
.sidebar {
  width:254px; flex:0 0 254px; background:linear-gradient(180deg,var(--navy-950) 0%,var(--navy-900) 55%,#0b1c42 100%);
  color:#c7d4ee; display:flex; flex-direction:column; position:sticky; top:64px; height:calc(100vh - 64px);
  overflow-y:auto; padding:14px 12px 26px; scrollbar-width:thin; scrollbar-color:#2a4178 transparent;
}
.sidebar::-webkit-scrollbar-thumb { background:#2a4178; }
.sidebar nav { flex:1; }
.nav-group { font-size:9.5px; font-weight:800; letter-spacing:1.8px; text-transform:uppercase;
  color:#5d74a6; padding:16px 10px 6px; }
.nav-item {
  display:flex; align-items:center; gap:11px; width:100%; text-align:left; cursor:pointer;
  padding:9px 11px; margin:1px 0; border-radius:10px; color:#c7d4ee; font-weight:600; font-size:13px;
  background:transparent; border:1px solid transparent; transition:.14s; position:relative;
}
.nav-item svg { width:17px; height:17px; color:#7c91bf; flex:0 0 auto; transition:.14s; }
.nav-item:hover { background:rgba(255,255,255,.06); color:#fff; }
.nav-item:hover svg { color:var(--gold); }
.nav-item.active { background:linear-gradient(90deg,rgba(230,174,42,.18),rgba(230,174,42,.05)); color:#fff;
  border-color:rgba(230,174,42,.28); }
.nav-item.active svg { color:var(--gold); }
.nav-item.active::before { content:""; position:absolute; left:-12px; top:20%; bottom:20%; width:3px;
  border-radius:0 4px 4px 0; background:var(--gold); }
.sidebar .side-foot { margin-top:14px; padding:12px; border-radius:12px; background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08); }
.side-foot .f-t { font-size:10px; font-weight:800; letter-spacing:1px; text-transform:uppercase; color:var(--gold); }
.side-foot .f-d { font-size:10.5px; color:#8fa3c9; margin-top:3px; line-height:1.45; }

/* ===================== MAIN / VIEW ===================== */
.main { flex:1; min-width:0; padding:26px 30px 70px; }
.view { max-width:1240px; margin:0 auto; }

/* Page hero header */
.page-hero { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; flex-wrap:wrap; margin-bottom:22px; }
.page-hero .ph-tag { font-size:10px; font-weight:800; letter-spacing:1.8px; text-transform:uppercase; color:var(--gold-strong); }
.page-hero h1 { font-size:26px; color:var(--navy-900); margin-top:3px; }
.page-hero .ph-desc { color:var(--muted); font-size:13.5px; max-width:660px; margin-top:5px; line-height:1.55; }
.page-hero .ph-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }

/* ===================== CARDS ===================== */
.panel { background:var(--surface); border:1px solid var(--line); border-radius:var(--r-l); box-shadow:var(--shadow-s); }
.panel + .panel { margin-top:18px; }
.panel-head { display:flex; align-items:center; gap:12px; justify-content:space-between; padding:15px 20px;
  border-bottom:1px solid var(--line-2); flex-wrap:wrap; }
.panel-title { display:flex; align-items:center; gap:10px; font-weight:800; font-size:14.5px; color:var(--navy-900); }
.panel-title .lead { width:9px; height:9px; border-radius:3px; background:var(--gold); box-shadow:0 0 0 3px var(--gold-soft); flex:0 0 auto; }
.panel-title .lead.blue { background:var(--blue); box-shadow:0 0 0 3px var(--blue-soft); }
.panel-title .lead.green { background:var(--green); box-shadow:0 0 0 3px var(--green-soft); }
.panel-title .lead.red { background:var(--red); box-shadow:0 0 0 3px var(--red-soft); }
.panel-sub { font-size:12px; color:var(--muted); font-weight:500; }
.panel-body { padding:20px; }
.panel-actions { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.panel .tools { display:flex; gap:8px; align-items:center; }

/* Section label */
.sec-label { font-size:10px; font-weight:800; letter-spacing:1.6px; text-transform:uppercase; color:var(--faint); margin:4px 0 10px; }

/* ===================== GRID ===================== */
.grid { display:grid; gap:16px; }
.g2 { grid-template-columns:repeat(2,1fr); } .g3 { grid-template-columns:repeat(3,1fr); }
.g4 { grid-template-columns:repeat(4,1fr); } .g6 { grid-template-columns:repeat(6,1fr); }
.cols-a { grid-template-columns:1fr 1.4fr; } .cols-b { grid-template-columns:1.4fr 1fr; }
.flex { display:flex; gap:12px; align-items:center; } .flex.wrap { flex-wrap:wrap; }
.spread { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.grow { flex:1; min-width:0; }
.mt { margin-top:14px; } .mb { margin-bottom:14px; } .mt0{margin-top:0}
.right { margin-left:auto; }
.stack { display:flex; flex-direction:column; gap:14px; }
.two-col { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media (max-width:980px){ .g4{grid-template-columns:repeat(2,1fr)} .g6{grid-template-columns:repeat(3,1fr)} .g3{grid-template-columns:1fr} .two-col{grid-template-columns:1fr} .cols-a,.cols-b{grid-template-columns:1fr} }
@media (max-width:640px){ .g2,.g4{grid-template-columns:1fr} .g6{grid-template-columns:repeat(2,1fr)} }

/* ===================== BUTTONS ===================== */
.btn {
  display:inline-flex; align-items:center; justify-content:center; gap:8px; cursor:pointer;
  border-radius:10px; font-weight:700; font-size:13px; padding:10px 16px; border:1px solid transparent;
  transition:.15s; white-space:nowrap; user-select:none; line-height:1.2;
}
.btn:disabled { opacity:.55; cursor:not-allowed; }
.btn svg { width:16px; height:16px; }
.btn-primary { background:linear-gradient(180deg,var(--navy-700),var(--navy-900)); color:#fff; box-shadow:var(--shadow-s); }
.btn-primary:hover { filter:brightness(1.15); box-shadow:var(--shadow-m); }
.btn-gold { background:linear-gradient(180deg,#f3c14a,var(--gold) 55%,var(--gold-strong)); color:#3a2a00; box-shadow:var(--shadow-s); }
.btn-gold:hover { filter:brightness(1.05); box-shadow:var(--shadow-m); }
.btn-ghost { background:#fff; color:var(--navy-800); border-color:#ccd7ea; }
.btn-ghost:hover { border-color:var(--blue); color:var(--blue); background:#fbfcff; }
.btn-soft { background:var(--blue-soft); color:var(--blue-ink); }
.btn-soft:hover { filter:brightness(.97); }
.btn-danger { background:var(--red); color:#fff; }
.btn-danger:hover { filter:brightness(1.08); }
.btn-danger-ghost { background:#fff; color:var(--red); border-color:#f0c6c8; }
.btn-danger-ghost:hover { background:var(--red-soft); }
.btn-success { background:var(--green); color:#fff; }
.btn-success:hover { filter:brightness(1.07); }
.btn-sm { padding:6px 11px; font-size:12px; border-radius:8px; }
.btn-lg { padding:13px 22px; font-size:14.5px; border-radius:12px; }
.btn-xs { padding:3px 8px; font-size:11px; border-radius:7px; }
.btn-icon { padding:8px; }
.btn-block { width:100%; }
.btn:active { transform:translateY(1px); }

/* ===================== FORMS ===================== */
.field { display:block; margin-bottom:15px; }
.field .fl { display:block; font-size:12px; font-weight:700; color:var(--ink-2); margin-bottom:6px; letter-spacing:.1px; }
.field .fl .req { color:var(--red); }
.field .fh { font-size:11px; color:var(--faint); font-weight:500; margin-top:5px; }
.inp, select.inp, textarea.inp {
  width:100%; background:#fff; border:1px solid #cdd8ea; border-radius:10px; padding:10px 12px;
  font-size:13.5px; color:var(--ink); font-family:inherit; outline:none; transition:border-color .14s, box-shadow .14s;
}
.inp::placeholder { color:var(--faint); }
.inp:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(36,86,224,.13); }
select.inp { appearance:none; -webkit-appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236b7a96' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 12px center; padding-right:36px; cursor:pointer; }
select.inp:disabled { background-color:#f1f4fa; color:var(--faint); }
textarea.inp { resize:vertical; min-height:84px; }
.inp.invalid { border-color:var(--red); box-shadow:0 0 0 3px rgba(214,54,60,.12); }
.input-err { color:var(--red); font-size:11.5px; margin-top:4px; font-weight:600; }

/* Checkbox / switch */
.check { display:inline-flex; align-items:center; gap:9px; cursor:pointer; font-size:13px; font-weight:600; color:var(--ink-2); user-select:none; }
.check input { width:17px; height:17px; accent-color:var(--navy-700); cursor:pointer; }

/* Segmented control */
.seg { display:inline-flex; background:#e8edf7; border-radius:11px; padding:4px; gap:3px; flex-wrap:wrap; }
.seg button { border:none; background:transparent; padding:8px 14px; border-radius:8px; font-weight:700; font-size:12.5px; color:var(--muted); cursor:pointer; transition:.14s; display:inline-flex; align-items:center; gap:7px; }
.seg button svg { width:15px; height:15px; }
.seg button.on { background:#fff; color:var(--navy-900); box-shadow:var(--shadow-s); }

/* ===================== STEPPER (carousel) ===================== */
.steps { display:flex; align-items:center; gap:6px; margin:0 0 20px; overflow-x:auto; padding:2px; }
.step { display:flex; align-items:center; gap:9px; flex:1 1 0; min-width:0; }
.step .dotc { width:34px; height:34px; border-radius:50%; background:#e6ecf7; color:var(--muted); display:grid; place-items:center; font-weight:800; font-size:13px; flex:0 0 auto; transition:.2s; }
.step .dotc svg{ width:16px; height:16px; }
.step .st-label { font-size:12px; font-weight:700; color:var(--muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; transition:.2s; }
.step .st-sub { font-size:10px; color:var(--faint); font-weight:500; display:block; }
.step.active .dotc { background:linear-gradient(135deg,var(--navy-700),var(--navy-900)); color:#fff; box-shadow:0 0 0 4px rgba(230,174,42,.25); }
.step.active .st-label { color:var(--navy-900); }
.step.done .dotc { background:var(--gold); color:#3a2a00; }
.step.done .st-label { color:var(--ink-2); }
.step .connector { flex:1; height:2px; background:#e2e9f5; border-radius:2px; min-width:12px; margin:0 2px; }
.step.done .connector, .step.active + .step .connector { background:var(--gold); }
@media (max-width:760px){ .step .st-label{display:none} }

.stage { display:none; animation:stIn .28s ease; }
.stage.on { display:block; }
@keyframes stIn { from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:none;} }

/* ===================== BADGES / CHIPS ===================== */
.chip { display:inline-flex; align-items:center; gap:5px; font-size:10.5px; font-weight:800; letter-spacing:.4px;
  text-transform:uppercase; padding:3px 9px; border-radius:999px; white-space:nowrap; }
.chip.grey { background:#eef2f8; color:var(--muted); }
.chip.navy { background:var(--navy-900); color:#fff; }
.chip.blue { background:var(--blue-soft); color:var(--blue-ink); }
.chip.green { background:var(--green-soft); color:#0f6b41; }
.chip.gold { background:var(--gold-bg); color:#8a6207; border:1px solid var(--gold-soft); }
.chip.red { background:var(--red-soft); color:#b3272c; }
.chip.orange { background:var(--orange-soft); color:#9c5c06; }
.chip.teal { background:#e0f5f2; color:#0d6b64; }

/* Status dot inside chip */
.chip .c-dot { width:6px; height:6px; border-radius:50%; background:currentColor; }

/* ===================== KPI ===================== */
.kpi { background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:16px 17px;
  box-shadow:var(--shadow-s); position:relative; overflow:hidden; }
.kpi::after { content:""; position:absolute; inset:auto 0 0 0; height:3px; background:var(--gold); opacity:.9; }
.kpi .k-l { font-size:10.5px; font-weight:800; letter-spacing:1.1px; text-transform:uppercase; color:var(--muted); display:flex; align-items:center; gap:6px; }
.kpi .k-l svg { width:14px; height:14px; color:var(--gold-strong); }
.kpi .k-v { font-size:27px; font-weight:800; color:var(--navy-900); margin-top:7px; letter-spacing:-.02em; line-height:1; }
.kpi .k-d { font-size:11px; color:var(--faint); margin-top:6px; font-weight:600; }
.kpi .k-v small{ font-size:14px; font-weight:700; color:var(--muted); }

/* ===================== TABLES ===================== */
.tbl-wrap { overflow:auto; }
table.tbl { width:100%; border-collapse:collapse; font-size:13px; }
.tbl thead th { text-align:left; font-size:10.5px; font-weight:800; text-transform:uppercase; letter-spacing:.7px;
  color:var(--muted); padding:11px 14px; border-bottom:1px solid var(--line); background:#f8fafd; white-space:nowrap; }
.tbl tbody td { padding:11px 14px; border-bottom:1px solid var(--line-2); vertical-align:middle; color:var(--ink); }
.tbl tbody tr { transition:background .1s; }
.tbl tbody tr:hover { background:#f7f9fd; }
.tbl .num { font-variant-numeric:tabular-nums; }
.tbl .mut { color:var(--muted); }
.tbl .row-act { display:flex; gap:6px; justify-content:flex-end; }
.tbl tr.clickable { cursor:pointer; }
.tbl .strong { font-weight:700; }

/* ===================== MISC UI ===================== */
.empty { text-align:center; padding:46px 20px; color:var(--muted); }
.empty .e-ic { width:58px; height:58px; margin:0 auto 14px; border-radius:18px; background:#eef2f9; color:var(--faint);
  display:grid; place-items:center; }
.empty .e-ic svg { width:28px; height:28px; }
.empty .e-t { font-weight:800; font-size:15px; color:var(--ink-2); }
.empty .e-d { font-size:12.5px; max-width:440px; margin:6px auto 16px; }

.spin { width:26px; height:26px; border-radius:50%; border:3px solid #dbe3f1; border-top-color:var(--navy-700);
  animation:rot .8s linear infinite; margin:18px auto; }
@keyframes rot { to { transform:rotate(360deg); } }

.caret-link { color:var(--blue); font-weight:700; font-size:12px; cursor:pointer; display:inline-flex; align-items:center; gap:4px; }
.caret-link:hover { text-decoration:underline; }
.caret-link svg { width:13px; height:13px; }

code { font-family:var(--mono); background:#f1f4fa; padding:1px 6px; border-radius:6px; font-size:11.5px; color:#334a7a; }

/* Progress bars */
.progress { height:8px; border-radius:99px; background:#e7edf7; overflow:hidden; }
.progress > i { display:block; height:100%; border-radius:99px; background:linear-gradient(90deg,var(--navy-600),var(--blue)); }

/* Search box */
.search { position:relative; }
.search svg { position:absolute; left:11px; top:50%; transform:translateY(-50%); width:15px; height:15px; color:var(--faint); }
.search .inp { padding-left:34px; }

/* ===================== TOASTS ===================== */
#toasts { position:fixed; top:18px; right:18px; z-index:200; display:flex; flex-direction:column; gap:9px; max-width:380px; }
.toast { display:flex; gap:11px; align-items:flex-start; background:#fff; border:1px solid var(--line);
  border-radius:13px; padding:12px 14px; box-shadow:var(--shadow-l); font-size:13px; animation:toastIn .22s ease; }
.toast .t-ic { width:22px; height:22px; border-radius:50%; display:grid; place-items:center; flex:0 0 auto; margin-top:1px; }
.toast .t-ic svg { width:13px; height:13px; color:#fff; }
.toast.ok { border-left:4px solid var(--green); } .toast.ok .t-ic{background:var(--green);}
.toast.err { border-left:4px solid var(--red); }  .toast.err .t-ic{background:var(--red);}
.toast.warn { border-left:4px solid var(--gold); } .toast.warn .t-ic{background:var(--gold);}
.toast.info { border-left:4px solid var(--blue); } .toast.info .t-ic{background:var(--blue);}
.toast .t-body b { display:block; font-size:12.5px; color:var(--ink); }
.toast .t-body span { color:var(--muted); font-size:12.5px; }
@keyframes toastIn { from { opacity:0; transform:translateX(16px);} to {opacity:1; transform:none;} }

/* ===================== MODAL ===================== */
.overlay { position:fixed; inset:0; background:rgba(7,15,35,.55); backdrop-filter:blur(3px); z-index:150;
  display:flex; align-items:center; justify-content:center; padding:20px; animation:fadeIn .16s ease; }
.modal { background:#fff; border-radius:20px; width:100%; max-width:540px; max-height:90vh; display:flex; flex-direction:column;
  box-shadow:var(--shadow-l); animation:popIn .2s ease; overflow:hidden; }
.modal.wide { max-width:860px; }
.modal-head { padding:17px 22px; border-bottom:1px solid var(--line-2); display:flex; align-items:center; gap:12px; justify-content:space-between; }
.modal-head h3 { font-size:16px; color:var(--navy-900); }
.modal-body { padding:20px 22px; overflow:auto; }
.modal-foot { padding:14px 22px; border-top:1px solid var(--line-2); display:flex; justify-content:flex-end; gap:10px; }
@keyframes fadeIn { from{opacity:0;} to{opacity:1;} }
@keyframes popIn { from{opacity:0; transform:translateY(10px) scale(.98);} to{opacity:1; transform:none;} }

/* ===================== DRAWER ===================== */
.drawer-wrap { position:fixed; inset:0; z-index:150; }
.drawer-bg { position:absolute; inset:0; background:rgba(7,15,35,.5); animation:fadeIn .16s ease; }
.drawer { position:absolute; top:0; right:0; height:100%; width:min(620px,100%); background:#fff;
  box-shadow:var(--shadow-l); display:flex; flex-direction:column; animation:drawIn .24s cubic-bezier(.2,.8,.3,1); }
.drawer.wide { width:min(860px,100%); }
@keyframes drawIn { from { transform:translateX(40px); opacity:.4; } to { transform:none; opacity:1; } }
.drawer-head { padding:18px 22px; border-bottom:1px solid var(--line-2); display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
  background:linear-gradient(180deg,#fbfcff,#fff); }
.drawer-head h3 { font-size:16.5px; color:var(--navy-900); }
.drawer-head .dh-sub { font-size:12px; color:var(--muted); margin-top:2px; }
.drawer-body { padding:22px; overflow:auto; flex:1; }
.drawer-foot { padding:14px 22px; border-top:1px solid var(--line-2); display:flex; justify-content:flex-end; gap:10px; background:#fbfcff; }

/* ===================== PHONE MOCKUPS ===================== */
.phone { width:300px; flex:0 0 300px; background:linear-gradient(180deg,#0b1526,#15233f); border-radius:38px;
  padding:11px; box-shadow:0 30px 60px -20px rgba(10,20,50,.5); }
.phone .p-screen { background:#eef1f6; border-radius:28px; overflow:hidden; height:560px; display:flex; flex-direction:column; position:relative; }
.phone .p-notch { position:absolute; top:8px; left:50%; transform:translateX(-50%); width:90px; height:20px;
  background:#0b1526; border-radius:0 0 14px 14px; z-index:5; }
.p-head { background:linear-gradient(180deg,#f8fafd,#eef2f8); padding:22px 14px 12px; text-align:center; border-bottom:1px solid #e3e9f4; }
.p-head .p-ico { width:30px; height:30px; border-radius:50%; margin:0 auto 5px; display:grid; place-items:center; }
.p-head .p-title { font-weight:800; font-size:12px; color:#24344f; }
.p-head .p-sub { font-size:9.5px; color:#8493ad; font-weight:600; letter-spacing:.5px; text-transform:uppercase; }
.p-body { flex:1; overflow:auto; padding:14px; display:flex; flex-direction:column; gap:8px; }

/* SMS thread */
.sms-bubble { align-self:flex-start; max-width:86%; background:#fff; border-radius:16px 16px 16px 4px; padding:9px 12px;
  font-size:12.5px; box-shadow:0 1px 2px rgba(20,40,80,.08); white-space:pre-wrap; word-break:break-word; color:#1c2a45; }
.sms-bubble.me { align-self:flex-end; background:linear-gradient(180deg,#2b5bd7,#2451c4); color:#fff; border-radius:16px 16px 4px 16px; }

/* WhatsApp thread */
.wa-row { display:flex; flex-direction:column; }
.wa-bubble { max-width:88%; background:#fff; border-radius:10px; padding:7px 9px; box-shadow:0 1px 1px rgba(0,0,0,.05);
  font-size:12.5px; color:#111b28; word-break:break-word; align-self:flex-end; min-width:60%; }
.wa-bubble .wa-h { color:#046162; font-weight:800; font-size:12px; }
.wa-bubble .wa-b { white-space:pre-wrap; }
.wa-bubble .wa-f { color:#667085; font-size:11px; margin-top:3px; }
.wa-bubble .wa-meta { display:flex; justify-content:flex-end; align-items:center; gap:3px; font-size:9px; color:#8aa0b0; margin-top:3px; }
.wa-btn { display:block; width:100%; margin-top:5px; padding:6px; border-radius:8px; background:#eef7f6; color:#0b6b62;
  font-weight:700; font-size:12px; text-align:center; border:1px solid #d5ebe8; }
.p-time { font-size:10px; color:#93a1b8; text-align:center; margin-bottom:2px; }
.wallpaper { background:repeating-linear-gradient(45deg,#dfe7d8,#e4ebe0 8px,#e0e8d6 8px,#e5ebe0 16px); }

/* Token highlight inside preview */
.tok { background:rgba(230,174,42,.3); color:#7a5203; border-radius:5px; padding:0 3px; font-weight:700; border:1px dashed rgba(214,154,18,.55); }
.tok.filled { background:#e0f3e7; color:#0f6b41; border-color:#a8ddbf; border-style:solid; }

/* value pill inputs (chips) */
.pills { display:flex; flex-wrap:wrap; gap:8px; }
.pill-input { display:flex; align-items:center; gap:7px; background:#fff; border:1px solid #cdd8ea; border-radius:999px; padding:5px 7px 5px 13px; font-size:12.5px; }
.pill-input b { color:var(--navy-700); font-weight:700; }
.pill-input .mini { width:92px; }

/* ===================== CHOICE CARDS ===================== */
.optcards { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:11px; }
.optcard { border:1.5px solid var(--line); border-radius:14px; padding:14px; cursor:pointer; background:#fff; transition:.15s; text-align:left; }
.optcard:hover { border-color:#b9c9e6; box-shadow:var(--shadow-s); }
.optcard.on { border-color:var(--navy-700); background:linear-gradient(180deg,#f7faff,#eef4ff); box-shadow:0 0 0 3px rgba(20,48,102,.08); }
.optcard .oc-ic { width:38px; height:38px; border-radius:11px; background:#eef2f9; color:var(--navy-700); display:grid; place-items:center; margin-bottom:10px; }
.optcard.on .oc-ic { background:var(--navy-900); color:var(--gold); }
.optcard .oc-ic svg { width:20px; height:20px; }
.optcard .oc-t { font-weight:800; font-size:13px; color:var(--navy-900); }
.optcard .oc-d { font-size:11px; color:var(--muted); margin-top:3px; line-height:1.4; }

/* Template library cards */
.tcards { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:14px; }
.tcard { background:#fff; border:1px solid var(--line); border-radius:16px; padding:15px; cursor:pointer; transition:.16s; display:flex; flex-direction:column; }
.tcard:hover { border-color:#c4d2ea; box-shadow:var(--shadow-m); transform:translateY(-1px); }
.tcard .tc-top { display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
.tcard .tc-name { font-weight:800; color:var(--navy-900); font-size:13.5px; }
.tcard .tc-desc { font-size:11.5px; color:var(--muted); margin-top:5px; line-height:1.45; flex:1; }
.tcard .tc-foot { display:flex; align-items:center; gap:6px; margin-top:12px; }

/* ===================== LOGIN ===================== */
.login-wrap { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:24px; position:relative; overflow:hidden;
  background:radial-gradient(900px 500px at 20% -10%, rgba(36,86,224,.28), transparent 60%),
             radial-gradient(800px 520px at 110% 110%, rgba(230,174,42,.25), transparent 55%),
             linear-gradient(135deg,#081531,#0e2350 55%,#122a63); }
.login-card { width:100%; max-width:430px; background:rgba(255,255,255,.97); border-radius:24px; padding:34px 34px 26px;
  box-shadow:0 40px 90px -20px rgba(0,0,0,.55); position:relative; z-index:2; }
.login-card .lc-brand { display:flex; align-items:center; gap:13px; margin-bottom:20px; }
.login-card h1 { font-size:21px; color:var(--navy-900); }
.login-card .lc-sub { font-size:12px; color:var(--muted); margin-top:3px; }
.login-card .demo-note { margin-top:16px; padding:10px 12px; border-radius:10px; background:var(--gold-bg);
  border:1px solid var(--gold-soft); font-size:11.5px; color:#7a5a09; display:flex; gap:9px; align-items:flex-start; }
.login-foot { text-align:center; margin-top:18px; font-size:11px; color:#b9c7e6; position:relative; z-index:2; }
.login-mark { position:absolute; right:-80px; bottom:-120px; width:420px; height:420px; border-radius:50%;
  border:2px solid rgba(230,174,42,.35); opacity:.5; }
.login-mark::after{ content:""; position:absolute; inset:40px; border-radius:50%; border:2px solid rgba(255,255,255,.12); }
.login-mark::before{ content:""; position:absolute; inset:100px; border-radius:50%; border:2px solid rgba(230,174,42,.25); }

/* ===================== CHAT (simulators) ===================== */
.chatwin { height:520px; overflow-y:auto; display:flex; flex-direction:column; gap:9px; padding:16px; background:#0b1526; border-radius:18px; }
.tg-chat .bubble { max-width:78%; padding:9px 13px; border-radius:16px; font-size:13px; white-space:pre-wrap; word-break:break-word; }
.tg-chat .bubble.bot { background:#fff; border-bottom-left-radius:5px; align-self:flex-start; color:#1c2a45; }
.tg-chat .bubble.me { background:linear-gradient(180deg,#3b6fe0,#2b57cc); color:#fff; border-bottom-right-radius:5px; align-self:flex-end; }
.tg-chat .bubble.sys { align-self:center; background:rgba(230,174,42,.16); color:var(--gold); border:1px solid rgba(230,174,42,.35);
  font-size:11px; border-radius:999px; padding:5px 14px; }
.tg-chat .kb { display:flex; flex-wrap:wrap; gap:7px; align-self:center; justify-content:center; }
.tg-chat .kb button { background:rgba(255,255,255,.07); color:#e8eefb; border:1px solid rgba(255,255,255,.22);
  padding:7px 15px; border-radius:999px; font-size:12.5px; font-weight:700; cursor:pointer; transition:.14s; }
.tg-chat .kb button:hover { background:var(--gold); color:#3a2a00; border-color:var(--gold); }
.tg-chat .kb button.danger { border-color:rgba(214,54,60,.6); color:#ffb4b6; }
.tg-chat .kb button.danger:hover { background:var(--red); color:#fff; }

/* WhatsApp simulator */
.wa-chat .bubble.me { align-self:flex-end; background:linear-gradient(180deg,#6cc07d,#47a05e); color:#fff; border-radius:14px 14px 4px 14px; padding:9px 12px; font-size:13px; max-width:72%; white-space:pre-wrap; }
.wa-chat .bubble.cust { align-self:flex-start; background:#fff; color:#17233a; border-radius:14px 14px 14px 4px; padding:9px 12px; font-size:13px; max-width:72%; white-space:pre-wrap; box-shadow:0 1px 1px rgba(0,0,0,.2); }
.wa-chat { background:radial-gradient(circle at 15% 15%, rgba(230,174,42,.14), transparent 40%), #0d8453; }

/* ===================== MISC ===================== */
.divider { height:1px; background:var(--line-2); margin:16px 0; border:none; }
.mono { font-family:var(--mono); }
.muted { color:var(--muted); } .faint{color:var(--faint);} .small{font-size:12px;}
.nowrap{white-space:nowrap;}
.hide{display:none !important;}
.center{text-align:center;}
.textarea-code { font-family:var(--mono); font-size:12px; }

/* Callout */
/* overflow-wrap keeps long unbroken text (e.g. raw API/JSON errors) inside the callout
   instead of forcing a horizontal scrollbar on narrow screens. */
.callout { border-radius:12px; padding:12px 15px; font-size:12.5px; display:flex; gap:10px; align-items:flex-start; line-height:1.5; overflow-wrap:anywhere; }
.callout > div { min-width:0; }
.callout.info { background:var(--blue-soft); color:#1c3f8f; }
.callout.warn { background:var(--gold-bg); color:#7a5a09; border:1px solid var(--gold-soft); }
.callout.danger { background:var(--red-soft); color:#a32a2e; }
.callout svg { width:16px; height:16px; flex:0 0 auto; margin-top:1px; }

/* statline */
.statline { display:flex; align-items:baseline; gap:8px; }
.statline .s-v { font-weight:800; font-size:18px; color:var(--navy-900); }
.statline .s-l { font-size:11px; color:var(--muted); font-weight:600; text-transform:uppercase; letter-spacing:.5px; }

/* timeline */
.timeline { display:flex; flex-direction:column; }
.tl-item { display:flex; gap:12px; padding:9px 0; border-bottom:1px dashed var(--line-2); }
.tl-item:last-child{border-bottom:none;}
.tl-dot { width:9px; height:9px; border-radius:50%; background:var(--gold); margin-top:6px; flex:0 0 auto; }
.tl-item .tl-t { font-size:12.5px; font-weight:600; color:var(--ink); }
.tl-item .tl-s { font-size:11px; color:var(--faint); }

/* responsive */
@media (max-width:1020px){
  .sidebar { position:fixed; left:0; top:64px; bottom:0; z-index:60; transform:translateX(-105%); transition:transform .2s ease; box-shadow:var(--shadow-l); }
  .sidebar.open { transform:none; }
  .main { padding:20px 16px 60px; }
  .phone { width:100%; flex:0 0 auto; }
}

/* Dashboard — glance cards + responsive columnar layout */
.glance { display:grid; gap:12px; grid-template-columns:repeat(auto-fit,minmax(168px,1fr)); }
.glance .kpi { margin:0; }
.dash-cols { display:grid; gap:16px; margin-top:16px; grid-template-columns:repeat(12,minmax(0,1fr)); }
.dash-cols .panel { grid-column:span 12; margin-top:0; }
.dash-cols .panel.s7  { grid-column:span 7; }
.dash-cols .panel.s5  { grid-column:span 5; }
.dash-cols .panel.s12 { grid-column:span 12; }
@media (max-width:1100px){ .dash-cols .panel.s7, .dash-cols .panel.s5 { grid-column:span 12; } }
/* panels placed inside any grid should not carry their extra top margin */
.grid > .panel + .panel, .dash-cols > .panel + .panel, .cols-a > .panel + .panel,
.cols-b > .panel + .panel, .g2 > .panel + .panel, .g3 > .panel + .panel { margin-top:0; }
.scrim { position:fixed; inset:0; background:rgba(7,15,35,.45); z-index:55; display:none; }
.scrim.show { display:block; }
