/* RoamiGo Digital Marketing · Meta Ads — "Clean white" look, like the Sales Desk */
@font-face { font-family: "Hind Siliguri"; src: url("/static/fonts/HindSiliguri-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hind Siliguri"; src: url("/static/fonts/HindSiliguri-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --bg: #F4F5F7; --card: #FFFFFF; --line: #E6E8EC; --line-2: #D9DDE4;
  --text: #18212F; --muted: #6B7280; --faint: #9AA3B2;
  --navy: #10234E; --navy-2: #0B1A3C; --gold: #D4A53A; --gold-soft: #FBF3E0;
  --amber: #F2A93B; --coral: #F26B5B; --green: #1E9E63; --green-soft: #E6F6EE;
  --red: #D14343; --red-soft: #FDECEC; --blue: #2F6FED; --blue-soft: #EAF0FD; --warn-soft: #FFF4E0;
  --shadow: 0 1px 2px rgba(16, 35, 78, .05); --r: 14px; --r-s: 10px;
  --sunrise: linear-gradient(135deg, #D4A53A 0%, #F2A93B 55%, #F26B5B 100%);
  --tab-h: 56px; --top-h: 56px; --side-w: 236px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hind Siliguri", "Noto Sans Bengali", sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0B1530; --card: #121F3E; --line: #22335C; --line-2: #2C3F6E;
  --text: #E9EDF6; --muted: #A3AFC9; --faint: #6F7C9B;
  --gold-soft: #2B2A1E; --green-soft: #14302A; --red-soft: #3A1E22; --blue-soft: #16244A; --warn-soft: #3A2E18;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45;
  overflow-x: hidden; overscroll-behavior-y: none; min-height: 100%; }
body.locked { overflow: hidden; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.bn { font-family: "Hind Siliguri", var(--font); }
.mono { font-variant-numeric: tabular-nums; }
.right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.sr { position: absolute; left: -9999px; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.s { width: 18px; height: 18px; }

/* ---------- shell ---------- */
.shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.side { display: none; }
.top { position: sticky; top: 0; z-index: 20; height: calc(var(--top-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top);
  background: var(--card); display: flex; align-items: center; gap: 10px; padding-left: 12px; padding-right: 12px; border-bottom: 1px solid transparent; }
.top.scrolled { border-bottom-color: var(--line); }
.top .title { flex: 1; min-width: 0; }
.top .title h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .title .sub { font-size: 12px; color: var(--muted); margin-top: -2px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; color: var(--text); position: relative; }
.iconbtn:active { background: var(--bg); }
.iconbtn .dot { position: absolute; top: 7px; right: 7px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--coral); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.main { flex: 1; padding: 12px 16px calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); max-width: 1120px; width: 100%; margin: 0 auto; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line); display: flex; }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 600; position: relative; }
.tabs a .icon { width: 24px; height: 24px; }
.tabs a.on { color: var(--navy); }
:root[data-theme="dark"] .tabs a.on { color: var(--gold); }
.tabs a.on::before { content: ""; position: absolute; top: 6px; width: 48px; height: 30px; border-radius: 15px; background: var(--gold-soft); z-index: -1; }
.tabs a .dot { position: absolute; top: 6px; right: calc(50% - 24px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--coral); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
body.kbd .tabs { display: none; }

@media (min-width: 900px) {
  .shell { flex-direction: row; }
  .side { display: flex; flex-direction: column; width: var(--side-w); flex: none; background: var(--navy); color: #E8ECF5; position: sticky; top: 0; height: 100vh; padding: 18px 12px; }
  .side .brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
  .side .brand .mark { width: 40px; height: 40px; border-radius: 12px; background: var(--gold); display: grid; place-items: center; color: var(--navy); font-weight: 800; font-family: Georgia, "Times New Roman", serif; font-size: 22px; }
  .side .brand b { display: block; font-size: 15px; letter-spacing: .01em; }
  .side .brand span { display: block; font-size: 12px; color: var(--gold); }
  .side nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #C7D0E6; font-weight: 600; font-size: 14px; margin-bottom: 2px; }
  .side nav a .icon { width: 20px; height: 20px; }
  .side nav a.on { background: rgba(255, 255, 255, .1); color: #fff; }
  .side nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
  .side nav a .dot { margin-left: auto; background: var(--coral); color: #fff; font-size: 11px; font-weight: 700; border-radius: 9px; padding: 0 6px; min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
  .side .foot { margin-top: auto; font-size: 12px; color: #8E9BBD; padding: 10px 12px; }
  .side .foot b { color: #C7D0E6; }
  .wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .top { height: var(--top-h); padding: 0 24px; }
  .top .back { display: none; }
  .main { padding: 18px 24px 40px; }
  .tabs { display: none; }
  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  .cols > .span { grid-column: 1 / -1; }
}
.top .back { display: inline-flex; }
.top .back.hide { display: none; }

.only-desk { display: none; }
@media (min-width: 900px) { .only-desk { display: block; } .only-phone { display: none; } }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 14px; }
.card.tight { padding: 0; overflow: hidden; }
.card h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.card h2 .spacer { flex: 1; }
.band { background: var(--sunrise); color: #fff; border: 0; }
.band h2, .band .muted { color: rgba(255, 255, 255, .92); }
.band .kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.band .kpi { background: rgba(255, 255, 255, .16); border-radius: 12px; padding: 8px 10px; }
.band .kpi b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.band .kpi span { font-size: 11px; opacity: .9; }
@media (max-width: 420px) { .band .kpis { grid-template-columns: repeat(2, 1fr); } }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); min-height: 52px; }
.row:first-child { border-top: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .grow b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .grow .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.link { cursor: pointer; }
.row.link:active { background: var(--bg); }
.row .chev { color: var(--faint); }
.list .row:first-child { border-top: 0; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--muted); white-space: nowrap; border: 1px solid var(--line); }
.pill.good { background: var(--green-soft); color: var(--green); border-color: transparent; }
.pill.bad { background: var(--red-soft); color: var(--red); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: #9A6400; border-color: transparent; }
.pill.info { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.pill.gold { background: var(--gold-soft); color: #8A6A17; border-color: transparent; }
:root[data-theme="dark"] .pill.gold { color: var(--gold); }
:root[data-theme="dark"] .pill.warn { color: #F2C56B; }
.dotl { width: 10px; height: 10px; border-radius: 5px; flex: none; }
.dotl.error { background: var(--red); } .dotl.warn { background: var(--amber); } .dotl.good { background: var(--green); } .dotl.note, .dotl.info { background: var(--blue); }
.skeleton { background: linear-gradient(90deg, var(--bg) 25%, var(--line) 50%, var(--bg) 75%); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: 8px; height: 14px; }
@keyframes sh { from { background-position: 200% 0 } to { background-position: -200% 0 } }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty .icon { width: 36px; height: 36px; color: var(--faint); margin: 0 auto 8px; }
.notice { border-radius: var(--r-s); padding: 10px 12px; font-size: 14px; margin-bottom: 12px; border: 1px solid transparent; }
.notice.error { background: var(--red-soft); color: var(--red); }
.notice.warn { background: var(--warn-soft); color: #8A5A00; }
:root[data-theme="dark"] .notice.warn { color: #F2C56B; }
.notice.info { background: var(--blue-soft); color: var(--blue); }
.notice.good { background: var(--green-soft); color: var(--green); }
.notice.gold { background: var(--gold-soft); color: #7A5C12; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--sunrise); color: #fff; border: 0; box-shadow: 0 2px 8px rgba(242, 107, 91, .25); }
.btn.navy { background: var(--navy); color: #fff; border: 0; }
.btn.danger { color: var(--red); border-color: var(--red-soft); background: var(--red-soft); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--blue); padding: 0 8px; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btns.end { justify-content: flex-end; }
.seg { display: inline-flex; background: var(--bg); border-radius: 12px; padding: 3px; border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ---------- forms ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field .hint { font-size: 12px; color: var(--faint); margin-top: 4px; }
.input, textarea.input, select.input { width: 100%; height: 42px; border: 1px solid var(--line-2); border-radius: 12px; padding: 0 12px; background: var(--card); color: var(--text); font-size: 16px; outline: none; }
textarea.input { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(16, 35, 78, .08); }
:root[data-theme="dark"] .input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212, 165, 58, .15); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 420px) { .grid2 { grid-template-columns: 1fr; } }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.check:first-child { border-top: 0; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--navy); flex: none; }
.check .t b { display: block; font-weight: 600; }
.check .t span { color: var(--muted); font-size: 13px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.switch:first-child { border-top: 0; }
.switch input { width: 44px; height: 26px; appearance: none; background: var(--line-2); border-radius: 13px; position: relative; flex: none; transition: .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 10px; background: #fff; transition: .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked { background: var(--green); }
.switch input:checked::after { left: 21px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--card); font-weight: 600; font-size: 14px; }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
:root[data-theme="dark"] .chip.on { background: var(--gold); color: var(--navy); border-color: var(--gold); }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .name { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
.scroll-x::-webkit-scrollbar { height: 6px; }
.scroll-x::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }

/* ---------- sheets & toasts ---------- */
.overlay { position: fixed; inset: 0; background: rgba(9, 22, 52, .45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.sheet { background: var(--card); width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; display: flex; flex-direction: column; animation: up .2s; padding-bottom: env(safe-area-inset-bottom); }
@keyframes up { from { transform: translateY(40px); opacity: .6 } to { transform: none; opacity: 1 } }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 8px auto 0; }
.sheet header { display: flex; align-items: center; gap: 8px; padding: 10px 16px 6px; }
.sheet header h2 { flex: 1; }
.sheet .body { padding: 6px 16px 16px; overflow: auto; }
.sheet .foot { padding: 10px 16px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
@media (min-width: 900px) { .overlay { align-items: center; } .sheet { width: 560px; max-height: 86vh; border-radius: 18px; animation: fade .15s; } .sheet.wide { width: 860px; } }
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + 16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 60; pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
.toast { background: var(--navy-2); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 6px 20px rgba(0, 0, 0, .2); max-width: 92vw; animation: up .2s; }
.toast.error { background: var(--red); }
.toast.good { background: var(--green); }
.offline { position: fixed; top: calc(var(--top-h) + env(safe-area-inset-top)); left: 0; right: 0; background: var(--amber); color: #3A2600; text-align: center; font-size: 13px; padding: 4px; z-index: 30; }

/* ---------- login ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: var(--bg); }
.auth .box { width: 100%; max-width: 380px; }
.auth .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth .logo .mark { width: 52px; height: 52px; border-radius: 16px; background: var(--navy); color: var(--gold); display: grid; place-items: center; font-family: Georgia, serif; font-weight: 800; font-size: 28px; }
.auth .logo b { display: block; font-size: 18px; } .auth .logo span { display: block; font-size: 13px; color: var(--muted); }

/* ---------- misc screens ---------- */
.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps span.on { background: var(--gold); }
.steps span.done { background: var(--navy); }
:root[data-theme="dark"] .steps span.done { background: var(--gold); opacity: .6; }
.pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.pic { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--bg); position: relative; }
.pic img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.pic .cap { padding: 6px 8px; font-size: 12px; }
.pic .cap b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pic.sel { outline: 3px solid var(--gold); }
.pic .tick { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 13px; background: var(--gold); color: var(--navy); display: grid; place-items: center; font-weight: 800; }
.preview { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; min-height: 200px; }
.preview img { max-height: 520px; width: auto; border-radius: 8px; }
.tree { font-size: 14px; }
.tree .node { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--line); }
.tree .node:first-child { border-top: 0; }
.tree .node.l1 { padding-left: 18px; } .tree .node.l2 { padding-left: 36px; }
.tree .node .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checks li { display: flex; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; align-items: flex-start; }
.checks li:first-child { border-top: 0; }
.checks { list-style: none; margin: 0; padding: 0; }
.copybox { white-space: pre-wrap; font-size: 14px; line-height: 1.5; background: var(--bg); border-radius: 10px; padding: 10px 12px; border: 1px solid var(--line); }
.count { display: inline-flex; align-items: center; gap: 6px; }
.count button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); font-size: 18px; }
.count b { min-width: 28px; text-align: center; font-size: 17px; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 20px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.ext { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.demo { background: var(--gold-soft); color: #7A5C12; text-align: center; font-size: 12px; padding: 4px; }
::-webkit-scrollbar { width: 8px; } ::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
