:root {
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #f1f4fa; --border: #e3e8f2; --text: #151a2c; --muted: #66708a;
  --accent: #2f5bff; --accent-2: #6a4dff; --accent-soft: #e8edff; --accent-text: #fff;
  --good: #0e9f6e; --good-bg: #dcf6ec; --warn: #b7791f; --warn-bg: #fdf0d2; --bad: #d13a3a; --bad-bg: #fde4e4; --info: #1d6fd6; --info-bg: #e0eeff; --orange: #c2570c; --orange-bg: #ffe9d6;
  --shadow: 0 1px 2px rgba(20,30,60,.06), 0 8px 24px rgba(20,30,60,.06);
  --radius: 14px; --sidebar: 268px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Bengali", Arial, sans-serif;
}
:root[data-theme="dark"] {
  --bg: #0d1120; --surface: #151b2f; --surface-2: #1b2340; --border: #252e4d; --text: #e8ecf8; --muted: #8c97b5;
  --accent: #5b82ff; --accent-2: #8a74ff; --accent-soft: #1f2a52; --accent-text: #0b1020;
  --good: #34d399; --good-bg: #0f3a2d; --warn: #f5c451; --warn-bg: #3d3112; --bad: #ff7a7a; --bad-bg: #431b1f; --info: #6cb0ff; --info-bg: #14305a; --orange: #ffa05a; --orange-bg: #432a14;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body.noscroll { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.ic { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.sm-text { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 0; min-width: 0; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.hidden { display: none !important; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 600; padding: 11px 18px; border-radius: 12px; cursor: pointer; transition: transform .08s, box-shadow .15s, opacity .15s; min-height: 44px; }
.btn:hover { box-shadow: 0 6px 18px rgba(47,91,255,.28); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn.danger { background: var(--bad); }
.btn.good { background: var(--good); }
.btn.sm { padding: 6px 12px; min-height: 34px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.active { border-color: var(--accent); color: var(--accent); }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* forms */
label.f { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; min-height: 46px; color: var(--text); font-weight: 500; }
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input[readonly] { background: var(--surface-2); }
.input-icon { position: relative; }
.input-icon > .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon > .input { padding-left: 42px; }
.select-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 14px; min-height: 46px; cursor: pointer; font-weight: 500; }
.select-btn:hover { border-color: var(--accent); }
.select-btn .txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.hint { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card h3 { font-size: 17px; margin-bottom: 14px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.stat { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.stat .ico.g { background: linear-gradient(135deg, #10b981, #0e9f6e); }
.stat .ico.o { background: linear-gradient(135deg, #f59e0b, #e0780c); }
.stat .ico.p { background: linear-gradient(135deg, #8b5cf6, #6d3ee0); }
.stat .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .val { font-size: 22px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }

/* platform tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.tile { display: grid; justify-items: center; gap: 8px; padding: 14px 6px; background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; cursor: pointer; font-weight: 600; font-size: 13px; text-align: center; transition: .15s; }
.tile .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile.on { border-color: var(--accent); background: var(--accent-soft); }
.tile.on .ico { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }

/* tabs */
.tabs { display: flex; gap: 6px; background: var(--surface-2); padding: 5px; border-radius: 14px; }
.tab { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border-radius: 10px; font-weight: 700; color: var(--muted); border: 0; background: transparent; cursor: pointer; }
.tab.on { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 11px 14px; background: var(--surface-2); white-space: nowrap; }
table.t td { padding: 12px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
table.t tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
td.link-cell { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.name-cell { min-width: 220px; max-width: 420px; }
.empty { text-align: center; padding: 38px 10px; color: var(--muted); }
.empty .ic { opacity: .5; margin-bottom: 8px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge.good { background: var(--good-bg); color: var(--good); } .badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); }
.badge.orange { background: var(--orange-bg); color: var(--orange); } .badge.muted { background: var(--surface-2); color: var(--muted); }
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); margin-right: 8px; }
.price { font-weight: 800; color: var(--good); background: var(--good-bg); padding: 3px 9px; border-radius: 9px; font-size: 13px; white-space: nowrap; }
.pager { display: flex; gap: 12px; justify-content: center; align-items: center; padding: 14px 0 2px; }

/* shell */
.shell { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 18px 14px; display: flex; flex-direction: column; gap: 14px; z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px; }
.logo { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 16px rgba(47,91,255,.3); }
.brand b { display: block; font-size: 18px; letter-spacing: .02em; font-weight: 800; }
.brand small { display: block; font-size: 10.5px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.me { display: flex; align-items: center; gap: 10px; background: var(--accent-soft); border: 1px solid var(--border); padding: 10px; border-radius: 14px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); position: relative; text-transform: uppercase; flex: none; }
.avatar::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid var(--surface); }
.me .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me .sub { font-size: 12px; color: var(--muted); }
.nav { display: grid; gap: 3px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--text); font-weight: 600; }
.nav a .ic { color: var(--accent); }
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; box-shadow: 0 6px 16px rgba(47,91,255,.25); }
.nav a.on .ic { color: #fff; }
.nav .count { margin-left: auto; background: #f59e0b; color: #fff; font-size: 11px; font-weight: 800; min-width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; padding: 0 6px; }
.nav .sep { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 12px 12px 4px; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 12px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.topbar .spacer { flex: 1; }
.topbar .burger { display: none; }
.topbar h2 { font-size: 18px; }
.content { padding: 24px; max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.scrim { display: none; }
select.input.cur-select { width: auto; min-height: 42px; padding: 8px 10px; border-radius: 12px; font-weight: 700; }
.topbar h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* overlay / dialogs */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(10,14,30,.55); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.dialog { width: min(520px, 100%); max-height: 88vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.35); animation: pop .18s; }
.dialog.wide { width: min(760px, 100%); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 12px; }
.dialog-head h3 { font-size: 18px; }
.dialog-body { padding: 4px 18px 18px; overflow-y: auto; }
.overlay.sheet { place-items: end center; padding: 0; }
.overlay.sheet .dialog { width: min(640px, 100%); border-radius: 22px 22px 0 0; max-height: 82vh; animation: slide .2s; }
.pick-list { display: grid; gap: 2px; margin-top: 12px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; cursor: pointer; border: 0; background: transparent; text-align: left; width: 100%; }
.pick:hover { background: var(--surface-2); }
.pick.on { background: var(--accent-soft); }
.pick .nm { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; }
.pick .ic.tick { color: var(--accent); }
.new-tag { font-size: 10px; font-weight: 800; background: #ef4444; color: #fff; padding: 1px 6px; border-radius: 6px; margin-left: 6px; vertical-align: middle; }
.info-box { background: var(--surface-2); border: 1px dashed var(--border); border-radius: 12px; padding: 14px; font-size: 14px; display: grid; gap: 8px; }
.info-box .kv { display: flex; gap: 8px; flex-wrap: wrap; }
.info-box .kv span { background: var(--surface); border: 1px solid var(--border); padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 700; }
.desc { white-space: pre-wrap; color: var(--muted); font-size: 13.5px; }
.charge-box { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); font-weight: 700; }
.charge-box b { font-size: 22px; letter-spacing: -.02em; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 14px; background: var(--info-bg); color: var(--info); display: flex; gap: 10px; align-items: flex-start; }
.alert.warn { background: var(--warn-bg); color: var(--warn); } .alert.bad { background: var(--bad-bg); color: var(--bad); } .alert.good { background: var(--good-bg); color: var(--good); }
.codebox { background: #0f1426; color: #d6e0ff; border-radius: 12px; padding: 14px; overflow-x: auto; font: 13px/1.6 ui-monospace, Menlo, Consolas, monospace; white-space: pre; }
.kbd { display: flex; gap: 8px; align-items: center; }
.kbd .input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.msg { max-width: 82%; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.me { background: var(--accent-soft); margin-left: auto; }
.msg small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 6px; }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; min-width: 90px; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.float-help { position: fixed; right: 18px; bottom: 18px; z-index: 50; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #22c55e; color: #fff; box-shadow: 0 8px 24px rgba(34,197,94,.45); }
.float-help:hover { transform: scale(1.06); }
#toasts { position: fixed; z-index: 200; right: 16px; top: 16px; display: grid; gap: 8px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-weight: 600; animation: slidein .2s; }
.toast.ok .ic { color: var(--good); } .toast.err { border-color: var(--bad); } .toast.err .ic { color: var(--bad); }
.toast.out { opacity: 0; transform: translateX(20px); transition: .3s; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: shine 1.2s infinite; border-radius: 10px; height: 18px; }

/* landing / auth */
.landing { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; background: radial-gradient(1200px 500px at 50% -10%, var(--accent-soft), transparent), var(--bg); }
.landing-nav { display: flex; justify-content: space-between; align-items: center; padding: 16px 22px; max-width: 1100px; margin: 0 auto; width: 100%; }
.hero { width: 100%; max-width: 760px; margin: 0 auto; padding: 48px 22px 24px; text-align: center; display: grid; gap: 20px; justify-items: center; }
.hero .pill { display: inline-flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--border); padding: 8px 16px; border-radius: 99px; font-weight: 700; box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(32px, 6vw, 54px); letter-spacing: -.03em; line-height: 1.08; }
.hero h1 em { font-style: normal; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 17px; max-width: 580px; margin: 0; }
.hero .cta { display: grid; gap: 12px; width: min(380px, 100%); }
.landing-nav .row { flex-wrap: nowrap; }
.features { width: 100%; max-width: 1000px; margin: 20px auto 60px; padding: 0 22px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; display: grid; gap: 8px; }
.feature .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.auth-card { width: min(430px, 100%); margin: 0 auto; }

@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: scale(.96); } } @keyframes slide { from { transform: translateY(40px); opacity: .5; } }
@keyframes slidein { from { opacity: 0; transform: translateX(16px); } } @keyframes shine { to { background-position: -200% 0; } }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10,14,30,.5); z-index: 35; }
  .topbar { padding: 10px 14px; } .topbar .burger { display: inline-grid; }
  .content { padding: 14px; }
  .card { padding: 16px; }
  .tiles { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .tile { padding: 10px 2px; font-size: 11.5px; } .tile .ico { width: 36px; height: 36px; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; } .stat { padding: 12px; gap: 10px; } .stat .ico { width: 40px; height: 40px; } .stat .val { font-size: 18px; }
}
@media (max-width: 600px) { #toasts { top: auto; bottom: 84px; } .topbar .avatar { display: none; } }
@media (max-width: 420px) { .tiles { grid-template-columns: repeat(3, 1fr); } .hide-xs { display: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.landing-nav .btn { white-space: nowrap; }
