/* ==========================================================================
   Kisti Lock — "Lagoon" design system
   Warm paper canvas · deep lagoon teal · ink sidebar · semantic status colours
   Mobile-first; works on phone, tablet and laptop. Light + dark.
   ========================================================================== */

@font-face { font-family: "KL Inter"; src: url("../fonts/inter-latin-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "KL Manrope"; src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "KL Bengali"; src: url("../fonts/noto-sans-bengali-bengali-wght-normal.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CF7, U+200C-200D, U+20B9, U+25CC; size-adjust: 103%; }

:root {
  color-scheme: light;
  --font-ui: "KL Inter", "KL Bengali", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Bengali", sans-serif;
  --font-display: "KL Manrope", "KL Bengali", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  /* canvas & surfaces */
  --bg: #f4f3ef;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --surface-3: #f1efe9;
  --line: #e7e4dc;
  --line-strong: #d4d0c3;
  --text: #14201f;
  --text-2: #475755;
  --text-3: #76847f;
  --ink: #0a1a1d;
  --ink-2: #102528;
  --ink-line: #1c3a3e;
  --ink-text: #b9cdcc;

  /* brand (overridden inline from Settings > Appearance) */
  --brand: #0e6f73;
  --brand-600: #0a595d;
  --brand-700: #08464a;
  --brand-50: #e7f3f3;
  --brand-100: #cde7e7;
  --brand-ring: rgba(14, 111, 115, .28);
  --on-brand: #ffffff;

  /* semantic */
  --ok: #167a43;   --ok-bg: #e4f4ea;   --ok-line: #bfe3cc;
  --bad: #b4332e;  --bad-bg: #fcebea;  --bad-line: #f3c6c3;
  --warn: #946200; --warn-bg: #fcf1d6; --warn-line: #f1dda3;
  --info: #2358b8; --info-bg: #e8effc; --info-line: #c4d5f6;
  --vio: #5b3fd1;  --vio-bg: #efebfd;  --vio-line: #d6ccf8;
  --mute: #566361; --mute-bg: #eeede8; --mute-line: #dedbd1;
  --ok-solid: #1f9d55; --bad-solid: #d6403a; --warn-solid: #e0a010; --info-solid: #2f6fde; --vio-solid: #7a5af8;

  --r-sm: 8px; --r: 10px; --r-lg: 14px; --r-xl: 20px;
  --shadow-1: 0 1px 2px rgba(20, 32, 31, .06), 0 1px 1px rgba(20, 32, 31, .04);
  --shadow-2: 0 4px 14px rgba(20, 32, 31, .08), 0 1px 3px rgba(20, 32, 31, .06);
  --shadow-3: 0 18px 50px rgba(10, 26, 29, .22), 0 4px 14px rgba(10, 26, 29, .12);
  --sidebar-w: 256px;
  --topbar-h: 60px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #091315; --surface: #101d20; --surface-2: #142427; --surface-3: #1a2d31;
  --line: #1f3337; --line-strong: #2b4448;
  --text: #e8f0ef; --text-2: #aebdbb; --text-3: #7f908e;
  --ink: #061012; --ink-2: #0b1a1d; --ink-line: #17302f; --ink-text: #a7bdbc;
  --ok: #5fd08e; --ok-bg: #11291c; --ok-line: #1d4a31;
  --bad: #ff8f87; --bad-bg: #321513; --bad-line: #5a2622;
  --warn: #f2c25a; --warn-bg: #2d2208; --warn-line: #5a4512;
  --info: #8db4ff; --info-bg: #11203d; --info-line: #223a69;
  --vio: #b6a2ff; --vio-bg: #1f1840; --vio-line: #3a2f77;
  --mute: #a9b7b5; --mute-bg: #1b2a2d; --mute-line: #2a3f43;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 6px 18px rgba(0, 0, 0, .4);
  --shadow-3: 0 22px 60px rgba(0, 0, 0, .6);
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    color-scheme: dark;
    --bg: #091315; --surface: #101d20; --surface-2: #142427; --surface-3: #1a2d31;
    --line: #1f3337; --line-strong: #2b4448;
    --text: #e8f0ef; --text-2: #aebdbb; --text-3: #7f908e;
    --ink: #061012; --ink-2: #0b1a1d; --ink-line: #17302f; --ink-text: #a7bdbc;
    --ok: #5fd08e; --ok-bg: #11291c; --ok-line: #1d4a31;
    --bad: #ff8f87; --bad-bg: #321513; --bad-line: #5a2622;
    --warn: #f2c25a; --warn-bg: #2d2208; --warn-line: #5a4512;
    --info: #8db4ff; --info-bg: #11203d; --info-line: #223a69;
    --vio: #b6a2ff; --vio-bg: #1f1840; --vio-line: #3a2f77;
    --mute: #a9b7b5; --mute-bg: #1b2a2d; --mute-line: #2a3f43;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-2: 0 6px 18px rgba(0, 0, 0, .4);
    --shadow-3: 0 22px 60px rgba(0, 0, 0, .6);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.55 var(--font-ui); letter-spacing: -.003em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100dvh;
}
:lang(bn) body, html[lang="bn"] body { line-height: 1.62; letter-spacing: 0; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -.015em; line-height: 1.25; margin: 0; color: var(--text); }
html[lang="bn"] h1, html[lang="bn"] h2, html[lang="bn"] h3, html[lang="bn"] h4 { letter-spacing: 0; line-height: 1.35; }
p { margin: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--brand-100); color: var(--brand-700); }
[hidden] { display: none !important; }
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.i-lg { width: 22px; height: 22px; }
.i-xl { width: 28px; height: 28px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: 0; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.ok { color: var(--ok); } .bad { color: var(--bad); } .warn { color: var(--warn); } .info { color: var(--info); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.right { text-align: right; } .center { text-align: center; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 650; }
.small { font-size: 13px; } .xs { font-size: 12px; }

/* ---------- layout helpers ---------- */
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.start { align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-sm { display: flex; flex-direction: column; gap: 6px; }
.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.gap-sm { gap: 8px; } .gap-xs { gap: 4px; } .gap-lg { gap: 20px; }
.grow { flex: 1 1 0; min-width: 0; }
.shrink-0 { flex: none; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.split-wide { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 28px; } .mb { margin-bottom: 16px; } .mt-sm { margin-top: 8px; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; background: var(--ink); color: var(--ink-text);
  display: flex; flex-direction: column; padding: 14px 12px; gap: 6px; overflow-y: auto; z-index: 50;
  scrollbar-width: thin; scrollbar-color: var(--ink-line) transparent;
}
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 6px 8px 14px; color: #fff; }
.sb-brand:hover { text-decoration: none; }
.sb-logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(145deg, var(--brand), var(--brand-700)); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16), 0 4px 12px rgba(0,0,0,.35); overflow: hidden; flex: none; }
.sb-logo img { width: 100%; height: 100%; object-fit: cover; }
.sb-logo svg { width: 22px; height: 22px; color: #fff; }
.sb-name { font: 700 16px/1.15 var(--font-display); letter-spacing: -.01em; }
.sb-sub { font-size: 12px; color: var(--ink-text); opacity: .75; margin-top: 2px; }
.sb-group { margin-top: 10px; }
.sb-label { font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: #6f8d8c; padding: 8px 10px 5px; }
html[lang="bn"] .sb-label { letter-spacing: 0; text-transform: none; font-size: 12px; }
.sb-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; color: var(--ink-text);
  font-weight: 500; font-size: 14px; transition: background .14s var(--ease), color .14s; position: relative;
}
.sb-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.sb-link.active { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.sb-link.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-ring); background: #3fd0d6; }
.sb-link .i { width: 18px; height: 18px; opacity: .9; }
.sb-badge { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: #d6403a; color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.sb-badge.soft { background: rgba(255,255,255,.12); color: #d8e8e7; }
.sb-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--ink-line); }
.sb-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; color: #fff; }
.sb-user .who { min-width: 0; }
.sb-user .who b { display: block; font-size: 13.5px; font-weight: 600; }
.sb-user .who span { display: block; font-size: 12px; color: var(--ink-text); opacity: .75; }
.sb-demo { margin: 8px 4px 0; padding: 8px 10px; border-radius: 10px; background: rgba(224, 160, 16, .12); color: #f2c25a; font-size: 12px; border: 1px solid rgba(224,160,16,.25); }
.scrim { position: fixed; inset: 0; background: rgba(5, 14, 16, .55); backdrop-filter: blur(2px); z-index: 45; opacity: 0; pointer-events: none; transition: opacity .2s; }

.app-main { min-width: 0; display: flex; flex-direction: column; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 10px;
  padding: 0 clamp(14px, 3vw, 32px); background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line);
}
.tb-menu { display: none; }
.tb-search {
  flex: 1 1 auto; max-width: 460px; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text-3); cursor: text; text-align: left;
  transition: border-color .15s, box-shadow .15s;
}
.tb-search:hover { border-color: var(--line-strong); }
.tb-search span { flex: 1; font-size: 14px; }
.kbd { font: 600 11px/1 var(--font-ui); padding: 3px 6px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--line); color: var(--text-3); }
.tb-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative; width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--text-2); transition: background .14s, color .14s, border-color .14s;
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); color: var(--text); text-decoration: none; }
.icon-btn .i { width: 19px; height: 19px; }
.icon-btn .pip { position: absolute; top: 6px; right: 6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--bad-solid); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; border: 2px solid var(--bg); box-sizing: content-box; }
.lang-toggle { font-weight: 700; font-size: 13px; width: auto; padding: 0 10px; gap: 6px; display: inline-flex; align-items: center; }
.content { padding: 24px clamp(14px, 3vw, 32px) 96px; width: 100%; max-width: 1520px; margin-inline: auto; flex: 1; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-size: clamp(22px, 2.4vw, 28px); }
.page-sub { color: var(--text-3); margin-top: 4px; font-size: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-3); margin-bottom: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--brand); }

.bottomnav { display: none; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; flex-wrap: wrap; }
.card-title { font: 700 15.5px/1.3 var(--font-display); }
.card-sub { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.card-body { padding: 16px 20px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.card-flush .card-body { padding: 0; }
.card.accent { border-color: var(--brand-100); background: linear-gradient(180deg, var(--brand-50), var(--surface) 70%); }
.card.pad { padding: 20px; }
.section-title { font: 700 13px/1 var(--font-ui); text-transform: uppercase; letter-spacing: .07em; color: var(--text-3); margin: 0 0 10px; }
html[lang="bn"] .section-title { text-transform: none; letter-spacing: 0; font-size: 14px; }

/* ---------- stat tiles ---------- */
.stats { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-1); position: relative; overflow: hidden; display: block; color: inherit; transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; }
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-strong); text-decoration: none; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stat-label { font-size: 13px; color: var(--text-3); font-weight: 500; }
.stat-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.stat-ico.bad { background: var(--bad-bg); color: var(--bad); } .stat-ico.warn { background: var(--warn-bg); color: var(--warn); }
.stat-ico.ok { background: var(--ok-bg); color: var(--ok); } .stat-ico.info { background: var(--info-bg); color: var(--info); } .stat-ico.vio { background: var(--vio-bg); color: var(--vio); }
.stat-value { font: 800 28px/1.1 var(--font-display); letter-spacing: -.02em; margin-top: 10px; font-variant-numeric: tabular-nums; }
.stat-meta { font-size: 12.5px; color: var(--text-3); margin-top: 6px; }
.stats.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1680px) { .stats.six { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 899px) { .stats.six { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-spark { position: absolute; right: 0; bottom: 0; width: 40%; height: 38px; opacity: .85; pointer-events: none; }
.stat-value { position: relative; z-index: 1; }

/* ---------- buttons ---------- */
.btn {
  --b: var(--surface); --bc: var(--line-strong); --c: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 10px;
  border: 1px solid var(--bc); background: var(--b); color: var(--c); font-weight: 600; font-size: 14px; line-height: 1; white-space: nowrap;
  transition: background .14s, border-color .14s, box-shadow .14s, transform .08s; box-shadow: var(--shadow-1); user-select: none; text-decoration: none !important;
}
.btn:hover { --b: var(--surface-2); --bc: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn .i { width: 17px; height: 17px; }
.btn-primary { --b: var(--brand); --bc: var(--brand); --c: var(--on-brand); box-shadow: 0 1px 2px rgba(0,0,0,.15), inset 0 1px 0 rgba(255,255,255,.14); }
.btn-primary:hover { --b: var(--brand-600); --bc: var(--brand-600); }
.btn-danger { --b: var(--bad-solid); --bc: var(--bad-solid); --c: #fff; }
.btn-danger:hover { --b: #bd322d; --bc: #bd322d; }
.btn-soft { --b: var(--brand-50); --bc: transparent; --c: var(--brand); box-shadow: none; }
.btn-soft:hover { --b: var(--brand-100); --bc: transparent; }
.btn-soft-danger { --b: var(--bad-bg); --bc: transparent; --c: var(--bad); box-shadow: none; }
.btn-soft-danger:hover { --b: var(--bad-line); --bc: transparent; }
.btn-ghost { --b: transparent; --bc: transparent; box-shadow: none; --c: var(--text-2); }
.btn-ghost:hover { --b: var(--surface-3); --bc: transparent; --c: var(--text); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; gap: 6px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn-icon { width: 38px; padding: 0; } .btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-group { display: inline-flex; } .btn-group .btn { border-radius: 0; margin-left: -1px; } .btn-group .btn:first-child { border-radius: 10px 0 0 10px; margin-left: 0; } .btn-group .btn:last-child { border-radius: 0 10px 10px 0; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.req { color: var(--bad-solid); }
.hint { font-size: 12.5px; color: var(--text-3); }
.error { font-size: 12.5px; color: var(--bad); display: flex; gap: 6px; align-items: center; }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 9px 12px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px;
  color: var(--text); transition: border-color .14s, box-shadow .14s, background .14s; appearance: none; -webkit-appearance: none;
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: .8; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
.input[readonly] { background: var(--surface-3); }
.has-error .input, .has-error .select, .has-error .textarea, .input.is-bad { border-color: var(--bad-solid); }
.has-error .input:focus { box-shadow: 0 0 0 4px rgba(214, 64, 58, .2); }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2376847f' 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; }
.input-group { display: flex; align-items: stretch; }
.input-group .addon { display: inline-flex; align-items: center; padding: 0 12px; background: var(--surface-3); border: 1px solid var(--line-strong); color: var(--text-2); font-weight: 600; font-size: 14px; }
.input-group .addon:first-child { border-radius: 10px 0 0 10px; border-right: 0; }
.input-group .addon:last-child { border-radius: 0 10px 10px 0; border-left: 0; }
.input-group .input:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group .input:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-icon { position: relative; }
.input-icon .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.check input { appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 2px 0 0; border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--surface); display: grid; place-content: center; flex: none; cursor: pointer; transition: .12s; }
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { background: var(--brand); border-color: var(--brand); }
.check input:checked::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.check input[type="radio"]:checked::after { width: 7px; height: 7px; border: 0; border-radius: 50%; background: #fff; transform: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 23px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .16s; cursor: pointer; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .16s var(--ease); }
.switch input:checked { background: var(--brand); }
.switch input:checked::after { transform: translateX(17px); }
.seg { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 11px; gap: 2px; border: 1px solid var(--line); max-width: 100%; overflow-x: auto; }
.seg label, .seg a, .seg button { padding: 6px 13px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; border: 0; background: transparent; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span, .seg .on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg label span { padding: 6px 13px; border-radius: 8px; display: inline-flex; gap: 6px; align-items: center; margin: -6px -13px; }
.seg a.on, .seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); text-decoration: none; }
.file-drop { border: 1.5px dashed var(--line-strong); border-radius: var(--r); padding: 14px; display: flex; gap: 12px; align-items: center; background: var(--surface-2); cursor: pointer; transition: .15s; }
.file-drop:hover { border-color: var(--brand); background: var(--brand-50); }
.file-drop .thumb { width: 52px; height: 52px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; overflow: hidden; color: var(--text-3); flex: none; }
.file-drop .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.color-input { width: 46px; height: 40px; padding: 3px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.card .table-wrap { border: 0; box-shadow: none; border-radius: 0; background: transparent; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 12px; font-weight: 650; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
html[lang="bn"] .t th { text-transform: none; letter-spacing: 0; font-size: 13px; }
.t td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .1s; }
.t tbody tr:hover { background: var(--surface-2); }
.t tr.row-link { cursor: pointer; }
.t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; }
.t td.act, .t th.act { width: 1%; white-space: nowrap; text-align: right; }
.t .chk { width: 36px; padding-right: 0; }
.t tr.selected { background: var(--brand-50); }
.cell-main { font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-main a { color: inherit; }
.cell-sub { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); display: inline-grid; place-items: center; font: 700 13px/1 var(--font-display); flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; } .avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.c1 { background: #dff1e6; color: #1b6b43; } .avatar.c2 { background: #fde9d4; color: #9a4f08; } .avatar.c3 { background: #e5e8fb; color: #3b46a8; }
.avatar.c4 { background: #fbe2ea; color: #a1264f; } .avatar.c5 { background: #e3f0f7; color: #1d5f85; } .avatar.c6 { background: #efe5fb; color: #6234ad; }
html[data-theme="dark"] .avatar { filter: saturate(.8) brightness(.92); }
.devico { width: 36px; height: 36px; border-radius: 10px; background: var(--surface-3); display: inline-grid; place-items: center; color: var(--text-2); flex: none; }

.bulkbar { position: sticky; bottom: 16px; z-index: 20; margin-top: 12px; display: none; align-items: center; gap: 12px; padding: 10px 14px; background: var(--ink); color: #fff; border-radius: 14px; box-shadow: var(--shadow-3); flex-wrap: wrap; }
.bulkbar.show { display: flex; }
.bulkbar .btn { --b: rgba(255,255,255,.1); --bc: rgba(255,255,255,.16); --c: #fff; box-shadow: none; }
.bulkbar .btn:hover { --b: rgba(255,255,255,.18); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .input-icon { flex: 1 1 260px; max-width: 420px; }
.filters .select { width: auto; min-width: 150px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; transition: .14s; text-decoration: none !important; }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
html[data-theme="dark"] .chip.on { background: var(--brand); border-color: var(--brand); }
.chip .n { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.chip.on .n { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- badges / status ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 650; line-height: 1.4; border: 1px solid var(--mute-line); background: var(--mute-bg); color: var(--mute); white-space: nowrap; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.badge .i { width: 13px; height: 13px; }
.badge.sq { border-radius: 7px; }
.b-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.b-bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.b-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.b-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.b-vio { background: var(--vio-bg); color: var(--vio); border-color: var(--vio-line); }
.b-mute { background: var(--mute-bg); color: var(--mute); border-color: var(--mute-line); }
.b-brand { background: var(--brand-50); color: var(--brand); border-color: var(--brand-100); }
.pulse { position: relative; }
.pulse::after { content: ""; position: absolute; left: 8px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: currentColor; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(3.2); opacity: 0; } }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 600; }
.online-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok-solid); box-shadow: 0 0 0 3px var(--ok-bg); }
.online-dot.off { background: var(--text-3); box-shadow: 0 0 0 3px var(--mute-bg); }
.online-dot.bad { background: var(--bad-solid); box-shadow: 0 0 0 3px var(--bad-bg); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 14px; font-weight: 600; font-size: 14px; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; background: none; border-top: 0; border-left: 0; border-right: 0; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab .n { font-size: 11.5px; background: var(--surface-3); color: var(--text-2); border-radius: 999px; padding: 1px 7px; font-weight: 700; }

/* ---------- dropdown menu ---------- */
.dd { position: relative; display: inline-block; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-3); padding: 6px; z-index: 60; display: none; }
.menu.left { right: auto; left: 0; }
.dd.open > .menu { display: block; animation: pop .14s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border-radius: 8px; border: 0; background: none; color: var(--text); font-size: 14px; font-weight: 500; text-align: left; text-decoration: none !important; cursor: pointer; }
.menu-item:hover { background: var(--surface-3); }
.menu-item .i { color: var(--text-3); width: 17px; height: 17px; }
.menu-item.danger { color: var(--bad); } .menu-item.danger .i { color: var(--bad); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-head { padding: 8px 11px 6px; font-size: 12px; color: var(--text-3); }

/* ---------- dialog / drawer ---------- */
dialog { border: 0; padding: 0; background: transparent; color: var(--text); max-width: 100vw; max-height: 100dvh; }
dialog::backdrop { background: rgba(6, 16, 18, .55); backdrop-filter: blur(3px); animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, calc(100vw - 24px)); margin: auto; }
.modal.lg { width: min(780px, calc(100vw - 24px)); }
.modal.sm { width: min(420px, calc(100vw - 24px)); }
.modal-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-3); overflow: hidden; animation: pop .2s var(--ease); display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.modal-head { padding: 20px 22px 4px; display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.modal-title { font: 700 18px/1.3 var(--font-display); }
.modal-sub { color: var(--text-3); font-size: 14px; margin-top: 4px; }
.modal-body { padding: 14px 22px 20px; overflow-y: auto; }
.modal-foot { padding: 14px 22px; background: var(--surface-2); border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.modal-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand); }
.modal-ico.bad { background: var(--bad-bg); color: var(--bad); } .modal-ico.warn { background: var(--warn-bg); color: var(--warn); } .modal-ico.vio { background: var(--vio-bg); color: var(--vio); }
dialog.drawer { margin: 0 0 0 auto; height: 100dvh; width: min(520px, 100vw); }
dialog.drawer .modal-card { height: 100dvh; max-height: none; border-radius: var(--r-xl) 0 0 var(--r-xl); animation: slide-in .24s var(--ease); }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }

/* palette */
dialog.palette { margin: 10vh auto 0; width: min(640px, calc(100vw - 20px)); }
.palette .modal-card { max-height: 70dvh; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.palette-input input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; }
.palette-list { overflow-y: auto; padding: 8px; }
.pal-group { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 10px 10px 4px; }
html[lang="bn"] .pal-group { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none !important; }
.pal-item .i { color: var(--text-3); }
.pal-item.sel, .pal-item:hover { background: var(--brand-50); }
.pal-item.sel .i { color: var(--brand); }
.pal-item small { color: var(--text-3); margin-left: auto; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 28px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; background: var(--ink); color: #fff; border-radius: 14px; box-shadow: var(--shadow-3); animation: toast-in .28s var(--ease); font-size: 14px; border: 1px solid rgba(255,255,255,.08); }
.toast .i { width: 20px; height: 20px; margin-top: 1px; }
.toast.ok .i { color: #5fd08e; } .toast.bad .i { color: #ff8f87; } .toast.warn .i { color: #f2c25a; }
.toast .x { margin-left: auto; background: none; border: 0; color: #9fb7b6; padding: 0; }
@keyframes toast-in { from { transform: translateY(14px) scale(.97); opacity: 0; } }

/* ---------- alerts / banners ---------- */
.alert { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--info-line); background: var(--info-bg); color: var(--info); font-size: 14px; align-items: flex-start; }
.alert .i { margin-top: 2px; width: 18px; height: 18px; }
.alert b { color: inherit; }
.alert p { color: var(--text-2); font-size: 13.5px; margin-top: 2px; }
.alert.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.alert.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.alert.warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }

/* ---------- misc components ---------- */
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #2fb7bc); border-radius: 999px; transition: width .5s var(--ease); }
.progress.ok > i { background: var(--ok-solid); } .progress.bad > i { background: var(--bad-solid); } .progress.warn > i { background: var(--warn-solid); }
.progress.lg { height: 12px; }
.kv { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr); gap: 0; font-size: 14px; }
.kv dt, .kv dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.kv dt { color: var(--text-3); } .kv dd { color: var(--text); font-weight: 500; word-break: break-word; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.empty { text-align: center; padding: 44px 20px; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .em-ico { width: 60px; height: 60px; border-radius: 18px; background: var(--surface-3); display: grid; place-items: center; color: var(--text-3); }
.empty .em-ico .i { width: 28px; height: 28px; }
.empty h3 { font-size: 16px; color: var(--text); }
.empty p { max-width: 380px; font-size: 14px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px; min-height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl { display: flex; gap: 14px; padding: 8px 0; position: relative; }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line); display: grid; place-items: center; flex: none; z-index: 1; color: var(--text-3); }
.tl-dot .i { width: 15px; height: 15px; }
.tl-dot.ok { border-color: var(--ok-line); color: var(--ok); background: var(--ok-bg); } .tl-dot.bad { border-color: var(--bad-line); color: var(--bad); background: var(--bad-bg); }
.tl-dot.warn { border-color: var(--warn-line); color: var(--warn); background: var(--warn-bg); } .tl-dot.info { border-color: var(--info-line); color: var(--info); background: var(--info-bg); }
.tl-dot.vio { border-color: var(--vio-line); color: var(--vio); background: var(--vio-bg); }
.tl-body { min-width: 0; padding-top: 4px; flex: 1; }
.tl-title { font-weight: 600; font-size: 14px; }
.tl-meta { font-size: 12.5px; color: var(--text-3); margin-top: 1px; }

.stepper { display: flex; gap: 8px; align-items: center; margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.step { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-weight: 600; font-size: 14px; white-space: nowrap; cursor: default; }
.step .sn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--line-strong); background: var(--surface); font-size: 13px; font-weight: 700; flex: none; transition: .2s; }
.step.active { color: var(--text); } .step.active .sn { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-ring); }
.step.done { color: var(--text-2); } .step.done .sn { border-color: var(--ok-solid); background: var(--ok-solid); color: #fff; }
.step.done .sn .i { width: 14px; height: 14px; }
.step-line { flex: 1 1 24px; min-width: 18px; height: 2px; background: var(--line); border-radius: 2px; }
.step-line.done { background: var(--ok-solid); }
button.step { background: none; border: 0; padding: 0; cursor: pointer; }

.option-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.opt { position: relative; display: block; border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; background: var(--surface); cursor: pointer; transition: .15s; }
.opt:hover { border-color: var(--line-strong); }
.opt input { position: absolute; opacity: 0; }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px var(--brand-ring); }
.opt b { display: block; font-weight: 650; } .opt span { color: var(--text-3); font-size: 13px; }
.opt .i { color: var(--brand); width: 22px; height: 22px; margin-bottom: 6px; }

.hero-money { font: 800 clamp(28px, 4vw, 38px)/1.05 var(--font-display); letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.tile { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.tile .k { font-size: 12.5px; color: var(--text-3); } .tile .v { font: 700 18px/1.25 var(--font-display); margin-top: 3px; font-variant-numeric: tabular-nums; }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.sched { display: grid; gap: 8px; }
.sched-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.sched-row .no { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.sched-row.paid .no { background: var(--ok-bg); color: var(--ok); }
.sched-row.overdue { border-color: var(--bad-line); background: var(--bad-bg); }
.sched-row.overdue .no { background: var(--bad-solid); color: #fff; }
.sched-row.due { border-color: var(--warn-line); background: var(--warn-bg); }
.sched-row.partial .no { background: var(--info-bg); color: var(--info); }

.chart { width: 100%; display: block; }
.chart text { font: 500 11px var(--font-ui); fill: var(--text-3); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }

.signpad { border: 1.5px dashed var(--line-strong); border-radius: var(--r); background: var(--surface-2); position: relative; touch-action: none; }
.signpad canvas { width: 100%; height: 160px; display: block; border-radius: var(--r); cursor: crosshair; }
.signpad .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); pointer-events: none; font-size: 14px; }
.signpad .clr { position: absolute; right: 8px; top: 8px; }

.qr-frame { background: #fff; border-radius: var(--r-lg); padding: 14px; display: inline-block; border: 1px solid var(--line); box-shadow: var(--shadow-2); line-height: 0; }
.qr-frame svg { width: min(340px, 78vw); height: auto; }
.pin-steps { counter-reset: s; list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pin-steps li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.pin-steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-weight: 700; font-size: 13px; display: grid; place-items: center; flex: none; }

/* ---------- phone mock (lock screen preview / virtual device) ---------- */
.phone { width: 290px; aspect-ratio: 9 / 18.6; border-radius: 42px; padding: 10px; background: #0b0f10; box-shadow: 0 0 0 2px #2a3436, var(--shadow-3), inset 0 0 0 2px #1b2426; position: relative; margin-inline: auto; flex: none; }
.phone::before { content: ""; position: absolute; top: 20px; left: 50%; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%; background: #05080a; box-shadow: inset 0 0 0 2px #1a2427; z-index: 5; }
.phone-screen { width: 100%; height: 100%; border-radius: 33px; overflow: hidden; position: relative; background: #0d1a1c; color: #fff; display: flex; flex-direction: column; }
.ph-status { display: flex; justify-content: space-between; padding: 14px 22px 0; font-size: 12px; font-weight: 600; opacity: .9; }
.lock-ui { flex: 1; display: flex; flex-direction: column; padding: 34px 20px 18px; background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--lock-brand, #0e6f73) 55%, #061012), #061012 70%); text-align: center; }
.lock-ico { width: 54px; height: 54px; border-radius: 17px; margin: 6px auto 12px; display: grid; place-items: center; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(6px); }
.lock-ico .i { width: 26px; height: 26px; }
.lock-title { font: 800 19px/1.25 var(--font-display); }
.lock-msg { font-size: 12.5px; opacity: .82; margin-top: 8px; line-height: 1.5; }
.lock-amount { margin: 16px 0 4px; padding: 14px 12px; border-radius: 16px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); }
.lock-amount small { display: block; font-size: 11.5px; opacity: .75; }
.lock-amount b { font: 800 27px/1.2 var(--font-display); letter-spacing: -.02em; }
.lock-btns { margin-top: auto; display: grid; gap: 8px; }
.lock-btn { height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.1); color: #fff; font-weight: 650; font-size: 13.5px; display: flex; gap: 8px; align-items: center; justify-content: center; }
.lock-btn.pri { background: #fff; color: #0a1a1d; border-color: #fff; }
.lock-btn.sos { background: #d6403a; border-color: #d6403a; }
.lock-foot { font-size: 11px; opacity: .6; margin-top: 10px; }
.home-ui { flex: 1; background: linear-gradient(160deg, #1f3b44, #0f2026 70%); padding: 40px 18px 18px; display: flex; flex-direction: column; }
.home-clock { font: 300 54px/1 var(--font-display); text-align: center; margin-top: 18px; }
.home-date { text-align: center; opacity: .75; font-size: 13px; margin: 6px 0 20px; }
.home-notif { background: rgba(255,255,255,.12); border-radius: 16px; padding: 11px 13px; text-align: left; font-size: 12.5px; margin-bottom: 8px; backdrop-filter: blur(8px); }
.home-notif b { display: block; font-size: 12px; opacity: .8; font-weight: 600; margin-bottom: 2px; }
.home-apps { margin-top: auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.home-apps i { aspect-ratio: 1; border-radius: 14px; background: rgba(255,255,255,.14); display: block; }

/* ---------- auth screens ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--bg); }
.auth-art { position: relative; background: var(--ink); color: #fff; padding: 44px clamp(28px, 5vw, 72px); display: flex; flex-direction: column; overflow: hidden; isolation: isolate; }
.auth-art::before { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 50% at 80% 10%, color-mix(in srgb, var(--brand) 55%, transparent), transparent 70%), radial-gradient(50% 40% at 0% 100%, rgba(63, 208, 214, .18), transparent 70%); z-index: -1; }
.auth-art .grid-bg { position: absolute; inset: 0; z-index: -1; opacity: .5; background-image: linear-gradient(var(--ink-line) 1px, transparent 1px), linear-gradient(90deg, var(--ink-line) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(70% 60% at 70% 30%, #000, transparent 75%); -webkit-mask-image: radial-gradient(70% 60% at 70% 30%, #000, transparent 75%); }
.auth-art h2 { color: #fff; font-size: clamp(26px, 3.2vw, 40px); max-width: 15em; line-height: 1.2; margin-top: auto; }
.auth-art p { color: var(--ink-text); max-width: 34em; margin-top: 14px; font-size: 15.5px; }
.auth-points { display: grid; gap: 12px; margin-top: 26px; }
.auth-points div { display: flex; gap: 12px; align-items: center; color: #d2e3e2; font-size: 14.5px; }
.auth-points .i { color: #3fd0d6; width: 20px; height: 20px; }
.auth-form-wrap { display: grid; place-items: center; padding: 28px; }
.auth-card { width: min(420px, 100%); }
.auth-card h1 { font-size: 28px; }
.demo-creds { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; }
.demo-cred { text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13px; transition: .14s; }
.demo-cred:hover { border-color: var(--brand); background: var(--brand-50); }
.demo-cred b { display: block; font-size: 13.5px; } .demo-cred span { color: var(--text-3); }

/* ---------- pagination ---------- */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 4px 0; font-size: 13.5px; color: var(--text-3); }
.pager .pages { display: flex; gap: 4px; }
.pager .pg { min-width: 34px; height: 34px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid transparent; color: var(--text-2); font-weight: 600; text-decoration: none !important; }
.pager a.pg:hover { background: var(--surface); border-color: var(--line); }
.pager .pg.on { background: var(--surface); border-color: var(--line-strong); color: var(--text); box-shadow: var(--shadow-1); }
.pager .pg.dis { opacity: .4; }

/* ---------- guide / prose ---------- */
.prose { font-size: 15px; line-height: 1.75; max-width: 76ch; }
.prose h2 { font-size: 20px; margin: 28px 0 10px; } .prose h3 { font-size: 16.5px; margin: 20px 0 8px; }
.prose p { margin: 0 0 12px; } .prose ul, .prose ol { padding-left: 22px; margin: 0 0 14px; } .prose li { margin: 4px 0; }
.prose code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-3); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: var(--ink); color: #d6ecea; padding: 14px 16px; border-radius: 12px; overflow-x: auto; font-size: 13px; }

/* new-sale compact quote (the full quote card only fits on wide screens) */
.quote-bar { display: none; }
@media (max-width: 1280px) { .quote-bar { display: flex; } }

/* pay form: only show a transaction id for mobile-money / bank methods */
.pay-form:has(input[name="method"][value="cash"]:checked) .trx-field { display: none; }
.auth-mbrand { display: none; }
@media (max-width: 1100px) { .auth-mbrand { display: flex; } }

/* ---------- print ---------- */
.print-sheet { background: #fff; color: #111; max-width: 820px; margin: 0 auto; padding: 36px 40px; font-size: 14px; line-height: 1.7; }
.print-sheet h2, .print-sheet h3 { color: #111; } .print-sheet h3 { font-size: 15px; margin: 16px 0 4px; }
.print-sheet table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.print-sheet td, .print-sheet th { border: 1px solid #bbb; padding: 6px 10px; text-align: left; }
.print-sheet .sig { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 60px; text-align: center; font-size: 13px; }
.print-sheet .sig div { border-top: 1px solid #111; padding-top: 6px; }
.print-sheet .sig img { max-height: 70px; display: block; margin: 0 auto -14px; }
.print-bar { position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 16px; display: flex; gap: 10px; justify-content: center; z-index: 5; }
.receipt { width: 300px; margin: 18px auto; background: #fff; color: #111; padding: 18px 16px; font-size: 13px; line-height: 1.5; border-radius: 6px; box-shadow: var(--shadow-2); }
.receipt hr { border-top: 1px dashed #999; margin: 10px 0; }
.receipt .r { display: flex; justify-content: space-between; gap: 12px; }
.receipt h3 { text-align: center; font-size: 16px; color: #111; }
.receipt .big { font-size: 20px; font-weight: 800; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split-wide { grid-template-columns: minmax(0, 1fr); }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .26s var(--ease); box-shadow: var(--shadow-3); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .tb-menu { display: inline-grid; }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .content { padding-top: 16px; padding-bottom: 104px; }
  .topbar { gap: 6px; }
  .tb-search { flex: 0 0 38px; width: 38px; padding: 0; justify-content: center; border-color: transparent; background: transparent; }
  .tb-search span, .tb-search .kbd { display: none; }
  .tb-hide-sm { display: none !important; }
  .cols-2, .cols-3, .cols-4, .form-grid, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px; } .stat-value { font-size: 22px; } .stat-spark { display: none; }
  .page-head { align-items: flex-start; } .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }
  .card-head { padding: 14px 16px 0; } .card-body { padding: 14px 16px 16px; }
  .demo-creds { grid-template-columns: 1fr; }
  .modal { width: 100vw; margin: auto 0 0; }
  .modal-card { border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92dvh; }
  dialog.drawer { width: 100vw; } dialog.drawer .modal-card { border-radius: 0; }
  dialog.palette { margin-top: 0; width: 100vw; } dialog.palette .modal-card { border-radius: 0 0 var(--r-xl) var(--r-xl); }
  .toasts { bottom: 86px; right: 12px; left: 12px; width: auto; }
  .bottomnav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bn-link { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--text-3); padding: 6px 2px; border-radius: 12px; text-decoration: none !important; background: none; border: 0; position: relative; }
  .bn-link .i { width: 22px; height: 22px; }
  .bn-link.active { color: var(--brand); }
  .bn-link.active::after { content: ""; position: absolute; top: 0; width: 22px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
  .bn-link.fab .fab-ico { width: 46px; height: 46px; margin-top: -22px; border-radius: 16px; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px var(--brand-ring), 0 0 0 4px var(--bg); }
  .bn-link.fab { color: var(--text-2); }
  .bn-link .pip { position: absolute; top: 2px; right: calc(50% - 20px); min-width: 16px; height: 16px; border-radius: 99px; background: var(--bad-solid); color: #fff; font-size: 10px; line-height: 16px; padding: 0 4px; }

  /* tables become cards on phones */
  .t-cards, .t-cards thead, .t-cards tbody, .t-cards tr, .t-cards td { display: block; }
  .t-cards thead { display: none; }
  .t-cards tr { padding: 12px 14px; border-bottom: 1px solid var(--line); position: relative; }
  .t-cards td { padding: 4px 0; border: 0; display: flex; gap: 12px; justify-content: space-between; align-items: center; text-align: right !important; }
  .t-cards td[data-label]::before { content: attr(data-label); font-size: 12.5px; color: var(--text-3); font-weight: 500; text-align: left; flex: none; }
  .t-cards td.main { display: block; text-align: left !important; padding-bottom: 8px; }
  .t-cards td.main::before { display: none; }
  .t-cards td.chk { display: none; }
  .t-cards td.act { width: auto; padding-top: 8px; justify-content: flex-end; }
  .t-cards td.hide-sm { display: none; }
  .stepper .step:not(.active) > span:not(.sn) { display: none; }
  .sched-row { grid-template-columns: 30px minmax(0, 1fr) auto; } .sched-row > :last-child { grid-column: 2 / -1; }
  .kv { grid-template-columns: minmax(96px, 42%) minmax(0, 1fr); }
  .phone { width: min(290px, 78vw); }
  .bulkbar { bottom: 82px; }
  .print-sheet { padding: 20px 16px; }
}
@media (max-width: 340px) { .stats { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

@media print {
  @page { margin: 12mm; }
  body { background: #fff; }
  .sidebar, .topbar, .bottomnav, .print-bar, .toasts, .no-print, .scrim { display: none !important; }
  .app { display: block; } .content { padding: 0; max-width: none; }
  .print-sheet, .receipt { box-shadow: none; margin: 0 auto; border-radius: 0; }
  a { color: inherit; text-decoration: none; }
}
