/* NotifyBD — design system. Brand colours come from the logo: orange #F55932 and navy #202530. */
:root {
  --brand: #F55932;
  --brand-rgb: 245, 89, 50;
  --brand-600: #E2461F;
  --brand-700: #C43A17;
  --brand-50: #FFF2ED;
  --brand-100: #FFE1D6;
  --navy: #202530;
  --navy-rgb: 32, 37, 48;
  --navy-2: #2A303D;
  --navy-3: #363D4D;

  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --surface-2: #F8F9FB;
  --surface-3: #EFF1F4;
  --border: #E5E7EB;
  --border-strong: #D5D9E0;
  --text: #1A1E27;
  --text-2: #3D4452;
  --muted: #6B7280;
  --faint: #9AA1AD;

  --ok: #16A34A;   --ok-bg: rgba(22, 163, 74, .1);
  --warn: #D97706; --warn-bg: rgba(217, 119, 6, .12);
  --bad: #DC2626;  --bad-bg: rgba(220, 38, 38, .1);
  --info: #2563EB; --info-bg: rgba(37, 99, 235, .1);

  --r-lg: 18px;
  --r: 14px;
  --r-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 24px -8px rgba(16, 24, 40, .08);
  --shadow-lg: 0 20px 50px -12px rgba(16, 24, 40, .25);
  --side-w: 256px;
  --top-h: 64px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  --link: var(--brand-600);
  --bs-primary: var(--brand);
  --bs-primary-rgb: var(--brand-rgb);
  --bs-link-color: var(--brand-600);
  --bs-link-color-rgb: 226, 70, 31;
  --bs-link-hover-color: var(--brand-700);
  --bs-body-font-family: "Plus Jakarta Sans", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-secondary-color: var(--muted);
  --bs-emphasis-color: var(--text);
}

[data-bs-theme="dark"] {
  --bg: #0F1116;
  --surface: #171A21;
  --surface-2: #1C2029;
  --surface-3: #232834;
  --border: #282D39;
  --border-strong: #353B49;
  --text: #ECEEF2;
  --text-2: #C5CAD3;
  --muted: #9097A5;
  --faint: #6B7280;
  --link: #FF8A66;
  --brand-50: rgba(245, 89, 50, .12);
  --brand-100: rgba(245, 89, 50, .22);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -8px rgba(0, 0, 0, .5);
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);
  --bs-secondary-color: var(--muted);
  --bs-emphasis-color: var(--text);
  --bs-tertiary-bg: var(--surface-2);
  color-scheme: dark;
}

* { -webkit-tap-highlight-color: transparent; }
html { scroll-padding-top: 80px; }
body { background: var(--bg); color: var(--text); font-size: .9rem; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: var(--link); }
h1, h2, h3, h4, h5, h6 { color: var(--text); letter-spacing: -.015em; }
.text-muted, .text-secondary { color: var(--muted) !important; }
.text-faint { color: var(--faint) !important; }
.text-brand { color: var(--brand) !important; }
.fw-semi { font-weight: 600; }
.fw-800 { font-weight: 800; }
.mono { font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace; font-size: .86em; }
.small-2 { font-size: .78rem; }
.min-w-0 { min-width: 0; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
hr { border-color: var(--border); opacity: 1; }

/* ---------- Buttons ---------- */
.btn { --bs-btn-font-weight: 600; --bs-btn-font-size: .875rem; border-radius: var(--r-sm); padding: .55rem 1rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; transition: all .15s; }
.btn-sm { padding: .36rem .72rem; border-radius: 9px; --bs-btn-font-size: .8rem; gap: .35rem; }
.btn-lg { padding: .8rem 1.3rem; border-radius: 12px; --bs-btn-font-size: .95rem; }
.btn-primary {
  --bs-btn-color: #fff; --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600);
  --bs-btn-active-bg: var(--brand-700); --bs-btn-active-border-color: var(--brand-700);
  --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
  --bs-btn-focus-shadow-rgb: var(--brand-rgb);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 6px 14px -6px rgba(var(--brand-rgb), .7);
}
.btn-dark, .btn-navy {
  --bs-btn-color: #fff; --bs-btn-bg: var(--navy); --bs-btn-border-color: var(--navy);
  --bs-btn-hover-bg: var(--navy-2); --bs-btn-hover-border-color: var(--navy-2); --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: #11141A;
}
[data-bs-theme="dark"] .btn-navy { --bs-btn-bg: var(--surface-3); --bs-btn-border-color: var(--border-strong); }
.btn-outline-primary {
  --bs-btn-color: var(--brand-600); --bs-btn-border-color: rgba(var(--brand-rgb), .45);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand);
  --bs-btn-active-bg: var(--brand-600); --bs-btn-active-border-color: var(--brand-600);
}
.btn-soft { --bs-btn-color: var(--brand-600); --bs-btn-bg: var(--brand-50); --bs-btn-border-color: transparent; --bs-btn-hover-bg: var(--brand-100); --bs-btn-hover-color: var(--brand-700); --bs-btn-active-bg: var(--brand-100); }
[data-bs-theme="dark"] .btn-soft { --bs-btn-color: #FF8A66; --bs-btn-hover-color: #FFA385; }
.btn-light, .btn-ghost {
  --bs-btn-color: var(--text-2); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--border);
  --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: var(--border-strong); --bs-btn-hover-color: var(--text);
  --bs-btn-active-bg: var(--surface-3); --bs-btn-active-border-color: var(--border-strong); --bs-btn-active-color: var(--text);
}
.btn-ghost { --bs-btn-border-color: transparent; --bs-btn-bg: transparent; }
.btn-success { --bs-btn-bg: var(--ok); --bs-btn-border-color: var(--ok); --bs-btn-hover-bg: #15803D; --bs-btn-hover-border-color: #15803D; }
.btn-danger-soft { --bs-btn-color: var(--bad); --bs-btn-bg: var(--bad-bg); --bs-btn-border-color: transparent; --bs-btn-hover-bg: var(--bad); --bs-btn-hover-color: #fff; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 11px; flex-shrink: 0; }
.btn-icon.btn-sm { width: 32px; height: 32px; border-radius: 9px; }
.btn i { font-size: 1.05em; line-height: 1; }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .8rem; color: var(--text-2); margin-bottom: .38rem; }
.form-control, .form-select {
  border-radius: var(--r-sm); border-color: var(--border-strong); background-color: var(--surface); color: var(--text);
  padding: .6rem .85rem; font-size: .9rem; transition: border-color .15s, box-shadow .15s;
}
.form-control::placeholder { color: var(--faint); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .14); background-color: var(--surface); color: var(--text); }
.form-control-sm, .form-select-sm { padding: .4rem .7rem; font-size: .82rem; border-radius: 9px; }
.form-text { color: var(--muted); font-size: .77rem; margin-top: .3rem; }
.form-check-input { border-color: var(--border-strong); background-color: var(--surface); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .14); border-color: var(--brand); }
.form-switch .form-check-input { width: 2.4em; height: 1.3em; margin-top: .1em; }
.form-switch .form-check-input:focus { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23F55932'/%3e%3c/svg%3e"); }
.input-group-text { background: var(--surface-2); border-color: var(--border-strong); color: var(--muted); border-radius: var(--r-sm); font-size: .88rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 575.98px) { .field-row { grid-template-columns: 1fr; } }

/* Segmented control made of radio / checkbox inputs */
.seg { display: flex; flex-wrap: wrap; gap: .35rem; background: var(--surface-3); padding: .3rem; border-radius: 12px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { flex: 1 1 0; min-width: max-content; text-align: center; padding: .48rem .75rem; border-radius: 9px; font-weight: 600; font-size: .82rem; color: var(--muted); cursor: pointer; white-space: nowrap; transition: all .15s; user-select: none; }
.seg label:hover { color: var(--text); }
.seg input:checked + label { background: var(--surface); color: var(--brand-600); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
[data-bs-theme="dark"] .seg input:checked + label { color: #FF8A66; }
.seg input:focus-visible + label { outline: 2px solid var(--brand); }

/* Toggle cards (pick delivery methods, days) */
.pick { display: flex; flex-wrap: wrap; gap: .5rem; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick label {
  display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .9rem; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: .84rem; color: var(--text-2); user-select: none; transition: all .15s;
}
.pick label i { font-size: 1.05rem; color: var(--muted); }
.pick input:checked + label { border-color: var(--brand); background: var(--brand-50); color: var(--brand-700); }
[data-bs-theme="dark"] .pick input:checked + label { color: #FF9C7D; }
.pick input:checked + label i { color: var(--brand); }
.pick input:disabled + label { opacity: .45; cursor: not-allowed; }
.pick.days label { width: 46px; justify-content: center; padding: .55rem 0; }
.pick .lock { font-size: .7rem; color: var(--faint); margin-left: .15rem; }

.swatches { display: flex; gap: .5rem; flex-wrap: wrap; }
.swatches input { position: absolute; opacity: 0; }
.swatches label { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); transition: transform .12s; }
.swatches input:checked + label { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px currentColor; transform: scale(1.05); }
.icon-pick { display: grid; grid-template-columns: repeat(8, 1fr); gap: .4rem; }
.icon-pick input { position: absolute; opacity: 0; }
.icon-pick label { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 10px; border: 1.5px solid var(--border); cursor: pointer; font-size: 1.1rem; color: var(--muted); }
.icon-pick input:checked + label { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }

/* ---------- Colour tokens for reminder / topic chips ---------- */
.c-orange { --c: #F55932; } .c-navy { --c: #3B4457; } .c-blue { --c: #2563EB; } .c-green { --c: #16A34A; }
.c-purple { --c: #7C3AED; } .c-pink { --c: #DB2777; } .c-teal { --c: #0D9488; } .c-amber { --c: #D97706; }
[data-bs-theme="dark"] .c-navy { --c: #8A94A8; }
.swatches label[class*="c-"] { background: var(--c); color: var(--c); }
.tile { width: 44px; height: 44px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; background: color-mix(in srgb, var(--c, var(--brand)) 13%, transparent); color: var(--c, var(--brand)); }
.tile-sm { width: 36px; height: 36px; border-radius: 11px; font-size: 1rem; }
.tile-lg { width: 54px; height: 54px; border-radius: 16px; font-size: 1.45rem; }

/* ---------- App shell ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 1040; display: flex; flex-direction: column;
  background: var(--navy); color: #AEB5C2; border-right: 1px solid rgba(255, 255, 255, .04);
}
.sidebar .brand { display: flex; align-items: center; height: var(--top-h); padding: 0 1.35rem; flex-shrink: 0; }
.sidebar .brand img { height: 30px; }
.side-nav { flex: 1; overflow-y: auto; padding: .5rem .8rem 1rem; scrollbar-width: thin; scrollbar-color: #3A4152 transparent; }
.side-nav .sec { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; color: #6D7587; margin: 1.15rem .75rem .45rem; font-weight: 700; }
.side-nav .sec:first-child { margin-top: .4rem; }
.side-nav a {
  display: flex; align-items: center; gap: .75rem; padding: .58rem .75rem; border-radius: 10px; color: #B3BAC7;
  font-weight: 550; font-size: .875rem; margin-bottom: 2px; position: relative; transition: background .15s, color .15s;
}
.side-nav a i { font-size: 1.08rem; width: 20px; text-align: center; color: #8189A0; transition: color .15s; }
.side-nav a:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.side-nav a:hover i { color: #DDE1E8; }
.side-nav a.active { background: rgba(var(--brand-rgb), .14); color: #fff; }
.side-nav a.active i { color: var(--brand); }
.side-nav a.active::before { content: ""; position: absolute; left: -.8rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.side-nav .count { margin-left: auto; background: var(--brand); color: #fff; font-size: .68rem; font-weight: 700; border-radius: 20px; padding: .08rem .48rem; min-width: 20px; text-align: center; }
.side-foot { padding: .9rem; border-top: 1px solid rgba(255, 255, 255, .06); }
.plan-card { border-radius: 14px; padding: .9rem 1rem; background: linear-gradient(140deg, rgba(var(--brand-rgb), .22), rgba(var(--brand-rgb), .06)); border: 1px solid rgba(var(--brand-rgb), .25); color: #E8EAEE; }
.plan-card .lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #C4C9D3; font-weight: 700; }
.plan-card .val { font-size: 1.25rem; font-weight: 800; color: #fff; letter-spacing: -.02em; }
.plan-card a { color: #FFB199; font-weight: 600; font-size: .8rem; }

.main { margin-left: var(--side-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 1020; height: var(--top-h); display: flex; align-items: center; gap: .75rem; padding: 0 1.75rem;
  background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .title { min-width: 0; }
.topbar .title h1 { font-size: 1.05rem; font-weight: 750; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .title .crumb { font-size: .74rem; color: var(--muted); font-weight: 500; }
.topbar .actions { margin-left: auto; display: flex; align-items: center; gap: .45rem; }
.topbar .m-brand { display: none; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-2); background: transparent; border: 1px solid transparent; font-size: 1.15rem; transition: all .15s; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--border); color: var(--text); }
.icon-btn .dotc { position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font-size: .65rem; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .75rem; border-radius: 30px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 650; font-size: .8rem; color: var(--text); white-space: nowrap; }
.chip-brand { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
[data-bs-theme="dark"] .chip-brand { color: #FF9C7D; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--navy); color: #fff; font-weight: 750; font-size: .82rem; flex-shrink: 0; letter-spacing: .02em; }
[data-bs-theme="dark"] .avatar { background: var(--surface-3); }
.avatar.brand { background: var(--brand); }
.avatar-sm { width: 32px; height: 32px; border-radius: 10px; font-size: .72rem; }
.avatar-lg { width: 64px; height: 64px; border-radius: 20px; font-size: 1.35rem; }
.user-btn { display: flex; align-items: center; gap: .6rem; background: none; border: 0; padding: .2rem .3rem .2rem .2rem; border-radius: 14px; color: var(--text); }
.user-btn:hover { background: var(--surface-2); }
.user-btn .nm { display: block; font-weight: 700; font-size: .84rem; line-height: 1.15; text-align: left; }
.user-btn .rl { display: block; font-size: .72rem; color: var(--muted); text-align: left; }

.content { padding: 1.75rem; flex: 1; width: 100%; min-width: 0; }
.app-foot { padding: 1rem 1.75rem 1.4rem; color: var(--faint); font-size: .76rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

.acting-bar { background: var(--navy); color: #FFD4C4; padding: .5rem 1.75rem; font-size: .82rem; display: flex; align-items: center; gap: .75rem; border-bottom: 2px solid var(--brand); }
[data-bs-theme="dark"] .acting-bar { background: #1E1410; }

.dropdown-menu { --bs-dropdown-bg: var(--surface); --bs-dropdown-border-color: var(--border); --bs-dropdown-link-color: var(--text); --bs-dropdown-link-hover-bg: var(--surface-2); --bs-dropdown-link-hover-color: var(--text); --bs-dropdown-link-active-bg: var(--brand-50); --bs-dropdown-link-active-color: var(--brand-700); border-radius: 14px; box-shadow: var(--shadow-lg); padding: .4rem; font-size: .87rem; }
.dropdown-item { border-radius: 9px; padding: .5rem .7rem; display: flex; align-items: center; gap: .6rem; }
.dropdown-item i { color: var(--muted); width: 18px; }
.dropdown-header { font-size: .72rem; }

/* ---------- Layout helpers ---------- */
/* Repeated cards (plans, topics, channels…): as many per row as fit, always filling the full width. */
.card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card-grid > * { min-width: 0; }
.card-grid > * > .card, .card-grid > * > .plan { height: 100%; }
.card-grid > .span-all { grid-column: 1 / -1; }
/* Side-by-side page columns: the last card in each column grows to the row height, so no blank gap under a short card. */
.content > .row > [class*="col-"], .content > form > .row > [class*="col-"] { display: flex; flex-direction: column; }
.content > .row > [class*="col-"] > .card:last-child, .content > form > .row > [class*="col-"] > .card:last-child { flex: 1 1 auto; }
.content > .row > [class*="col-"] > .card.stat { flex: 1 1 auto; }

/* Inside the Android app notifications are native, so hide the browser-push controls. */
.in-app [data-push-card] { display: none !important; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h2 { font-size: 1.5rem; font-weight: 800; margin: 0; letter-spacing: -.025em; }
.page-head p { color: var(--muted); margin: .3rem 0 0; font-size: .88rem; }
.page-head .tools { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card { --bs-card-bg: var(--surface); --bs-card-border-color: var(--border); --bs-card-cap-bg: transparent; --bs-card-color: var(--text); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-head { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .75rem; min-height: 60px; }
.card-head h3 { font-size: .98rem; font-weight: 750; margin: 0; }
.card-head .sub { font-size: .78rem; color: var(--muted); }
.card-head .tools { margin-left: auto; display: flex; gap: .4rem; align-items: center; }
.card-body { padding: 1.25rem; }
.card-foot { padding: .85rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
.card-link { display: block; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card-link:hover { border-color: var(--border-strong); box-shadow: var(--shadow); color: inherit; }

.stat { padding: 1.15rem 1.2rem; display: flex; flex-direction: row; gap: .95rem; align-items: center; height: 100%; }
.stat .lbl { color: var(--muted); font-size: .78rem; font-weight: 600; }
.stat .val { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; margin-top: .1rem; }
.stat .sub { font-size: .75rem; color: var(--muted); margin-top: .15rem; }
.stat .sub .up { color: var(--ok); font-weight: 700; } .stat .sub .down { color: var(--bad); font-weight: 700; }
.stat-hero { background: var(--navy); border-color: var(--navy); color: #fff; position: relative; overflow: hidden; }
.stat-hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(var(--brand-rgb), .55), transparent 65%); }
.stat-hero .lbl, .stat-hero .sub { color: #B9C0CC; }
.stat-hero .val { color: #fff; }
.stat-hero .tile { background: rgba(var(--brand-rgb), .2); color: #FF8A66; }
[data-bs-theme="dark"] .stat-hero { background: linear-gradient(140deg, #232937, #1A1E27); border-color: var(--border); }

/* ---------- Pills ---------- */
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .22rem .6rem; border-radius: 20px; font-size: .72rem; font-weight: 700; white-space: nowrap; line-height: 1.4; }
.pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: #B45309; }
[data-bs-theme="dark"] .pill.warn { color: #F59E0B; }
.pill.info { background: var(--info-bg); color: var(--info); }
[data-bs-theme="dark"] .pill.info { color: #60A5FA; }
.pill.mute { background: var(--surface-3); color: var(--muted); }
.pill.brand { background: var(--brand-50); color: var(--brand-700); }
[data-bs-theme="dark"] .pill.brand { color: #FF9C7D; }
.pill.navy { background: rgba(var(--navy-rgb), .08); color: var(--navy); }
[data-bs-theme="dark"] .pill.navy { background: var(--surface-3); color: var(--text-2); }
.mchip { display: inline-flex; align-items: center; gap: .25rem; font-size: .72rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: .12rem .45rem; border-radius: 7px; margin-right: .25rem; white-space: nowrap; }
.mchip i { font-size: .8rem; }
.amt-pos { color: var(--ok); font-weight: 700; } .amt-neg { color: var(--bad); font-weight: 700; }
.pulse { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--ok); box-shadow: 0 0 0 0 rgba(22, 163, 74, .5); animation: pulse 2s infinite; flex-shrink: 0; }
.pulse.bad { background: var(--bad); box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); animation-name: pulse-bad; }
.pulse.mute { background: var(--faint); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(22, 163, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); } }
@keyframes pulse-bad { 70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-hover-bg: var(--surface-2); --bs-table-hover-color: var(--text); margin: 0; font-size: .86rem; }
.table > :not(caption) > * > * { padding: .8rem 1.25rem; border-bottom-color: var(--border); vertical-align: middle; }
.table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; background: var(--surface-2); white-space: nowrap; padding-top: .65rem; padding-bottom: .65rem; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table .main-cell { font-weight: 650; color: var(--text); }
.table .sub-cell { font-size: .76rem; color: var(--muted); }
.table .actions-cell { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* ---------- Lists (app-style rows) ---------- */
.list { display: flex; flex-direction: column; }
.row-item { display: flex; align-items: center; gap: .9rem; padding: .95rem 1.25rem; border-bottom: 1px solid var(--border); color: inherit; position: relative; }
.row-item:last-child { border-bottom: 0; }
a.row-item:hover { background: var(--surface-2); color: inherit; }
.row-item .grow { flex: 1; min-width: 0; }
.row-item .t { font-weight: 700; color: var(--text); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .s { font-size: .78rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-item .end { text-align: right; flex-shrink: 0; }
.row-item.unread::before { content: ""; position: absolute; left: .45rem; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); transform: translateY(-50%); }
.row-item.off { opacity: .55; }

.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .85rem 1.25rem; border-bottom: 1px solid var(--border); }
.filter-bar .form-control, .filter-bar .form-select { padding: .42rem .7rem; font-size: .84rem; width: auto; }
.filter-bar .search { position: relative; flex: 1 1 220px; max-width: 340px; }
.filter-bar .search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--faint); }
.filter-bar .search input { padding-left: 2.1rem; width: 100%; }
.tabs { display: inline-flex; gap: .2rem; background: var(--surface-3); padding: .25rem; border-radius: 11px; flex-wrap: wrap; }
.tabs a { padding: .38rem .8rem; border-radius: 8px; font-weight: 650; font-size: .8rem; color: var(--muted); white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.tabs a .n { font-size: .7rem; color: var(--faint); margin-left: .2rem; }

.empty { text-align: center; padding: 3.2rem 1.25rem; color: var(--muted); }
.empty .ico { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 1rem; display: flex; align-items: center; justify-content: center; font-size: 1.7rem; background: var(--brand-50); color: var(--brand); }
.empty h4 { font-size: 1rem; font-weight: 750; color: var(--text); margin-bottom: .3rem; }
.empty p { max-width: 380px; margin: 0 auto 1rem; font-size: .86rem; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .8rem 1.25rem; border-top: 1px solid var(--border); font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.pagination { --bs-pagination-color: var(--text-2); --bs-pagination-bg: var(--surface); --bs-pagination-border-color: var(--border); --bs-pagination-hover-bg: var(--surface-2); --bs-pagination-hover-color: var(--text); --bs-pagination-hover-border-color: var(--border); --bs-pagination-active-bg: var(--brand); --bs-pagination-active-border-color: var(--brand); --bs-pagination-focus-box-shadow: none; --bs-pagination-disabled-bg: var(--surface); --bs-pagination-disabled-color: var(--faint); --bs-pagination-disabled-border-color: var(--border); margin: 0; }
.page-link { border-radius: 8px !important; margin: 0 2px; min-width: 32px; text-align: center; }

.kv { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: .55rem 1.2rem; font-size: .86rem; margin: 0; }
.kv dt { color: var(--muted); font-weight: 550; }
.kv dd { margin: 0; font-weight: 650; min-width: 0; overflow-wrap: anywhere; }
.meter { height: 8px; border-radius: 10px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 10px; background: var(--brand); }
.meter.ok > span { background: var(--ok); }
.note { border-radius: 12px; padding: .8rem 1rem; font-size: .84rem; display: flex; gap: .7rem; align-items: flex-start; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.note i { font-size: 1.05rem; margin-top: .05rem; }
.note.brand { background: var(--brand-50); border-color: var(--brand-100); } .note.brand i { color: var(--brand); }
.note.warn { background: var(--warn-bg); border-color: transparent; } .note.warn i { color: var(--warn); }
.note.bad { background: var(--bad-bg); border-color: transparent; } .note.bad i { color: var(--bad); }
.note.ok { background: var(--ok-bg); border-color: transparent; } .note.ok i { color: var(--ok); }
.divider { display: flex; align-items: center; gap: .75rem; color: var(--faint); font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; margin: 1.4rem 0 .9rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Uptime bars */
.bars { display: flex; gap: 2px; align-items: flex-end; height: 34px; }
.bars span { flex: 1; min-width: 3px; border-radius: 3px; background: var(--ok); opacity: .85; height: 100%; }
.bars span.bad { background: var(--bad); } .bars span.part { background: var(--warn); } .bars span.none { background: var(--surface-3); }

/* Answer card (reminder waiting for "Yes") */
.ask {
  border-radius: var(--r-lg); padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--brand-100);
  box-shadow: 0 10px 30px -14px rgba(var(--brand-rgb), .5); display: flex; gap: .9rem; align-items: flex-start;
}
.ask .q { font-weight: 750; font-size: .98rem; }
.ask .meta { font-size: .78rem; color: var(--muted); }
.ask .btns { display: flex; gap: .45rem; margin-top: .7rem; flex-wrap: wrap; }
.ring { animation: ring 2.4s ease-in-out infinite; transform-origin: 50% 10%; display: inline-block; }
@keyframes ring { 0%, 60%, 100% { transform: rotate(0); } 64% { transform: rotate(14deg); } 70% { transform: rotate(-12deg); } 76% { transform: rotate(8deg); } 82% { transform: rotate(-5deg); } }

/* Code / API docs */
.code { background: #161A22; color: #DCE1EA; border-radius: 12px; padding: 1rem 1.1rem; font-size: .78rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-x: auto; white-space: pre; margin: 0; border: 1px solid #262B36; line-height: 1.6; }
.code .k { color: #FF8A66; } .code .s { color: #9FE0B0; } .code .c { color: #6C7489; }
.verb { font-weight: 800; font-size: .68rem; padding: .18rem .45rem; border-radius: 6px; font-family: ui-monospace, monospace; letter-spacing: .03em; }
.verb.get { background: var(--ok-bg); color: var(--ok); } .verb.post { background: var(--info-bg); color: var(--info); }
.verb.put { background: var(--warn-bg); color: var(--warn); } .verb.del { background: var(--bad-bg); color: var(--bad); }
.endpoint { display: flex; align-items: center; gap: .6rem; font-family: ui-monospace, monospace; font-size: .86rem; font-weight: 700; flex-wrap: wrap; }
.keybox { display: flex; align-items: center; gap: .5rem; background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: 12px; padding: .6rem .8rem; }
.keybox code { flex: 1; color: var(--text); font-size: .85rem; word-break: break-all; }

/* Plans */
.plan { border: 1.5px solid var(--border); border-radius: var(--r-lg); padding: 1.3rem; background: var(--surface); height: 100%; display: flex; flex-direction: column; position: relative; }
.plan.current { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .1); }
.plan .name { font-weight: 800; font-size: 1.05rem; }
.plan .price { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; margin: .4rem 0 .1rem; }
.plan .price small { font-size: .82rem; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.plan ul { list-style: none; padding: 0; margin: 1rem 0 1.2rem; font-size: .84rem; flex: 1; }
.plan li { padding: .28rem 0; display: flex; gap: .5rem; color: var(--text-2); }
.plan li i { color: var(--ok); }
.plan li.no { color: var(--faint); } .plan li.no i { color: var(--faint); }
.plan .tag { position: absolute; top: -11px; right: 1rem; }

/* Modals & toasts */
.modal { --bs-modal-bg: var(--surface); --bs-modal-border-color: var(--border); --bs-modal-border-radius: 20px; --bs-modal-color: var(--text); }
.modal-content { box-shadow: var(--shadow-lg); }
.modal-header { border-bottom-color: var(--border); padding: 1.1rem 1.4rem; }
.modal-title { font-weight: 750; font-size: 1.02rem; }
.modal-body { padding: 1.3rem 1.4rem; }
.modal-footer { border-top-color: var(--border); padding: .9rem 1.4rem; gap: .5rem; }
.modal-footer > * { margin: 0; }
[data-bs-theme="dark"] .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
.offcanvas { --bs-offcanvas-bg: var(--surface); --bs-offcanvas-color: var(--text); --bs-offcanvas-border-color: var(--border); }

.toasts { position: fixed; top: 1rem; right: 1rem; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; max-width: calc(100vw - 2rem); }
.toast-x { min-width: 280px; max-width: 420px; background: var(--navy); color: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); padding: .8rem 1rem; display: flex; gap: .7rem; align-items: center; animation: toastIn .3s cubic-bezier(.2, .9, .3, 1.2); font-weight: 550; font-size: .86rem; }
[data-bs-theme="dark"] .toast-x { background: var(--surface-3); border: 1px solid var(--border-strong); }
.toast-x i { font-size: 1.15rem; }
.toast-x .x { margin-left: auto; background: none; border: 0; color: #9AA1AD; font-size: 1.1rem; padding: 0 0 0 .5rem; }
.toast-x.success i.lead { color: #4ADE80; } .toast-x.error i.lead { color: #F87171; } .toast-x.warning i.lead { color: #FBBF24; } .toast-x.info i.lead { color: #FF8A66; }
@keyframes toastIn { from { transform: translateY(-12px) scale(.96); opacity: 0; } }

/* Notification dropdown */
.notif-menu { width: 380px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; }
.notif-menu .hd { display: flex; align-items: center; justify-content: space-between; padding: .85rem 1rem; border-bottom: 1px solid var(--border); }
.notif-menu .bd { max-height: 420px; overflow-y: auto; }
.notif-menu .row-item { padding: .75rem 1rem; }
.notif-menu .ft { padding: .6rem; border-top: 1px solid var(--border); text-align: center; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(420px, 1fr) 1.1fr; background: var(--surface); }
.auth-form { display: flex; flex-direction: column; padding: 2rem 3rem; }
.auth-form .top { display: flex; justify-content: space-between; align-items: center; }
.auth-form .top img { height: 34px; }
.auth-card { width: 100%; max-width: 400px; margin: auto; padding: 2rem 0; }
.auth-card h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: .35rem; }
.auth-card .lead-t { color: var(--muted); margin-bottom: 1.8rem; }
.auth-card .form-control { padding: .75rem .95rem; }
.auth-card .btn-primary { padding: .8rem; font-size: .95rem; width: 100%; }
.auth-side {
  position: relative; overflow: hidden; background: var(--navy); color: #fff; padding: 3.5rem; display: flex; flex-direction: column; justify-content: center;
  background-image: radial-gradient(60% 50% at 85% 10%, rgba(var(--brand-rgb), .35), transparent 70%), radial-gradient(50% 40% at 0% 100%, rgba(var(--brand-rgb), .18), transparent 70%);
}
.auth-side .grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%); }
.auth-side .inner { position: relative; max-width: 520px; }
.auth-side h2 { color: #fff; font-size: 2.3rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.15; }
.auth-side h2 em { font-style: normal; color: var(--brand); }
.auth-side p { color: #B9C0CC; font-size: 1rem; margin: 1rem 0 2rem; }
.mock-stack { display: flex; flex-direction: column; gap: .7rem; }
.mock-n { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); backdrop-filter: blur(8px); border-radius: 16px; padding: .85rem 1rem; display: flex; gap: .85rem; align-items: center; animation: floatIn .7s both; }
.mock-n:nth-child(2) { animation-delay: .15s; margin-left: 1.5rem; } .mock-n:nth-child(3) { animation-delay: .3s; margin-left: .75rem; }
.mock-n .tile { background: rgba(var(--brand-rgb), .18); color: #FF8A66; }
.mock-n .t { font-weight: 700; font-size: .9rem; } .mock-n .s { font-size: .78rem; color: #AEB5C2; }
.mock-n .yes { margin-left: auto; font-size: .72rem; font-weight: 800; background: var(--brand); color: #fff; padding: .3rem .7rem; border-radius: 8px; }
@keyframes floatIn { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Mobile app shell ---------- */
.tabbar, .m-sheet-nav { display: none; }
.fab { display: none; }

@media (max-width: 991.98px) {
  .sidebar { display: none; }
  .main { margin-left: 0; }
  body { padding-bottom: calc(var(--tab-h) + var(--safe-b)); }
  .topbar { padding: 0 .75rem 0 1rem; height: 58px; padding-top: env(safe-area-inset-top, 0); height: calc(58px + env(safe-area-inset-top, 0px)); }
  .topbar .m-brand { display: flex; align-items: center; }
  .topbar .m-brand img { height: 30px; width: 30px; border-radius: 9px; }
  .topbar .title h1 { font-size: 1.05rem; }
  .topbar .title .crumb { display: none; }
  .topbar .hide-m { display: none !important; }
  .user-btn .nm, .user-btn .rl, .user-btn .bi-chevron-down { display: none; }
  .content { padding: 1rem; }
  .app-foot { display: none; }
  .acting-bar { padding: .5rem 1rem; }
  .page-head { margin-bottom: 1rem; align-items: center; }
  .page-head h2 { font-size: 1.3rem; }
  .page-head .hide-m { display: none !important; }

  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; height: calc(var(--tab-h) + var(--safe-b));
    padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-top: 1px solid var(--border);
  }
  .tabbar a, .tabbar button {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint);
    font-size: .66rem; font-weight: 700; background: none; border: 0; position: relative; letter-spacing: .01em;
  }
  .tabbar a i, .tabbar button i { font-size: 1.32rem; line-height: 1; transition: transform .2s; }
  .tabbar a.active { color: var(--brand); }
  .tabbar a.active i { transform: translateY(-1px); }
  .tabbar a.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
  .tabbar .badge-t { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--brand); color: #fff; font-size: .6rem; display: flex; align-items: center; justify-content: center; border: 2px solid var(--surface); }
  .tabbar .fab-slot { flex: 1; display: flex; justify-content: center; }
  .tabbar .fab-slot a {
    flex: none; width: 54px; height: 54px; border-radius: 18px; background: var(--brand); color: #fff; margin-top: -18px;
    box-shadow: 0 10px 22px -6px rgba(var(--brand-rgb), .75), 0 0 0 5px var(--bg);
  }
  .tabbar .fab-slot a i { font-size: 1.55rem; }

  .m-sheet-nav { display: block; }
  .sheet-nav a { display: flex; align-items: center; gap: .9rem; padding: .8rem .4rem; color: var(--text); font-weight: 600; border-bottom: 1px solid var(--border); }
  .sheet-nav a i.lead { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--text-2); font-size: 1.1rem; }
  .sheet-nav a.active i.lead { background: var(--brand-50); color: var(--brand); }
  .sheet-nav a .count { margin-left: auto; background: var(--brand); color: #fff; font-size: .7rem; font-weight: 800; border-radius: 20px; padding: .1rem .5rem; }
  .sheet-nav .sec { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 800; margin: 1.1rem 0 .1rem; }
  .offcanvas-bottom.m-sheet { height: auto; max-height: 86vh; border-radius: 22px 22px 0 0; padding-bottom: var(--safe-b); }
  .m-sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--border-strong); margin: .6rem auto .2rem; }

  /* App-like cards: full-bleed feel, bigger touch targets */
  .card { border-radius: 18px; }
  .row-item { padding: .9rem 1rem; min-height: 64px; }
  .card-head { padding: .9rem 1rem; }
  .card-body { padding: 1rem; }
  .filter-bar { padding: .75rem 1rem; }
  .filter-bar .search { max-width: none; flex-basis: 100%; }
  .toasts { top: auto; bottom: calc(var(--tab-h) + var(--safe-b) + .75rem); left: 1rem; right: 1rem; }
  .toast-x { min-width: 0; max-width: none; }
  .modal-dialog { margin: .75rem; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-form { padding: 1.25rem 1.25rem 2rem; }
  body.auth-body { padding-bottom: 0; }
  .stat .val { font-size: 1.35rem; }
  .seg label { padding: .45rem .5rem; font-size: .78rem; min-width: 0; }
  .stat { padding: 1rem; gap: .75rem; }

  /* Tables turn into stacked cards on phones */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack > :not(caption) > * > * { padding: .18rem 0; border: 0; }
  table.stack td[data-label] { display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  table.stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .76rem; font-weight: 600; text-align: left; flex-shrink: 0; }
  table.stack td.lead-cell { padding-bottom: .35rem; }
  table.stack td.actions-cell { text-align: left; padding-top: .55rem; }
}
@media (min-width: 992px) { .show-m { display: none !important; } }

@media (display-mode: standalone) { .app-foot { display: none; } }
