/* ==========================================================================
   ISP Desk — design system
   Tokens → shell (sidebar, top bar) → components → pages → responsive.
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #f2f6fb;
  --surface: #ffffff;
  --surface-2: #f6f9fd;
  --surface-3: #edf3fa;
  --border: #dfe7f1;
  --border-strong: #cbd8e8;
  --card-border: #c6dbf3;

  /* Text */
  --text: #1b2534;
  --text-2: #3a4658;
  --muted: #667085;
  --faint: #98a2b3;

  /* Brand */
  --primary: #07a78c;
  --primary-600: #058f78;
  --primary-500: #22b89e;
  --primary-soft: #e6f6f3;
  --primary-ring: rgba(7, 167, 140, .18);
  --primary-ink: #ffffff;

  /* Semantic */
  --success: #16a34a; --success-soft: #e7f7ed;
  --danger: #e5484d;  --danger-soft: #fdecec;
  --warning: #ea6c0a; --warning-soft: #fff1e6;
  --info: var(--primary);    --info-soft: var(--primary-soft);
  --violet: #7c3aed;  --violet-soft: #f2ecfe;
  --accent: #f59e0b;  --accent-soft: #fff6e3;

  /* Charts & tables */
  --chart-1: var(--primary);
  --chart-2: #a9cdf3;
  --chart-3: #f59e0b;
  --chart-4: #e5484d;
  --chart-grid: #edf2f8;
  --table-head: var(--primary);
  --table-head-text: #ffffff;
  --zebra: #f5f9fe;

  /* App bar & sidebar */
  --appbar-bg: color-mix(in srgb, var(--primary) 11%, #fff);
  --sidebar-bg: #f8fbff;
  --nav-border: #e1e9f3;
  --nav-text: #3a4658;
  --nav-text-strong: #1b2534;
  --nav-hover: #ebf7f4;
  --nav-active: #dcf3ed;
  --nav-accent: var(--primary);
  --nav-section: #8a97a8;

  /* Shape & depth */
  --radius-lg: 14px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(22, 60, 110, .04), 0 1px 3px rgba(22, 60, 110, .05);
  --shadow-md: 0 4px 14px rgba(22, 60, 110, .08), 0 2px 4px rgba(22, 60, 110, .04);
  --shadow-lg: 0 18px 48px rgba(22, 60, 110, .16), 0 4px 12px rgba(22, 60, 110, .06);

  --sidebar: 262px;
  --topbar: 72px;
  --font: "Inter", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  color-scheme: light;
}

/* Dark theme — follows the OS unless the user picked light; can be forced with data-theme="dark". */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a111e; --surface: #111a2b; --surface-2: #142036; --surface-3: #18263e; --border: #22324a; --border-strong: #2d4160; --card-border: #26406a;
    --text: #e6edf6; --text-2: #c3cedd; --muted: #93a3b8; --faint: #64748b;
    --primary: #2cc4a8; --primary-600: #1fb096; --primary-500: #4fd3bb; --primary-soft: rgba(44, 196, 168, .14); --primary-ring: rgba(44, 196, 168, .28); --primary-ink: #ffffff;
    --success: #4ade80; --success-soft: rgba(74, 222, 128, .12); --danger: #f87171; --danger-soft: rgba(248, 113, 113, .12);
    --warning: #fb923c; --warning-soft: rgba(251, 146, 60, .13); --info: #5fd6c0; --info-soft: rgba(96, 165, 250, .12);
    --violet: #a78bfa; --violet-soft: rgba(167, 139, 250, .13); --accent: #fbbf24; --accent-soft: rgba(251, 191, 36, .12);
    --chart-1: var(--primary); --chart-2: #1f3f66; --chart-grid: #1a2741; --table-head: color-mix(in srgb, var(--primary) 38%, #0c1524); --zebra: #132036;
    --appbar-bg: #0e1828; --sidebar-bg: #0c1524; --nav-border: #1c2a40; --nav-text: #b7c3d4; --nav-text-strong: #ffffff;
    --nav-hover: rgba(255, 255, 255, .05); --nav-active: color-mix(in srgb, var(--primary) 16%, transparent); --nav-accent: #6ab0f5; --nav-section: #6b7a90;
    --shadow-xs: none; --shadow: 0 1px 2px rgba(0, 0, 0, .35); --shadow-md: 0 6px 16px rgba(0, 0, 0, .35); --shadow-lg: 0 20px 50px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a111e; --surface: #111a2b; --surface-2: #142036; --surface-3: #18263e; --border: #22324a; --border-strong: #2d4160; --card-border: #26406a;
  --text: #e6edf6; --text-2: #c3cedd; --muted: #93a3b8; --faint: #64748b;
  --primary: #2cc4a8; --primary-600: #1fb096; --primary-500: #4fd3bb; --primary-soft: rgba(44, 196, 168, .14); --primary-ring: rgba(44, 196, 168, .28); --primary-ink: #ffffff;
  --success: #4ade80; --success-soft: rgba(74, 222, 128, .12); --danger: #f87171; --danger-soft: rgba(248, 113, 113, .12);
  --warning: #fb923c; --warning-soft: rgba(251, 146, 60, .13); --info: #5fd6c0; --info-soft: rgba(96, 165, 250, .12);
  --violet: #a78bfa; --violet-soft: rgba(167, 139, 250, .13); --accent: #fbbf24; --accent-soft: rgba(251, 191, 36, .12);
  --chart-1: var(--primary); --chart-2: #1f3f66; --chart-grid: #1a2741; --table-head: color-mix(in srgb, var(--primary) 38%, #0c1524); --zebra: #132036;
  --appbar-bg: #0e1828; --sidebar-bg: #0c1524; --nav-border: #1c2a40; --nav-text: #b7c3d4; --nav-text-strong: #ffffff;
  --nav-hover: rgba(255, 255, 255, .05); --nav-active: color-mix(in srgb, var(--primary) 16%, transparent); --nav-accent: #6ab0f5; --nav-section: #6b7a90;
  --shadow-xs: none; --shadow: 0 1px 2px rgba(0, 0, 0, .35); --shadow-md: 0 6px 16px rgba(0, 0, 0, .35); --shadow-lg: 0 20px 50px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); font-feature-settings: "cv11", "ss01"; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -.015em; color: var(--text); }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
.faint { color: var(--faint); }
code, .mono { font-family: var(--mono); font-size: .9em; }
code { background: var(--surface-3); padding: 1px 5px; border-radius: 5px; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); background: var(--surface); }
.num, .tabular { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.svg-icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
::selection { background: var(--primary-soft); }

/* ==========================================================================
   Shell: full-width app bar on top, light sidebar + content below
   ========================================================================== */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); flex: 1; min-height: 0; }
body.sidebar-collapsed .app { grid-template-columns: 0 minmax(0, 1fr); }
body.sidebar-collapsed .sidebar { visibility: hidden; }

/* ---------- App bar ---------- */
.appbar {
  position: sticky; top: 0; z-index: 45; height: var(--topbar); display: flex; align-items: center; gap: 14px; padding: 0 22px 0 0;
  background: var(--appbar-bg); border-bottom: 1px solid var(--border);
}
.appbar-brand { width: var(--sidebar); flex: none; display: flex; align-items: center; gap: 10px; padding-left: 22px; text-decoration: none; min-width: 0; }
.appbar-brand:hover { text-decoration: none; }
.appbar-brand .brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.appbar-brand .brand-sub { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-brand .brand-name { font-weight: 800; font-size: 17px; letter-spacing: .01em; text-transform: uppercase; color: var(--primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 13.5px; letter-spacing: .02em;
  background: linear-gradient(140deg, var(--primary-500) 0%, var(--primary) 55%, color-mix(in srgb, var(--primary-600) 80%, #000) 100%); color: #fff; box-shadow: 0 0 0 3px #fff, 0 4px 12px color-mix(in srgb, var(--primary) 25%, transparent);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.brand-text { min-width: 0; }
.brand-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.square-btn {
  width: 42px; height: 42px; flex: none; display: inline-grid; place-items: center; border-radius: 10px; border: 0; cursor: pointer;
  background: var(--surface); color: var(--primary); box-shadow: var(--shadow-xs); text-decoration: none;
}
.square-btn:hover { background: var(--primary-soft); text-decoration: none; }
.square-btn .svg-icon { width: 20px; height: 20px; }
.square-btn.fill .svg-icon { fill: currentColor; stroke: none; }
.appbar .search { flex: 1; max-width: 400px; display: flex; min-width: 0; }
.appbar .search .input { height: 42px; border-radius: 9px 0 0 9px; border: 1px solid transparent; background: var(--surface); box-shadow: none; padding-left: 16px; }
.appbar .search .input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.appbar .search button { width: 46px; height: 42px; flex: none; border: 0; border-radius: 0 9px 9px 0; background: var(--primary); color: #fff; display: grid; place-items: center; cursor: pointer; }
.appbar .search button:hover { background: var(--primary-600); }
.appbar .search button .svg-icon { width: 20px; height: 20px; }
.appbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.add-client { display: inline-flex; align-items: stretch; height: 42px; border-radius: 9px; overflow: hidden; text-decoration: none; box-shadow: var(--shadow-xs); margin-right: 8px; }
.add-client:hover { text-decoration: none; box-shadow: var(--shadow-md); }
.add-client .plus { width: 44px; display: grid; place-items: center; background: var(--primary); color: #fff; }
.add-client .plus .svg-icon { width: 20px; height: 20px; stroke-width: 2.2; }
.add-client .label { display: grid; place-items: center; padding: 0 14px; background: var(--surface); color: var(--text); font-weight: 550; font-size: 14.5px; }
.quick-icons { display: flex; align-items: center; gap: 6px; }
.qi { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 8px; position: relative; text-decoration: none; color: #fff; transition: transform .12s, box-shadow .12s; border: 0; cursor: pointer; }
.qi:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }
.qi .svg-icon { width: 18px; height: 18px; stroke-width: 2; }
.qi-blue { background: #3d8fe6; } .qi-orange { background: #f47a1f; } .qi-red { background: #ef4444; border-radius: 50%; }
.qi-sky { background: #5aa6ef; } .qi-yellow { background: #f6b52e; } .qi-indigo { background: #2f7fd8; }
.qi-ghost { background: transparent; color: var(--primary); }
.qi-bell { background: transparent; color: #f6a609; }
.qi-bell .svg-icon { width: 22px; height: 22px; fill: #fbbf24; stroke: #f59e0b; }
.qi .count {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--danger);
  color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--appbar-bg); line-height: 1;
}
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer; position: relative; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.icon-btn .count {
  position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger);
  color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); line-height: 1;
}
.menu-toggle { display: none; }
.theme-icon-dark { display: none; }
:root[data-theme="dark"] .theme-icon-dark { display: block; }
:root[data-theme="dark"] .theme-icon-light { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-icon-dark { display: block; } :root:not([data-theme="light"]) .theme-icon-light { display: none; } }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 0; border-radius: 999px; border: 0; background: none; cursor: pointer; color: var(--text); }
.user-chip .avatar { width: 40px; height: 40px; font-size: 13.5px; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(22, 60, 110, .2); }

/* ---------- Sidebar ---------- */
.sidebar {
  position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); display: flex; flex-direction: column; z-index: 40;
  background: var(--sidebar-bg); color: var(--nav-text); border-right: 1px solid var(--nav-border); overflow: hidden;
}
.nav { flex: 1; overflow-y: auto; padding: 6px 14px 18px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.nav-section { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--nav-section); padding: 18px 12px 8px; }
.nav-single, .nav-group > summary {
  display: flex; align-items: center; gap: 13px; padding: 10px 12px; border-radius: 10px; color: var(--nav-text); font-weight: 500; font-size: 14.5px;
  cursor: pointer; user-select: none; position: relative; text-decoration: none; transition: background .12s, color .12s; margin-bottom: 2px;
}
.nav-single:hover, .nav-group > summary:hover { background: var(--nav-hover); color: var(--nav-text-strong); text-decoration: none; }
.nav-single .svg-icon, .nav-group > summary .svg-icon { width: 21px; height: 21px; stroke-width: 1.6; color: var(--nav-text); }
.nav-single.active, .nav-group.active > summary { background: var(--nav-active); color: var(--nav-accent); font-weight: 600; }
.nav-single.active .svg-icon, .nav-group.active > summary .svg-icon { color: var(--nav-accent); }
.nav-group > summary { list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary .chev { margin-left: auto; width: 17px; height: 17px; transition: transform .15s; color: var(--nav-section); transform: rotate(90deg); }
.nav-group[open] > summary .chev { transform: rotate(-90deg); color: var(--nav-accent); }
.nav-items { padding: 4px 0 10px; display: grid; gap: 1px; }
.nav-items a { display: block; padding: 7px 12px 7px 46px; border-radius: 8px; color: var(--nav-text); font-size: 13.5px; text-decoration: none; }
.nav-items a:hover { color: var(--nav-accent); background: var(--nav-hover); }
.nav-items a.active { color: var(--nav-accent); background: var(--nav-hover); font-weight: 600; }

.sidebar-wallet { margin: 0 14px 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--card-border); background: linear-gradient(135deg, var(--primary-soft), var(--surface)); }
.sidebar-wallet span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.sidebar-wallet b { display: block; font-size: 19px; color: var(--text); font-variant-numeric: tabular-nums; margin: 2px 0 6px; }
.sidebar-wallet a { font-size: 12.5px; color: var(--primary); font-weight: 550; }
.sidebar-foot { padding: 12px 18px; border-top: 1px solid var(--nav-border); font-size: 12px; color: var(--nav-section); }

/* ---------- Main column ---------- */
.main { min-width: 0; display: flex; flex-direction: column; }
/* The client portal keeps a simple top bar. */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: var(--appbar-bg); border-bottom: 1px solid var(--border);
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* Avatars */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 650; font-size: 12px; flex: none;
  background: var(--primary-soft); color: var(--primary); letter-spacing: .02em;
}
.avatar.lg { width: 48px; height: 48px; font-size: 16px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.t1 { background: #e7f5f3; color: #0f766e; } .avatar.t2 { background: #e9effd; color: var(--primary-600); }
.avatar.t3 { background: #fdf3e2; color: #b45309; } .avatar.t4 { background: #f1ebfd; color: #6d28d9; }
.avatar.t5 { background: #fcebe8; color: #c2341f; } .avatar.t6 { background: #e8f6ec; color: #15803d; }
:root[data-theme="dark"] .avatar[class*=" t"] { background: var(--surface-3); color: var(--text-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar[class*=" t"] { background: var(--surface-3); color: var(--text-2); } }
.avatar.xl { width: 84px; height: 84px; font-size: 26px; }

/* Dropdowns */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60;
}
.dropdown.open .dropdown-menu { display: block; animation: pop .12s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dropdown-menu a, .dropdown-menu button {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text-2);
  background: none; border: 0; font: inherit; font-size: 13.5px; cursor: pointer; text-align: left; text-decoration: none;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.dropdown-menu .svg-icon { width: 16px; height: 16px; color: var(--muted); }
.dropdown-menu .text-danger, .dropdown-menu .text-danger .svg-icon { color: var(--danger); }
.dropdown-head { padding: 10px 10px 8px; border-bottom: 1px solid var(--border); margin: -6px -6px 6px; }
.dropdown-head b { display: block; font-size: 13.5px; }
.dropdown-head span { font-size: 12px; color: var(--muted); }
.notif-menu { width: 340px; }
.notif-item { align-items: flex-start !important; }
.notif-item .notif-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.notif-item .notif-icon .svg-icon { width: 15px; height: 15px; color: inherit; }
.notif-icon.amber { background: var(--warning-soft); color: var(--warning); }
.notif-icon.red { background: var(--danger-soft); color: var(--danger); }
.notif-icon.blue { background: var(--info-soft); color: var(--info); }
.notif-icon.teal { background: var(--primary-soft); color: var(--primary); }
.notif-item b { display: block; color: var(--text); font-weight: 600; }
.notif-item small { font-size: 12px; }
.notif-empty { padding: 22px 12px; text-align: center; color: var(--muted); font-size: 13px; }

.content { padding: 28px; width: 100%; }
.impersonate-bar {
  background: linear-gradient(90deg, var(--warning-soft), var(--surface)); color: var(--warning); border-bottom: 1px solid var(--border);
  padding: 9px 28px; display: flex; align-items: center; gap: 10px; font-weight: 550; font-size: 13.5px;
}

/* ==========================================================================
   Page header
   ========================================================================== */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.page-head .subtitle { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
.crumbs .svg-icon { width: 12px; height: 12px; color: var(--faint); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ==========================================================================
   Cards & layout grids
   ========================================================================== */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-width: 0; }
.card + .card { margin-top: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; min-height: 58px; }
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-head .card-sub { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.card-body { padding: 20px; }
.card-body.tight { padding: 0; }
.card-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-main > *, .grid-2 > *, .grid-3 > * { min-width: 0; }
.stack > * + * { margin-top: 20px; }
.section-gap { margin-top: 20px; }

/* ==========================================================================
   KPI / stat cards
   ========================================================================== */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stats.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 18px 16px;
  box-shadow: var(--shadow); color: var(--text); display: flex; flex-direction: column; gap: 6px; min-width: 0; position: relative;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
a.stat:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); text-decoration: none; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .chip { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.stat .chip .svg-icon { width: 17px; height: 17px; }
.stat-value { font-size: 26px; font-weight: 650; letter-spacing: -.025em; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--text); word-break: break-word; }
.stat-meta { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.stat .progress { margin-top: 4px; }
.stats.compact .stat { padding: 14px 16px; gap: 4px; }
.stats.compact .stat-value { font-size: 19px; }
.stats.compact .chip { width: 30px; height: 30px; border-radius: 9px; }
.tone-teal .chip { background: var(--primary-soft); color: var(--primary); }
.tone-green .chip { background: var(--success-soft); color: var(--success); }
.tone-red .chip { background: var(--danger-soft); color: var(--danger); }
.tone-amber .chip { background: var(--warning-soft); color: var(--warning); }
.tone-blue .chip { background: var(--info-soft); color: var(--info); }
.tone-violet .chip { background: var(--violet-soft); color: var(--violet); }
.tone-slate .chip { background: var(--surface-3); color: var(--muted); }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; font-size: 12px; padding: 1px 7px; border-radius: 999px; }
.trend.up { color: var(--success); background: var(--success-soft); }
.trend.down { color: var(--danger); background: var(--danger-soft); }

/* Featured KPI (hero) */
.stat.hero { background: linear-gradient(145deg, #0f766e 0%, #115e59 60%, #134e4a 100%); border-color: transparent; color: #fff; overflow: hidden; }
.stat.hero::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.14), transparent 70%); }
.stat.hero .stat-label, .stat.hero .stat-meta { color: rgba(236, 253, 250, .78); }
.stat.hero .stat-value { color: #fff; }
.stat.hero .chip { background: rgba(255, 255, 255, .14); color: #fff; }
.stat.hero .progress { background: rgba(255, 255, 255, .16); border-color: transparent; }
.stat.hero .progress > span { background: #5eead4; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 9px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 550;
  cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-xs); transition: background .12s, border-color .12s, color .12s, box-shadow .12s; text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--faint); color: var(--text); text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-ring); }
.btn .svg-icon { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 1px 2px rgba(15, 118, 110, .25), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); color: var(--primary-ink); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger); filter: brightness(.94); color: #fff; }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); box-shadow: none; }
.btn-soft:hover { background: var(--primary-soft); border-color: var(--primary-ring); color: var(--primary); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-xs { height: 28px; padding: 0 9px; font-size: 12px; border-radius: 7px; gap: 5px; }
.btn-xs .svg-icon, .btn-sm .svg-icon { width: 14px; height: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; height: 42px; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* ==========================================================================
   Forms
   ========================================================================== */
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: inherit; font-size: 13.5px; outline: none; box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s;
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { height: auto; min-height: 88px; padding: 9px 12px; resize: vertical; line-height: 1.5; }
.select { padding-right: 32px; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--faint); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.input[type=date] { padding-right: 8px; }
.input-sm { height: 32px; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 550; color: var(--text-2); }
.field .help { font-size: 12px; color: var(--muted); line-height: 1.4; }
.field .error, .error-text { font-size: 12px; color: var(--danger); font-weight: 500; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }

/* Settings-style sections: title + description on the left, fields on the right */
.form-section { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 28px; padding: 26px 0; }
.form-section:first-child { padding-top: 4px; }
.form-section + .form-section { border-top: 1px solid var(--border); }
.form-section > h3, .form-section .section-intro h3 { font-size: 14.5px; font-weight: 600; color: var(--text); text-transform: none; letter-spacing: -.01em; margin: 0; }
.form-section .section-intro p { margin: 6px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.form-section > h3 { grid-column: 1; }
.form-section > .form-grid, .form-section > .field, .form-section > .toolbar, .form-section > div:not(.section-intro) { grid-column: 2; min-width: 0; }
.form-section > .form-grid ~ .toolbar, .form-section > .form-grid ~ div { margin-top: 16px; }
.form-section .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-section .form-grid .field:has(.textarea) { grid-column: 1 / -1; }

.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; color: var(--text-2); }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }
.switch { position: relative; display: inline-flex; align-items: center; gap: 11px; cursor: pointer; color: var(--text-2); font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 36px; height: 20px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--primary-ring); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.card-foot.form-actions { margin: 0; }
.input-group { display: flex; }
.input-group .input { border-radius: 9px 0 0 9px; }
.input-group .btn { border-radius: 0 9px 9px 0; border-left: 0; }

/* ==========================================================================
   Filter bar
   ========================================================================== */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.filters .field { min-width: 140px; flex: 1 1 150px; max-width: 220px; gap: 5px; }
.filters .field.grow { max-width: none; flex: 2 1 240px; }
.filters .field > label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.filters .input, .filters .select { height: 36px; font-size: 13px; }
.filters .btn { height: 36px; }
.filter-bar { display: flex; gap: 10px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.filter-bar .search-input { position: relative; flex: 1 1 260px; max-width: 420px; }
.filter-bar .search-input .svg-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.filter-bar .search-input .input { padding-left: 34px; height: 36px; }
.filter-bar .select { width: auto; min-width: 150px; height: 36px; font-size: 13px; }
.filter-bar .btn { height: 36px; }
.filter-bar .spacer { flex: 1; }
.filter-more { border-bottom: 1px solid var(--border); background: var(--surface-2); }
.filter-more > summary { list-style: none; cursor: pointer; padding: 10px 20px; font-size: 13px; font-weight: 550; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.filter-more > summary::-webkit-details-marker { display: none; }
.filter-more > summary:hover { color: var(--text); }
.filter-more > summary .chev { width: 14px; height: 14px; transition: transform .15s; }
.filter-more[open] > summary .chev { transform: rotate(90deg); }
.filter-more .filters { border-bottom: 0; padding-top: 2px; }
.filter-count { background: var(--primary); color: var(--primary-ink); border-radius: 999px; font-size: 11px; padding: 0 7px; font-weight: 700; }

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em;
  padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-2); }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 650; background: var(--surface-2); border-top: 1px solid var(--border); color: var(--text); }
.table .actions { white-space: nowrap; text-align: right; }
.table td.check-col, .table th.check-col { width: 40px; padding-right: 0; }
.table input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); vertical-align: middle; }
.table .mono { white-space: nowrap; }
.cell-main { font-weight: 600; color: var(--text); }
a.cell-main:hover { color: var(--primary); }
.cell-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.cell-user { display: flex; align-items: center; gap: 11px; min-width: 180px; }
.cell-user > div { min-width: 0; }
.empty { padding: 52px 20px; text-align: center; color: var(--muted); }
.empty .empty-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--surface-3); color: var(--faint); }
.empty .empty-icon .svg-icon { width: 24px; height: 24px; }
.empty .empty-title { font-weight: 600; color: var(--text-2); }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px 16px; font-size: 13.5px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 550; color: var(--text); word-break: break-word; }

/* ==========================================================================
   Badges, amounts, alerts
   ========================================================================== */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 550;
  white-space: nowrap; background: var(--surface-3); color: var(--text-2); border: 1px solid var(--border); line-height: 1.6;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.plain::before { display: none; }
.badge.plain { padding-left: 9px; }
.badge-green { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-red { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-amber { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-blue { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge-teal { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge-violet { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
.amount-due { color: var(--danger); font-weight: 600; }
.amount-adv { color: var(--success); font-weight: 600; }

.alert { display: flex; gap: 11px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; border: 1px solid transparent; font-weight: 500; font-size: 13.5px; }
.alert .svg-icon { margin-top: 1px; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 20%, transparent); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 20%, transparent); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 20%, transparent); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 20%, transparent); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* ==========================================================================
   Tabs, segmented control, pagination
   ========================================================================== */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); padding: 0 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a, .tabs button {
  padding: 14px 12px 12px; color: var(--muted); font-weight: 550; border: 0; background: none; font: inherit; font-size: 13.5px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none;
}
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs .active { color: var(--text); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.segmented { display: inline-flex; background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented a { padding: 5px 13px; border-radius: 7px; color: var(--muted); font-weight: 550; font-size: 13px; text-decoration: none; white-space: nowrap; }
.segmented a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented a:hover { color: var(--text); text-decoration: none; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.pager .pages { display: flex; gap: 4px; flex-wrap: wrap; }
.pager .pages a, .pager .pages span { min-width: 32px; height: 32px; padding: 0 9px; display: inline-grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); color: var(--text-2); background: var(--surface); font-weight: 550; text-decoration: none; }
.pager .pages a:hover { border-color: var(--border-strong); background: var(--surface-2); }
.pager .pages .current { background: var(--text); color: var(--surface); border-color: var(--text); }
.pager .pages .disabled { color: var(--faint); background: transparent; }

/* ==========================================================================
   Lists, charts, misc widgets
   ========================================================================== */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list.compact li { padding: 10px 20px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--faint); flex: none; }
.dot.on { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.dot.off { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .axis-label { fill: var(--faint); font-size: 11px; font-family: var(--font); }
.chart .bar-a { fill: var(--chart-2); }
.chart .bar-b { fill: var(--chart-1); }
.chart .bar-group:hover .bar-a { fill: color-mix(in srgb, var(--chart-2) 80%, var(--text)); }
.chart .bar-group:hover .bar-b { fill: var(--primary-600); }
.chart-summary { display: flex; gap: 28px; flex-wrap: wrap; margin-bottom: 14px; }
.chart-summary div span { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.chart-summary div b { display: block; font-size: 20px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { width: 132px; height: 132px; flex: none; }
.donut .track { stroke: var(--surface-3); }
.donut-center { font-size: 22px; font-weight: 700; fill: var(--text); font-family: var(--font); }
.donut-caption { font-size: 10px; fill: var(--muted); font-family: var(--font); text-transform: uppercase; letter-spacing: .08em; }
.legend-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; flex: 1; min-width: 0; }
.legend-list li { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); }
.legend-list li b { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--text); }
.metric-rows { list-style: none; margin: 0; padding: 0; }
.metric-rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.metric-rows li:last-child { border-bottom: 0; }
.metric-rows li span { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.metric-rows li b { font-variant-numeric: tabular-nums; font-weight: 600; }
.progress { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.notice { background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 25%, transparent); color: var(--text); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; white-space: pre-line; }
.callout { display: flex; gap: 10px; background: var(--info-soft); color: var(--info); border-radius: 10px; padding: 12px 16px; font-size: 13px; margin-bottom: 18px; line-height: 1.5; border: 1px solid color-mix(in srgb, var(--info) 15%, transparent); }
.quote-box { background: var(--primary-soft); border: 1px solid var(--primary-ring); border-radius: 12px; padding: 16px 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quote-box b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.quote-box span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.traffic-svg { width: 100%; height: 260px; display: block; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); }
.quick-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 16px; }
.quick-link { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border); color: var(--text-2); font-weight: 550; font-size: 13px; text-decoration: none; background: var(--surface); }
.quick-link:hover { border-color: var(--primary-ring); background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.quick-link .svg-icon { width: 16px; height: 16px; color: var(--primary); }
.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.option-card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface); cursor: pointer; transition: border-color .12s, box-shadow .12s, background .12s;
}
.option-card:hover { border-color: var(--border-strong); }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); background: var(--primary-soft); }
.option-card:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--primary-ring); }
.option-card.is-current { cursor: default; opacity: .75; background: var(--surface-2); }
.option-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.option-top b { font-size: 14.5px; color: var(--text); }
.option-price { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.option-price small { font-size: 12.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.option-meta { font-size: 12.5px; color: var(--muted); }
.profile-head { display: flex; align-items: center; gap: 16px; }
.portal-topbar { padding: 0 max(20px, calc((100% - 1180px) / 2)); }
.portal-brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.portal-brand b { display: block; font-size: 14.5px; font-weight: 650; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.portal-brand small { display: block; font-size: 11.5px; color: var(--muted); }
.portal-content { margin: 0 auto; max-width: 1180px; }
.bkash-btn { background: #e2136e; border-color: #e2136e; color: #fff; }
.bkash-btn:hover { background: #c5105f; border-color: #c5105f; color: #fff; }
@media (max-width: 640px) { .portal-topbar .btn-ghost { display: none; } }
.profile-head h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ==========================================================================
   Authentication pages
   ========================================================================== */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--surface); }
.auth-art {
  position: relative; overflow: hidden; color: #e6fffb; padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background:
    radial-gradient(900px 480px at 0% 0%, rgba(45, 212, 191, .28), transparent 60%),
    radial-gradient(700px 520px at 100% 100%, rgba(59, 130, 246, .20), transparent 60%),
    linear-gradient(160deg, #0b1220 0%, #0d1b2a 55%, #0b2a2a 100%);
}
.auth-art::before {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 40px 40px; mask-image: radial-gradient(ellipse at 30% 30%, #000 30%, transparent 75%);
}
.auth-art > * { position: relative; }
.auth-brand { display: flex; align-items: center; gap: 12px; font-weight: 650; font-size: 15px; color: #fff; }
.auth-art h2 { font-size: 36px; line-height: 1.12; max-width: 470px; letter-spacing: -.03em; color: #fff; font-weight: 650; }
.auth-art p { color: rgba(226, 244, 241, .72); max-width: 440px; font-size: 15px; margin-top: 14px; }
.auth-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 10px; }
.auth-points li { display: flex; align-items: center; gap: 10px; color: rgba(236, 253, 250, .86); font-size: 14px; }
.auth-points .svg-icon { width: 16px; height: 16px; color: #5eead4; }
.auth-preview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 520px; }
.auth-preview div { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.09); border-radius: 12px; padding: 14px; backdrop-filter: blur(6px); }
.auth-preview .svg-icon { width: 20px; height: 20px; color: #5eead4; }
.auth-preview span { display: block; font-size: 12px; color: rgba(226,244,241,.75); text-transform: uppercase; letter-spacing: .07em; margin-top: 10px; font-weight: 600; }
.auth-preview i { display: block; height: 4px; border-radius: 4px; margin-top: 10px; background: linear-gradient(90deg, #2dd4bf, rgba(45,212,191,.15)); font-style: normal; }
.auth-foot { font-size: 12.5px; color: rgba(226, 244, 241, .5); }
.auth-form { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .mobile-brand { display: none; align-items: center; gap: 11px; margin-bottom: 28px; font-weight: 650; }
.auth-card h1 { font-size: 26px; font-weight: 650; letter-spacing: -.025em; margin-bottom: 6px; }
.auth-card .stack-form > * + * { margin-top: 18px; }
.auth-card .input { height: 42px; }
.auth-switch { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); text-align: center; }

/* ==========================================================================
   Invoice & print
   ========================================================================== */
.invoice { max-width: 780px; margin: 0 auto; }
.invoice .inv-head { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.invoice .total-row td { font-size: 16px; }
@media print {
  .sidebar, .topbar, .no-print, .impersonate-bar { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; }
}


/* ==========================================================================
   Light-blue theme components (client profile and shared pieces)
   ========================================================================== */
.card, .stat { border-color: var(--card-border); }
.stat.hero { background: linear-gradient(140deg, var(--primary-500) 0%, var(--primary) 50%, color-mix(in srgb, var(--primary-600) 80%, #000) 100%); }
.stat.hero::after { background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%); }
.stat.hero .progress > span { background: #bfe0ff; }
.table th { background: var(--table-head); color: var(--table-head-text); border-bottom: 0; font-weight: 600; letter-spacing: .04em; }
.table th input[type=checkbox] { accent-color: #fff; }
.section-title { font-size: 19px; font-weight: 650; color: var(--primary); margin: 6px 4px 14px; letter-spacing: -.01em; }

/* Pills: small rounded buttons and status chips */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 13px; border-radius: 999px; border: 0;
  font: inherit; font-size: 13px; font-weight: 550; white-space: nowrap; cursor: pointer; text-decoration: none; line-height: 1;
}
.pill:hover { text-decoration: none; filter: brightness(.95); }
.pill .svg-icon { width: 15px; height: 15px; }
.pill-blue { background: var(--primary); color: #fff; }
.pill-green { background: #22a55a; color: #fff; }
.pill-red { background: #ef4444; color: #fff; }
.pill-orange { background: #f97316; color: #fff; }
.pill-gray { background: #94a3b8; color: #fff; }
.pill-soft { background: var(--primary-soft); color: var(--primary); }
span.pill { cursor: default; }
span.pill:hover { filter: none; }

/* Horizontal action bar above a profile */
.action-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 2px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--card-border);
  border-radius: var(--radius-lg); margin-bottom: 20px;
}
.action-bar > a, .action-bar > form > button, .action-bar > .dropdown > button {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 9px; border-radius: 10px; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; text-decoration: none;
}
.action-bar > a:hover, .action-bar > form > button:hover, .action-bar > .dropdown > button:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.action-bar .svg-icon { width: 20px; height: 20px; color: var(--primary); stroke-width: 1.6; }
.action-bar .is-disabled { opacity: .45; pointer-events: none; }
.action-bar .dropdown-menu { right: auto; left: 0; }
.action-bar > form { display: contents; }

/* Profile header card */
.profile-card { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius-lg); margin-bottom: 26px; }
.profile-card > summary { list-style: none; cursor: default; }
.profile-card > summary::-webkit-details-marker { display: none; }
.profile-top { display: flex; align-items: flex-start; gap: 20px; padding: 18px 24px 16px; }
.profile-top .avatar.xl { width: 84px; height: 84px; font-size: 26px; box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--primary-ring); }
.profile-top h1 { font-size: 21px; font-weight: 600; margin: 6px 0 10px; }
.profile-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; font-weight: 550; color: var(--text-2); }
.profile-top .edit-link { margin-left: auto; }
.profile-status { display: flex; justify-content: flex-end; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 24px 16px; margin: 0 24px; border-top: 1px solid var(--border); }
.profile-status .toggle { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); cursor: pointer; border: 0; background: none; font: inherit; }
.profile-status .toggle[aria-expanded="true"] .svg-icon { transform: rotate(180deg); }
.profile-status .toggle:hover { background: var(--surface-3); color: var(--text); }
.profile-status .toggle .svg-icon { transition: transform .15s; }
.profile-card[open] .profile-status .toggle .svg-icon { transform: rotate(180deg); }
.detail-grid { margin: 0 24px 20px; border-top: 1px solid var(--border); }
.detail-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.detail-row > div { padding: 10px 0 8px; min-width: 0; }
.detail-row.labels > div { font-size: 13px; font-weight: 600; color: var(--text); padding-top: 14px; }
.detail-row.values { background: var(--zebra); margin: 0 -24px; padding: 0 24px; }
.detail-row.values > div { font-size: 14.5px; color: var(--text-2); word-break: break-word; padding-right: 10px; }

/* Key/value info tables with inline actions */
.kv-table { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius-lg); }
.kv-table > .kv-row:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.kv-table > .kv-row:last-child { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.kv-table.two-col > .kv-row:nth-last-child(2) { border-radius: 0 0 0 var(--radius-lg); }
.kv-table.two-col > .kv-row:last-child { border-radius: 0 0 var(--radius-lg) 0; }
.profile-columns { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.kv-table .kv-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 0 20px; min-height: 56px; }
.kv-table .kv-row:nth-child(even) { background: var(--zebra); }
.kv-table .kv-row > span:first-child { font-size: 14.5px; font-weight: 500; color: var(--text); }
.kv-table .kv-row > span:nth-child(2) { font-size: 14.5px; color: var(--text-2); word-break: break-word; }
.kv-table.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kv-table.two-col .kv-row { grid-template-columns: 130px minmax(0, 1fr) auto; }
.kv-table.two-col .kv-row:nth-child(even) { background: none; }
.kv-table.two-col .kv-row:nth-child(4n+3), .kv-table.two-col .kv-row:nth-child(4n+4) { background: var(--zebra); }
.text-red-strong { color: #e5484d; font-weight: 600; }
.icon-links { display: inline-flex; gap: 12px; align-items: center; }
.icon-links a { color: var(--primary); display: inline-grid; place-items: center; }
.icon-links a.red { color: #e5484d; }
.icon-links .svg-icon { width: 22px; height: 22px; }
.reveal { cursor: pointer; border-bottom: 1px dashed var(--border-strong); }

/* Popover forms attached to pills */
.popover { position: relative; display: inline-block; }
.popover > summary { list-style: none; }
.popover > summary::-webkit-details-marker { display: none; }
.popover-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 280px; padding: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); display: grid; gap: 10px;
}
.popover-panel .help { font-size: 12px; color: var(--muted); }

/* Log table action chips */
.log-chip { display: inline-block; padding: 4px 12px; border-radius: 999px; background: #f97316; color: #fff; font-size: 12.5px; font-weight: 550; white-space: nowrap; }
.card-pager { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--text-2); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1360px) {
  .quick-icons .qi:not(.qi-bell):nth-child(n+5) { display: none; }
}
@media (max-width: 1200px) {
  .stats.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-icons .qi:not(.qi-bell) { display: none; }
  .detail-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kv-table.two-col { grid-template-columns: minmax(0, 1fr); }
  .kv-table.two-col .kv-row:nth-child(n) { background: none; }
  .kv-table.two-col .kv-row:nth-child(even) { background: var(--zebra); }
}
@media (max-width: 1100px) {
  .grid-main, .grid-3, .profile-columns { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-section { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .form-section > h3, .form-section > .form-grid, .form-section > .field, .form-section > .toolbar, .form-section > div:not(.section-intro) { grid-column: 1; }
}
@media (max-width: 900px) {
  .app, body.sidebar-collapsed .app { grid-template-columns: minmax(0, 1fr); }
  body.sidebar-collapsed .sidebar { visibility: visible; }
  .sidebar { position: fixed; left: 0; top: var(--topbar); width: var(--sidebar); transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: var(--topbar) 0 0 0; background: rgba(5, 10, 20, .45); z-index: 35; }
  .appbar { gap: 8px; padding-right: 14px; }
  .appbar-brand { width: auto; padding-left: 14px; }
  .appbar-brand .brand-name, .appbar-brand .brand-sub { display: none; }
  .add-client .label { display: none; }
  .add-client { margin-right: 0; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .auth-card .mobile-brand { display: flex; }
  .topbar { padding: 0 18px; }
  .content { padding: 22px 18px; }
  .profile-top { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  :root { --topbar: 64px; }
  .content { padding: 16px; }
  .appbar .back-btn { display: none; }
  .square-btn, .appbar .search .input, .appbar .search button, .add-client { height: 38px; }
  .square-btn { width: 38px; }
  .appbar .search button { width: 40px; }
  .add-client .plus { width: 38px; }
  .user-chip .avatar { width: 34px; height: 34px; }
  .topbar { padding: 0 12px; gap: 6px; }
  .grid-2, .form-grid, .form-grid.cols-2, .form-section .form-grid { grid-template-columns: minmax(0, 1fr); }
  .stats, .stats.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px; }
  .stat-value { font-size: 20px; }
  .stat .chip { display: none; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .filters .field, .filter-bar .search-input { max-width: none; }
  .filter-bar .select { flex: 1 1 140px; }
  .page-head h1 { font-size: 20px; }
  .impersonate-bar { padding: 8px 12px; font-size: 12.5px; }
  .quote-box { grid-template-columns: minmax(0, 1fr); }
  .donut-wrap { flex-direction: column; align-items: stretch; }
  .donut { margin: 0 auto; }
  .notif-menu { width: calc(100vw - 24px); right: -60px; }
  .detail-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .kv-table .kv-row, .kv-table.two-col .kv-row { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 16px; row-gap: 2px; }
  .kv-table .kv-row > span:first-child { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
  .profile-top { padding: 16px; gap: 14px; }
  .profile-top .avatar.xl { width: 64px; height: 64px; font-size: 21px; }
  .profile-status { margin: 0 16px; padding: 12px 0; justify-content: flex-start; }
  .detail-grid { margin: 0 16px 16px; }
  .detail-row.values { margin: 0 -16px; padding: 0 16px; }
}

/* ---------- Network operations ---------- */
.sparkline { width: 100%; height: 44px; display: block; }
.sparkline polyline { fill: none; stroke-width: 1.6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.sparkline .spark-a { stroke: var(--primary); }
.sparkline .spark-b { stroke: var(--success); }
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; margin-bottom: 20px; }
.health-card { background: var(--surface); border: 1px solid var(--card-border); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.health-card.is-offline { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.health-card .hc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.health-card .hc-head h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.health-card .hc-meta { font-size: 12px; color: var(--muted); }
.hc-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; font-size: 13px; }
.hc-metrics .k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; }
.hc-metrics .v { font-weight: 600; }
.hc-error { font-size: 12.5px; color: var(--danger); background: var(--danger-soft); border-radius: 8px; padding: 8px 10px; word-break: break-word; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.segmented button { padding: 5px 13px; border-radius: 7px; color: var(--muted); font-weight: 550; font-size: 13px; white-space: nowrap; border: 0; background: transparent; cursor: pointer; font-family: inherit; }
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.code-block { background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-family: "Consolas", "Courier New", monospace; font-size: 12.5px; overflow-x: auto; white-space: pre; line-height: 1.6; }

/* ---------- Topology tree & map ---------- */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { margin-left: 14px; padding-left: 14px; border-left: 1px dashed var(--card-border); }
.tree li { padding: 4px 0; }
.tree .node { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; }
.tree .node .svg-icon { width: 15px; height: 15px; color: var(--primary); }
.map-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; margin: 0 4px 10px; color: var(--muted); }
.map-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

/* ---------- Client list ---------- */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--card-border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 550; text-decoration: none; white-space: nowrap; }
.chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.chip .svg-icon { width: 15px; height: 15px; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-count { min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--surface-3); color: var(--text-2); font-size: 11.5px; display: inline-flex; align-items: center; justify-content: center; }
.chip.active .chip-count { background: rgba(255, 255, 255, .25); color: #fff; }
.chip-expired:not(.active) .chip-count, .chip-sync:not(.active) .chip-count { background: var(--danger-soft); color: var(--danger); }
.chip-online:not(.active) .chip-count { background: var(--success-soft); color: var(--success); }
.list-summary { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); align-items: center; }
.list-summary b { color: var(--text); }
.bulk-bar { position: sticky; top: 64px; z-index: 30; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 18px; background: var(--primary-soft); border-top: 1px solid var(--card-border); border-bottom: 1px solid var(--card-border); }
.bulk-bar[hidden] { display: none; }
.bulk-bar .select, .bulk-bar .input { height: 34px; max-width: 220px; }
.bulk-count { font-size: 13.5px; margin-right: 4px; }
.avatar-wrap { position: relative; display: inline-flex; flex: none; }
.presence { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--faint); border: 2px solid var(--surface); }
.presence.on { background: var(--success); }
.days-pill { display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; }
.days-pill.ok { background: var(--success-soft); color: var(--success); }
.days-pill.soon { background: var(--warning-soft); color: var(--warning); }
.days-pill.overdue { background: var(--danger-soft); color: var(--danger); }
.badge.tiny { font-size: 10.5px; padding: 0 6px; margin-left: 4px; height: 18px; }
.plain-link { color: inherit; }
.client-table.compact td { padding-top: 6px; padding-bottom: 6px; }
.client-table.compact .avatar { width: 28px; height: 28px; font-size: 11px; }
.client-table .col-hidden { display: none; }
.client-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; padding: 16px; }
.client-card { border: 1px solid var(--card-border); border-radius: 14px; padding: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.client-card.deactive { border-left: 4px solid var(--danger); }
.client-card.active { border-left: 4px solid var(--success); }
.cc-head { display: flex; align-items: center; gap: 10px; }
.cc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; font-size: 13px; }
.cc-grid span { display: block; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; }
.cc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--border); padding-top: 10px; font-size: 13px; }
.segmented a .svg-icon { width: 16px; height: 16px; }
@media (max-width: 640px) { .bulk-bar { top: 56px; } .bulk-bar .select, .bulk-bar .input { max-width: 100%; flex: 1 1 140px; } }
.client-table td[data-col="area"] { min-width: 190px; }

/* ---------- Dashboard ---------- */
.shortcut-card .card-head { flex-wrap: wrap; gap: 10px; }
.shortcut-tabs { max-width: 100%; }
.shortcut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; padding: 16px 18px 18px; }
.shortcut { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; min-height: 100px; padding: 14px 8px; border-radius: 14px; border: 1px solid var(--card-border);
  background: var(--surface); color: var(--text); text-decoration: none; text-align: center; transition: transform .12s, box-shadow .12s, border-color .12s; }
.shortcut:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--sc); text-decoration: none; }
.shortcut[hidden] { display: none; }
.shortcut-icon { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--sc-soft); color: var(--sc); }
.shortcut-icon .svg-icon { width: 22px; height: 22px; }
.shortcut-label { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.tone-blue { --sc: var(--info); --sc-soft: var(--info-soft); }
.tone-green { --sc: var(--success); --sc-soft: var(--success-soft); }
.tone-amber { --sc: var(--warning); --sc-soft: var(--warning-soft); }
.tone-red { --sc: var(--danger); --sc-soft: var(--danger-soft); }
.tone-violet { --sc: var(--violet); --sc-soft: var(--violet-soft); }
.tone-teal { --sc: var(--primary); --sc-soft: var(--primary-soft); }
.tone-slate { --sc: var(--muted); --sc-soft: var(--surface-3); }
.dash-kpis { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.attention-list { list-style: none; margin: 0; padding: 6px; }
.attention-list a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-size: 13.5px; }
.attention-list a:hover { background: var(--surface-3); text-decoration: none; }
.attention-list .att-icon { width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--sc-soft); color: var(--sc); flex: none; }
.attention-list .att-icon .svg-icon { width: 16px; height: 16px; }
.attention-list b { color: var(--sc); }
.attention-list a > .svg-icon { width: 14px; height: 14px; color: var(--faint); }
.att-clear { display: flex; gap: 8px; align-items: center; padding: 14px; color: var(--success); font-size: 13.5px; }
@media (max-width: 640px) { .shortcut-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px; } .shortcut { min-height: 88px; padding: 10px 4px; } .shortcut-icon { width: 38px; height: 38px; } }

/* ---------- Client list v2 ---------- */
.chip-card { padding: 14px 18px; display: grid; gap: 10px; }
.chip-group { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; align-items: start; }
.chip-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding-top: 9px; }
.chip-card .chip-row { margin: 0; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 14px; padding: 16px 18px; align-items: end; }
.filter-grid .span-2 { grid-column: span 2; }
.filter-grid .field label { font-size: 12px; }
.filter-actions { display: flex; gap: 8px; flex-direction: row; align-items: end; }
.date-range { display: flex; align-items: center; gap: 6px; }
.date-range .input { min-width: 0; padding: 0 8px; }
.date-range span { color: var(--muted); }
.code-tag { display: inline-block; padding: 1px 7px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border); font-family: "Consolas", "Courier New", monospace; font-size: 12px; white-space: nowrap; }
.code-tag.secret { cursor: pointer; }
.ip-tag { display: inline-block; padding: 0 6px; border-radius: 5px; background: var(--info-soft); color: var(--info); font-size: 10.5px; font-weight: 600; }
.online-state { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.online-state.on { color: var(--success); font-weight: 600; }
.icon-actions { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: nowrap; }
.ia { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--ia, var(--border)); background: var(--surface); color: var(--ia, var(--muted)); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; transition: background .12s; flex: none; }
.ia .svg-icon { width: 15px; height: 15px; }
.ia:hover { background: var(--ia-soft, var(--surface-3)); text-decoration: none; }
.ia.is-disabled { opacity: .35; pointer-events: none; }
.ia-view { --ia: var(--muted); }
.ia-edit, .ia-login { --ia: var(--info); --ia-soft: var(--info-soft); }
.ia-disable, .ia-sync { --ia: var(--warning); --ia-soft: var(--warning-soft); }
.ia-enable, .ia-collect { --ia: var(--success); --ia-soft: var(--success-soft); }
.ia-sms, .ia-graph { --ia: var(--violet); --ia-soft: var(--violet-soft); }
.ia-delete { --ia: var(--danger); --ia-soft: var(--danger-soft); }
.client-card .icon-actions { flex-wrap: wrap; }
@media (max-width: 640px) { .chip-group { grid-template-columns: 1fr; gap: 6px; } .chip-title { padding-top: 0; } .filter-grid { grid-template-columns: 1fr 1fr; padding: 12px; } .filter-grid .span-2 { grid-column: 1 / -1; } }
.filter-grid .search-input { position: relative; }
.filter-grid .search-input .svg-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.filter-grid .search-input .input { padding-left: 34px; }

/* ---------- Customer portal v2 ---------- */
.portal-body { background: var(--bg, #f3f7fc); padding-bottom: 70px; }
.pt-header { position: sticky; top: 0; z-index: 40; background: var(--surface); border-bottom: 1px solid var(--card-border); }
.pt-header-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 16px; height: 64px; padding: 0 20px; }
.pt-brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.pt-brand:hover { text-decoration: none; }
.pt-brand b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.pt-brand small { display: block; font-size: 11.5px; color: var(--muted); }
.pt-nav { display: flex; gap: 4px; margin-left: auto; }
.pt-nav a { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-weight: 550; font-size: 13.5px; text-decoration: none; position: relative; }
.pt-nav a .svg-icon { width: 16px; height: 16px; }
.pt-nav a:hover { background: var(--surface-3); text-decoration: none; }
.pt-nav a.active { background: var(--primary-soft); color: var(--primary); }
.pt-dot { min-width: 18px; height: 18px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.pt-actions { display: flex; align-items: center; gap: 6px; }
.pt-user { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 3px 12px 3px 3px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--text); }
.pt-main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 30px; }
.pt-footer { text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 30px; }
.pt-bottom { display: none; }
.pt-page-head { margin: 0 0 18px; }
.pt-page-head h1 { margin: 0; font-size: 24px; }
.pt-page-head p { margin: 4px 0 0; color: var(--muted); }
.pt-profile-head { display: flex; align-items: center; gap: 14px; }
.pt-hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 24px 26px; border-radius: 20px; color: #fff; margin-bottom: 16px;
  background: radial-gradient(circle at 90% 0%, rgba(255,255,255,.18), transparent 45%), linear-gradient(135deg, var(--primary), #05584a); box-shadow: 0 12px 30px color-mix(in srgb, var(--primary) 25%, transparent); }
.pt-hero.off { background: radial-gradient(circle at 90% 0%, rgba(255,255,255,.15), transparent 45%), linear-gradient(135deg, #dc2626, #7f1d1d); box-shadow: 0 12px 30px rgba(220,38,38,.25); }
.pt-hello { font-size: 14px; opacity: .85; }
.pt-hero-status { display: flex; align-items: center; gap: 8px; font-size: 26px; font-weight: 800; margin: 4px 0; }
.pt-led { width: 12px; height: 12px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.3); }
.pt-hero.off .pt-led { background: #fecaca; box-shadow: 0 0 0 4px rgba(254,202,202,.3); }
.pt-hero-pkg { font-size: 15px; font-weight: 600; }
.pt-hero-meta { font-size: 12.5px; opacity: .75; margin-top: 2px; }
.pt-ring { --p: 0; width: 118px; height: 118px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,.22) 0); }
.pt-ring > div { width: 94px; height: 94px; border-radius: 50%; background: rgba(11,63,128,.55); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.pt-hero.off .pt-ring > div { background: rgba(127,29,29,.6); }
.pt-ring b { font-size: 28px; line-height: 1; }
.pt-ring span { font-size: 11px; opacity: .85; margin-top: 3px; }
.pt-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pt-tile { display: block; background: var(--surface); border: 1px solid var(--card-border); border-radius: 16px; padding: 14px 16px; color: var(--text); text-decoration: none; }
a.pt-tile:hover { border-color: var(--primary); text-decoration: none; }
.pt-tile span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pt-tile b { display: block; font-size: 22px; margin: 4px 0 2px; }
.pt-tile small { color: var(--muted); font-size: 12px; }
.pt-tile.warn b { color: var(--danger); }
.pt-tile.good b { color: var(--success); }
.pt-actions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.pt-actions-grid form { margin: 0; }
.pt-action { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border-radius: 16px; border: 1px solid var(--card-border); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; }
.pt-action:hover { border-color: var(--sc); text-decoration: none; }
.pt-action > span { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--sc-soft); color: var(--sc); }
.pt-action .svg-icon { width: 20px; height: 20px; }
.pt-li-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); flex: none; }
.pt-li-icon.good { background: var(--success-soft); color: var(--success); }
.pt-li-icon .svg-icon { width: 16px; height: 16px; }
.pt-package { display: flex; gap: 12px; align-items: center; }
.pt-package > .svg-icon { width: 36px; height: 36px; padding: 8px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); }
.pt-package b { display: block; font-size: 15px; }
.pt-package span { color: var(--muted); font-size: 13px; }
.pt-amount { font-size: 22px; height: 52px; font-weight: 700; }
.pt-quick-amounts, .pt-topics { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.pt-quick-amounts .chip, .pt-topics .chip { cursor: pointer; font-family: inherit; }
.pt-gateways { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.pt-gateway { height: 50px; border-radius: 12px; border: 0; color: #fff; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--primary); }
.pt-gateway.gw-bkash { background: #e2136e; }
.pt-gateway.gw-nagad { background: #f6921e; }
.pt-gateway.gw-sslcommerz { background: #2b6cb0; }
.pt-gateway.gw-aamarpay { background: #0f766e; }
.pt-bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; }
.pt-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.pt-bar span { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; background: var(--primary); opacity: .85; }
.pt-bar small { font-size: 10.5px; color: var(--muted); }
.pt-packages { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pt-pkg { position: relative; cursor: pointer; }
.pt-pkg input { position: absolute; opacity: 0; }
.pt-pkg-body { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; border: 1.5px solid var(--card-border); background: var(--surface); }
.pt-pkg-body span { color: var(--muted); font-size: 12.5px; }
.pt-pkg-body em { font-style: normal; font-weight: 800; color: var(--primary); font-size: 16px; }
.pt-pkg-body small { font-weight: 500; color: var(--muted); font-size: 11px; }
.pt-pkg input:checked + .pt-pkg-body { border-color: var(--primary); background: var(--primary-soft); }
@media (max-width: 980px) {
  .pt-nav { display: none; }
  .pt-actions { margin-left: auto; }
  .pt-bottom { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--card-border); padding: 6px 4px 8px; }
  .pt-bottom a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); text-decoration: none; padding: 4px 0; }
  .pt-bottom a .svg-icon { width: 20px; height: 20px; }
  .pt-bottom a.active { color: var(--primary); font-weight: 700; }
}
@media (max-width: 640px) {
  .pt-header-inner { padding: 0 12px; gap: 8px; }
  .pt-brand b { max-width: 130px; }
  .pt-user > span:not(.avatar) { display: none; }
  .pt-user { padding: 3px; }
  .pt-main { padding: 16px 12px 24px; }
  .pt-hero { padding: 18px; }
  .pt-hero-status { font-size: 21px; }
  .pt-ring { width: 92px; height: 92px; }
  .pt-ring > div { width: 74px; height: 74px; }
  .pt-ring b { font-size: 22px; }
  .pt-tiles { grid-template-columns: 1fr 1fr; }
  .pt-tile b { font-size: 18px; }
  .pt-actions-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---- Portal: pay button, IP card, balance strip ---- */
.pt-pay-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; margin-right: 4px; border-radius: 99px; background: linear-gradient(180deg, #22c55e, #16a34a); color: #fff; font-size: 13px; font-weight: 650; text-decoration: none; box-shadow: 0 8px 18px -10px rgba(22, 163, 74, .8); white-space: nowrap; }
.pt-pay-btn:hover { filter: brightness(1.05); }
.pt-pay-btn .svg-icon { width: 16px; height: 16px; }
@media (max-width: 640px) { .pt-pay-btn { padding: 0 12px; height: 34px; } }
.pt-hero-pay { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; height: 38px; padding: 0 16px; border-radius: 99px; background: #fff; color: color-mix(in srgb, var(--primary-600) 80%, #000); font-size: 13.5px; font-weight: 700; text-decoration: none; box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .45); }
.pt-hero-pay .svg-icon { width: 16px; height: 16px; }
.pt-ip-list { list-style: none; margin: 0; padding: 4px 18px 14px; }
.pt-ip-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.pt-ip-list li:last-child { border-bottom: 0; }
.pt-ip-list span { color: var(--muted); }
.pt-ip-list b { font-weight: 650; text-align: right; word-break: break-all; }
.pt-balance { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.pt-balance > div { background: var(--surface); border: 1px solid var(--card-border); border-radius: 16px; padding: 14px 16px; }
.pt-balance span { display: block; font-size: 12.5px; color: var(--muted); }
.pt-balance b { display: block; font-size: 20px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.pt-balance.due > div:first-child { border-color: rgba(220, 38, 38, .35); background: linear-gradient(180deg, rgba(220, 38, 38, .07), transparent); }
.pt-balance.due > div:first-child b { color: var(--danger); }
.pt-balance.advance > div:first-child { border-color: rgba(22, 163, 74, .35); background: linear-gradient(180deg, rgba(22, 163, 74, .08), transparent); }
.pt-balance.advance > div:first-child b { color: var(--success); }

/* ---------- BW (bandwidth) clients ---------- */
.bw-src-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.bw-src { border: 1px solid var(--card-border); border-radius: 14px; background: var(--surface); padding: 14px; transition: border-color .15s, box-shadow .15s, opacity .15s; }
.bw-src.is-on { border-color: color-mix(in srgb, var(--primary) 45%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent); }
.bw-src:not(.is-on) { opacity: .7; }
.bw-src-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.bw-src-head b { flex: 1; font-size: 15px; }
.bw-src-head .switch { margin: 0; }
.bw-src-amount { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--primary); }
.bw-src-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bw-src-inputs label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.bw-src-inputs .input { height: 38px; }
.bw-total { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 14px 18px; border-radius: 14px; background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 12%, var(--surface)), var(--surface)); border: 1px solid var(--card-border); }
.bw-total span { color: var(--muted); font-size: 13px; }
.bw-total b { font-size: 24px; font-variant-numeric: tabular-nums; }
.bw-total .bw-diff { font-size: 13px; font-weight: 600; }
.bw-diff.up { color: var(--danger); } .bw-diff.down { color: var(--success); }
.bw-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 22px; margin-bottom: 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--card-border); }
.bw-head .avatar { width: 56px; height: 56px; font-size: 20px; }
.bw-head h1 { margin: 0; font-size: 22px; }
.bw-head-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 13px; margin-top: 4px; }
.bw-head-meta span { display: inline-flex; align-items: center; gap: 5px; }
.bw-head-meta .svg-icon { width: 14px; height: 14px; }
.bw-head-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.bw-timeline { list-style: none; margin: 0; padding: 6px 20px 16px; }
.bw-timeline li { position: relative; padding: 12px 0 12px 22px; border-left: 2px solid var(--border); }
.bw-timeline li::before { content: ""; position: absolute; left: -7px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.bw-timeline li.is-future::before { border-color: var(--info); }
.bw-timeline .bw-when { font-weight: 700; }
.bw-items-inline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bw-items-inline span { font-size: 12px; padding: 3px 8px; border-radius: 99px; background: var(--surface-3); }
.ia-bw { --ia: var(--primary); --ia-soft: var(--primary-soft, var(--info-soft)); }
/* ---------- App bar (redesign) ---------- */
.appbar { gap: 12px; padding: 0 20px 0 0; background: color-mix(in srgb, var(--appbar-bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); box-shadow: 0 1px 0 var(--border), 0 8px 24px -18px rgba(15, 40, 80, .35); border-bottom: 0; }
.appbar-nav { display: flex; align-items: center; gap: 4px; flex: none; }
.hb-btn { position: relative; width: 40px; height: 40px; flex: none; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s, border-color .15s; text-decoration: none; }
.hb-btn:hover { background: var(--surface); border-color: var(--border); color: var(--primary); text-decoration: none; }
.hb-btn .svg-icon { width: 20px; height: 20px; }
.hb-bell .svg-icon { width: 21px; height: 21px; }
.hb-btn .count { position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--appbar-bg); line-height: 1; }
.appbar .search { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; min-width: 0; }
.appbar .search .search-ico { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--faint, var(--muted)); pointer-events: none; }
.appbar .search .input { height: 42px; border-radius: 999px; padding: 0 44px 0 42px; border: 1px solid var(--border); background: var(--surface); box-shadow: none; transition: border-color .15s, box-shadow .15s; }
.appbar .search .input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.appbar .search .search-kbd { position: absolute; right: 12px; min-width: 22px; height: 22px; padding: 0 6px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-3); color: var(--muted); font: 600 12px/1 inherit; pointer-events: none; }
.appbar .search .input:focus ~ .search-kbd { display: none; }
.appbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.hb-primary { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px; border-radius: 999px; background: linear-gradient(135deg, var(--primary), var(--primary-600, var(--primary))); color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; box-shadow: 0 8px 18px -10px var(--primary); margin-right: 4px; white-space: nowrap; transition: transform .15s, box-shadow .15s; }
.hb-primary:hover { color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: 0 12px 22px -12px var(--primary); }
.hb-primary .svg-icon { width: 18px; height: 18px; stroke-width: 2.4; }
.user-chip { gap: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); margin-left: 4px; }
.user-chip:hover { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.user-chip .avatar { width: 34px; height: 34px; font-size: 12.5px; box-shadow: none; }
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.user-meta b { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.user-meta small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.user-caret { width: 16px; height: 16px; color: var(--muted); }
.search-toggle { display: none; }
@media (max-width: 1200px) {
  .user-meta, .user-caret { display: none; }
  .user-chip { padding: 3px; }
}
@media (max-width: 1024px) {
  .hb-primary span { display: none; }
  .hb-primary { width: 40px; padding: 0; justify-content: center; margin-right: 0; }
}
@media (max-width: 900px) {
  .appbar { padding-right: 12px; gap: 6px; }
  .appbar-brand { width: auto; padding-left: 12px; }
  .appbar .search .search-kbd { display: none; }
}
@media (max-width: 720px) {
  .appbar .search { display: none; }
  .search-toggle { display: inline-grid; }
  body.search-open .appbar .search { display: flex; position: absolute; left: 10px; right: 10px; top: calc(100% + 8px); max-width: none; z-index: 60; filter: drop-shadow(0 12px 24px rgba(15, 40, 80, .25)); }
  .hide-sm { display: none; }
}
@media (max-width: 640px) {
  .appbar .back-btn { display: none; }
  .hb-btn, .hb-primary { width: 38px; height: 38px; }
  .user-chip .avatar { width: 32px; height: 32px; }
}
/* Customer portal and bandwidth portal headers share the same glass look. */
.pt-header { background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); box-shadow: 0 1px 0 var(--border), 0 8px 24px -18px rgba(15, 40, 80, .35); }
.mini-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--border); }
.mini-header-inner { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.mini-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mini-brand b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-brand small { display: block; font-size: 12px; color: var(--muted); }
.mini-actions { display: flex; align-items: center; gap: 6px; }
@media (max-width: 560px) { .mini-actions .hb-label { display: none; } }
/* App bar layout: search centred on desktop; centred logo and only menu / search / profile on phones. */
.appbar .search { margin: 0 auto; }
.appbar-actions { margin-left: 0; }
@media (max-width: 720px) {
  .appbar { position: sticky; padding: 0 10px; }
  .appbar-nav { order: -1; }
  .appbar-brand { position: absolute; left: 50%; transform: translateX(-50%); width: auto; padding: 0; }
  .appbar-actions { margin-left: auto; }
  .appbar-actions .hb-primary, .appbar-actions .notif-dd, .appbar-actions .theme-btn { display: none; }
}@media (min-width: 1101px) {
  .appbar .search { position: absolute; left: 50%; transform: translateX(-50%); width: min(560px, 34vw); margin: 0; }
  .appbar-actions { margin-left: auto; }
}
/* Uploaded company logo: show the whole logo (no round crop), without repeating the name next to it. */
.appbar-brand.has-logo .brand-mark { width: auto; height: 44px; max-width: 210px; border-radius: 10px; background: transparent; box-shadow: none; padding: 0; }
.appbar-brand.has-logo .brand-mark img { width: auto; height: 100%; max-width: 210px; object-fit: contain; border-radius: 0; }
.appbar-brand.has-logo .brand-text { display: none; }
@media (max-width: 720px) {
  .appbar-brand.has-logo .brand-mark { height: 36px; max-width: 150px; }
  .appbar-brand.has-logo .brand-mark img { max-width: 150px; }
}
/* Profile photos */
.avatar-photo { object-fit: cover; padding: 0; background: var(--surface-3); }
.avatar.avatar-xl { width: 96px; height: 96px; font-size: 30px; border-radius: 50%; }
.profile-photo-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }/* Same for every other header that shows the company logo (customer portal, BW portal, sign-in). */
.brand-mark:has(img) { width: auto; max-width: 190px; height: 40px; border-radius: 10px; background: transparent; box-shadow: none; }
.brand-mark:has(img) img { width: auto; height: 100%; max-width: 190px; object-fit: contain; border-radius: 0; }
@media (max-width: 720px) {
  .appbar-brand.has-logo .brand-mark, .appbar-brand.has-logo .brand-mark img { max-width: min(150px, calc(100vw - 240px)); }
}
/* Customer portal header: full logo, menu that never wraps, icons only when space is short. */
.pt-header-inner, .pt-main { max-width: 1320px; }
.pt-brand { flex: none; }
.pt-brand.has-logo .pt-brand-text { display: none; }
.pt-brand.has-logo .brand-mark { height: 40px; max-width: 190px; }
.pt-nav { flex-wrap: nowrap; min-width: 0; }
.pt-nav a { white-space: nowrap; flex: none; }
.pt-actions { flex: none; }
.pt-user span { white-space: nowrap; }
@media (max-width: 1240px) {
  .pt-nav a .lbl { display: none; }
  .pt-nav a { padding: 0 11px; }
  .pt-nav a.active .lbl { display: inline; }
}
@media (max-width: 1060px) {
  .pt-nav a.active .lbl { display: none; }
}
@media (max-width: 640px) {
  .pt-brand.has-logo .brand-mark { height: 34px; max-width: 130px; }
}/* Phones: profile avatar always visible at the top right. */
.pt-user .avatar { flex: none; }
@media (max-width: 640px) { .pt-user .avatar { width: 32px; height: 32px; display: inline-grid; } }
@media (max-width: 640px) { .pt-brand.has-logo .brand-mark, .pt-brand.has-logo .brand-mark img { max-width: min(130px, calc(100vw - 230px)); height: auto; max-height: 34px; } .pt-header-inner { gap: 6px; } }

/* ---------- Automation engine ---------- */
.auto-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 20px; }
.auto-card { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--card-border); box-shadow: var(--shadow-xs); }
.auto-card.is-off { opacity: .7; }
.auto-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.auto-head b { font-size: 14px; letter-spacing: .04em; text-transform: uppercase; }
.auto-desc { margin: 0; color: var(--text-2); font-size: 14px; }
.auto-meta { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.auto-meta span { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.auto-meta .svg-icon { width: 13px; height: 13px; }
.auto-actions { display: flex; gap: 8px; margin-top: auto; }
.auto-actions form { margin: 0; }
/* ---------- Message templates ---------- */
.tpl-card { margin-bottom: 0; }
.tpl-card.is-off { opacity: .72; }
.tpl-card .textarea { min-height: 96px; font-size: 14px; }
.tpl-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.tpl-test { margin: -6px 0 6px; padding: 0 4px; }.int-card { color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.int-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); text-decoration: none; }
.int-icon { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.int-icon .svg-icon { width: 17px; height: 17px; }
/* ---- Expired page settings ---- */
.exp-steps { margin: 0; padding-left: 38px; line-height: 1.75; }
.exp-steps li { margin-bottom: 8px; }
.exp-steps ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); }
.exp-script { margin: 0; max-height: 340px; overflow: auto; padding: 14px; border-radius: 10px; background: #0f172a; color: #d1e3ff; font: 12px/1.6 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.exp-preview { display: block; width: 100%; height: 560px; border: 0; border-radius: 0 0 12px 12px; background: #f1f5f9; }

/* ---- SaaS owner panel ---- */
.saas-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.saas-stat { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 14px; background: var(--card, #fff); border: 1px solid var(--border); color: inherit; text-decoration: none; }
.saas-stat span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.saas-stat b { font-size: 24px; line-height: 1.2; }
.saas-stat small { font-size: 12px; color: var(--muted); }
.saas-stat.warn b { color: #b54708; }
.saas-stat.good b { color: #067647; }
.saas-slug { display: flex; align-items: stretch; }
.saas-slug .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.saas-slug span { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--border); border-left: 0; border-radius: 0 10px 10px 0; background: var(--soft, #f5f7fb); color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.saas-plans { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.saas-plan.is-off { opacity: .65; }
.saas-plan.is-new { border-style: dashed; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ---- ISP subscription page ---- */
.sub-hero { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; padding: 22px 24px; margin-bottom: 16px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--primary, var(--primary)), color-mix(in srgb, var(--primary, var(--primary)) 55%, #020617)); }
.sub-hero h2 { margin: 2px 0 4px; font-size: 26px; color: #fff; }
.sub-hero p { margin: 0; opacity: .85; font-size: 14px; }
.sub-label { font-size: 12px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; opacity: .8; }
.sub-expiry { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.sub-expiry b { font-size: 22px; }
.sub-days { padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-size: 12.5px; font-weight: 700; }
.sub-days.is-low { background: #fee4e2; color: #b42318; }
.sub-usage { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.sub-meter { padding: 14px 16px; margin: 0; }
.sub-meter-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13.5px; color: var(--muted); }
.sub-meter-top span { display: inline-flex; align-items: center; gap: 6px; }
.sub-meter-top b { color: var(--text); font-size: 18px; }
.sub-meter-top small { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.sub-bar { height: 8px; border-radius: 999px; background: var(--soft, #eef2f7); overflow: hidden; }
.sub-bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary, var(--primary)); }
.sub-bar i.warn { background: #f79009; }
.sub-title { margin: 6px 0 12px; font-size: 16px; }
.sub-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-bottom: 18px; }
.sub-plan { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1.5px solid var(--border); border-radius: 16px; background: var(--card, #fff); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.sub-plan input { position: absolute; top: 16px; right: 16px; accent-color: var(--primary, var(--primary)); width: 18px; height: 18px; }
.sub-plan:has(input:checked) { border-color: var(--primary, var(--primary)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary, var(--primary)) 14%, transparent); }
.sub-plan-name { font-weight: 700; font-size: 16px; }
.sub-plan-name em { margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #dcfae6; color: #067647; font-style: normal; font-size: 11px; }
.sub-plan-price { font-size: 24px; font-weight: 800; color: var(--primary, var(--primary)); }
.sub-plan-price small { font-size: 13px; font-weight: 600; color: var(--muted); }
.sub-plan ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.sub-gws { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 6px; }
.sub-total { font-weight: 800; font-size: 18px; color: var(--primary, var(--primary)); margin-right: auto; }
.sub-banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; margin-bottom: 14px; border-radius: 12px; background: #fffaeb; color: #93370d; font-size: 14px; }
.sub-banner.is-danger { background: #fef3f2; color: #b42318; }
.sub-banner a { margin-left: auto; font-weight: 700; color: inherit; }
@media (max-width: 640px) { .form-grid.cols-3 { grid-template-columns: 1fr; } .sub-expiry { align-items: flex-start; } }

/* ==== SaaS owner panel theme ==== */
.saas-ui {
  --sidebar-bg: linear-gradient(180deg, #052e28 0%, #063d35 60%, #074a40 100%);
  --nav-border: rgba(255, 255, 255, .06); --nav-text: #a3d3c8; --nav-text-strong: #fff; --nav-hover: rgba(255, 255, 255, .06);
  --nav-active: linear-gradient(90deg, var(--primary), #059669); --nav-accent: #fff; --nav-section: #6aa598;
  --so-blue: var(--primary); --so-cyan: #34d399;
  background: var(--bg);
}
.saas-ui .sidebar { background: var(--sidebar-bg); }
.saas-ui .nav-single.active { box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--primary) 80%, transparent); }
.saas-ui .nav-single .pill { font-size: 11px; padding: 1px 8px; }
.saas-ui .nav-section { color: var(--nav-section); }
.saas-ui .brand-mark { border-radius: 12px; background: linear-gradient(135deg, var(--so-blue), var(--so-cyan)); box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--primary) 70%, transparent); }
.saas-ui .brand-mark .svg-icon { width: 20px; height: 20px; }
.saas-ui .appbar { background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(10px); }
.so-side-card { display: flex; align-items: center; gap: 10px; margin: 0 14px 16px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); color: #fff; }
.so-side-card b { display: block; font-size: 13.5px; }
.so-side-card small { color: #86bfb2; font-size: 12px; }
.so-side-card a { margin-left: auto; color: #86bfb2; display: grid; place-items: center; }
.so-side-card a:hover { color: #fff; }
.so-side-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: color-mix(in srgb, var(--primary) 30%, transparent); color: #9be8da; }

.so-hero { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 26px 28px; margin-bottom: 18px; border-radius: 20px; color: #fff;
  background: radial-gradient(600px 240px at 90% -40%, rgba(52, 211, 153, .55), transparent 60%), linear-gradient(120deg, var(--primary-600), #046b5a 60%, #033d33); box-shadow: 0 24px 48px -30px color-mix(in srgb, var(--primary) 80%, transparent); }
.so-hero::after { content: ""; position: absolute; right: -60px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, .06); }
.so-hero h1 { margin: 4px 0 6px; font-size: 26px; color: #fff; }
.so-hero p { margin: 0; color: #c4ece3; }
.so-hero-kicker { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #9be8da; }
.so-hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.so-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 700; font-size: 14px; text-decoration: none !important; }
.so-btn .svg-icon { width: 18px; height: 18px; }
.so-btn-white { background: #fff; color: var(--primary-600); }
.so-btn-glass { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .25); }

.so-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.so-stat { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none !important; transition: transform .15s, box-shadow .15s; }
.so-stat:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -26px rgba(15, 23, 42, .45); }
.so-stat-icon { flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 15px; }
.so-stat-icon .svg-icon { width: 24px; height: 24px; }
.so-stat-icon.blue { background: #dcf4ee; color: var(--primary); }
.so-stat-icon.green { background: #dcfce7; color: #16a34a; }
.so-stat-icon.orange { background: #ffedd5; color: #ea580c; }
.so-stat-icon.violet { background: #ede9fe; color: #7c3aed; }
.so-stat small { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.so-stat b { display: block; font-size: 24px; line-height: 1.25; color: var(--text); }
.so-stat em { font-style: normal; font-size: 12px; color: var(--muted); }
.so-stat em.up { color: #16a34a; font-weight: 700; }
.so-stat em.down { color: #dc2626; font-weight: 700; }

.so-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.so-span-2 { grid-column: span 2; }
.so-card { padding: 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); min-width: 0; margin-bottom: 16px; }
.so-grid .so-card { margin-bottom: 0; }
.so-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.so-card-head h3 { margin: 0; font-size: 16px; }
.so-card-head span { font-size: 12.5px; color: var(--muted); }
.so-big { font-size: 22px; }
.so-link { font-size: 13px; font-weight: 700; white-space: nowrap; }
.so-empty { display: flex; align-items: center; gap: 8px; margin: 0; padding: 20px 4px; color: var(--muted); font-size: 14px; }
.so-empty .svg-icon { color: #16a34a; }

.so-chart { display: flex; align-items: flex-end; gap: 14px; height: 210px; padding: 0 4px; }
.so-bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.so-bar { width: 100%; max-width: 54px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, #b4e8dc, #dff5ef); transition: height .4s; }
.so-bar.is-now { background: linear-gradient(180deg, var(--primary), #34d399); box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--primary) 80%, transparent); }
.so-bar-col small { font-size: 12px; font-weight: 600; color: var(--muted); }
.so-bar-val { font-size: 11.5px; font-weight: 700; color: var(--text); min-height: 16px; }

.so-donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.so-donut { position: relative; width: 150px; height: 150px; border-radius: 50%; }
.so-donut span { position: absolute; inset: 24px; border-radius: 50%; background: var(--surface); display: grid; place-content: center; text-align: center; }
.so-donut b { font-size: 26px; line-height: 1; }
.so-donut small { color: var(--muted); font-size: 12px; }
.so-legend { width: 100%; margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.so-legend li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.so-legend i { width: 10px; height: 10px; border-radius: 3px; }
.so-legend b { margin-left: auto; }

.so-list { display: grid; gap: 4px; }
.so-item { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: 12px; color: inherit; text-decoration: none !important; }
.so-item:hover { background: var(--surface-2); }
.so-item-main { flex: 1; min-width: 0; }
.so-item-main b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-item-main small { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-item-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.so-item-end b { font-size: 14px; }
.so-avatar { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-600); font-weight: 800; font-size: 14px; }
.so-avatar.violet { background: #ede9fe; color: #6d28d9; }
.so-avatar.lg { width: 46px; height: 46px; font-size: 16px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), #34d399); color: #fff; }
.so-chip-btn { border: 0; padding: 5px 12px; border-radius: 999px; background: #dcf4ee; color: var(--primary-600); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; text-decoration: none !important; }
.so-chip-btn:hover { background: var(--primary); color: #fff; }
.so-days { padding: 4px 10px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.so-days.is-soon { background: #ffedd5; color: #c2410c; }
.so-days.is-late { background: #fee2e2; color: #b91c1c; }

.so-isps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.so-isp { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 16px; border: 1px solid var(--border); color: inherit; text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.so-isp:hover { border-color: #b4e8dc; transform: translateY(-2px); box-shadow: 0 18px 36px -28px color-mix(in srgb, var(--primary) 60%, transparent); }
.so-isp-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.so-isp b { font-size: 15px; }
.so-isp small { color: var(--muted); font-size: 12.5px; }
.so-isp-foot { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--muted); }

.saas-ui .card { border-radius: 18px; border-color: #e6ecf5; box-shadow: none; }
.saas-ui .saas-stat { border-radius: 18px; border-color: #e6ecf5; }

@media (max-width: 1100px) { .so-stats { grid-template-columns: repeat(2, 1fr); } .so-grid { grid-template-columns: 1fr 1fr; } .so-span-2 { grid-column: span 2; } }
@media (max-width: 700px) {
  .so-stats, .so-grid { grid-template-columns: 1fr; }
  .so-span-2 { grid-column: auto; }
  .so-hero { padding: 20px; }
  .so-hero h1 { font-size: 21px; }
  .so-chart { gap: 8px; height: 170px; }
}
.so-hero-isp-main { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; min-width: 0; }
.so-hero-isp .so-avatar.lg { width: 58px; height: 58px; font-size: 19px; border-radius: 18px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); }
.so-hero-isp h1 { font-size: 23px; }
.so-row-isp { display: flex; align-items: center; gap: 12px; text-decoration: none !important; color: inherit; }
.so-row-isp b { display: block; color: var(--text); }
.so-row-isp small { display: block; color: var(--muted); font-size: 12.5px; }
.saas-ui .table thead th { background: #f5f8fd; color: var(--muted); }
.so-steps { margin: 0 0 12px; padding-left: 22px; display: grid; gap: 10px; line-height: 1.6; }
.so-steps code, .so-card code { padding: 1px 6px; border-radius: 6px; background: var(--surface-3); font-size: 12.5px; }

/* ---- Client import ---- */
.imp-drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 20px; border: 2px dashed var(--border-strong, #cbd5e1); border-radius: 16px; background: var(--surface, #f8fafc); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.imp-drop:hover, .imp-drop.is-over { border-color: var(--primary); background: var(--primary-soft, #ebf7f4); }
.imp-drop.has-file { border-style: solid; border-color: #16a34a; background: #f0fdf4; }
.imp-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.imp-drop-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--primary-soft, #dcf4ee); color: var(--primary); }
.imp-drop-icon .svg-icon { width: 26px; height: 26px; }
.imp-drop b { font-size: 15px; }
.imp-drop small { color: var(--muted); }
.imp-steps { margin: 0; padding-left: 36px; display: grid; gap: 8px; line-height: 1.6; }
.imp-fields { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-strong { border-color: var(--primary) !important; color: var(--primary) !important; font-weight: 700; }
.imp-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.imp-counts div { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--card, #fff); }
.imp-counts b { display: block; font-size: 26px; line-height: 1.2; }
.imp-counts span { font-size: 13px; color: var(--muted); }
.imp-counts .ok b { color: #16a34a; }
.imp-counts .bad b { color: #dc2626; }
.imp-counts .info b { color: var(--primary); }
.imp-errors { display: grid; gap: 4px; max-height: 360px; overflow: auto; font-size: 13.5px; }
.imp-errors > div { padding: 7px 10px; border-radius: 8px; background: #fef2f2; color: #991b1b; }
.imp-errors.warn > div { background: #fffbeb; color: #92400e; }
.imp-errors .mono { display: inline-block; min-width: 64px; font-weight: 700; }
.imp-map { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 18px; }
.imp-map-row { display: grid; grid-template-columns: minmax(96px, .8fr) 1.4fr; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.imp-map-row.is-set { background: #f0fdf4; }
.imp-map-row.is-required:not(.is-set) { background: #fef2f2; }
.imp-map-row span { font-size: 13.5px; font-weight: 600; }
.imp-map-row em { color: #dc2626; font-style: normal; margin-left: 2px; }
.imp-map-row .select { height: 36px; }
.imp-row-bad td { background: #fef2f2 !important; }
@media (max-width: 760px) { .imp-map { grid-template-columns: 1fr; } .imp-counts { grid-template-columns: 1fr; } }
.sms-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; margin-bottom: 14px; border-radius: 16px; background: var(--primary-soft); border: 1px solid #c7efe4; }
.sms-balance b { display: block; font-size: 34px; line-height: 1.15; color: color-mix(in srgb, var(--primary-600) 80%, #000); }
.sms-balance small, .sms-note small { display: block; font-size: 12.5px; color: var(--muted); }
.sms-note { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; max-width: 420px; text-align: right; }
@media (max-width: 640px) { .sms-note { align-items: flex-start; text-align: left; } }
.plan-card.is-off { opacity: .7; }
.plan-card.is-new { border-style: dashed; }
.plan-card-body { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 24px; }
.plan-card-fields { display: grid; gap: 10px; align-content: start; }
.plan-mods { padding: 14px 16px; border-radius: 14px; background: #f8fafd; border: 1px solid #e6ecf5; align-self: start; }
.plan-mods label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.plan-mods input { width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.plan-mods-all { padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px dashed #dbe3ef; }
.plan-mods-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 9px 14px; margin-bottom: 10px; }
.plan-mods small { display: block; font-size: 12px; }
@media (max-width: 900px) { .plan-card-body { grid-template-columns: 1fr; } }
.sub-mods { font-size: 12.5px; color: var(--muted); }
.sub-mods summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.owner-logo { display: flex; align-items: center; gap: 12px; }
.owner-logo img { height: 46px; max-width: 160px; object-fit: contain; padding: 4px 8px; border-radius: 10px; background: #fff; border: 1px solid #e6ecf5; }
.saas-ui .appbar-brand.has-logo .brand-mark { background: transparent; box-shadow: none; border-radius: 0; }
/* Logos in the headers: always vertically centred in the bar, never squeezed. */
.appbar-brand.has-logo { align-self: stretch; align-items: center; }
.appbar-brand.has-logo .brand-mark { display: flex; align-items: center; height: 46px; max-width: 220px; }
.appbar-brand.has-logo .brand-mark img { display: block; height: 100%; width: auto; max-width: 220px; object-fit: contain; object-position: left center; }
@media (max-width: 720px) { .appbar-brand.has-logo .brand-mark { height: 30px; } .appbar-brand.has-logo .brand-mark, .appbar-brand.has-logo .brand-mark img { max-width: min(140px, calc(100vw - 230px)); } }
/* Profile photo picker (portal profile, owner profile) */
.pt-photo { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; }
.pt-photo-pick { position: relative; cursor: pointer; display: block; border-radius: 50%; }
.pt-photo-pick .avatar { transition: filter .15s; }
.pt-photo-pick:hover .avatar { filter: brightness(.85); }
.pt-photo-edit { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; border: 2px solid var(--card, #fff); }
.pt-photo-edit .svg-icon { width: 14px; height: 14px; }
.pt-photo-remove { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
.pt-photo-remove:hover { color: #dc2626; }
.avatar-photo { object-fit: cover; }

/* ---- Live client search ---- */
.live-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 70; max-height: min(70vh, 460px); overflow-y: auto; padding: 6px; border-radius: 16px; background: var(--card, #fff); border: 1px solid var(--border); box-shadow: 0 24px 48px -20px rgba(15, 40, 35, .35); }
.live-results[hidden] { display: none; }
.live-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; color: var(--text); text-decoration: none !important; }
.live-item:hover, .live-item.is-active { background: var(--primary-soft); }
.live-avatar { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 13px; }
.live-main { flex: 1; min-width: 0; }
.live-main b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-main small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.live-side small { font-size: 11.5px; color: #dc2626; font-weight: 600; }
.live-status { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: capitalize; background: #eef2f6; color: var(--muted); }
.live-status.s-active { background: #dcfce7; color: #15803d; }
.live-status.s-deactive { background: #fee2e2; color: #b91c1c; }
.live-empty { padding: 14px 12px; font-size: 13.5px; color: var(--muted); }
.live-all { display: block; margin-top: 4px; padding: 10px 12px; border-top: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--primary); text-decoration: none !important; }
.live-all:hover { background: var(--primary-soft); border-radius: 0 0 12px 12px; }

/* Mobile: the centred logo also sits in the vertical middle of the bar. */
@media (max-width: 720px) {
  .appbar-brand { top: 0; bottom: 0; display: flex; align-items: center; }
  .appbar-brand.has-logo .brand-mark { margin: 0; }
}

/* ---- Client profile (view client) ---- */
.crumbs-line { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; display: flex; gap: 6px; align-items: center; }
.crumbs-line a { color: var(--muted); }
.crumbs-line b { color: var(--text); font-weight: 600; }
.cp-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 20px; align-items: start; }
.cp-side, .cp-main { display: grid; gap: 16px; min-width: 0; }
.cp-hero { background: linear-gradient(135deg, #0f2233 0%, #12343f 55%, #0b5b52 100%); color: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 10px 28px rgba(15, 34, 51, .22); }
.cp-hero-top { display: flex; gap: 14px; align-items: center; }
.cp-hero-top h1 { margin: 0; font-size: 21px; line-height: 1.2; color: #fff; word-break: break-word; }
.cp-hero .cp-hero-avatar { width: 62px; height: 62px; border-radius: 14px; font-size: 24px; flex: none; background: #fff; color: var(--primary); }
.cp-hero img.cp-hero-avatar { object-fit: cover; }
.cp-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; font-size: 13px; color: rgba(255, 255, 255, .78); }
.cp-hero-edit { margin-left: auto; align-self: flex-start; color: rgba(255, 255, 255, .8); padding: 6px; border-radius: 8px; }
.cp-hero-edit:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.cp-hero-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, .14); margin-top: 16px; padding-top: 14px; }
.cp-hero-ledger { font-size: 14px; color: rgba(255, 255, 255, .85); }
.cp-hero-ledger b { color: #6ee7b7; font-size: 15px; }
.cp-hero-ledger b.is-due { color: #fca5a5; }
.cp-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600; line-height: 1.4; }
.cp-chip.is-on { background: #16a34a; color: #fff; }
.cp-chip.is-off { background: #e5484d; color: #fff; }
.cp-chip.is-gray { background: rgba(255, 255, 255, .2); color: #fff; }
.cp-chip.is-light { background: #fff; color: #1b2534; }
.cp-dot { width: 8px; height: 8px; border-radius: 50%; background: #98a2b3; }
.cp-chip.is-online .cp-dot { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .2); }
.cp-chip.is-offline .cp-dot { background: #e5484d; }
.cp-title { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--primary); }
.cp-title .svg-icon { width: 17px; height: 17px; }
.cp-side > .cp-title { margin: 6px 0 -6px; }
.cp-title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cp-link { background: none; border: 0; color: var(--primary); font-size: 13px; cursor: pointer; padding: 2px 4px; }
.cp-link:hover { text-decoration: underline; }
.cp-list { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); overflow: hidden; }
.cp-row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.cp-row:last-child { border-bottom: 0; }
.cp-row-main { min-width: 0; flex: 1; display: grid; gap: 2px; }
.cp-row-main small, .cp-tile small { color: var(--muted); font-size: 12.5px; }
.cp-row-main b, .cp-tile b { color: var(--text); font-size: 14.5px; font-weight: 600; word-break: break-word; }
.cp-row-main b small { font-weight: 500; }
.cp-ico { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--primary); }
.cp-ico .svg-icon { width: 17px; height: 17px; }
.cp-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px; display: grid; gap: 14px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.cp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cp-tiles.cols-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cp-tile { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 0 -1px -1px 0; min-width: 0; }
.cp-tile > div { display: grid; gap: 3px; min-width: 0; }
.cp-tile .cp-ico { background: var(--surface); }
.cp-eye { width: 15px; height: 15px; color: var(--muted); vertical-align: middle; }
.cp-note { margin: -6px 0 0; font-size: 12.5px; color: var(--muted); }
.cp-traffic { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.cp-traffic-item { display: flex; gap: 14px; align-items: center; }
.cp-traffic-item > div { display: grid; gap: 2px; }
.cp-traffic-item small { color: var(--muted); font-size: 12.5px; }
.cp-traffic-item b { font-size: 18px; color: var(--text); }
.cp-ring { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; border: 2px solid currentColor; flex: none; }
.cp-traffic-item.is-up .cp-ring { color: var(--violet); }
.cp-traffic-item.is-down .cp-ring { color: var(--success); }
.cp-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.cp-actions > form, .cp-actions > .dropdown { display: block; margin: 0; }
.cp-act { --tone: var(--text-2); width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 12px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  color: var(--tone); background: var(--surface); border: 1px solid var(--border-strong); transition: background .15s, box-shadow .15s; }
.cp-act:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(16, 24, 40, .08); background: color-mix(in srgb, var(--tone) 8%, var(--surface)); }
.cp-act .svg-icon { width: 17px; height: 17px; }
.cp-act[class*="tone-"] { background: color-mix(in srgb, var(--tone) 9%, var(--surface)); border-color: color-mix(in srgb, var(--tone) 32%, var(--surface)); }
.cp-act[class*="tone-"]:hover { background: color-mix(in srgb, var(--tone) 16%, var(--surface)); }
.cp-act.tone-blue { --tone: #2f80d1; }
.cp-act.tone-red { --tone: var(--danger); }
.cp-act.tone-green { --tone: var(--success); }
.cp-act.tone-teal { --tone: var(--primary); }
.cp-act.tone-violet { --tone: var(--violet); }
.cp-act.tone-amber { --tone: #c27803; }
@media (max-width: 1100px) { .cp-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .cp-panel { padding: 14px; }
  .cp-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cp-act { font-size: 13px; padding: 8px; }
  .cp-tiles, .cp-tiles.cols-2 { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Live search on any client search box ---- */
.has-live, .search-input { position: relative; }
.search-input > .svg-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
.search-input > .input { padding-left: 34px; width: 100%; }
.has-live .live-results .svg-icon { position: static; transform: none; }
.live-head { padding: 8px 12px 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.filter-bar .has-live .live-results, .field .has-live .live-results { min-width: min(420px, 92vw); }
@media (max-width: 640px) {
  .filter-bar .has-live .live-results, .field .has-live .live-results { min-width: 0; left: 0; right: 0; }
}

/* ---- Website text editor (owner + ISP) ---- */
.le-form { display: grid; gap: 12px; }
.le-bar { position: sticky; top: 64px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 6px 18px rgba(16, 24, 40, .06); }
.le-bar b { display: block; font-size: 15px; }
.le-bar small { color: var(--muted); font-size: 12.5px; }
.le-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.le-section { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.le-section > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; font-weight: 700; font-size: 15px; color: var(--text); }
.le-section > summary::-webkit-details-marker { display: none; }
.le-section > summary .svg-icon { width: 18px; height: 18px; color: var(--muted); transition: transform .15s; }
.le-section[open] > summary { border-bottom: 1px solid var(--border); background: var(--surface-2); }
.le-section[open] > summary .svg-icon { transform: rotate(180deg); }
.le-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; padding: 16px 18px 18px; }
.le-full { grid-column: 1 / -1; }
.le-lines { font-size: 13px; line-height: 1.55; white-space: pre; overflow-x: auto; }
.le-foot { display: flex; justify-content: flex-end; }
@media (max-width: 640px) { .le-bar { top: 56px; } .le-grid { grid-template-columns: minmax(0, 1fr); padding: 12px; } .le-lines { white-space: pre-wrap; } }

/* ---- Owner settings page ---- */
.st-hero-main { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; min-width: 0; }
.st-hero-logo { width: 64px; height: 64px; flex: none; border-radius: 16px; background: #fff; display: grid; place-items: center; overflow: hidden; padding: 6px; color: var(--primary); }
.st-hero-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.st-hero-logo .svg-icon { width: 28px; height: 28px; }
.st-hero-facts { position: relative; z-index: 1; display: flex; gap: 10px; flex-wrap: wrap; }
.st-hero-facts > div { min-width: 92px; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); color: #fff; display: grid; }
.st-hero-facts b { font-size: 17px; }
.st-hero-facts small { color: #c4ece3; font-size: 12px; }
.st-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.st-nav { position: sticky; top: 80px; display: grid; gap: 4px; padding: 10px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.st-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: 14px; text-decoration: none; }
.st-nav a:hover { background: var(--primary-soft); color: var(--primary); }
.st-nav .svg-icon { width: 17px; height: 17px; color: var(--primary); }
.st-main, .st-stack { display: grid; gap: 16px; min-width: 0; }
.st-main .so-card { margin: 0; scroll-margin-top: 80px; }
.st-card-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.st-card-head h3 { margin: 0 0 3px; font-size: 16.5px; }
.st-card-head p { margin: 0; font-size: 13px; color: var(--muted); }
.st-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.st-ico .svg-icon { width: 19px; height: 19px; }
.st-logo-row { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.st-logo-box { width: 220px; max-width: 100%; height: 96px; border-radius: 14px; border: 1px dashed var(--border-strong); background: var(--surface-2); display: grid; place-items: center; padding: 10px; }
.st-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.st-save { display: flex; justify-content: flex-end; }
.st-gateways { display: grid; gap: 10px; }
.st-gateway { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.st-gateway > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 13px 16px; background: var(--surface-2); }
.st-gateway > summary::-webkit-details-marker { display: none; }
.st-gateway > summary .svg-icon { width: 17px; height: 17px; color: var(--muted); margin-left: 4px; transition: transform .15s; }
.st-gateway[open] > summary .svg-icon { transform: rotate(180deg); }
.st-gw-name { font-weight: 700; margin-right: auto; }
.st-gw-form { padding: 16px; }
.st-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.st-profile { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
@media (max-width: 960px) {
  .st-layout { grid-template-columns: minmax(0, 1fr); }
  .st-nav { position: static; display: flex; overflow-x: auto; gap: 6px; padding: 8px; scrollbar-width: none; }
  .st-nav a { white-space: nowrap; flex: none; padding: 8px 12px; }
}
@media (max-width: 560px) {
  .st-hero-facts > div { min-width: 0; flex: 1; }
  .st-two { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Owner cron page ---- */
.cr-state { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; font-weight: 700; background: rgba(229, 72, 77, .18); color: #fff; border: 1px solid rgba(255, 255, 255, .25); }
.cr-state.is-on { background: rgba(22, 163, 74, .3); }
.cr-dot { width: 10px; height: 10px; border-radius: 50%; background: #fca5a5; }
.cr-state.is-on .cr-dot { background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, .25); }
.cr-copy { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.cr-copy code { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; padding: 10px 12px !important; border-radius: 10px; background: #0f2233 !important; color: #d1fae5; font-size: 12.5px; }
@media (max-width: 560px) { .cr-copy { flex-direction: column; align-items: stretch; } }
.so-steps > li { min-width: 0; overflow-wrap: anywhere; }
.so-card code { overflow-wrap: anywhere; }

/* ---- Responsive safety net (phones, tablets, big screens) ---- */
img, video { max-width: 100%; height: auto; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.btn-row, .toolbar, .bulk-bar, .filter-bar, .page-head .actions { flex-wrap: wrap; }
.dropdown-menu { max-width: calc(100vw - 24px); }
.input, .select, .textarea { max-width: 100%; }
@media (max-width: 900px) {
  .form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bulk-bar { position: sticky; bottom: 8px; z-index: 20; }
}
@media (max-width: 640px) {
  .form-grid.cols-3, .le-grid { grid-template-columns: minmax(0, 1fr); }
  .bulk-bar > .select, .bulk-bar > .input { flex: 1 1 100%; max-width: none !important; }
  .page-head .actions > .btn { flex: 1 1 auto; justify-content: center; }
  .card-head { flex-wrap: wrap; gap: 8px; }
  .filter-bar > .select, .filter-bar > .btn { flex: 1 1 calc(50% - 8px); }
}
@media (max-width: 380px) {
  .stats, .stats.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .cp-actions { grid-template-columns: minmax(0, 1fr); }
  .so-hero h1 { font-size: 21px; }
}
@media (min-width: 1600px) {
  .cp-layout { grid-template-columns: 400px minmax(0, 1fr); }
}

/* ---- Client list: summary tiles + status tabs ---- */
.cl-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.cl-kpi { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; min-width: 0; }
.cl-kpi:hover { border-color: var(--primary); box-shadow: 0 8px 22px -14px color-mix(in srgb, var(--primary) 55%, transparent); transform: translateY(-1px); }
.cl-kpi.is-on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.cl-kpi > div { display: grid; min-width: 0; }
.cl-kpi small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.cl-kpi b { font-size: 24px; line-height: 1.2; letter-spacing: -.02em; }
.cl-kpi em { font-style: normal; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-kpi-ico { width: 46px; height: 46px; flex: none; border-radius: 14px; display: grid; place-items: center; }
.cl-kpi-ico .svg-icon { width: 22px; height: 22px; }
.k-teal { background: var(--primary-soft); color: var(--primary); }
.k-green { background: var(--success-soft); color: var(--success); }
.k-amber { background: var(--accent-soft); color: #c27803; }
.k-red { background: var(--danger-soft); color: var(--danger); }
.cl-card { padding-top: 0; }
.cl-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin; margin: 0 -20px 16px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.cl-tab { display: inline-flex; align-items: center; gap: 7px; flex: none; padding: 14px 10px 12px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; text-decoration: none !important; white-space: nowrap; }
.cl-tab .svg-icon { width: 16px; height: 16px; }
.cl-tab:hover { color: var(--text); }
.cl-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.cl-tab-n { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 11.5px; text-align: center; }
.cl-tab.active .cl-tab-n { background: var(--primary); color: #fff; }
.cl-tab.is-warn .cl-tab-n { background: var(--danger-soft); color: var(--danger); }
.cl-tab.is-warn.active .cl-tab-n { background: var(--danger); color: #fff; }
@media (max-width: 1100px) { .cl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .cl-kpis { gap: 10px; }
  .cl-kpi { padding: 12px; gap: 10px; }
  .cl-kpi-ico { width: 38px; height: 38px; border-radius: 11px; }
  .cl-kpi b { font-size: 20px; }
  .cl-tabs { margin: 0 -14px 12px; padding: 0 10px; }
}
.cl-tabs { scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.cl-tabs::-webkit-scrollbar { display: none; }
.cl-filter-toggle { display: none; }
@media (max-width: 640px) {
  .cl-filters .filter-grid > .field:not(.span-2):not(.filter-actions), .cl-filters .filter-more { display: none; }
  .cl-filters.open .filter-grid > .field, .cl-filters.open .filter-more { display: block; }
  .cl-filters .filter-actions { display: flex; gap: 8px; }
  .cl-filter-toggle { display: inline-flex; }
}

/* ---- Owner panel colours in dark mode ---- */
:root[data-theme="dark"] .so-stat-icon.orange, :root[data-theme="dark"] .so-days.is-soon { background: rgba(234, 88, 12, .18); color: #fdba74; }
:root[data-theme="dark"] .so-stat-icon.violet, :root[data-theme="dark"] .so-avatar.violet { background: rgba(124, 58, 237, .2); color: #c4b5fd; }
:root[data-theme="dark"] .so-days.is-late { background: rgba(229, 72, 77, .2); color: #fca5a5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .so-stat-icon.orange, :root:not([data-theme="light"]) .so-days.is-soon { background: rgba(234, 88, 12, .18); color: #fdba74; }
  :root:not([data-theme="light"]) .so-stat-icon.violet, :root:not([data-theme="light"]) .so-avatar.violet { background: rgba(124, 58, 237, .2); color: #c4b5fd; }
  :root:not([data-theme="light"]) .so-days.is-late { background: rgba(229, 72, 77, .2); color: #fca5a5; }
}

/* ---- Customer portal on phones ---- */
@media (max-width: 520px) {
  .pt-header-inner { gap: 6px; padding: 0 10px; height: 58px; }
  .pt-brand { flex: 1 1 auto; min-width: 0; }
  .pt-brand-text { min-width: 0; }
  .pt-brand b { max-width: 100%; }
  .pt-brand-text small { display: none; }
  .pt-brand.has-logo .brand-mark { height: 30px; max-width: 110px; }
  .pt-actions { flex: none; gap: 4px; margin-left: 0; }
  .pt-actions a.icon-btn[href^="tel:"] { display: none; } /* "Call us" is on the home page */
  .pt-actions .icon-btn { width: 34px; height: 34px; }
  .pt-pay-btn { height: 34px; padding: 0 11px; margin-right: 0; font-size: 13px; }
  .pt-actions-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .pt-actions-grid > *, .pt-actions-grid form > button { min-width: 0; padding: 10px 4px !important; font-size: 11.5px; line-height: 1.25; }
  .pt-tiles { gap: 10px; }
  .pt-main { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 360px) {
  .pt-pay-btn span { display: none; }
  .pt-pay-btn { width: 34px; padding: 0; justify-content: center; }
  .pt-actions-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .pt-balance { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px !important; }
  .pt-balance > div { padding: 10px !important; min-width: 0; }
  .pt-balance > div span { font-size: 11px; }
  .pt-balance > div b { font-size: 15px !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
}
.wp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 14px; }
.wp-item { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); min-width: 0; }
.wp-item b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-thumb { height: 110px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(160deg, #f0fbf8, var(--primary-soft)); color: var(--muted); font-size: 12px; }
.wp-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---- Customer portal header on phones: menu left, logo centre, Pay right ---- */
.pt-menu { display: none; }
.pt-menu-btn { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--primary-soft); cursor: pointer; display: grid; place-items: center; align-content: center; gap: 4px; padding: 0; }
.pt-menu-btn span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--primary); }
.pt-menu-list { left: 0; right: auto; min-width: 240px; }
.pt-menu-list a.active { color: var(--primary); background: var(--primary-soft); }
@media (max-width: 520px) {
  .pt-header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .pt-menu { display: block; grid-column: 1; grid-row: 1; justify-self: start; }
  .pt-brand { grid-column: 2; grid-row: 1; justify-self: center; flex: none; }
  .pt-brand-text b { max-width: 150px; }
  .pt-actions { grid-column: 3; grid-row: 1; justify-self: end; }
  .pt-actions .icon-btn, .pt-actions .dropdown { display: none; }
  .pt-actions:not(:has(.pt-pay-btn)) .dropdown { display: block; }
  .pt-pay-btn span { display: inline; }
}
@media (max-width: 360px) {
  .pt-pay-btn span { display: none; }
}

/* ---- Owner panel: Message ISPs ---- */
.msg-step { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; }
.msg-step b { font-size: 14.5px; }
.msg-n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-size: 13px; font-weight: 800; }
.msg-audiences { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.msg-aud input { position: absolute; opacity: 0; pointer-events: none; }
.msg-aud span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13.5px; transition: border-color .15s, background .15s; }
.msg-aud span em { font-style: normal; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); font-size: 11.5px; text-align: center; }
.msg-aud input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.msg-aud input:checked + span em { background: var(--primary); color: #fff; }
.msg-aud input:focus-visible + span { box-shadow: 0 0 0 3px var(--primary-ring); }
.msg-pick { margin-bottom: 18px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.msg-pick[hidden] { display: none; }
.msg-pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); gap: 6px; max-height: 260px; overflow-y: auto; margin-top: 10px; }
.msg-pick-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); cursor: pointer; min-width: 0; }
.msg-pick-item[hidden] { display: none; }
.msg-pick-item > span { flex: 1; min-width: 0; display: grid; }
.msg-pick-item b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-pick-item small { color: var(--muted); font-size: 12px; }
.msg-tools { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.msg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.msg-chip { border: 1px dashed var(--border-strong); background: var(--surface-2); color: var(--text-2); border-radius: 8px; padding: 3px 8px; font: 600 12px ui-monospace, monospace; cursor: pointer; }
.msg-chip:hover { border-color: var(--primary); color: var(--primary); }
.msg-count { font-size: 12.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.msg-preview { margin-top: 14px; padding: 14px 16px; border-radius: 16px 16px 16px 4px; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent); max-width: 560px; }
.msg-preview small { display: block; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); margin-bottom: 4px; }
.msg-preview p { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.5; }
.msg-send { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.msg-templates { display: grid; gap: 8px; }
.msg-tpl { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); }
.msg-tpl > summary { list-style: none; cursor: pointer; display: grid; gap: 2px; }
.msg-tpl > summary::-webkit-details-marker { display: none; }
.msg-tpl > summary small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.msg-tpl-new > summary b { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); }
.msg-tpl-new > summary .svg-icon { width: 16px; height: 16px; }

/* ---- Owner dashboard v2 ---- */
.k-violet { background: var(--violet-soft); color: var(--violet); }
.k-sky { background: #e0f2fe; color: #0284c7; }
.k-slate { background: var(--surface-3); color: var(--text-2); }
:root[data-theme="dark"] .k-sky { background: rgba(14, 165, 233, .18); color: #7dd3fc; }
.db-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.db-kpi { display: grid; gap: 2px; padding: 16px 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; transition: transform .15s, box-shadow .15s, border-color .15s; min-width: 0; }
.db-kpi:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); box-shadow: 0 14px 30px -22px rgba(5, 46, 40, .55); }
.db-kpi-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.db-kpi small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.db-kpi b { font-size: 24px; letter-spacing: -.02em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-kpi b span { font-size: 15px; color: var(--muted); font-weight: 600; }
.db-kpi em { font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.db-ico .svg-icon { width: 19px; height: 19px; }
.db-ico.sm { width: 34px; height: 34px; border-radius: 10px; }
.db-ico.sm .svg-icon { width: 16px; height: 16px; }
.db-trend { padding: 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800; background: var(--surface-3); color: var(--text-2); }
.db-trend.up { background: var(--success-soft); color: var(--success); }
.db-trend.down { background: var(--danger-soft); color: var(--danger); }
.db-meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.db-meter i { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.db-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; align-items: start; }
.db-grid .so-card { margin: 0; }
.db-chart { position: relative; }
.db-chart svg { display: block; width: 100%; height: 220px; overflow: visible; }
.db-grid-line { stroke: var(--border); stroke-dasharray: 3 5; }
.db-line { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.db-dot { fill: var(--surface); stroke: var(--primary); stroke-width: 2; vector-effect: non-scaling-stroke; }
.db-dot.is-now { fill: var(--primary); }
.db-chart-x { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.db-chart-x .is-now { color: var(--primary); }
.db-attn { display: grid; gap: 8px; }
.db-attn-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none !important; transition: border-color .15s, background .15s; }
.db-attn-item:hover { border-color: var(--primary); background: var(--surface); }
.db-attn-main { flex: 1; min-width: 0; display: grid; }
.db-attn-main b { font-size: 13.5px; }
.db-attn-main small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-attn-go { width: 16px; height: 16px; color: var(--muted); }
.db-clear { display: grid; justify-items: center; gap: 6px; padding: 18px 10px; text-align: center; }
.db-clear small { color: var(--muted); }
.db-table .db-isp { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.db-table .db-isp > span:last-child { display: grid; min-width: 0; }
.db-table .db-isp small { color: var(--muted); font-size: 12px; }
.db-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.db-timeline li { display: flex; gap: 12px; align-items: flex-start; position: relative; }
.db-timeline li > div { display: grid; min-width: 0; }
.db-timeline b { font-size: 13.5px; font-weight: 600; }
.db-timeline small { color: var(--muted); font-size: 12px; }
@media (max-width: 1280px) { .db-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .db-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .db-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .db-kpi { padding: 12px; }
  .db-kpi b { font-size: 19px; }
  .db-ico { width: 34px; height: 34px; border-radius: 10px; }
  .db-chart svg { height: 160px; }
  .db-chart-x span:nth-child(even) { visibility: hidden; }
}
@media (max-width: 640px) { .db-kpis > .db-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; } }

/* ---- Owner SMS: two gateways ---- */
.gw-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.gw-grid .so-card { margin: 0; }
.gw-card { display: grid; gap: 16px; align-content: start; }
.gw-head { display: flex; align-items: flex-start; gap: 12px; }
.gw-head > div { flex: 1; min-width: 0; }
.gw-head h3 { margin: 0 0 2px; font-size: 16.5px; }
.gw-head span:not(.pill):not(.gw-ico) { color: var(--muted); font-size: 12.5px; }
.gw-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.gw-ico .svg-icon { width: 20px; height: 20px; }
.gw-test { display: flex; gap: 8px; padding-top: 14px; border-top: 1px dashed var(--border); }
.gw-test .input { flex: 1; min-width: 0; }
@media (max-width: 900px) { .gw-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- Customer portal v3: header fix, usage + fiber signal cards ---- */
@media (max-width: 520px) {
  .pt-header-inner { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
  .pt-brand { justify-self: center; max-width: 100%; min-width: 0; }
  .pt-brand-text { min-width: 0; overflow: hidden; }
  .pt-brand-text b { max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .pt-brand .brand-mark { flex: none; }
  .pt-pay-btn { padding: 0 10px; font-size: 12.5px; gap: 5px; }
  .pt-pay-btn .svg-icon { width: 14px; height: 14px; }
}
@media (max-width: 340px) { .pt-brand-text { display: none; } }

.pt-hero-pay { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; height: 40px; padding: 0 16px; border-radius: 99px; background: #fff; color: var(--danger); font-weight: 800; font-size: 14px; text-decoration: none !important; box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .45); }
.pt-hero.on .pt-hero-pay { color: var(--primary); }
.pt-hero-pay .svg-icon { width: 17px; height: 17px; }

.pt-insights { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-bottom: 18px; align-items: start; }
.pt-insights .card { margin: 0; }
.pt-usage-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.pt-usage-sum > div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.pt-usage-sum small { display: inline-block; color: var(--muted); font-size: 12px; font-weight: 600; }
.pt-usage-sum b { display: block; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-dot-down, .pt-dot-up { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-right: 5px; }
.pt-dot-down { background: var(--primary); }
.pt-dot-up { background: #8b5cf6; }
.pt-usage-bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding: 6px 2px 0; border-bottom: 1px solid var(--border); }
.pt-usage-bars > span { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; min-width: 0; border-radius: 4px 4px 0 0; }
.pt-usage-bars > span:hover { background: var(--surface-3); }
.pt-usage-bars i { display: block; width: 100%; border-radius: 3px 3px 1px 1px; }
.pt-usage-bars i.down { background: var(--primary); opacity: .9; }
.pt-usage-bars i.up { background: #8b5cf6; opacity: .85; }
.pt-usage-bars .is-today i.down { opacity: 1; box-shadow: 0 0 0 1px var(--primary); }
.pt-usage-x { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.pt-onu-main { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.pt-onu-value b { font-size: 34px; letter-spacing: -.03em; line-height: 1; }
.pt-onu-value span { margin-left: 4px; color: var(--muted); font-weight: 700; }
.pt-onu-quality { padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 800; background: var(--surface-3); color: var(--text-2); }
.pt-sig-good .pt-onu-quality { background: var(--success-soft); color: var(--success); }
.pt-sig-weak .pt-onu-quality, .pt-sig-too_strong .pt-onu-quality { background: var(--warning-soft); color: var(--warning); }
.pt-sig-critical .pt-onu-quality { background: var(--danger-soft); color: var(--danger); }
.pt-onu-meter { height: 10px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.pt-onu-meter i { display: block; height: 100%; border-radius: 99px; background: var(--muted); transition: width .4s; }
.pt-sig-good + .pt-onu-meter i { background: var(--success); }
.pt-sig-weak + .pt-onu-meter i, .pt-sig-too_strong + .pt-onu-meter i { background: var(--warning); }
.pt-sig-critical + .pt-onu-meter i { background: var(--danger); }
.pt-onu-scale { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--muted); font-weight: 600; }
@media (max-width: 900px) { .pt-insights { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) {
  .pt-usage-sum { gap: 6px; }
  .pt-usage-sum > div { padding: 8px; }
  .pt-usage-sum b { font-size: 14.5px; }
  .pt-usage-bars { gap: 2px; height: 110px; }
  .pt-onu-value b { font-size: 28px; }
}
.pt-account { border: 0; border-radius: 0; box-shadow: none; }

/* ---- Client lists v4: one search bar, quiet tabs, extra filters on demand ---- */
.cl-tabs { margin-bottom: 0; }
.cl-tab-end { margin-left: auto; }
.cl-tab-end .svg-icon { width: 15px; height: 15px; }
.cl-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 16px 18px; }
.cl-search { position: relative; flex: 1 1 260px; min-width: 0; }
.cl-search .svg-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.cl-search .input { height: 44px; padding-left: 42px; font-size: 14.5px; border-radius: 12px; background: var(--surface-2); }
.cl-search .input:focus { background: var(--surface); }
.cl-select { width: auto; min-width: 150px; max-width: 220px; height: 44px; border-radius: 12px; }
.cl-toolbar .btn { height: 44px; border-radius: 12px; }
.cl-more-btn.is-on { border-color: var(--primary); color: var(--primary); }
.cl-more { border-top: 1px dashed var(--border); background: var(--surface-2); }
.cl-more .filter-grid { padding: 14px 18px 16px; }
.cl-card .list-summary { border-top: 1px solid var(--border); background: var(--surface); }
.client-table th { font-size: 12px; font-weight: 650; letter-spacing: .02em; text-transform: none; color: var(--table-head-text); }
.client-table td[data-col="status"] .cell-sub { margin-top: 4px; }
.dropdown-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); padding: 2px 0 6px; }
@media (max-width: 760px) {
  .cl-toolbar { padding: 12px; gap: 8px; }
  .cl-search { flex-basis: 100%; }
  .cl-select { flex: 1 1 140px; max-width: none; }
  .cl-toolbar .btn { flex: 1 1 auto; justify-content: center; }
  .cl-tab-end { margin-left: 0; }
}

/* ---- Settings › Color: primary color picker ---- */
.brand-swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.brand-swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--surface); background: var(--sw); box-shadow: 0 0 0 1px var(--border); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.brand-swatch:hover { transform: scale(1.08); }
.brand-swatch.is-on { box-shadow: 0 0 0 2px var(--sw); }
.brand-custom { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.brand-custom input[type="color"] { width: 46px; height: 40px; padding: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.brand-preview { display: inline-flex; align-items: center; gap: 12px; padding: 8px 12px; border: 1px dashed var(--border); border-radius: 12px; }
.brand-preview .bp-btn { padding: 6px 14px; border-radius: 8px; background: var(--sw); color: #fff; font-weight: 600; font-size: 13px; }
.brand-preview .bp-link { color: var(--sw); font-weight: 600; font-size: 13px; text-decoration: underline; }
.brand-preview .bp-pill { padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--sw) 14%, transparent); color: var(--sw); font-weight: 600; font-size: 12px; }
.table th a, .table th small, .table th .muted { color: inherit; }

/* ---- API & Integrations overview ---- */
.k-blue { background: rgba(37, 99, 235, .1); color: #2563eb; }
.ig-hero { display: flex; align-items: center; gap: 20px; padding: 20px 22px; margin-bottom: 18px; border-radius: 18px; border: 1px solid var(--border);
  background: linear-gradient(120deg, var(--primary-soft), var(--surface) 70%); }
.ig-ring { --p: 0; flex: none; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--surface-3) 0); }
.ig-ring b { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); font-size: 22px; letter-spacing: -.02em; }
.ig-ring small { font-size: 13px; color: var(--muted); font-weight: 600; }
.ig-hero h2 { margin: 0 0 4px; font-size: 18px; }
.ig-hero p { margin: 0; color: var(--muted); font-size: 13.5px; }
.ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ig-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.ig-card:hover { border-color: var(--primary); box-shadow: 0 10px 26px -18px var(--primary); transform: translateY(-2px); }
.ig-card.is-off { background: var(--surface-2); }
.ig-card.is-off .ig-icon { filter: grayscale(.6); opacity: .8; }
.ig-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.ig-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; }
.ig-icon .svg-icon { width: 21px; height: 21px; }
.ig-state { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--muted); padding: 4px 10px; border-radius: 999px; background: var(--surface-3); }
.ig-state.on { color: var(--success); background: var(--success-soft); }
.ig-card h3 { margin: 0; font-size: 15.5px; }
.ig-what { margin: 0; color: var(--muted); font-size: 13px; min-height: 18px; }
.ig-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 12.5px; }
.ig-usage { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); min-width: 0; }
.ig-usage .svg-icon { width: 14px; height: 14px; flex: none; }
.ig-cta { display: inline-flex; align-items: center; gap: 2px; color: var(--primary); font-weight: 650; white-space: nowrap; }
.ig-cta .svg-icon { width: 14px; height: 14px; }
.ig-steps { list-style: none; margin: 0; padding: 0; counter-reset: ig; display: grid; gap: 14px; }
.ig-steps li { counter-increment: ig; display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; font-size: 13.5px; }
.ig-steps li::before { content: counter(ig); grid-row: span 2; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.ig-steps li span { color: var(--muted); }
.ig-code { margin: 0 0 14px; padding: 14px 16px; border-radius: 12px; background: #0f2233; color: #d1fae5; font-size: 12.5px; line-height: 1.6; overflow-x: auto; white-space: pre; }
.ig-links { display: flex; flex-wrap: wrap; gap: 8px; }
.ig-links a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; }
.ig-links a:hover { border-color: var(--primary); color: var(--primary); }
.ig-links .svg-icon { width: 15px; height: 15px; }
@media (max-width: 640px) { .ig-hero { flex-direction: column; text-align: center; } }

/* ---- Hotspot: how the captive portal redirect works ---- */
.hs-flow { list-style: none; margin: 0; padding: 16px 18px 18px; display: grid; gap: 4px; }
.hs-flow li { position: relative; display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding-bottom: 14px; font-size: 13.5px; }
.hs-flow li:not(:last-child)::after { content: ""; position: absolute; left: 18px; top: 38px; bottom: 0; width: 2px; background: var(--primary-soft); }
.hs-flow li > div { display: grid; gap: 2px; padding-top: 2px; }
.hs-flow li span:not(.hs-ico) { color: var(--muted); line-height: 1.5; }
.hs-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); position: relative; z-index: 1; }
.hs-ico .svg-icon { width: 18px; height: 18px; }
.hs-check .card-head { flex-wrap: wrap; gap: 10px; }
.hs-check-row { align-items: flex-start !important; }
.hs-check-ico { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; }
.hs-check-ico .svg-icon { width: 16px; height: 16px; }
.hs-check-ico.is-ok { background: var(--success-soft); color: var(--success); }
.hs-check-ico.is-warn { background: var(--accent-soft); color: #c27803; }
.hs-check-ico.is-fail { background: var(--danger-soft); color: var(--danger); }
.hs-fix { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; line-height: 1.55; }
.hs-tips { border-top: 1px solid var(--border); font-size: 13px; }
.hs-tips ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.7; color: var(--muted); }
.hs-tips ul b, .hs-tips ul i { color: var(--text); }

/* ---- OLT: public IP & port forward ---- */
.olt-pf .card-head { flex-wrap: wrap; gap: 10px; }
.olt-pf-path { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.olt-pf-node { display: grid; justify-items: center; gap: 2px; min-width: 120px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); text-align: center; }
.olt-pf-node .svg-icon { width: 20px; height: 20px; color: var(--primary); }
.olt-pf-node b { font-size: 13px; }
.olt-pf-node small { font-size: 11.5px; color: var(--muted); }
.olt-pf-arrow { position: relative; padding: 0 14px 0 4px; font-size: 11.5px; font-weight: 650; color: var(--primary); white-space: nowrap; }
.olt-pf-arrow::after { content: "→"; margin-left: 6px; font-size: 15px; }
.olt-pf-script { margin-top: 12px; font-size: 13px; }
.olt-pf-script summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.olt-pf-script pre { margin-top: 8px; }

/* ---- Add / edit OLT ---- */
.olt-form { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.olt-form-main { display: grid; gap: 16px; min-width: 0; }
.olt-form-side { position: sticky; top: 84px; display: grid; gap: 16px; }
.of-card { padding: 0; overflow: hidden; }
.of-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.of-head h3 { margin: 0; font-size: 15.5px; }
.of-head h3 small { margin-left: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.of-card.is-off .of-head { border-bottom: 0; }
.of-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; padding: 18px 20px 20px; }
.of-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.of-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.of-grid .span-2 { grid-column: span 2; }
.of-grid .span-3 { grid-column: 1 / -1; }
.of-grid-4 .span-2 { grid-column: span 2; }
.of-grid .field { margin: 0; }
.of-grid .help { margin: 4px 0 0; font-size: 12px; }
.of-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.of-check { align-self: end; min-height: 42px; display: flex; align-items: center; gap: 8px; }
.req { color: var(--danger); }
.field-error { margin: 4px 0 0; font-size: 12px; color: var(--danger); }
.of-test-btn { width: 100%; justify-content: center; height: 44px; background: #3b5bdb; border-color: #3b5bdb; color: #fff; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.of-test-btn:hover { background: #3249c0; color: #fff; }
.of-save-btn { width: 100%; justify-content: center; height: 46px; margin-top: 14px; font-size: 15px; }
.of-test-results { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.of-test-results li { display: grid; gap: 2px; padding: 9px 12px; border-radius: 10px; font-size: 13px; background: var(--surface-2); border-left: 3px solid var(--border); }
.of-test-results li.ok { border-left-color: var(--success); }
.of-test-results li.fail { border-left-color: var(--danger); }
.of-test-results li small { color: var(--muted); }
.of-test-results li.fail small { color: var(--danger); }
@media (max-width: 1100px) { .olt-form { grid-template-columns: 1fr; } .olt-form-side { position: static; } }
@media (max-width: 760px) {
  .of-grid, .of-grid-3, .of-grid-4, .of-pair { grid-template-columns: 1fr; }
  .of-grid .span-2, .of-grid-4 .span-2 { grid-column: auto; }
}
.olt-form [hidden] { display: none !important; }
@media (max-width: 1400px) { .of-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
