/*!
 * SmartISPBD premium UI (v1.16). Loaded after smartisp.css on every page.
 * Implements the approved four-panel reference: dark navy navigation with a light
 * content area (default), blue/cyan identity for the customer panel and navy/purple
 * for the Super Admin, split-screen sign-in pages, gradient KPI cards, the router
 * table and the dashboard widgets. Dark mode keeps the same composition.
 */

/* ------------------------------------------------------------------ tokens */
:root,
:root[data-theme="light"] {
  --sp-bg: #f3f6fb;
  --sp-surface: #ffffff;
  --sp-surface-2: #f8fafc;
  --sp-surface-3: #eef2f8;
  --sp-border: #e6eaf2;
  --sp-border-strong: #cfd6e4;
  --sp-ink: #243147;
  --sp-ink-strong: #0f172a;
  --sp-muted: #64748b;
  --sp-faint: #94a3b8;
  --sp-brand: #2f6bff;
  --sp-brand-hover: #1f55e0;
  --sp-brand-soft: rgba(47, 107, 255, 0.1);
  --sp-link: #2f6bff;
  --sp-focus: 0 0 0 3px rgba(47, 107, 255, 0.25);
  --sp-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 30px rgba(15, 23, 42, 0.06);
  --sp-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05), 0 2px 10px rgba(15, 23, 42, 0.04);
  --sp-row-hover: rgba(47, 107, 255, 0.04);
  --sp-radius: 14px;
  /* navigation is always dark (both themes) */
  --sp-side-bg: #0b1736;
  --sp-side-bg-2: #0d1d44;
  --sp-side-ink: #c7d2ea;
  --sp-side-ink-strong: #ffffff;
  --sp-side-muted: #7f8fb5;
  --sp-side-border: rgba(255, 255, 255, 0.07);
  --sp-side-hover: rgba(255, 255, 255, 0.06);
  --sp-accent: #2f6bff;
  --sp-accent-2: #4f8cff;
  --sp-accent-grad: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  --sp-accent-soft: rgba(47, 107, 255, 0.14);
  --sp-cyan: #06b6d4;
  --sp-topbar: #ffffff;
}
:root[data-theme="dark"] {
  --sp-bg: #0b1222;
  --sp-surface: #121a2e;
  --sp-surface-2: #172138;
  --sp-surface-3: #1d2944;
  --sp-border: #22304c;
  --sp-border-strong: #33446a;
  --sp-ink: #dbe3f3;
  --sp-ink-strong: #ffffff;
  --sp-muted: #94a3bf;
  --sp-faint: #66759a;
  --sp-brand: #3b7bff;
  --sp-brand-hover: #5a90ff;
  --sp-brand-soft: rgba(59, 123, 255, 0.18);
  --sp-link: #7aa5ff;
  --sp-focus: 0 0 0 3px rgba(59, 123, 255, 0.35);
  --sp-row-hover: rgba(122, 165, 255, 0.07);
  --sp-side-bg: #0a1230;
  --sp-side-bg-2: #0c173a;
  --sp-topbar: #121a2e;
}
/* Super Admin: purple accents on the same shell */
body.sp-sa {
  --sp-accent: #7c3aed;
  --sp-accent-2: #a855f7;
  --sp-accent-grad: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
  --sp-accent-soft: rgba(124, 58, 237, 0.14);
  --sp-brand: #7c3aed;
  --sp-brand-hover: #6d28d9;
  --sp-brand-soft: rgba(124, 58, 237, 0.1);
  --sp-link: #7c3aed;
  --sp-focus: 0 0 0 3px rgba(124, 58, 237, 0.25);
  --sp-side-bg: #0d1133;
  --sp-side-bg-2: #141a46;
}
:root[data-theme="dark"] body.sp-sa { --sp-link: #b794ff; --sp-brand: #8b5cf6; --sp-brand-hover: #a78bfa; --sp-brand-soft: rgba(139, 92, 246, 0.2); }

body { background: var(--sp-bg); }
.sp-auth-admin { --sp-accent: #7c3aed; --sp-accent-2: #a855f7; --sp-accent-grad: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%); --sp-accent-soft: rgba(124, 58, 237, 0.14); --sp-brand: #7c3aed; --sp-brand-hover: #6d28d9; --sp-brand-soft: rgba(124, 58, 237, 0.1); --sp-link: #7c3aed; --sp-focus: 0 0 0 3px rgba(124, 58, 237, 0.25); }

/* ------------------------------------------------------------------- sidebar */
.sidenav {
  background: linear-gradient(180deg, var(--sp-side-bg) 0%, var(--sp-side-bg-2) 100%);
  border-right: 1px solid var(--sp-side-border);
  color: var(--sp-side-ink);
}
.sidenav a.sp-brand { border-bottom: 1px solid var(--sp-side-border); height: 68px; color: #fff !important; }
.sidenav .sp-brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--sp-accent-grad); font-size: 18px; box-shadow: 0 8px 20px rgba(37, 99, 235, 0.45); }
body.sp-sa .sidenav .sp-brand-mark { box-shadow: 0 8px 20px rgba(124, 58, 237, 0.45); }
.sidenav .sp-brand-name { color: #fff; font-size: 16px; letter-spacing: .1px; }
.sidenav .sp-brand-name b { color: #7cc4ff; }
body.sp-sa .sidenav .sp-brand-name b { color: #c4b5fd; }
.sidenav .sp-brand-sub { color: var(--sp-side-muted); }
.sidenav .sp-nav { padding: 8px 12px 24px; }
.sidenav .sp-nav-label { color: var(--sp-side-muted); padding: 18px 10px 6px; font-size: 10.5px; letter-spacing: .1em; }
.sidenav .sp-nav-label i { color: var(--sp-side-muted); }
.sidenav a, .sidenav .dropdown-btn { color: var(--sp-side-ink); padding: 9px 12px; border-radius: 10px; font-size: 13.5px; }
.sidenav a i, .sidenav .dropdown-btn i { color: var(--sp-side-muted); }
.sidenav a:hover, .sidenav .dropdown-btn:hover { background: var(--sp-side-hover); color: #fff; }
.sidenav a:hover i { color: #fff; }
.sidenav a.active, .sidenav a.menu.active { background: var(--sp-accent-grad); color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35); }
body.sp-sa .sidenav a.active, body.sp-sa .sidenav a.menu.active { box-shadow: 0 6px 18px rgba(124, 58, 237, 0.4); }
.sidenav a.active i { color: #fff; }
.sidenav a.active::after { content: "\f105"; font: normal normal normal 13px/1 FontAwesome; margin-left: auto; opacity: .9; }
.sidenav a.active .sp-nav-count { margin-left: 6px; }
.sidenav .sp-nav-count { background: #ef4444; color: #fff; }
.sidenav .sp-nav-toggle .sp-nav-caret { color: var(--sp-side-muted); }
.sp-nav-foot { border-top: 1px solid var(--sp-side-border); color: var(--sp-side-muted); }
.sidenav ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-color: transparent; }
.sidenav .sp-router-chip { background: rgba(255, 255, 255, .05); border-color: var(--sp-side-border); }
.sidenav .sp-router-chip .sp-chip-value { color: #fff; }
body.sp-collapsed .sidenav a.active::after { display: none; }

/* --------------------------------------------------------------------- topbar */
.navbar {
  background: var(--sp-topbar);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  border-bottom: 1px solid var(--sp-border);
  height: 68px; padding: 0 22px 0 14px; gap: 10px;
}
#main { padding-top: 68px; }
.sp-topbar-title { display: flex; flex-direction: column; min-width: 0; padding: 0 6px; }
.sp-topbar-title #cpage { padding: 0 !important; font-size: 17px !important; line-height: 1.2; }
.sp-topbar-sub { font-size: 12.5px; color: var(--sp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.sp-router-picker {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 6px 0 12px;
  border: 1px solid var(--sp-border); border-radius: 12px; background: var(--sp-surface-2);
}
.sp-router-picker-label { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--sp-muted); font-weight: 600; }
.sp-router-select { border: 0; background-color: transparent; height: 36px; font-weight: 600; color: var(--sp-ink-strong); }
.sp-router-none { border-color: #f59e0b; background: rgba(245, 158, 11, .08); }
.sp-router-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sp-faint); flex: none; }
.sp-dot-online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.sp-dot-offline { background: #ef4444; }
.sp-icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--sp-border); background: var(--sp-surface); color: var(--sp-ink) !important; }
.sp-icon-btn:hover { border-color: var(--sp-border-strong); }
.sp-bell { position: relative; }
.sp-bell-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ef4444; color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--sp-topbar); }
.sp-user { height: 40px; border-radius: 12px; padding: 0 12px 0 4px !important; gap: 9px; background: var(--sp-surface); }
.sp-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sp-accent-grad); color: #fff; }
.sp-user-name { line-height: 1.15; display: flex; flex-direction: column; }
.sp-user-role { display: block; font-size: 11px; color: var(--sp-muted); font-weight: 500; }
.sp-global-search { border-radius: 12px; }

/* ------------------------------------------------------------- content shell */
.main-container { padding: 22px 24px 40px; }
.card { border-radius: var(--sp-radius); border: 1px solid var(--sp-border); box-shadow: var(--sp-shadow-sm); }
.card-header { padding: 16px 20px; }
.card-header h3 { font-size: 15.5px; }
.card-header h3 i { color: var(--sp-accent); }
.sp-card-head { align-items: center; gap: 12px; flex-wrap: wrap; }
.sp-card-sub { display: block; font-size: 12.5px; color: var(--sp-muted); font-weight: 400; margin-top: 2px; }
.sp-card-head-text { display: flex; flex-direction: column; min-width: 0; }
.btn { border-radius: 10px; font-weight: 600; }
.btn.bg-primary, .btn-login { background: var(--sp-accent-grad); border-color: transparent; box-shadow: 0 6px 16px rgba(37, 99, 235, .3); }
body.sp-sa .btn.bg-primary { box-shadow: 0 6px 16px rgba(124, 58, 237, .3); }
.btn.bg-primary:hover { background: var(--sp-accent-grad); filter: brightness(1.06); }
.form-control, .sp-search .form-control { border-radius: 10px; }
.sp-page-head h2 { font-size: 22px; }

/* ------------------------------------------------------------- KPI cards */
.sp-kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.sp-kpi {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 18px 18px 16px;
  border-radius: 16px; color: #fff; min-width: 0; overflow: hidden; text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
  transition: transform .15s ease, box-shadow .15s ease;
}
a.sp-kpi:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(15, 23, 42, .18); color: #fff; }
.sp-kpi::before { content: ""; position: absolute; right: -30px; top: -40px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.sp-kpi-blue { background: linear-gradient(135deg, #3b82f6 0%, #2457d6 100%); }
.sp-kpi-green { background: linear-gradient(135deg, #34d399 0%, #15a06b 100%); }
.sp-kpi-red { background: linear-gradient(135deg, #f87171 0%, #dc2626 100%); }
.sp-kpi-orange { background: linear-gradient(135deg, #fbbf24 0%, #ea580c 100%); }
.sp-kpi-purple { background: linear-gradient(135deg, #a78bfa 0%, #6d28d9 100%); }
.sp-kpi-icon { flex: none; width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: rgba(255, 255, 255, .22); font-size: 19px; }
.sp-kpi-body { min-width: 0; flex: 1; }
.sp-kpi-label { font-size: 12.5px; font-weight: 600; opacity: .92; }
.sp-kpi-value { font-size: 28px; font-weight: 800; line-height: 1.15; margin: 2px 0 1px; letter-spacing: -.3px; }
.sp-kpi-note { font-size: 12px; opacity: .85; line-height: 1.3; }
.sp-kpi-spark { position: absolute; right: 12px; bottom: 10px; width: 64px; height: 26px; opacity: .9; }
.sp-kpi-spark polyline { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 1365.98px) { .sp-kpi-grid { gap: 12px; } .sp-kpi { padding: 14px 16px; } .sp-kpi-value { font-size: 26px; } .sp-kpi-icon { width: 40px; height: 40px; } }
@media (max-width: 1099.98px) { .sp-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1599.98px) { .sp-router-table td.sp-row-num, .sp-router-table th.sp-row-num { display: none; } } /* v1.61.0: 1599 (was 1399): at 1440 px the last column slid under the pinned actions */
@media (max-width: 820px) { .sp-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .sp-kpi { padding: 14px; } .sp-kpi-value { font-size: 24px; } }
/* v1.27.22 (UI-7b): two compact columns on phones too (one card per row took more than a screen); a 5th card spans both */
@media (max-width: 480px) {
  .sp-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .sp-kpi { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .sp-kpi-icon { width: 32px; height: 32px; font-size: 14px; border-radius: 10px; }
  .sp-kpi-value { font-size: 22px; overflow-wrap: anywhere; }
  .sp-kpi-spark { display: none; }
  .sp-kpi-grid > .sp-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* Super Admin KPI cards (white, colored circle icon) */
.sp-kpi-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sp-stat-card {
  display: flex; align-items: flex-start; gap: 14px; padding: 18px; border-radius: 16px;
  background: var(--sp-surface); border: 1px solid var(--sp-border); box-shadow: var(--sp-shadow-sm); color: var(--sp-ink); min-width: 0;
  transition: transform .15s ease, box-shadow .15s ease;
}
a.sp-stat-card:hover { transform: translateY(-2px); box-shadow: var(--sp-shadow); border-color: var(--sp-border-strong); }
.sp-stat-card .sp-stat-icon { width: 46px; height: 46px; border-radius: 50%; font-size: 18px; color: #fff; }
.sp-tone-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.sp-tone-green { background: linear-gradient(135deg, #34d399, #059669); }
.sp-tone-red { background: linear-gradient(135deg, #f87171, #dc2626); }
.sp-tone-orange { background: linear-gradient(135deg, #fbbf24, #ea580c); }
.sp-tone-purple { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.sp-tone-cyan { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.sp-stat-card .sp-stat-label { font-size: 12.5px; }
.sp-stat-card .sp-stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
.sp-stat-card .sp-stat-note { font-size: 12px; }
.sp-stat-note .sp-up { color: #16a34a; font-weight: 600; }
.sp-stat-note .sp-down { color: #dc2626; font-weight: 600; }
@media (max-width: 1365.98px) { .sp-kpi-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .sp-kpi-grid-4 { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ router table */
.sp-table-card .card-body { padding: 14px 20px 18px; }
.sp-table-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.sp-table-toolbar .sp-search { flex: 1 1 220px; max-width: 360px; }
.sp-table-toolbar .form-control { height: 38px; }
.sp-table-toolbar select.form-control { width: auto; min-width: 130px; }
.sp-table-toolbar .sp-spacer { flex: 1; }
.table thead th { background: var(--sp-surface-2); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--sp-muted); font-weight: 600; padding: 11px 12px; border-bottom: 1px solid var(--sp-border); }
@media (min-width: 641px) { .table:not(.sp-table-stack) td, .sp-table-card .table td { padding: 12px; } }
.table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--sp-surface-2) 60%, transparent); }
.table-hover tbody tr:hover td { background: var(--sp-row-hover); }
tr.sp-row-offline td { background: rgba(239, 68, 68, .06) !important; }
.sp-router-cell b { display: block; font-size: 13.5px; }
.sp-router-cell span { display: block; font-size: 11.5px; }
.sp-row-num { color: var(--sp-faint); font-weight: 600; width: 34px; }
.sp-badge { border-radius: 999px; padding: 4px 10px; font-size: 11.5px; font-weight: 600; }
.sp-badge i.fa-circle { font-size: 7px; margin-right: 2px; vertical-align: 1px; }
/* v1.27.5 (UI audit UI-4): a long voucher comment badge in a table is cut with an ellipsis (its title
   shows the full text) instead of running past the cell. */
.table td > a.sp-badge, .table td > span.sp-badge { display: inline-block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.sp-mini-meter { display: flex; align-items: center; gap: 8px; min-width: 110px; }
.sp-mini-meter .progress { flex: 1; height: 6px; border-radius: 6px; background: var(--sp-surface-3); overflow: hidden; margin: 0; }
.sp-mini-meter .progress-bar-blue { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #3b82f6, #06b6d4); }
.sp-mini-meter .sp-bar-warning { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.sp-mini-meter .sp-bar-danger { background: linear-gradient(90deg, #f87171, #dc2626); }
.sp-mini-meter span { font-size: 12px; color: var(--sp-muted); min-width: 32px; text-align: right; }
.sp-row-actions { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.sp-row-actions .btn.sp-btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }
.sp-act { width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--sp-muted); }
.sp-act:hover { background: var(--sp-surface-3); color: var(--sp-ink-strong); }
.sp-selected-btn { background: var(--sp-success-soft) !important; color: var(--sp-success) !important; border-color: transparent !important; }
.sp-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; color: var(--sp-muted); }
.sp-pager-btns { display: flex; gap: 4px; }
.sp-pager-btns button { min-width: 32px; height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--sp-border); background: var(--sp-surface); color: var(--sp-ink); font-size: 12.5px; }
.sp-pager-btns button.sp-on { background: var(--sp-accent-grad); color: #fff; border-color: transparent; }
.sp-pager-btns button:disabled { opacity: .45; cursor: default; }
.sp-chip-trend { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--sp-success-soft); color: var(--sp-success); }
.sp-chip-trend.sp-down { background: var(--sp-danger-soft); color: var(--sp-danger); }
.sp-sa-kpis { margin-bottom: 16px; }
.sp-stat-card .sp-stat-value.sp-stat-money { font-size: 20px; line-height: 1.3; }
.sp-sa-bottom .sp-feed-table th:first-child { padding-left: 14px; }
.sp-sa-bottom .sp-list-time .badge, .sp-sa-bottom .sp-list-time .sp-badge { white-space: nowrap; }
.sp-sa-bottom .sp-table-wrap { border: 0; }

/* --------------------------------------------------------- dashboard widgets */
.sp-dash-row { display: grid; grid-template-columns: 1.15fr 1.15fr 1fr; gap: 16px; margin-top: 16px; }
.sp-dash-row-2 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 1365.98px) { .sp-dash-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 820px) { .sp-dash-row { grid-template-columns: 1fr; } }
.sp-dash-row .card { margin: 0; }
.sp-dash-row .card-body { padding: 10px 20px 16px; }
.sp-tl { list-style: none; margin: 0; padding: 0; }
.sp-tl li { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--sp-border); font-size: 13px; }
.sp-tl li:last-child { border-bottom: 0; }
.sp-tl b { display: block; color: var(--sp-ink-strong); font-size: 13px; }
.sp-tl small { display: block; color: var(--sp-muted); font-size: 12px; margin-top: 1px; }
.sp-tl .sp-list-time { margin-left: auto; flex: none; color: var(--sp-faint); font-size: 11.5px; white-space: nowrap; padding-top: 2px; }
.sp-list-icon { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 14px; }
.sp-li-warning { background: var(--sp-warning-soft); color: var(--sp-warning); }
.sp-li-danger { background: var(--sp-danger-soft); color: var(--sp-danger); }
.sp-li-info { background: var(--sp-info-soft); color: var(--sp-info); }
.sp-li-success { background: var(--sp-success-soft); color: var(--sp-success); }
.sp-li-brand { background: var(--sp-accent-soft); color: var(--sp-accent); }
.sp-donut-wrap { display: flex; align-items: center; gap: 22px; padding: 10px 0 4px; }
.sp-donut { position: relative; width: 150px; height: 150px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--sp-border) 0 100%); }
.sp-donut::after { content: ""; position: absolute; inset: 24px; border-radius: 50%; background: var(--sp-surface); }
.sp-donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; z-index: 1; }
.sp-donut-center b { font-size: 28px; font-weight: 800; color: var(--sp-ink-strong); line-height: 1; }
.sp-donut-center span { font-size: 11.5px; color: var(--sp-muted); }
.sp-donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13px; }
.sp-donut-legend li { display: flex; align-items: center; gap: 8px; }
.sp-donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sp-donut-legend span { color: var(--sp-muted); }
.sp-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sp-shortcuts a { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px; border: 1px solid var(--sp-border); background: var(--sp-surface-2); color: var(--sp-ink-strong); font-weight: 600; font-size: 13px; }
.sp-shortcuts a i { color: var(--sp-accent); font-size: 18px; }
.sp-shortcuts a:hover { border-color: var(--sp-accent); background: var(--sp-accent-soft); }
.sp-kvl { list-style: none; margin: 0; padding: 0; }
.sp-kvl li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--sp-border); font-size: 13px; }
.sp-kvl li:last-child { border-bottom: 0; }
.sp-kvl li span { color: var(--sp-muted); }
.sp-kvl li span i { width: 18px; color: var(--sp-faint); }
.sp-kvl li b { color: var(--sp-ink-strong); font-size: 15px; }
.sp-kvl li.sp-kvl-note { padding: 0 0 8px; border-bottom: 0; margin-top: 0; font-size: 12px; }
/* v1.27.5 (UI audit UI-8): the row before a note keeps its line below the note, not through it */
.sp-kvl li:has(+ li.sp-kvl-note) { border-bottom: 0; padding-bottom: 2px; }
.sp-kvl li.sp-kvl-note + li { border-top: 1px solid var(--sp-border); }
/* router table on the dashboard: keep the actions on one line, give the name room */
@media (min-width: 1400px) {
  .sp-table-card .sp-router-table { table-layout: auto; }
  .sp-table-card .sp-router-table td[data-label="Router"] { min-width: 190px; }
  .sp-table-card .sp-router-table td[data-label="Router"] .sp-cell { overflow-wrap: anywhere; }
  .sp-table-card .sp-router-table .sp-row-actions { white-space: nowrap; }
  .sp-table-card .sp-router-table td, .sp-table-card .sp-router-table th { padding-left: 8px; padding-right: 8px; }
  .sp-table-card .sp-router-table .sp-row-actions { gap: 2px; }
  .sp-table-card .sp-router-table .sp-row-actions .btn.sp-btn-sm { padding: 5px 10px; }
  .sp-table-card .sp-router-table .sp-act { width: 28px; }
}
.sp-freshness { font-size: 12.5px; color: var(--sp-muted); }
.sp-card-head .sp-freshness { margin: 0; }

/* Super Admin dashboard */
.sp-sa-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 2px; }
@media (max-width: 1023.98px) { .sp-sa-charts { grid-template-columns: 1fr; } }
.sp-sa-charts .card { margin: 0; }
.sp-chart-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.sp-chart-head b { font-size: 24px; font-weight: 800; color: var(--sp-ink-strong); }
.sp-chart-head span { font-size: 12.5px; color: var(--sp-muted); }
.sp-chart-sm { height: 220px; }
.sp-sa-bottom { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-top: 16px; }
@media (max-width: 1023.98px) { .sp-sa-bottom { grid-template-columns: 1fr; } }
.sp-sa-bottom .card { margin: 0; }
.sp-health-list { list-style: none; margin: 0; padding: 0; }
.sp-health-list li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--sp-border); font-size: 13.5px; }
.sp-health-list li:last-child { border-bottom: 0; }
.sp-health-list .sp-list-icon { width: 32px; height: 32px; }
.sp-health-list .sp-health-state { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }
.sp-health-state i.fa-circle { font-size: 8px; }
.sp-health-list .sp-health-ok { color: var(--sp-success); } .sp-health-list .sp-health-warn { color: var(--sp-warning); } .sp-health-list .sp-health-fail { color: var(--sp-danger); } .sp-health-list .sp-health-unknown { color: var(--sp-faint); }
.sp-feed-table td { vertical-align: middle; }
.sp-feed-table .sp-feed-icon { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; margin-right: 8px; vertical-align: middle; }

/* ------------------------------------------------------------- sign-in pages */
.sp-auth.sp-auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; place-items: stretch; padding: 0; gap: 0; background: var(--sp-bg); }
.sp-auth-wide .sp-auth-card { max-width: 640px; }
.sp-auth-hero {
  position: relative; overflow: hidden; color: #e8eefc;
  background: radial-gradient(1200px 600px at 20% 10%, #1e3a8a 0%, transparent 55%), radial-gradient(900px 500px at 80% 90%, #0e4a9d 0%, transparent 55%), linear-gradient(160deg, #0a1434 0%, #0b1a4a 55%, #0a2660 100%);
  padding: 34px 44px 30px; display: flex; flex-direction: column; min-height: 100vh;
}
.sp-auth-hero-admin {
  background: radial-gradient(1100px 600px at 20% 10%, #312e81 0%, transparent 55%), radial-gradient(900px 500px at 85% 85%, #4c1d95 0%, transparent 55%), linear-gradient(160deg, #0b1030 0%, #15123f 55%, #241160 100%);
}
.sp-auth-hero .sp-net { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; pointer-events: none; }
.sp-auth-hero > * { position: relative; }
.sp-auth-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 36px; }
.sp-auth-brand-big { display: flex; align-items: center; gap: 12px; color: #fff; }
.sp-auth-brand-big .sp-brand-mark { width: 44px; height: 44px; border-radius: 13px; background: var(--sp-accent-grad); font-size: 20px; box-shadow: 0 8px 22px rgba(37, 99, 235, .5); }
.sp-auth-hero-admin .sp-auth-brand-big .sp-brand-mark { background: linear-gradient(135deg, #6d28d9, #a855f7); box-shadow: 0 8px 22px rgba(124, 58, 237, .5); }
.sp-auth-brand-big b { display: block; font-size: 20px; line-height: 1.1; }
.sp-auth-brand-big b span { color: #7cc4ff; }
.sp-auth-hero-admin .sp-auth-brand-big b span { color: #c4b5fd; }
.sp-auth-brand-big small { display: block; font-size: 12.5px; opacity: .85; }
.sp-auth-role { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .08); font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; }
.sp-auth-role i { color: #fbbf24; }
.sp-auth-hero h2 { color: #fff; font-size: 38px; line-height: 1.12; font-weight: 800; letter-spacing: -.5px; margin: 0 0 14px; max-width: 520px; }
.sp-auth-hero h2 .sp-grad { background: linear-gradient(90deg, #67e8f9, #60a5fa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sp-auth-hero-admin h2 .sp-grad { background: linear-gradient(90deg, #c084fc, #818cf8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sp-auth-hero .sp-lead { font-size: 15px; line-height: 1.6; opacity: .88; max-width: 460px; margin: 0 0 24px; }
.sp-auth-features { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 12px; }
.sp-auth-features li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 600; color: #fff; }
.sp-auth-features i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 14px; color: #fff; flex: none; }
.sp-f-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.sp-f-green { background: linear-gradient(135deg, #34d399, #059669); }
.sp-f-orange { background: linear-gradient(135deg, #fbbf24, #ea580c); }
.sp-f-red { background: linear-gradient(135deg, #f87171, #dc2626); }
.sp-f-purple { background: linear-gradient(135deg, #a78bfa, #6d28d9); }
.sp-f-cyan { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.sp-auth-glance { max-width: 440px; padding: 14px 16px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(10, 20, 55, .55); backdrop-filter: blur(6px); }
.sp-auth-glance > b { display: block; font-size: 12px; font-weight: 600; opacity: .9; margin-bottom: 10px; }
.sp-auth-glance ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sp-auth-glance li { border-radius: 12px; background: rgba(255, 255, 255, .07); padding: 10px 10px 9px; text-align: center; font-size: 11.5px; line-height: 1.3; opacity: .95; }
.sp-auth-glance li i { display: block; font-size: 16px; margin-bottom: 6px; color: #67e8f9; }
.sp-auth-hero-admin .sp-auth-glance li i { color: #c4b5fd; }
.sp-auth-glance li b { display: block; font-size: 13px; color: #fff; margin-bottom: 1px; }
.sp-auth-art { position: absolute; right: 24px; bottom: 54px; width: min(46%, 420px); pointer-events: none; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .45)); }
.sp-auth-hero-foot { margin-top: auto; padding-top: 30px; font-size: 12px; opacity: .72; line-height: 1.6; }
.sp-auth-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px 20px; position: relative; }
.sp-auth-side-top { position: absolute; top: 18px; right: 20px; display: flex; gap: 8px; align-items: center; }
.sp-auth-wrap .sp-auth-card { width: 100%; max-width: 440px; background: var(--sp-surface); border: 1px solid var(--sp-border); border-radius: 20px; box-shadow: var(--sp-shadow); padding: 34px 34px 26px; }
.sp-auth-card .sp-auth-brand { flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 18px; }
.sp-auth-card .sp-auth-brand .sp-brand-mark { width: 54px; height: 54px; border-radius: 16px; font-size: 24px; background: var(--sp-accent-grad); box-shadow: 0 10px 24px rgba(37, 99, 235, .35); }
.sp-auth-admin .sp-auth-card .sp-auth-brand .sp-brand-mark { background: linear-gradient(135deg, #6d28d9, #a855f7); box-shadow: 0 10px 24px rgba(124, 58, 237, .35); }
.sp-auth-card h1 { font-size: 23px; font-weight: 800; letter-spacing: -.2px; }
.sp-auth-card p.sp-sub { font-size: 13px; }
.sp-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 12px; background: var(--sp-surface-3); margin: 0 0 20px; }
.sp-auth-tabs a { display: flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--sp-muted); }
.sp-auth-tabs a.sp-on { background: var(--sp-accent-grad); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, .3); }
.sp-auth-admin .sp-auth-tabs a.sp-on { box-shadow: 0 4px 12px rgba(124, 58, 237, .3); }
.sp-auth-tabs a:not(.sp-on):hover { color: var(--sp-ink-strong); }
.sp-auth-card .sp-field label { font-size: 13px; font-weight: 600; color: var(--sp-ink-strong); }
.sp-auth-card .form-control { height: 44px; border-radius: 11px; background: var(--sp-surface-2); }
.sp-auth-card .form-control:focus { background: var(--sp-surface); }
.sp-auth-card .btn.bg-primary.sp-btn-block { height: 46px; font-size: 15px; border-radius: 12px; background: linear-gradient(90deg, #2563eb, #7c3aed); }
.sp-auth-admin .sp-auth-card .btn.bg-primary.sp-btn-block { background: linear-gradient(90deg, #7c3aed, #2563eb); }
.sp-auth-card .sp-row { margin: 4px 0 18px; }
.sp-auth-divider { margin: 18px 0 12px; }
.sp-auth-divider span { text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }
.sp-auth-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 4px; }
.sp-auth-tiles a { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 6px 10px; border-radius: 12px; font-size: 11.5px; font-weight: 600; color: var(--sp-ink-strong); border: 1px solid var(--sp-border); background: var(--sp-surface-2); text-align: center; }
.sp-auth-tiles a i { font-size: 18px; }
.sp-auth-tiles a:hover { border-color: var(--sp-accent); background: var(--sp-accent-soft); }
.sp-t-blue i { color: #2563eb; } .sp-t-green i { color: #059669; } .sp-t-purple i { color: #7c3aed; } .sp-t-orange i { color: #ea580c; }
.sp-auth-foot { margin-top: 18px; font-size: 11.5px; }
.sp-auth-side .sp-theme-float { position: static; }
@media (min-width: 1024px) {
  .sp-auth.sp-auth-wrap { grid-template-columns: minmax(0, 1.55fr) minmax(400px, 1fr); }
  .sp-auth-side { padding: 40px 32px; }
}
@media (min-width: 1440px) { .sp-auth.sp-auth-wrap { grid-template-columns: minmax(0, 1.6fr) minmax(460px, 1fr); } .sp-auth-hero { padding: 40px 56px 34px; } }
@media (max-width: 1023.98px) {
  .sp-auth.sp-auth-wrap { grid-template-columns: 1fr; }
  .sp-auth-hero { min-height: 0; padding: 22px 20px 24px; }
  .sp-auth-hero h2 { font-size: 26px; }
  .sp-auth-hero .sp-lead { font-size: 14px; margin-bottom: 16px; }
  .sp-auth-features { grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
  .sp-auth-features li { font-size: 13px; }
  .sp-auth-glance, .sp-auth-art, .sp-auth-hero-foot { display: none; }
  .sp-auth-hero-top { margin-bottom: 20px; }
  .sp-auth-side { padding: 24px 16px 32px; }
  .sp-auth-card { padding: 26px 20px 22px; }
}
@media (max-width: 480px) {
  .sp-auth-features { grid-template-columns: 1fr 1fr; gap: 6px 8px; }
  .sp-auth-features li { font-size: 12px; gap: 8px; }
  .sp-auth-features i { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }
  .sp-auth-hero .sp-lead { display: none; }
  .sp-auth-hero h2 { font-size: 22px; margin-bottom: 12px; }
  .sp-auth-hero { padding: 16px 16px 18px; }
}
/* the sign-in page is always light on the form side; dark theme darkens only the card side surfaces (tokens) */

/* --------------------------------------------------------------- responsive */
@media (max-width: 1023.98px) {
  .navbar { height: 60px; }
  #main { padding-top: 60px; }
  .sp-topbar-sub { display: none; }
}
@media (max-width: 640px) {
  .sp-router-picker { padding: 0 2px 0 10px; }
  .sp-router-picker-label { display: none; }
  .sp-user { padding: 0 4px !important; }
}
@media print { .sidenav, .navbar { display: none; } #main { margin: 0; padding: 0; } }

/* ------------------------------------------------- v1.17: language (English / বাংলা) */
/* Noto Sans Bengali (SIL OFL 1.1, css/fonts/OFL-NotoSansBengali.txt), Bengali block only:
   browsers download it only when a page shows Bangla text. Variable weight 400-700. */
@font-face {
  font-family: "SP Bengali";
  src: url("fonts/noto-sans-bengali.woff") format("woff");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0980-09FF, U+200C-200D, U+25CC, U+0964-0965;
}
body, button, input, select, textarea {
  font-family: "Inter", "SP Bengali", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans Bengali", "Nirmala UI", sans-serif;
}
html[lang="bn"] body { line-height: 1.6; }
/* Bangla has no letter case: keep small caps headings readable */
html[lang="bn"] .sp-nav-group, html[lang="bn"] .table th, html[lang="bn"] .sp-kpi-label, html[lang="bn"] .sp-stat-label { letter-spacing: 0; text-transform: none; }
html[lang="bn"] .table th { font-size: 12.5px; }

.sp-lang { margin: 0; display: inline-flex; position: relative; }
.sp-lang-dd { position: relative; }
.sp-lang-dd > summary { list-style: none; }
.sp-lang-dd > summary::-webkit-details-marker { display: none; }
.sp-lang-btn {
  height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--sp-border); background: var(--sp-surface); color: var(--sp-ink); font-size: 13px; font-weight: 600; white-space: nowrap; user-select: none;
}
.sp-lang-btn:hover { border-color: var(--sp-border-strong); color: var(--sp-ink-strong); }
.sp-lang-btn:focus-visible { outline: none; box-shadow: var(--sp-focus); }
.sp-lang-btn .fa-globe { font-size: 15px; color: var(--sp-accent, var(--sp-brand)); }
.sp-lang-caret { font-size: 12px; color: var(--sp-muted); }
.sp-lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 1200; min-width: 160px; padding: 6px;
  background: var(--sp-surface); border: 1px solid var(--sp-border); border-radius: 12px; box-shadow: var(--sp-shadow-lg, 0 12px 32px rgba(15, 23, 42, .18));
}
.sp-lang-menu button {
  display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--sp-ink); font-size: 14px; text-align: left; cursor: pointer;
}
.sp-lang-menu button:hover, .sp-lang-menu button:focus-visible { background: var(--sp-surface-3); color: var(--sp-ink-strong); outline: none; }
.sp-lang-menu button.sp-on { color: var(--sp-accent, var(--sp-brand)); font-weight: 600; }
.sp-auth-side-top { display: flex; align-items: center; gap: 8px; }
/* topbar: globe only on tablets; on phones the menu lives in the navigation drawer instead,
   so the top bar keeps room for the menu button and the router picker */
@media (max-width: 1023.98px) {
  .sp-lang-topbar .sp-lang-cur, .sp-lang-topbar .sp-lang-caret { display: none; }
  .sp-lang-topbar .sp-lang-btn { width: 40px; padding: 0; justify-content: center; }
}
@media (max-width: 640px) { .sp-lang-topbar { display: none !important; } }
@media (max-width: 480px) { .sp-lang-btn { height: 36px; } }
.sp-nav-lang { display: none; flex: none; padding: 10px 12px 0; border-top: 1px solid var(--sp-side-border, var(--sp-border)); }
@media (max-width: 640px) { .sp-nav-lang { display: block; } }
.sp-lang-side, .sp-lang-side .sp-lang-dd { display: block; width: 100%; }
.sp-lang-side .sp-lang-btn { width: 100%; justify-content: flex-start; background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); color: var(--sp-side-ink, #e2e8f0); }
.sp-lang-side .sp-lang-caret { margin-left: auto; color: inherit; }
.sp-lang-side .sp-lang-menu { top: auto; bottom: calc(100% + 6px); left: 0; right: 0; }
@media print { .sp-lang { display: none !important; } }

/* ------------------------------------------------------------------
   v1.19 Settings tabs, Email & SMS Setup, Notifications (msgui)
   ------------------------------------------------------------------ */
.sp-settings-tabs { position: static; }
.sp-settings-tabs a .fa { margin-right: 4px; opacity: .8; }
.sp-msgui-card .card-header .sp-badge { white-space: normal; }
.sp-msgui-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.sp-msgui-main, .sp-msgui-side { min-width: 0; }
.sp-msgui-side { padding: 16px; border: 1px solid var(--sp-border); border-radius: 12px; background: var(--sp-surface-2); }
.sp-msgui-side h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--sp-muted); }
.sp-msgui-side h5 { margin: 0 0 4px; font-size: 13.5px; color: var(--sp-ink-strong); }
.sp-msgui-kv { grid-template-columns: minmax(110px, 42%) 1fr; }
.sp-msgui-kv dd { font-weight: 400; font-size: 13px; }
.sp-msgui-help { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.5; color: var(--sp-muted); font-weight: 400; }
.sp-msgui-reason { display: block; margin-top: 3px; font-size: 12px; color: var(--sp-danger); overflow-wrap: anywhere; }
.sp-msgui-lead { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; line-height: 1.55; }
.sp-msgui-lead .fa { margin-top: 3px; color: var(--sp-muted); }
.sp-msgui-probe { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--sp-border); }
.sp-msgui-detail { display: block; margin-top: 2px; font-size: 11.5px; color: var(--sp-faint); overflow-wrap: anywhere; }
.sp-msgui-actions { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--sp-border); }
.sp-msgui-actions form { margin: 0; }
.sp-msgui-actions label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--sp-ink-strong); }
.sp-msgui-actions .sp-help { display: block; margin-top: 6px; }
.sp-msgui-wide { width: 100%; justify-content: center; }
.sp-msgui-inline { display: flex; gap: 8px; align-items: stretch; }
.sp-msgui-inline .form-control { flex: 1 1 auto; min-width: 0; }
.sp-msgui-inline .btn { flex: none; margin: 0; white-space: nowrap; }
.sp-msgui-form .sp-form-actions { margin-top: 14px; }
.sp-msgui-remove { margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed var(--sp-border); }
.sp-msgui-danger-link { color: var(--sp-danger) !important; }
.sp-req { color: var(--sp-danger); font-weight: 600; }
.sp-msgui-provider { margin: 14px 0 0; padding: 12px 14px 14px; border: 1px solid var(--sp-border); border-radius: 10px; min-width: 0; }
.sp-msgui-provider[hidden] { display: none !important; }
.sp-msgui-provider legend { width: auto; margin: 0; padding: 0 6px; border: 0; font-size: 13px; font-weight: 600; color: var(--sp-ink-strong); }
.sp-msgui-provider .sp-form-grid:empty { display: none; }
.sp-msgui-warn { display: flex; gap: 8px; margin: 0 0 10px; padding: 9px 12px; border-radius: 8px; background: var(--sp-warning-soft); color: var(--sp-ink); font-size: 12.5px; line-height: 1.5; }
.sp-msgui-warn .fa { margin-top: 2px; color: var(--sp-warning); }
.sp-msgui-prefix { display: flex; align-items: stretch; }
.sp-msgui-prefix span { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--sp-border); border-right: 0; border-radius: 8px 0 0 8px; background: var(--sp-surface-3); color: var(--sp-muted); font-weight: 600; }
.sp-msgui-prefix .form-control { border-top-left-radius: 0; border-bottom-left-radius: 0; min-width: 0; }
.sp-msgui-log td.sp-detail { max-width: 320px; font-size: 12.5px; color: var(--sp-muted); }
/* Notifications */
.sp-msgui-chan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.sp-msgui-chan-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 14px; border: 1px solid var(--sp-border); border-radius: 12px; background: var(--sp-surface); }
.sp-msgui-chan-item .sp-msgui-help { flex-basis: 100%; margin-top: 0; }
.sp-msgui-chan-name { font-weight: 600; color: var(--sp-ink-strong); }
.sp-msgui-matrix td { vertical-align: top; }
.sp-msgui-matrix .sp-msgui-ev { display: block; color: var(--sp-ink-strong); }
.sp-msgui-matrix .sp-msgui-cell { width: 150px; text-align: center; }
.sp-msgui-toggle { display: inline-flex; justify-content: center; margin: 0; }
.sp-msgui-toggle input { width: 18px; height: 18px; margin: 0; accent-color: var(--sp-brand); }
.sp-msgui-matrix .sp-msgui-cell .sp-msgui-help { font-size: 11.5px; }
.sp-msgui-health-actions form { margin: 0; }
@media (max-width: 1100px) {
  .sp-msgui-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767.98px) {
  .sp-msgui-chan { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sp-msgui-matrix .sp-msgui-cell { width: auto; text-align: right; }
  .sp-msgui-matrix td.sp-msgui-cell { align-items: center; flex-wrap: wrap; }
  .sp-msgui-matrix td:first-child { display: block; text-align: left; }
  .sp-msgui-matrix td:first-child::before { display: none; }
  .sp-msgui-matrix .sp-msgui-cell .sp-msgui-help { flex-basis: 100%; text-align: right; }
}
@media (max-width: 480px) {
  .sp-msgui-side { padding: 12px; }
  .sp-msgui-kv { grid-template-columns: 1fr; }
  .sp-msgui-kv dt { padding-bottom: 0; }
  .sp-msgui-kv dd { border-top: 0; padding-top: 2px; }
  .sp-msgui-inline { flex-direction: column; }
  .sp-msgui-inline .btn { width: 100%; justify-content: center; }
}
.sp-msgui-provider > .sp-help { display: block; margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; color: var(--sp-muted); }
@media (max-width: 640px) { .sp-settings-tabs { flex-wrap: wrap; overflow-x: visible; } .sp-settings-tabs a { padding: 7px 10px; } }

/* ------------------------------------------------- v1.20: Help Center (knowledge base) */
.kb-search { display: flex; gap: 10px; align-items: center; margin: 0 0 20px; padding: 14px; background: var(--sp-surface); border: 1px solid var(--sp-border); border-radius: var(--sp-radius); box-shadow: var(--sp-shadow-sm); }
.kb-search-field { position: relative; flex: 1; min-width: 0; display: block; }
.kb-search-field i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--sp-faint); pointer-events: none; }
.kb-search-field .form-control { width: 100%; padding-left: 38px; height: 44px; font-size: 15px; }
.kb-search .btn { height: 44px; padding: 0 20px; flex: none; }
.kb-preview-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; margin: -6px 0 16px; font-size: 13px; }
.kb-section-title { font-size: 16px; margin: 0 0 14px; color: var(--sp-ink-strong); display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.kb-section-title i { color: var(--sp-accent); }
.kb-section-title .sp-muted { font-size: 13px; font-weight: 500; }
.kb-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin: 0 0 22px; }
.kb-cat { display: flex; gap: 14px; align-items: flex-start; padding: 18px; background: var(--sp-surface); border: 1px solid var(--sp-border); border-radius: var(--sp-radius); box-shadow: var(--sp-shadow-sm); color: var(--sp-ink); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; min-width: 0; }
.kb-cat:hover, .kb-cat:focus-visible { border-color: var(--sp-accent); box-shadow: var(--sp-shadow); transform: translateY(-1px); text-decoration: none; color: var(--sp-ink); }
.kb-cat-icon { flex: none; width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--sp-accent-soft); color: var(--sp-accent); font-size: 18px; }
.kb-cat-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.kb-cat-name { font-weight: 700; color: var(--sp-ink-strong); font-size: 15px; }
.kb-cat-desc { font-size: 13px; color: var(--sp-muted); line-height: 1.45; }
.kb-cat-count { font-size: 12px; font-weight: 600; color: var(--sp-accent); margin-top: 4px; }
.kb-crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--sp-muted); margin: 0 0 14px; }
.kb-crumbs a { color: var(--sp-link); }
.kb-crumbs i { color: var(--sp-faint); }
.kb-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--sp-accent-soft); color: var(--sp-accent); font-size: 12px; font-weight: 600; white-space: nowrap; }
.kb-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; padding: 0; }
.kb-chips .kb-chip b { color: var(--sp-ink-strong); }
.kb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.kb-side .card + .card { margin-top: 16px; }
.kb-article .card-body { padding: 26px 30px 30px; }
.kb-article-head { margin: 0 0 18px; padding: 0 0 16px; border-bottom: 1px solid var(--sp-border); }
.kb-title { font-size: 26px; line-height: 1.25; margin: 12px 0 8px; color: var(--sp-ink-strong); font-weight: 700; overflow-wrap: anywhere; }
.kb-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: 12.5px; color: var(--sp-muted); }
.kb-meta i { color: var(--sp-success, #059669); }
.kb-fallback { padding: 10px 14px; border-radius: 10px; background: var(--sp-info-soft, rgba(2, 132, 199, .1)); color: var(--sp-ink); margin: 0 0 16px; }
.kb-body { max-width: 72ch; font-size: 15px; line-height: 1.7; color: var(--sp-ink); overflow-wrap: anywhere; }
.kb-body h2 { font-size: 19px; margin: 28px 0 10px; color: var(--sp-ink-strong); }
.kb-body h3 { font-size: 16px; margin: 22px 0 8px; color: var(--sp-ink-strong); }
.kb-body > :first-child { margin-top: 0; }
.kb-body p { margin: 0 0 12px; }
.kb-body a { color: var(--sp-link); text-decoration: underline; text-underline-offset: 2px; }
.kb-body a.kb-ext i { font-size: 11px; margin-left: 4px; }
.kb-body code { font-size: .88em; padding: 1px 6px; border-radius: 6px; background: var(--sp-surface-3); color: var(--sp-ink-strong); overflow-wrap: anywhere; }
.kb-body pre.kb-code { margin: 0 0 14px; padding: 14px 16px; border-radius: 10px; background: #0f172a; color: #e2e8f0; overflow-x: auto; font-size: 13px; line-height: 1.55; max-width: 100%; }
.kb-body pre.kb-code code { background: none; padding: 0; color: inherit; font-size: inherit; overflow-wrap: normal; white-space: pre; }
.kb-body ul.kb-list { margin: 0 0 14px; padding-left: 22px; }
.kb-body ul.kb-list li { margin: 4px 0; }
.kb-body ol.kb-steps { list-style: none; counter-reset: kbstep; margin: 0 0 16px; padding: 0; }
.kb-body ol.kb-steps > li { counter-increment: kbstep; position: relative; padding: 2px 0 10px 44px; min-height: 30px; }
.kb-body ol.kb-steps > li::before { content: counter(kbstep); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--sp-accent-grad); color: #fff; font-weight: 700; font-size: 13.5px; display: flex; align-items: center; justify-content: center; }
.kb-body ol.kb-steps > li:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 34px; bottom: 2px; width: 2px; background: var(--sp-border); }
.kb-body ol.kb-steps ol, .kb-body ol.kb-steps ul { margin: 8px 0 0; }
.kb-body li > p { margin: 0 0 8px; }
.kb-body blockquote.kb-note { margin: 0 0 16px; padding: 12px 16px; border-left: 4px solid var(--sp-accent); border-radius: 0 10px 10px 0; background: var(--sp-accent-soft); color: var(--sp-ink); }
.kb-body blockquote.kb-note p { margin: 0 0 6px; }
.kb-body blockquote.kb-note p:last-child { margin: 0; }
.kb-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--sp-border); display: flex; flex-wrap: wrap; gap: 10px; }
.kb-links { list-style: none; margin: 0; padding: 0; }
.kb-links li { padding: 8px 0; border-bottom: 1px solid var(--sp-border); font-size: 13.5px; line-height: 1.45; }
.kb-links li:last-child { border-bottom: 0; }
.kb-links a { color: var(--sp-link); font-weight: 600; }
.kb-help-card h3 { font-size: 15px; margin: 0 0 6px; }
.kb-help-card h3 i { color: var(--sp-accent); }
.kb-help-card p { color: var(--sp-muted); font-size: 13.5px; margin: 0 0 12px; }
.kb-help-wide { margin-top: 20px; }
.kb-help-wide .card-body { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.kb-help-wide p { margin: 0; }
.kb-results { list-style: none; margin: 0; padding: 0; }
.kb-results li + li { border-top: 1px solid var(--sp-border); }
.kb-result { display: flex; flex-direction: column; gap: 6px; padding: 14px 6px; color: var(--sp-ink); text-decoration: none; border-radius: 10px; }
.kb-result:hover, .kb-result:focus-visible { background: var(--sp-row-hover); text-decoration: none; color: var(--sp-ink); }
.kb-result-title { font-weight: 700; font-size: 15.5px; color: var(--sp-link); overflow-wrap: anywhere; }
.kb-result-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kb-snippet { font-size: 13.5px; color: var(--sp-muted); line-height: 1.55; overflow-wrap: anywhere; }
.kb-article-list { list-style: none; margin: 0; padding: 0; }
.kb-article-list li + li { border-top: 1px solid var(--sp-border); }
.kb-article-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 6px; color: var(--sp-ink-strong); font-weight: 600; text-decoration: none; border-radius: 8px; }
.kb-article-list a:hover { background: var(--sp-row-hover); color: var(--sp-link); }
.kb-article-list a > span { min-width: 0; overflow-wrap: anywhere; }
.kb-article-list a > i { color: var(--sp-faint); flex: none; }
.kb-empty p { margin: 4px 0 10px; }
.kb-missing h3 { font-size: 17px; color: var(--sp-ink-strong); margin: 4px 0; }
.kb-status { margin-top: 4px; }
.kb-status h4 { font-size: 13.5px; margin: 18px 0 8px; color: var(--sp-ink-strong); }
.kb-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.kb-stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--sp-surface-2); border: 1px solid var(--sp-border); }
.kb-stat-n { font-size: 22px; font-weight: 700; color: var(--sp-ink-strong); line-height: 1.1; }
.kb-stat-l { font-size: 12px; color: var(--sp-muted); }
.kb-stat-ok .kb-stat-n { color: var(--sp-success, #059669); }
.kb-stat-warn .kb-stat-n { color: var(--sp-warning, #d97706); }
.kb-stat-bad .kb-stat-n { color: var(--sp-danger, #dc2626); }
.kb-idlist { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.kb-idlist code, .kb-stale code, .kb-howto code { font-size: 12px; padding: 1px 6px; border-radius: 6px; background: var(--sp-surface-3); color: var(--sp-ink-strong); overflow-wrap: anywhere; }
.kb-stale { margin: 0; padding-left: 18px; font-size: 13px; }
.kb-stale li { margin: 4px 0; overflow-wrap: anywhere; }
.kb-howto { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.6; color: var(--sp-ink); }
:root[data-theme="dark"] .kb-body pre.kb-code { background: #070d1b; border: 1px solid var(--sp-border); }
:root[data-theme="dark"] .kb-cat-icon, :root[data-theme="dark"] .kb-chip { color: var(--sp-accent-2); }
:root[data-theme="dark"] body.sp-sa .kb-cat-icon, :root[data-theme="dark"] body.sp-sa .kb-chip { color: #c4b5fd; }
@media (max-width: 1100px) {
  .kb-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .kb-search { padding: 10px; gap: 8px; }
  .kb-search .btn { padding: 0 14px; }
  .kb-cats { grid-template-columns: minmax(0, 1fr); }
  .kb-article .card-body { padding: 18px 16px 22px; }
  .kb-title { font-size: 21px; }
  .kb-body { font-size: 14.5px; }
  .kb-body ol.kb-steps > li { padding-left: 38px; }
  .kb-body ol.kb-steps > li::before { width: 26px; height: 26px; font-size: 12.5px; }
  .kb-body ol.kb-steps > li:not(:last-child)::after { left: 12px; top: 30px; }
  .kb-preview-bar { justify-content: flex-start; }
}

/* ------------------------------------------------- AI Assistant (v1.21) */
/* js/smartisp-ai.js: floating launcher + chat panel. Tokens only; blue on customer pages,
   purple on Super Admin pages (body.sp-sa redefines --sp-accent-*). */
.sp-ai-sr, .sp-ai-offscreen { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sp-ai-offscreen { left: -9999px; }
.sp-ai-launcher {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 2800;
  display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 14px;
  border: 0; border-radius: 999px; background: var(--sp-accent-grad); color: #fff; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; letter-spacing: .01em;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .22), 0 2px 6px rgba(15, 23, 42, .12), inset 0 1px 0 rgba(255, 255, 255, .18);
  transition: transform .2s ease, translate .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.sp-ai-launcher:hover { box-shadow: 0 14px 34px rgba(15, 23, 42, .28), 0 2px 6px rgba(15, 23, 42, .14); }
.sp-ai-launcher:focus-visible { outline: none; box-shadow: var(--sp-focus), 0 10px 28px rgba(15, 23, 42, .22); }
.sp-ai-launcher[hidden], .sp-ai-launcher.sp-ai-hidden { display: none !important; }
.sp-ai-launcher-icon { display: inline-flex; width: 22px; height: 22px; }
.sp-ai-launcher.sp-ai-compact { height: 40px; padding: 0 12px; opacity: .92; }
.sp-ai-launcher.sp-ai-compact .sp-ai-launcher-label { display: none; }
/* v1.27.5 (UI audit UI-1): the floating button must never hide the end of a page (a confirmation
   checkbox, the last table column): pages leave room below their content, and on phones the button is a
   round icon (its accessible name stays in the label element). */
body:has(> .sp-ai-launcher:not([hidden]):not(.sp-ai-hidden)) { padding-bottom: 84px; }
@media (max-width: 640px) {
  .sp-ai-launcher { width: 48px; padding: 0; justify-content: center; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .sp-ai-launcher .sp-ai-launcher-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* v1.27.26: away while scrolling down (js/smartisp-ai.js tuck()); back on scroll up, a pause or the end of the page */
  .sp-ai-launcher.sp-ai-tucked { opacity: 0; pointer-events: none; translate: 72px 0; }
}
@media (max-width: 640px) and (prefers-reduced-motion: reduce) { .sp-ai-launcher { transition: none; } }

.sp-ai-panel {
  position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 2900;
  display: flex; flex-direction: column; width: 400px; max-width: calc(100vw - 40px);
  height: min(660px, calc(100vh - 100px)); height: min(660px, calc(100dvh - 100px));
  background: var(--sp-surface); color: var(--sp-ink); border: 1px solid var(--sp-border); border-radius: 18px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .22), 0 4px 14px rgba(15, 23, 42, .1); overflow: hidden;
  animation: sp-ai-in .18s ease-out;
}
.sp-ai-panel[hidden] { display: none; }
@keyframes sp-ai-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.sp-ai-head {
  display: flex; align-items: flex-start; gap: 12px; padding: 16px 14px 12px 16px;
  background: linear-gradient(180deg, var(--sp-accent-soft), transparent); border-bottom: 1px solid var(--sp-border);
}
.sp-ai-avatar { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 12px; background: var(--sp-accent-grad); color: #fff; box-shadow: 0 4px 12px var(--sp-accent-soft); }
.sp-ai-titles { flex: 1 1 auto; min-width: 0; }
.sp-ai-title { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--sp-ink-strong); }
.sp-ai-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--sp-muted); }
.sp-ai-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 2px 9px 2px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--sp-surface-3); color: var(--sp-ink); }
.sp-ai-status[hidden] { display: none; }
.sp-ai-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sp-faint); }
.sp-ai-online .sp-ai-dot { background: var(--sp-success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sp-success) 22%, transparent); }
.sp-ai-search .sp-ai-dot { background: var(--sp-warning); }
.sp-ai-icon-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--sp-muted); cursor: pointer; font-size: 15px;
}
.sp-ai-icon-btn:hover { background: var(--sp-surface-3); color: var(--sp-ink-strong); }
.sp-ai-icon-btn:focus-visible, .sp-ai-lang-btn:focus-visible, .sp-ai-chip:focus-visible, .sp-ai-act:focus-visible, .sp-ai-send:focus-visible,
.sp-ai-open:focus-visible, .sp-ai-history-open:focus-visible, .sp-ai-link-btn:focus-visible { outline: none; box-shadow: var(--sp-focus); }
.sp-ai-icon-btn[hidden] { display: none; }
.sp-ai-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--sp-border); }
.sp-ai-bar-acts { display: flex; gap: 2px; }
.sp-ai-lang { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--sp-surface-3); }
.sp-ai-lang-btn { min-width: 52px; height: 28px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--sp-muted); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.sp-ai-lang-btn[aria-pressed="true"] { background: var(--sp-surface); color: var(--sp-ink-strong); box-shadow: var(--sp-shadow-sm); }

.sp-ai-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px; background: var(--sp-surface-2); }
.sp-ai-log { display: flex; flex-direction: column; gap: 12px; }
.sp-ai-log[hidden], .sp-ai-welcome[hidden], .sp-ai-view[hidden], .sp-ai-compose[hidden] { display: none; }
.sp-ai-welcome p { margin: 0 0 10px; }
.sp-ai-hello { font-size: 14px; color: var(--sp-ink); line-height: 1.55; }
.sp-ai-ctx { font-size: 15px; font-weight: 700; color: var(--sp-ink-strong); }
.sp-ai-sugg-title { font-size: 11px !important; letter-spacing: .08em; text-transform: uppercase; color: var(--sp-muted); font-weight: 600; margin-top: 14px !important; }
.sp-ai-suggestions { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sp-ai-chip {
  width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--sp-border); border-radius: 12px;
  background: var(--sp-surface); color: var(--sp-ink); font-size: 13.5px; line-height: 1.4; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.sp-ai-chip:hover { border-color: var(--sp-accent); background: var(--sp-accent-soft); color: var(--sp-ink-strong); }
.sp-ai-readonly, .sp-ai-notice { font-size: 12.5px; color: var(--sp-muted); }

.sp-ai-msg { display: flex; flex-direction: column; max-width: 100%; min-width: 0; }
.sp-ai-bubble { min-width: 0; max-width: 100%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.sp-ai-user { align-items: flex-end; }
.sp-ai-user .sp-ai-bubble { max-width: 88%; background: var(--sp-accent-grad); color: #fff; border-bottom-right-radius: 4px; white-space: pre-wrap; }
.sp-ai-bot { align-items: flex-start; }
.sp-ai-bot .sp-ai-bubble { width: 100%; background: var(--sp-surface); border: 1px solid var(--sp-border); border-bottom-left-radius: 4px; color: var(--sp-ink); }
.sp-ai-sys .sp-ai-bubble { background: var(--sp-surface); border: 1px dashed var(--sp-border-strong); color: var(--sp-ink); }
.sp-ai-sys-ok .sp-ai-bubble { border-style: solid; border-left: 3px solid var(--sp-success); }
.sp-ai-error .sp-ai-bubble { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 8px; border-color: color-mix(in srgb, var(--sp-danger) 40%, var(--sp-border)); border-left: 3px solid var(--sp-danger); }
.sp-ai-error .fa { color: var(--sp-danger); }
.sp-ai-badge { display: inline-block; margin-bottom: 6px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: color-mix(in srgb, var(--sp-warning) 16%, transparent); color: var(--sp-ink); }
.sp-ai-content > :first-child { margin-top: 0; }
.sp-ai-content > :last-child { margin-bottom: 0; }
.sp-ai-content p, .sp-ai-content ul, .sp-ai-content ol, .sp-ai-content pre, .sp-ai-content blockquote, .sp-ai-content table { margin: 0 0 8px; }
.sp-ai-content ul, .sp-ai-content ol { padding-left: 20px; }
.sp-ai-content li + li { margin-top: 3px; }
.sp-ai-content h3, .sp-ai-content h4, .sp-ai-content h5 { margin: 10px 0 6px; font-size: 14px; color: var(--sp-ink-strong); }
.sp-ai-content a, .sp-ai-sources a, .sp-ai-link { color: var(--sp-link); text-decoration: underline; text-underline-offset: 2px; }
.sp-ai-content a:not([href]) { color: inherit; text-decoration: none; }
.sp-ai-content code { padding: 1px 5px; border-radius: 5px; background: var(--sp-surface-3); font-size: 12.5px; }
.sp-ai-content pre { max-width: 100%; overflow-x: auto; padding: 10px 12px; border-radius: 10px; background: var(--sp-surface-3); border: 1px solid var(--sp-border); white-space: pre; }
.sp-ai-content pre code { padding: 0; background: none; }
.sp-ai-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 12.5px; }
.sp-ai-content th, .sp-ai-content td { padding: 4px 8px; border: 1px solid var(--sp-border); }
.sp-ai-content blockquote { padding-left: 10px; border-left: 3px solid var(--sp-border-strong); color: var(--sp-muted); }
.sp-ai-plain { white-space: pre-wrap; }
.sp-ai-inline-notice { display: flex; gap: 6px; margin: 8px 0 0; padding: 7px 9px; border-radius: 9px; background: var(--sp-surface-3); font-size: 12.5px; color: var(--sp-muted); }
.sp-ai-sources { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--sp-border); }
.sp-ai-sources-title { margin: 0 0 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--sp-muted); }
.sp-ai-sources ul { margin: 0; padding-left: 18px; font-size: 12.5px; }
.sp-ai-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.sp-ai-act, .sp-ai-open, .sp-ai-link-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 9px; border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--sp-muted); font-size: 12.5px; cursor: pointer; text-decoration: none;
}
.sp-ai-act:hover, .sp-ai-link-btn:hover { background: var(--sp-surface-3); color: var(--sp-ink-strong); text-decoration: none; }
.sp-ai-act[aria-pressed="true"] { color: var(--sp-accent); background: var(--sp-accent-soft); }
.sp-ai-act.sp-ai-done { color: var(--sp-success); }
.sp-ai-open { border-color: var(--sp-border); background: var(--sp-surface); color: var(--sp-link); font-weight: 600; }
.sp-ai-open:hover { border-color: var(--sp-accent); text-decoration: none; }
.sp-ai-support { color: var(--sp-ink); }
.sp-ai-link-btn { color: var(--sp-link); padding: 0 6px; }

.sp-ai-thinking-text { margin-left: 8px; color: var(--sp-muted); font-size: 12.5px; }
.sp-ai-dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.sp-ai-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--sp-accent); opacity: .35; animation: sp-ai-dot 1.1s infinite ease-in-out; }
.sp-ai-dots i:nth-child(2) { animation-delay: .15s; }
.sp-ai-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes sp-ai-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

.sp-ai-view-head { display: flex; align-items: center; gap: 8px; margin: -4px 0 12px -6px; }
.sp-ai-view-title { margin: 0; font-size: 15px; font-weight: 700; color: var(--sp-ink-strong); }
.sp-ai-view-msg { margin: 0 0 12px; font-size: 13.5px; line-height: 1.55; color: var(--sp-ink); }
.sp-ai-view-acts { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sp-ai-preview-title { margin: 0 0 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; color: var(--sp-muted); }
.sp-ai-preview { max-height: 220px; overflow-y: auto; padding: 10px 12px; border: 1px solid var(--sp-border); border-radius: 10px; background: var(--sp-surface); font-size: 12.5px; line-height: 1.5; }
.sp-ai-preview-item { white-space: pre-wrap; overflow-wrap: anywhere; }
.sp-ai-preview-item + .sp-ai-preview-item { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--sp-border); }
.sp-ai-note-label { display: block; margin-top: 12px; font-size: 12.5px; color: var(--sp-ink); }
.sp-ai-note { display: block; width: 100%; margin-top: 6px; resize: vertical; }
.sp-ai-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sp-ai-history-item { display: flex; align-items: center; gap: 4px; border: 1px solid var(--sp-border); border-radius: 12px; background: var(--sp-surface); }
.sp-ai-history-open { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 9px 12px; border: 0; border-radius: 12px; background: transparent; color: var(--sp-ink); text-align: left; cursor: pointer; }
.sp-ai-history-open:hover { background: var(--sp-row-hover); }
.sp-ai-history-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-ai-history-date { font-size: 11.5px; color: var(--sp-muted); }

.sp-ai-compose { flex: 0 0 auto; padding: 10px 12px 10px; border-top: 1px solid var(--sp-border); background: var(--sp-surface); }
.sp-ai-compose-row { display: flex; align-items: flex-end; gap: 8px; }
.sp-ai-input {
  flex: 1 1 auto; min-width: 0; min-height: 42px; max-height: 132px; padding: 10px 12px; resize: none;
  border: 1px solid var(--sp-border-strong); border-radius: 12px; background: var(--sp-surface); color: var(--sp-ink);
  font: inherit; font-size: 14px; line-height: 1.45;
}
.sp-ai-input:focus { outline: none; border-color: var(--sp-accent); box-shadow: var(--sp-focus); }
.sp-ai-input:disabled { opacity: .6; }
.sp-ai-send { flex: 0 0 auto; width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--sp-accent-grad); color: #fff; font-size: 15px; cursor: pointer; }
.sp-ai-send:disabled { opacity: .45; cursor: not-allowed; }
.sp-ai-compose-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 11px; color: var(--sp-faint); }
.sp-ai-disclaimer { min-width: 0; }
.sp-ai-counter { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.sp-ai-counter-warn { color: var(--sp-warning); font-weight: 600; }

/* full-screen sheet on phones */
@media (max-width: 600px) {
  .sp-ai-launcher { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: 52px; height: 52px; padding: 0; justify-content: center; }
  .sp-ai-launcher-label { display: none; }
  .sp-ai-launcher.sp-ai-compact { width: 42px; height: 42px; }
  .sp-ai-panel { inset: 0; right: 0; bottom: 0; width: 100%; max-width: 100%; height: 100%; border: 0; border-radius: 0; animation-name: sp-ai-up; }
  .sp-ai-head { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .sp-ai-compose { padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); }
  .sp-ai-disclaimer { display: none; }
  .sp-ai-input { font-size: 16px; }   /* no zoom on focus (iOS) */
  html.sp-ai-sheet-open, html.sp-ai-sheet-open body { overflow: hidden; }
}
@keyframes sp-ai-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .sp-ai-launcher, .sp-ai-chip { transition: none; }
  .sp-ai-panel { animation: none; }
  .sp-ai-dots i { animation: none; opacity: .7; }
}
@media print { .sp-ai-launcher, .sp-ai-panel { display: none !important; } }

/* ===================================================================== v1.23 Access Points
   account/access_points.php, Main Dashboard "Access Point Health", light / dark tokens only. */
.sp-ap-stats { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
a.sp-stat { color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.sp-stat:hover, a.sp-stat:focus-visible { border-color: var(--sp-brand); color: inherit; }
.sp-ap-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-bottom: 18px; }
.sp-ap-row > .card { margin-bottom: 0; min-width: 0; }
.sp-ap-dot { font-size: 7px; vertical-align: middle; margin-right: 2px; }
.sp-badge.sp-ap-muted { background: var(--sp-surface-3); color: var(--sp-muted); }
.sp-ap-chip { display: inline-block; padding: 1px 7px; margin: 1px 0; border-radius: 999px; border: 1px solid var(--sp-border); background: var(--sp-surface-2); color: var(--sp-muted); font-size: 11.5px; line-height: 1.6; white-space: nowrap; }
.sp-ap-chip-on { border-color: transparent; background: var(--sp-success-soft); color: var(--sp-success); }
.sp-ap-inferred { display: inline-block; padding: 0 6px; border-radius: 6px; border: 1px dashed var(--sp-border-strong); color: var(--sp-muted); font-size: 11px; line-height: 1.5; }
.sp-ap-name { font-weight: 600; color: var(--sp-ink-strong); overflow-wrap: anywhere; }
a.sp-ap-name:hover { color: var(--sp-link); }
.sp-ap-sort { color: inherit !important; text-decoration: none; white-space: nowrap; }
.sp-ap-sort:hover { color: var(--sp-ink-strong) !important; }
.sp-ap-table td { vertical-align: top; }
.sp-ap-table td.sp-mono { white-space: nowrap; }
.sp-ap-filters .sp-search { flex: 2 1 240px; }
.sp-ap-notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; margin-bottom: 18px; border-radius: 12px; border: 1px solid var(--sp-info); background: var(--sp-info-soft); color: var(--sp-ink); font-size: 13px; line-height: 1.55; }
.sp-ap-notice > i { color: var(--sp-info); margin-top: 3px; }
.sp-ap-crumb { margin: 0 0 4px; font-size: 12.5px; }
.sp-ap-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 16px; }
.sp-ap-tabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--sp-border); background: var(--sp-surface); color: var(--sp-ink); font-size: 12.5px; font-weight: 500; text-decoration: none; }
.sp-ap-tabs a:hover, .sp-ap-tabs a:focus-visible { border-color: var(--sp-brand); color: var(--sp-ink-strong); }
.sp-ap-kvl li { align-items: flex-start; }
.sp-ap-kvl li > span { flex: none; max-width: 45%; }
.sp-ap-kvl li > b { font-size: 13.5px; font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.sp-ap-sub { margin: 16px 0 6px; font-size: 13px; font-weight: 600; color: var(--sp-ink-strong); }
.sp-ap-mini { margin-bottom: 0; font-size: 13px; }
/* status donut (conic gradient; real counts only) */
.sp-ap-donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.sp-ap-donut { --ap-on: 0; --ap-off: 0; position: relative; width: 132px; height: 132px; flex: none; border-radius: 50%;
  background: conic-gradient(var(--sp-success) 0 calc(var(--ap-on) * 1%), var(--sp-danger) 0 calc((var(--ap-on) + var(--ap-off)) * 1%), var(--sp-surface-3) 0 100%); }
.sp-ap-donut > div { position: absolute; inset: 18px; border-radius: 50%; background: var(--sp-surface); display: grid; place-items: center; text-align: center; align-content: center; }
.sp-ap-donut b { display: block; font-size: 22px; color: var(--sp-ink-strong); line-height: 1.1; }
.sp-ap-donut span { font-size: 11.5px; color: var(--sp-muted); }
.sp-ap-sw-on { background: var(--sp-success); } .sp-ap-sw-off { background: var(--sp-danger); } .sp-ap-sw-unk { background: var(--sp-surface-3); border: 1px solid var(--sp-border-strong); }
/* 24 h bars: offline / recovered / new per 3 hours */
.sp-ap-bars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; align-items: end; height: 120px; padding-bottom: 18px; }
.sp-ap-bar { position: relative; height: 100%; display: flex; flex-direction: column-reverse; gap: 1px; border-radius: 6px; background: var(--sp-surface-2); }
.sp-ap-bar > span { display: block; width: 100%; border-radius: 4px; }
.sp-ap-bar small { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 10.5px; color: var(--sp-faint); }
.sp-ap-b-off { background: var(--sp-danger); } .sp-ap-b-on { background: var(--sp-success); } .sp-ap-b-new { background: var(--sp-info); }
/* Main Dashboard widget */
.sp-ap-health-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sp-ap-health-item { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--sp-border); background: var(--sp-surface-2); color: var(--sp-ink); text-decoration: none; min-width: 0; }
.sp-ap-health-item:hover, .sp-ap-health-item:focus-visible { border-color: var(--sp-brand); color: var(--sp-ink-strong); }
.sp-ap-health-item b { font-size: 22px; line-height: 1.2; }
.sp-ap-health-item span { font-size: 12.5px; color: var(--sp-muted); }
.sp-ap-h-on b { color: var(--sp-success); } .sp-ap-h-off b { color: var(--sp-danger); } .sp-ap-h-unk b { color: var(--sp-info); }
@media (max-width: 600px) {
  .sp-ap-kvl li > span { max-width: 50%; }
  .sp-ap-donut { width: 112px; height: 112px; }
  .sp-ap-health-item { padding: 10px; }
  .sp-ap-health-item b { font-size: 19px; }
  .sp-ap-table td.sp-mono { white-space: normal; overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) { a.sp-stat, .sp-ap-health-item { transition: none; } }
.sp-ap-table td:first-child { min-width: 150px; }
@media (max-width: 760px) { .sp-ap-table td:first-child { min-width: 0; } }
.sp-ap-pager > span:first-child { white-space: nowrap; }
/* ------------------------------------------------------------------
 * v1.22 Voucher MAC Reset (hotspot/macreset.php)
 * ------------------------------------------------------------------ */
.mr-tabs { margin-bottom: 14px; }
.mr-card { border-radius: 14px; }
.mr-search { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mr-search .mr-q { flex: 1 1 260px; min-width: 0; }
.mr-search select { flex: 0 1 220px; min-width: 0; }
.mr-help { margin: 8px 0 12px; font-size: 12.5px; }
.mr-count { margin: 4px 0 10px; font-size: 13px; }
#mr-results[aria-busy="true"] { opacity: .55; transition: opacity .15s; }
.mr-empty { padding: 28px 12px; }
.mr-nomac { font-style: italic; }
.mr-table td, .mr-ba td { vertical-align: top; }
.mr-ba td:first-child { width: 28%; }
.mr-ba .sp-c-success, .mr-ba .sp-c-warning { font-weight: 600; }
.mr-exec { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--sp-border); }
.mr-exec .sp-form-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.mr-why { font-size: 13px; }
.mr-ack { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; font-size: 13.5px; }
.mr-result { border-left: 4px solid var(--sp-info); }
.mr-result-success { border-left-color: var(--sp-success); }
.mr-result-partial, .mr-result-uncertain { border-left-color: var(--sp-warning); }
.mr-result-failed { border-left-color: var(--sp-danger); }
.mr-kv { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 6px 16px; margin: 12px 0; }
.mr-kv dt { color: var(--sp-muted); font-weight: 600; font-size: 13px; }
.mr-kv dd { margin: 0; overflow-wrap: anywhere; }
.mr-remaining { margin: 12px 0; padding: 12px 14px; border: 1px solid var(--sp-border); border-radius: 12px; background: var(--sp-warning-soft); }
.mr-remaining h4 { margin: 0 0 6px; font-size: 14px; }
.mr-remaining ul, .mr-errors, .mr-notes { margin: 6px 0; padding-left: 20px; }
.mr-hfilters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.mr-hfilters .sp-search { flex: 1 1 200px; min-width: 0; }
.mr-hfilters select { flex: 0 1 180px; min-width: 0; }
.mr-date { display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: 12px; color: var(--sp-muted); }
.mr-date input { min-width: 0; }
@media (max-width: 600px) {
  .mr-search select, .mr-search .btn, .mr-hfilters select, .mr-hfilters .btn, .mr-date { flex: 1 1 100%; }
  .mr-kv { grid-template-columns: 1fr; gap: 2px; }
  .mr-kv dd { margin-bottom: 8px; }
  .mr-ba td:first-child { width: auto; }
  .mr-exec .btn { width: 100%; justify-content: center; }
}
.mr-sess { display: flex; flex-wrap: wrap; gap: 2px 10px; min-width: 0; }
.mr-sess + .mr-sess { margin-top: 4px; }
.mr-sess > span { overflow-wrap: anywhere; }
.mr-table td, .mr-ba td { overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .mr-table .mr-sess, .mr-ba .mr-sess { justify-content: flex-end; }
}

/* v1.24: Super Admin business cards: long table names, commands and details wrap on phones. */
#business, #business-health { min-width: 0; }
#business .sp-mono, #business p, #business li, #business-health li span { overflow-wrap: anywhere; word-break: break-word; }
#business .sp-toolbar { flex-wrap: wrap; } #business .btn { white-space: normal; max-width: 100%; } #business a { overflow-wrap: anywhere; }

/* v1.25 Super Admin: account recovery requests */
.sp-rec-verify { margin: 0 0 14px; padding: 12px 14px; border-radius: 10px; background: var(--sp-warning-soft, #fff7e6); border: 1px solid var(--sp-border); font-size: 13px; line-height: 1.55; }
.sp-rec-verify ol { margin: 6px 0 0; padding-left: 20px; }
.sp-rec-act { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sp-rec-act .form-control { flex: 1 1 160px; min-width: 0; }
.sp-recovery-check { list-style: none; margin: 0 0 10px; padding: 0; }
.sp-recovery-check li { display: flex; gap: 8px; align-items: baseline; padding: 4px 0; font-size: 13px; }
.sp-recovery-check .fa-check-circle { color: var(--sp-success, #16a34a); }
.sp-recovery-check .fa-times-circle { color: var(--sp-danger, #dc2626); }
.sp-rec-state { overflow-wrap: anywhere; }
.sp-rec-state .sp-badge { white-space: normal; }
#password .sp-help.sp-block { display: block; margin-top: 6px; }

/* v1.26 sidebar "Off" pill and the dashboard offer of Business Management */
.sidenav a .sp-nav-pill { margin-left: auto; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em;
  background: rgba(255, 255, 255, .1); color: var(--sp-side-ink); border: 1px solid var(--sp-side-border); }
.sidenav a.active .sp-nav-pill { background: rgba(255, 255, 255, .2); color: #fff; }
.sidenav a.active:has(.sp-nav-pill)::after { margin-left: 6px; }
body.sp-collapsed .sidenav a .sp-nav-pill { display: none; }
.sp-biz-offer { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; padding: 16px 18px; border-radius: var(--sp-radius);
  background: linear-gradient(135deg, rgba(37, 99, 235, .1), rgba(124, 58, 237, .1)); border: 1px solid rgba(124, 58, 237, .25); color: var(--sp-ink); }
.sp-biz-offer-icon { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; font-size: 18px; }
.sp-biz-offer-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sp-biz-offer-text b { color: var(--sp-ink-strong); font-size: 15px; }
.sp-biz-offer-text span { color: var(--sp-muted); font-size: 13.5px; }
.sp-biz-offer .btn { flex: none; }
@media (max-width: 640px) { .sp-biz-offer { flex-wrap: wrap; } .sp-biz-offer .btn { width: 100%; justify-content: center; } }
/* v1.26 Super Admin business status cell */
.sp-biz-st { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 170px; }
.sp-biz-st small { font-size: 12px; line-height: 1.35; }
[data-biz-overview] td:first-child > div { min-width: 140px; }
@media (max-width: 767.98px) { .sp-biz-st { align-items: flex-end; text-align: right; min-width: 0; } [data-biz-overview] td:first-child > div { min-width: 0; } }

/* v1.27 Super Admin › Database: a nested update block inside a card */
.sp-subcard { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--sp-border); border-radius: 12px; background: var(--sp-bg); }
.sp-subcard h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; color: var(--sp-ink-strong); }

/* v1.27.17 (UI-3): router tables in table mode (Network Monitoring, Reports, dashboard). The router name keeps a
   readable width, long column titles wrap instead of pushing the action buttons out of view, and the actions stay
   on one line. Selected by the router cell, not the English data-label, so it works in every language. */
@media (min-width: 1400px) {
  .table.sp-router-table { table-layout: auto; }
  .table.sp-router-table td:has(.sp-router-cell) { min-width: 200px; }
  .table.sp-router-table thead th { white-space: normal; vertical-align: bottom; }
  .table.sp-router-table th:not(:first-child), .table.sp-router-table td:not(:has(.sp-router-cell)) { padding-left: 8px; padding-right: 8px; }
  .table.sp-router-table .sp-row-actions { white-space: nowrap; flex-wrap: nowrap; }
}

/* v1.27.22 (DASH-1): in table mode the router tables keep their actions (refresh, settings, Manage / Select) pinned
   to the right edge, so a wide row scrolls under them instead of cutting the Manage button off. */
@media (min-width: 1400px) {
  .table.sp-router-table th.sp-col-actions, .table.sp-router-table td:has(> .sp-row-actions), .table.sp-router-table td:has(> .sp-cell > .sp-row-actions) {
    position: sticky; right: 0; z-index: 2; background: var(--sp-surface); box-shadow: -8px 0 12px -10px rgba(15, 23, 42, .35);
  }
  .table.sp-router-table tr.sp-row-offline td:has(.sp-row-actions) { background: linear-gradient(rgba(239, 68, 68, .06), rgba(239, 68, 68, .06)), var(--sp-surface) !important; }
}
/* v1.61.0: 1400-1599 px (a 1440 laptop): a little less padding so "Last checked" is not under the pinned actions */
@media (min-width: 1400px) and (max-width: 1599.98px) {
  .table.sp-router-table th:not(:first-child), .table.sp-router-table td:not(:has(.sp-router-cell)) { padding-left: 6px; padding-right: 6px; }
}

/* ===================================================================== v1.56.0 sign-in screens: bright scene
   Light page with diagonal rounded strokes, thin lines, rings and dot grids; a centred white card with the logo,
   a large welcome title, fields with icons and a full-width button with an arrow. Client Admin green (--v3),
   Super Admin violet. Dark theme: the same scene on a dark page. */
.sp-auth.sp-auth-v3 { --v3: #0f9d58; --v3-2: #22c55e; --v3-ink: #0b6b3a; --v3-soft: rgba(34, 197, 94, .16);
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; padding: 64px 16px 40px; background: linear-gradient(180deg, #f6f8fb 0%, #eef2f6 100%); color: #1f2937; }
.sp-auth-v3.sp-auth-admin { --v3: #6d28d9; --v3-2: #8b5cf6; --v3-ink: #4c1d95; --v3-soft: rgba(139, 92, 246, .16); }
.sp-v3-deco { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.sp-v3-deco span { position: absolute; display: block; }
.sp-v3-bar { width: 34px; border-radius: 40px; transform: rotate(45deg); }
.sp-v3-b1 { height: 230px; left: calc(50% - 390px); top: calc(50% - 40px); background: linear-gradient(180deg, var(--v3-2), var(--v3)); box-shadow: 0 18px 40px var(--v3-soft); }
.sp-v3-b2 { height: 300px; left: calc(50% - 330px); top: calc(50% - 230px); background: var(--v3-soft); width: 40px; }
.sp-v3-b3 { height: 260px; left: calc(50% - 470px); top: calc(50% + 20px); background: var(--v3-soft); width: 28px; filter: blur(1px); }
.sp-v3-b4 { height: 250px; left: calc(50% + 370px); top: calc(50% - 50px); background: linear-gradient(180deg, var(--v3-2), var(--v3)); box-shadow: 0 18px 40px var(--v3-soft); }
.sp-v3-b5 { height: 190px; left: calc(50% + 310px); top: calc(50% - 170px); background: linear-gradient(180deg, color-mix(in srgb, var(--v3) 70%, #fff), var(--v3)); opacity: .9; width: 30px; }
.sp-v3-b6 { height: 320px; left: calc(50% + 430px); top: calc(50% - 250px); background: var(--v3-soft); width: 44px; }
.sp-v3-line { width: 1.5px; background: linear-gradient(180deg, transparent, var(--v3-2), transparent); transform: rotate(45deg); opacity: .8; }
.sp-v3-l1 { height: 170px; left: calc(50% - 400px); top: calc(50% - 300px); }
.sp-v3-l2 { height: 190px; left: calc(50% - 360px); top: calc(50% + 170px); }
.sp-v3-l3 { height: 210px; left: calc(50% + 450px); top: calc(50% - 330px); }
.sp-v3-l4 { height: 170px; left: calc(50% + 380px); top: calc(50% + 170px); }
.sp-v3-ring { width: 14px; height: 14px; border: 2.5px solid var(--v3-2); border-radius: 50%; }
.sp-v3-r1 { left: calc(50% - 440px); top: calc(50% - 240px); } .sp-v3-r2 { left: calc(50% - 320px); top: calc(50% + 210px); }
.sp-v3-r3 { left: calc(50% + 560px); top: calc(50% - 150px); } .sp-v3-r4 { left: calc(50% + 250px); top: calc(50% + 90px); }
.sp-v3-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--v3-2); }
.sp-v3-d1 { left: calc(50% - 300px); top: calc(50% + 120px); } .sp-v3-d2 { left: calc(50% - 590px); top: calc(50% + 160px); }
.sp-v3-d3 { left: calc(50% + 260px); top: calc(50% - 260px); } .sp-v3-d4 { left: calc(50% + 390px); top: calc(50% - 260px); }
.sp-v3-grid { display: grid !important; grid-template-columns: repeat(5, 6px); gap: 18px; }
.sp-v3-grid i { width: 6px; height: 6px; border-radius: 50%; background: var(--v3-2); opacity: .85; }
.sp-v3-g1 { left: calc(50% - 600px); top: calc(50% - 75px); } .sp-v3-g2 { left: calc(50% + 480px); top: calc(50% + 70px); }

.sp-auth-v3 .sp-auth-side-top { position: absolute; top: 14px; right: 16px; display: flex; gap: 8px; align-items: center; z-index: 2; }
.sp-auth-v3 .sp-theme-float { position: static; }
.sp-auth-v3 .sp-auth-card { position: relative; width: 100%; max-width: 470px; padding: 36px 40px 26px; border-radius: 6px; border: 0;
  background: #fff; box-shadow: 0 24px 60px rgba(15, 23, 42, .10), 0 2px 6px rgba(15, 23, 42, .04); text-align: left; }
.sp-auth-v3.sp-auth-wide .sp-auth-card { max-width: 640px; }
.sp-v3-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 18px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; color: #111827; line-height: 1; }
.sp-v3-logo b { color: var(--v3); font-weight: 800; }
.sp-v3-mark { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--v3-2), var(--v3)); color: #fff; font-size: 19px; box-shadow: 0 6px 16px var(--v3-soft); }
.sp-v3-role { display: table; margin: -6px auto 12px; padding: 3px 10px; border-radius: 999px; background: var(--v3-soft); color: var(--v3-ink); font-size: 12px; font-weight: 700; }
.sp-auth-v3 .sp-auth-brand { display: block; text-align: center; margin: 0 0 24px; }
.sp-auth-v3 h1 { font-size: 25px; font-weight: 600; color: #111827; margin: 0 0 8px; letter-spacing: -.01em; }
.sp-auth-v3 p.sp-sub { font-size: 14.5px; color: #4b5563; margin: 0; }
.sp-auth-v3 .sp-field > label { font-size: 13.5px; font-weight: 600; color: #374151; }
.sp-auth-signin .sp-auth-card .sp-field > label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sp-auth-v3 .sp-field { margin-bottom: 16px; }
.sp-auth-v3 .form-control { min-height: 50px; border-radius: 3px; border: 1px solid #dfe3e8; background: #fff; color: #111827; font-size: 15px; box-shadow: none; }
.sp-auth-v3 .form-control::placeholder { color: #6b7280; opacity: 1; }
.sp-auth-v3 .form-control:focus { border-color: var(--v3); box-shadow: 0 0 0 3px var(--v3-soft); outline: none; }
.sp-auth-v3 .sp-input-icon .form-control { padding-left: 46px; }
.sp-auth-v3 .sp-input-icon > i { left: 17px; color: #9ca3af; font-size: 15px; }
.sp-auth-v3 .sp-pw-toggle { color: #9ca3af; }
.sp-auth-v3 .sp-row { margin: 4px 0 22px; font-size: 14.5px; }
.sp-auth-v3 .sp-check { color: #374151; font-size: 14.5px; }
.sp-auth-v3 .sp-check input { width: 18px; height: 18px; accent-color: var(--v3); }
.sp-auth-v3 .sp-auth-link, .sp-auth-v3 .sp-v3-alt a, .sp-auth-v3 .sp-auth-foot a { color: #1d6fd8; font-weight: 500; text-decoration: none; }
.sp-auth-v3 .sp-auth-link:hover, .sp-auth-v3 .sp-v3-alt a:hover { text-decoration: underline; }
.sp-auth-v3 .btn.bg-primary { background: var(--v3) !important; border-color: var(--v3) !important; color: #fff !important; border-radius: 3px; min-height: 48px; font-size: 16px; font-weight: 600; box-shadow: none; }
.sp-auth-v3 .btn.bg-primary:hover { background: var(--v3-ink) !important; border-color: var(--v3-ink) !important; }
.sp-auth-v3 .btn.bg-primary:focus-visible { outline: 3px solid var(--v3-soft); outline-offset: 2px; }
.sp-v3-go { position: relative; display: flex; align-items: center; justify-content: center; }
.sp-v3-go > i { position: absolute; right: 20px; font-size: 15px; }
.sp-v3-alt { margin: 22px 0 0; text-align: center; font-size: 14.5px; color: #374151; }
.sp-auth-v3 .sp-auth-divider { margin: 22px 0 12px; }
.sp-auth-v3 .sp-auth-tiles { display: flex !important; flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
.sp-auth-v3 .sp-auth-tiles a { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; padding: 0; background: none !important; border: 0 !important; color: #1d6fd8; font-size: 14px; font-weight: 500; min-height: 32px; }
.sp-auth-v3 .sp-auth-tiles a i { color: inherit; font-size: 14px; }
.sp-auth-v3 .sp-auth-foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid #eef0f3; color: #6b7280; font-size: 12px; line-height: 1.6; }
.sp-auth-v3 .sp-auth-hint, .sp-auth-v3 .sp-auth-lead { color: #4b5563; }

/* dark theme: the same scene on a dark page */
[data-theme="dark"] .sp-auth.sp-auth-v3 { background: linear-gradient(180deg, #0b1220 0%, #0f172a 100%); color: #e5e7eb; }
[data-theme="dark"] .sp-auth-v3 .sp-auth-card { background: #111a2e; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
[data-theme="dark"] .sp-v3-logo, [data-theme="dark"] .sp-auth-v3 h1 { color: #f3f4f6; }
[data-theme="dark"] .sp-auth-v3 p.sp-sub, [data-theme="dark"] .sp-auth-v3 .sp-check, [data-theme="dark"] .sp-v3-alt, [data-theme="dark"] .sp-auth-v3 .sp-field > label { color: #cbd5e1; }
[data-theme="dark"] .sp-auth-v3 .form-control { background: #0b1220; border-color: #273449; color: #f3f4f6; }
[data-theme="dark"] .sp-auth-v3 .form-control::placeholder { color: #94a3b8; }
[data-theme="dark"] .sp-auth-v3 .sp-auth-link, [data-theme="dark"] .sp-auth-v3 .sp-v3-alt a, [data-theme="dark"] .sp-auth-v3 .sp-auth-tiles a, [data-theme="dark"] .sp-auth-v3 .sp-auth-foot a { color: #7cb3ff; }
[data-theme="dark"] .sp-auth-v3 .sp-auth-foot { border-top-color: #1f2a40; color: #94a3b8; }
[data-theme="dark"] .sp-v3-role { color: #e9d5ff; }

/* the decoration needs room beside the card: on smaller screens it moves to the corners and fades */
@media (max-width: 1100px) {
  .sp-v3-b3, .sp-v3-b6, .sp-v3-g1, .sp-v3-g2, .sp-v3-d2, .sp-v3-r3 { display: none !important; }
  .sp-v3-deco { opacity: .55; }
}
@media (max-width: 640px) {
  .sp-auth.sp-auth-v3 { justify-content: flex-start; padding: 64px 12px 28px; }
  .sp-auth-v3 .sp-auth-card { padding: 28px 20px 20px; }
  .sp-v3-logo { font-size: 25px; } .sp-v3-mark { width: 34px; height: 34px; font-size: 16px; }
  .sp-auth-v3 h1 { font-size: 22px; }
  .sp-v3-deco { opacity: .35; }
  .sp-v3-b1 { left: -20px; top: 70px; } .sp-v3-b4 { left: auto; right: -10px; top: auto; bottom: 30px; }
  .sp-v3-b2, .sp-v3-b5, .sp-v3-line, .sp-v3-r1, .sp-v3-r2, .sp-v3-r4, .sp-v3-d1, .sp-v3-d3, .sp-v3-d4 { display: none !important; }
}
@media (prefers-reduced-motion: no-preference) {
  .sp-auth-v3 .sp-auth-card { animation: spV3In .35s ease-out both; }
  @keyframes spV3In { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

/* ===================================================================== v1.49.0 mobile-first polish
   Most customers use the panel on a phone. Applied everywhere, layout only. */
@media (max-width: 767.98px) {
  /* iOS zooms the whole page into a field whose text is under 16px: never on this panel */
  input.form-control, select.form-control, textarea.form-control, .sp-router-select, input[type="search"], input[type="text"], input[type="email"],
  input[type="password"], input[type="number"], input[type="tel"], input[type="date"], input[type="month"], select, textarea { font-size: 16px !important; }
  /* readable small print */
  .sp-badge, .badge, .sp-tag { font-size: 12px; }
  /* a little air above the floating assistant button for the last line of a page */
  .main-container, .sp-main { padding-bottom: 84px; }
}
/* finger-sized controls on touch screens (laptops with a mouse keep the compact sizes) */
@media (pointer: coarse) {
  .btn, a.btn, button.btn { min-height: 40px; }
  .btn.btn-sm, .btn.sp-btn-sm, a.btn.btn-sm, a.btn.sp-btn-sm, button.sp-btn-sm { min-height: 36px; min-width: 36px; }
  .sp-icon-btn, .sp-act, .sp-pw-toggle { min-width: 40px; min-height: 40px; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; }
  .sp-check { min-height: 32px; align-items: center; }
  .table td a.sp-act, .table td .sp-actions a, .table td.sp-actions-cell a, .table td.sp-col-actions a, .sp-actions-cell button, .sp-col-actions button { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  .biz-lang-btn { min-height: 36px; min-width: 40px; }
}
/* long lists on a phone: a compact two-column card per row (name across the top, actions across the bottom),
   about half as tall as one field per line */
@media (max-width: 640px) {
  .sp-table-stack tr:has(> td:nth-child(6)) { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; padding: 12px 14px; }
  .sp-table-stack tr:has(> td:nth-child(6)) > td:not(.sp-actions-cell):not(.sp-col-actions) {
    display: flex !important; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 1px; padding: 0 !important; text-align: left; min-width: 0; overflow-wrap: anywhere; }
  .sp-table-stack tr:has(> td:nth-child(6)) > td:not(.sp-actions-cell):not(.sp-col-actions)::before { font-size: 11.5px; padding: 0; margin: 0; text-transform: none; }
  .sp-table-stack tr:has(> td:nth-child(6)) > td:not(.sp-actions-cell):not(.sp-col-actions) > * { max-width: 100%; }
  .sp-table-stack tr:has(> td:nth-child(6)) > td:first-child { grid-column: 1 / -1; font-size: 15px; font-weight: 600; padding-bottom: 6px !important; border-bottom: 1px solid var(--sp-border) !important; }
  .sp-table-stack tr:has(> td:nth-child(6)) > td.sp-actions-cell, .sp-table-stack tr:has(> td:nth-child(6)) > td.sp-col-actions,
  .sp-table-stack tr:has(> td:nth-child(6)) > td[data-label=""] { grid-column: 1 / -1; }
  .sp-table-stack tr:has(> td:nth-child(6)) > td.sp-actions-cell, .sp-table-stack tr:has(> td:nth-child(6)) > td.sp-col-actions {
    display: flex !important; justify-content: flex-end; gap: 6px; padding: 6px 0 0 !important; border-top: 1px solid var(--sp-border) !important; }
  .sp-table-stack tr:has(> td:nth-child(6)) > td:empty { display: none !important; }
}
/* laptops (1024-1439px): a narrower sidebar and denser tables, so wide lists (users, sales, PPPoE) fit without
   scrolling sideways inside the table */
@media (min-width: 1024px) and (max-width: 1439.98px) {
  body:not(.sp-collapsed) .sidenav { width: 232px; }
  body:not(.sp-collapsed) .navbar { left: 232px; }
  body:not(.sp-collapsed) #main { margin-left: 232px; }
  .main-container { padding: 18px 18px 36px; }
  .table td, .table th { padding-left: 9px !important; padding-right: 9px !important; }
  .table td { font-size: 13.5px; }
  .table thead th { letter-spacing: .05em; }
}
@media (min-width: 1024px) and (max-width: 1439.98px) {
  /* long badges (voucher comments) end with "…" (their full text is in the tooltip) instead of widening the table */
  .table.text-nowrap td .sp-badge { max-width: 150px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; display: inline-block; }
  .table td .sp-mono, .table td code { font-size: 12.5px; }
}
@media (min-width: 1024px) and (max-width: 1439.98px) {
  .table.text-nowrap thead th { white-space: normal; line-height: 1.25; }
  .table td .sp-mac, .table td [class*="mono"] { font-size: 12px; letter-spacing: -.01em; }
}

/* v1.51.0: router health (seven-day strip on Monitoring, Router health page). */
.sp-day-good { --sp-day: #16a34a; color: #16a34a; }
.sp-day-warn { --sp-day: #f59e0b; color: #f59e0b; }
.sp-day-bad { --sp-day: #dc2626; color: #dc2626; }
.sp-day-none { --sp-day: var(--sp-border-strong); color: var(--sp-faint); }
.sp-week { display: inline-flex; align-items: center; gap: 8px; color: var(--sp-ink); text-decoration: none; white-space: nowrap; }
.sp-week:hover b { color: var(--sp-link); }
.sp-week-days { display: inline-flex; gap: 2px; }
.sp-week-days i { display: block; width: 8px; height: 18px; border-radius: 2px; background: var(--sp-day); }
.sp-week b { font-size: 13px; font-variant-numeric: tabular-nums; }
.sp-week-note { display: block; font-size: 12px; margin-top: 2px; }
.sp-rh-now { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: -4px 0 16px; font-size: 13px; }
.sp-rh-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.sp-rh-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 10px;
  border: 1px solid var(--sp-border); border-top: 4px solid var(--sp-day); background: var(--sp-surface); color: var(--sp-ink); text-align: center; min-width: 0; }
.sp-rh-day b { font-size: 13px; }
.sp-rh-day span { font-size: 12px; color: var(--sp-muted); }
.sp-rh-day em { font-style: normal; font-weight: 700; font-size: 14px; color: var(--sp-ink-strong); font-variant-numeric: tabular-nums; }
.sp-rh-day.sp-day-bad em { color: #dc2626; }
.sp-seg { display: inline-flex; border: 1px solid var(--sp-border-strong); border-radius: 10px; overflow: hidden; }
.sp-seg a { padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--sp-ink); text-decoration: none; min-height: 34px; display: inline-flex; align-items: center; }
.sp-seg a + a { border-left: 1px solid var(--sp-border-strong); }
.sp-seg a.sp-on { background: var(--sp-brand); color: #fff; }
.sp-rh-block + .sp-rh-block { margin-top: 18px; }
.sp-rh-label { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; font-size: 13px; }
.sp-rh-band { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--sp-surface); }
.sp-rh-band i { flex: 1 1 0; min-width: 0; background: var(--sp-day); }
.sp-hchart { display: block; width: 100%; height: 120px; border-radius: 8px; background: var(--sp-brand-soft); }
.sp-hchart-line { fill: none; stroke: var(--sp-brand); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.sp-hchart-dot { fill: var(--sp-brand); }
.sp-hchart-axis { stroke: var(--sp-border-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.sp-hchart-grid { stroke: var(--sp-border); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.sp-hchart-x { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--sp-muted); margin-top: 4px; }
@media (max-width: 640px) {
  .sp-rh-days { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sp-rh-day { padding: 8px 2px; }
  .sp-hchart { height: 96px; }
  .sp-card-head .sp-seg { margin-top: 6px; }
}

/* v1.52.0: Voucher MAC Reset, quick layout (code box and preview side by side on laptops; big buttons on phones). */
.mr-quick { display: block; }
@media (min-width: 1024px) {
  .mr-quick.mr-quick-two { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
  .mr-quick.mr-quick-two > .card { margin-bottom: 0; }
}
.mr-search-card #mr-q { font-size: 17px; font-weight: 600; letter-spacing: .02em; min-height: 46px; }
.mr-exec .sp-form-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.mr-exec .sp-form-actions .btn, .mr-toggle .btn { min-height: 44px; font-weight: 700; }
.mr-exec { display: inline-block; vertical-align: top; margin: 0 10px 14px 0; padding-top: 0; border-top: 0; }
.mr-exec .sp-form-actions { border-top: 0; padding-top: 0; margin-top: 0; }
.mr-exec .mr-ack { display: block; margin-bottom: 8px; }
.mr-toggle { display: inline-block; vertical-align: top; margin: 0 0 14px; }
.mr-toggle .btn { margin: 0; }
.mr-btn-disable { background: #c2410c; border-color: #c2410c; color: #fff; }
.mr-btn-disable:hover { background: #9a3412; border-color: #9a3412; color: #fff; }
@media (max-width: 640px) {
  .mr-exec, .mr-toggle { display: block; margin-right: 0; }
  .mr-exec .sp-form-actions .btn, .mr-toggle .btn { flex: 1 1 100%; width: 100%; justify-content: center; }
  .mr-exec { margin-bottom: 10px; }
}
#mr-preview { scroll-margin-top: 140px; }
@media (max-width: 640px) {
  .mr-exec .sp-form-actions { padding: 0; margin: 0; }
}

/* v1.53.0: Client Admin support session (Super Admin → Client Admin): always visible, never mistaken for a normal sign-in. */
.sp-support-bar { position: sticky; top: 0; z-index: 1030; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  margin: 0 0 14px; padding: 10px 16px; border-radius: 0 0 12px 12px; background: #7c2d12; color: #fff7ed; border: 2px solid #f97316; box-shadow: 0 6px 18px rgba(124, 45, 18, .25); }
.sp-support-bar[data-mode="manage"] { background: #7f1d1d; border-color: #ef4444; }
.sp-support-bar-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13.5px; }
.sp-support-bar-text b { font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.sp-support-bar-meta { opacity: .85; font-size: 12.5px; }
.sp-support-bar-end .btn { background: #fff; color: #7c2d12; border-color: #fff; font-weight: 700; min-height: 40px; }
.sp-support-bar-end .btn:hover { background: #ffedd5; color: #7c2d12; }
@media (max-width: 640px) { .sp-support-bar-end, .sp-support-bar-end .btn { width: 100%; justify-content: center; } }
.sp-sup-msg { margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--sp-bg, #f3f6fb); color: var(--sp-ink, #243147);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.sp-sup-msg main { max-width: 480px; margin: 16px; padding: 28px; border-radius: 16px; background: var(--sp-surface, #fff); box-shadow: 0 10px 30px rgba(15, 23, 42, .1); }
.sp-sup-msg h1 { font-size: 20px; margin: 0 0 10px; }

/* v1.54.0 Super Admin support cockpit: support check, attention list, health column */
.sp-att-card { margin-bottom: 16px; border-left: 4px solid var(--sp-success); }
.sp-att-card.sp-att-warn { border-left-color: var(--sp-warning); }
.sp-att-card.sp-att-critical { border-left-color: var(--sp-danger); }
.sp-att-card h3 .sp-badge { margin-left: 8px; vertical-align: middle; }
.sp-att-ok { margin: 0; color: var(--sp-success); font-weight: 600; }
.sp-att-note { margin: 10px 0 0; font-size: 12px; }
.sp-att-list li > div { flex: 1; min-width: 0; color: var(--sp-ink); }
.sp-att-list .sp-list-time, .sp-att-rows .sp-list-time { margin-left: auto; white-space: nowrap; }
.sp-att-dash { margin-top: 16px; }
.sp-att-dash .sp-att-rows li > div { flex: 1; min-width: 0; }
.sp-att-first { display: inline-block; max-width: 240px; font-size: 12px; line-height: 1.35; margin-top: 4px; }
.sp-chip-att i { margin-right: 4px; }
/* long menu labels wrap instead of being cut off on laptop widths */
body.sp-sa .sidenav .sp-nav a .sp-label { white-space: normal; line-height: 1.25; }

/* v1.56.0 Client Admin review fixes */
/* room under the last row so the floating "Ask AI" button never covers a value or an action */
body:has(.sp-ai-launcher:not([hidden]):not(.sp-ai-hidden)) .main-container { padding-bottom: 96px; }
/* money totals in stat cards wrap instead of ending in "..." */
.sp-stat-value { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
/* label / value lists: a gap between the label and its value */
.sp-kv dt { padding-right: 14px; }
/* the hint under a text area never touches its border */
.sp-field textarea + .sp-help { margin-top: 8px; }
/* router cards on a phone: meters shrink to their cell (the % stayed outside the card), names wrap at word edges */
@media (max-width: 640px) {
  .sp-mini-meter { min-width: 0; max-width: 100%; }
  .sp-mini-meter > span { flex: none; font-size: 12px; }
  .table.sp-router-table td { min-width: 0; overflow-wrap: anywhere; }
  .table.sp-router-table .sp-name-cell, .table.sp-router-table td[data-label] .sp-mono { text-align: left; word-break: normal; overflow-wrap: anywhere; }
}

/* v1.58.2 Main Dashboard: the selected router's five cards, in the summary row's grid */
.sp-focus { margin: 0 0 18px; }
.sp-focus-kpis { margin-bottom: 0; }
.sp-kpi-teal { background: linear-gradient(135deg, #2dd4bf 0%, #0d9488 100%); }
.sp-focus-kpis .sp-kpi-value { white-space: nowrap; overflow: hidden; overflow-wrap: normal; word-break: normal; }
.sp-kpi-cur { font-size: 13px; font-weight: 700; opacity: .85; letter-spacing: 0; }
.sp-kpi-amt { white-space: nowrap; }
.sp-kpi-dash { opacity: .7; }

/* v1.59.0 Router Backups */
.sp-rb-intro { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.sp-rb-intro > div { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--sp-surface); border: 1px solid var(--sp-border); font-size: 13.5px; line-height: 1.45; }
.sp-rb-intro i { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--sp-accent-soft); color: var(--sp-accent); }
.sp-rb-actions { white-space: nowrap; }
.sp-rb-actions .btn, .sp-rb-actions form { margin: 2px 0; }
.sp-rb-bad { color: var(--sp-danger); }
.sp-rb-warn { color: var(--sp-warning); }
.sp-rb-totals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 12px 0 16px; }
.sp-rb-totals > div { padding: 12px; border-radius: 12px; background: var(--sp-surface-3); text-align: center; }
.sp-rb-totals b { display: block; font-size: 24px; line-height: 1.2; }
.sp-rb-totals span { font-size: 12.5px; color: var(--sp-muted); }
.sp-rb-totals .sp-rb-bad b { color: var(--sp-danger); }
.sp-rb-progress { margin: 10px 0; }
.sp-rb-progress .progress-bar { background: var(--sp-accent-grad); transition: width .4s ease; }
.sp-rb-field { display: grid; gap: 6px; margin: 0 0 14px; max-width: 420px; }
.sp-rb-field > span { font-weight: 600; font-size: 13.5px; }
.sp-rb-groups { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.sp-rb-groups legend { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; border: 0; width: auto; }
.sp-rb-group { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin: 0 0 8px; border: 1px solid var(--sp-border); border-radius: 10px; cursor: pointer; }
.sp-rb-group:has(input:checked) { border-color: var(--sp-accent); background: var(--sp-accent-soft); }
.sp-rb-group input { margin-top: 3px; }
.sp-rb-group span { display: grid; gap: 2px; }
.sp-rb-group small { color: var(--sp-muted); font-size: 12.5px; line-height: 1.4; }
.sp-rb-sub { margin: 18px 0 8px; font-size: 15px; }
.sp-rb-confirm { margin-top: 14px; padding: 14px; border-radius: 12px; border: 1px solid var(--sp-border); background: var(--sp-surface-3); }
.sp-rb-ack { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; }
.sp-rb-diff { padding: 10px 0; border-bottom: 1px solid var(--sp-border); }
.sp-rb-diff h4 { font-size: 15px; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sp-rb-diff-list { margin: 2px 0; font-size: 13px; overflow-wrap: anywhere; }
.sp-rb-diff-list span { font-weight: 600; }
.sp-rb-errors { margin: 10px 0; }
.sp-rb-errors ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; }
.sp-rb-removed-list, .sp-rb-runs { margin: 0; padding-left: 18px; }
.sp-rb-removed-list li, .sp-rb-runs li { margin: 4px 0; }
.sp-rb-checks { list-style: none; margin: 0; padding: 0; }
.sp-rb-checks > li { padding: 8px 0; border-bottom: 1px solid var(--sp-border); }
.sp-rb-checks > li > i { margin-right: 6px; }
.sp-rb-checks .sp-ok > i { color: var(--sp-success); }
.sp-rb-checks .sp-bad > i { color: var(--sp-danger); }
.sp-rb-checks .sp-warn > i { color: var(--sp-warning); }
.sp-rb-checks pre.sp-code { white-space: pre-wrap; word-break: break-all; margin: 6px 0 0; }
@media (max-width: 820px) {
  .sp-rb-intro { grid-template-columns: 1fr; }
  .sp-rb-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table.sp-table-stack td.sp-rb-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-start; white-space: normal; min-width: 0; }
  .sp-rb-actions .btn, .sp-rb-actions form { margin: 0; }
  .sp-rb-actions form { display: inline-flex; }
}
/* v1.60.0 Router Backups: the full .backup */
.sp-rb-ok { color: var(--sp-success); }
.sp-rb-howto { margin: 14px 0; padding: 10px 14px; border: 1px solid var(--sp-border); border-radius: 12px; background: var(--sp-surface-3); }
.sp-rb-howto summary { cursor: pointer; font-weight: 600; }
.sp-rb-howto ol { margin: 8px 0 0; padding-left: 20px; font-size: 13.5px; line-height: 1.55; }
.sp-rb-howto li { margin: 4px 0; }
/* v1.61.0 audit (UX): a long table (hotspot users, user profiles) grows with the page instead of hiding most rows in a
   75vh box with its own scrollbar; wide tables still scroll sideways. The page keeps room at the bottom so the floating
   "Ask AI" button never covers the last row or a form button. */
.sp-table-wrap.sp-scroll-y { max-height: none; overflow-y: visible; overflow-x: auto; }
#main .main-container { padding-bottom: 84px; }
