/* ==========================================================================
   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;
  --nav-icon-bg: #edf2f8;

  /* 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; --nav-icon-bg: rgba(255, 255, 255, .06);
    --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; --nav-icon-bg: rgba(255, 255, 255, .06);
  --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 (fixed: it stays in place while the page scrolls) ---------- */
.sidebar {
  position: fixed; left: 0; top: var(--topbar); bottom: 0; width: var(--sidebar); 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;
}
.app > .main { grid-column: 2; }
.nav { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px 12px 16px; scrollbar-width: thin; scrollbar-color: transparent transparent; }
.sidebar:hover .nav { scrollbar-color: var(--border-strong) transparent; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { border-radius: 6px; background: transparent; }
.sidebar:hover .nav::-webkit-scrollbar-thumb { background: var(--border-strong); }
.nav-section { display: flex; align-items: center; gap: 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--nav-section); padding: 16px 8px 7px; }
.nav-section::after { content: ""; flex: 1; height: 1px; background: var(--nav-border); }
.nav-single, .nav-group > summary {
  display: flex; align-items: center; gap: 11px; padding: 5px 10px 5px 5px; border-radius: 12px; color: var(--nav-text); font-weight: 500; font-size: 14px;
  cursor: pointer; user-select: none; position: relative; text-decoration: none; transition: background .15s, color .15s, box-shadow .15s; margin-bottom: 3px;
}
.nav-single > .svg-icon:first-child, .nav-group > summary > .svg-icon:first-child {
  flex: none; width: 32px; height: 32px; padding: 7px; border-radius: 9px; stroke-width: 1.8; color: var(--nav-text); background: var(--nav-icon-bg); transition: background .15s, color .15s;
}
.nav-single:hover, .nav-group > summary:hover { background: var(--nav-hover); color: var(--nav-text-strong); text-decoration: none; }
.nav-single:hover > .svg-icon:first-child, .nav-group > summary:hover > .svg-icon:first-child { color: var(--nav-accent); background: var(--nav-icon-hover, var(--surface)); box-shadow: 0 2px 6px rgba(15, 40, 80, .08); }
.nav-group[open]:not(.active) > summary { color: var(--nav-text-strong); font-weight: 600; }
.nav-group[open]:not(.active) > summary > .svg-icon:first-child { color: var(--nav-accent); }
.nav-single.active, .nav-group.active > summary {
  color: #fff; font-weight: 600; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 62%, #0b3b6e));
  box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--primary) 85%, transparent);
}
.nav-single.active > .svg-icon:first-child, .nav-group.active > summary > .svg-icon:first-child { color: #fff; background: rgba(255, 255, 255, .2); box-shadow: none; }
.nav-group > summary { list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary .chev { margin-left: auto; width: 16px; height: 16px; transition: transform .2s; color: var(--nav-section); transform: rotate(90deg); }
.nav-group[open] > summary .chev { transform: rotate(-90deg); color: var(--nav-accent); }
.nav-group.active > summary .chev { color: rgba(255, 255, 255, .85); }
.nav-items { position: relative; display: grid; gap: 1px; margin: 3px 0 8px 21px; padding: 2px 0 2px 14px; border-left: 1.5px solid var(--nav-border); }
.nav-items a { position: relative; display: block; padding: 6px 10px; border-radius: 8px; color: var(--nav-text); font-size: 13px; text-decoration: none; transition: background .12s, color .12s; }
.nav-items a::before { content: ""; position: absolute; left: -18.5px; top: 50%; width: 7px; height: 7px; border-radius: 50%; transform: translateY(-50%); background: var(--sidebar-bg); border: 1.5px solid var(--nav-border); }
.nav-items a:hover { color: var(--nav-accent); background: var(--nav-hover); }
.nav-items a:hover::before { border-color: var(--nav-accent); }
.nav-items a.active { color: var(--nav-accent); background: var(--nav-hover); font-weight: 600; }
.nav-items a.active::before { background: var(--nav-accent); border-color: var(--nav-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--nav-accent) 22%, transparent); }

.sidebar-wallet { margin: 0 12px 10px; padding: 12px 14px; border-radius: 14px; 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 { display: flex; align-items: center; gap: 8px; margin: 0 12px 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--nav-border); background: var(--nav-icon-bg); font-size: 12px; font-weight: 600; color: var(--nav-text); line-height: 1.3; }
.sidebar-foot::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }

/* ---------- 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(min(220px, 100%), 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; }
.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(min(220px, 100%), 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); }
  .app > .main { grid-column: 1; }
  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(min(300px, 100%), 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(min(280px, 100%), 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(min(118px, 100%), 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(min(200px, 100%), 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(min(190px, 100%), 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(min(180px, 100%), 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(min(130px, 100%), 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(min(140px, 100%), 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(min(150px, 100%), 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(min(160px, 100%), 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(min(240px, 100%), 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(min(320px, 100%), 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(min(140px, 100%), 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(min(280px, 100%), 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(min(200px, 100%), 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(min(210px, 100%), 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(min(150px, 100%), 1fr)); gap: 10px; margin-top: 6px; }
.sub-total { font-weight: 800; font-size: 18px; color: var(--primary, var(--primary)); margin-right: auto; }
.sub-notice { display: flex; align-items: center; gap: 10px; padding: 10px 16px; margin-bottom: 14px; border-radius: 12px; background: #fffaeb; color: #93370d; font-size: 14px; }
.sub-notice.is-danger { background: #fef3f2; color: #b42318; }
.sub-notice 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; --nav-icon-bg: rgba(255, 255, 255, .08); --nav-icon-hover: rgba(255, 255, 255, .16);
  --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(min(220px, 100%), 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: var(--table-head); color: var(--table-head-text); }
.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(min(170px, 100%), 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(min(190px, 100%), 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(min(240px, 100%), 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(min(200px, 100%), 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(min(170px, 100%), 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(min(260px, 100%), 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(min(300px, 100%), 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 { gap: 8px; }
  .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: 12.5px; font-weight: 700; letter-spacing: .04em; 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(min(250px, 100%), 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)); } }

/* ---- Client lists v5: status chips, filter row, bulk buttons ---- */
.cs-filters { padding: 18px 20px 14px; }
.cs-label { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.cs-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.cs-chip { --c: var(--muted); display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: var(--surface); color: var(--c); font-size: 13.5px; font-weight: 650; text-decoration: none !important; white-space: nowrap; transition: background .15s, color .15s; }
.cs-chip .svg-icon { width: 16px; height: 16px; }
.cs-chip .cs-n { font-size: 12px; font-weight: 600; opacity: .75; }
.cs-chip:hover { background: color-mix(in srgb, var(--c) 9%, var(--surface)); }
.cs-chip.is-on { background: var(--c); border-color: var(--c); color: #fff; }
.cs-chip.is-on .cs-n { opacity: .9; }
.cs-dark { --c: #334155; } .cs-blue { --c: #2563eb; } .cs-violet { --c: #7c3aed; } .cs-green { --c: #16a34a; } .cs-gray { --c: #64748b; }
.cs-teal { --c: var(--primary); } .cs-red { --c: #dc2626; } .cs-amber { --c: #d97706; } .cs-pink { --c: #e11d48; }
:root[data-theme="dark"] .cs-dark { --c: #94a3b8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cs-dark { --c: #94a3b8; } }
.cs-grid { display: grid; grid-template-columns: minmax(220px, 1.2fr) repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: 12px 14px; }
.cs-grid .field, .cs-row .field, .cs-more .field { margin: 0; }
.cs-grid label, .cs-row label, .cs-more label { font-size: 12.5px; }
.cs-search { position: relative; }
.cs-search .svg-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); }
.cs-search .input { padding-left: 34px; }
.cs-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; margin-top: 12px; }
.cs-row .date-range { max-width: 340px; }
.cs-filter-btn { background: #3b5bdb; border-color: #3b5bdb; color: #fff; }
.cs-filter-btn:hover { background: #3249c0; color: #fff; }
.cs-more-link { border: 0; background: none; padding: 8px 4px; color: #3b5bdb; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.cs-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 12px 14px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.cs-more[hidden] { display: none; }
.cs-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); }
.cs-per-page { width: auto; min-width: 120px; height: 38px; }
.cs-act { --c: var(--muted); height: 36px; border-color: color-mix(in srgb, var(--c) 40%, transparent); color: var(--c); background: var(--surface); font-weight: 600; }
.cs-act:hover:not(:disabled) { background: color-mix(in srgb, var(--c) 9%, var(--surface)); color: var(--c); }
.cs-act:disabled { opacity: .45; cursor: not-allowed; }
.cs-act .svg-icon { width: 15px; height: 15px; }
.cs-selected { margin-left: auto; font-size: 13px; color: var(--muted); }
.cs-bulk-input { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 20px 12px; }
.cs-bulk-input[hidden] { display: none; }
@media (max-width: 760px) {
  .cs-filters { padding: 14px 12px; }
  .cs-grid { grid-template-columns: 1fr 1fr; }
  .cs-grid .field:first-child { grid-column: 1 / -1; }
  .cs-chip { height: 32px; padding: 0 10px; font-size: 12.5px; }
  .cs-bulk { padding: 10px 12px; }
}

/* ---- Long text in tables: one line with "…", the full text on hover ---- */
.cell-clip { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-clip-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 380px; white-space: normal; }
.client-table td { vertical-align: middle; }
.client-table .cell-user > div { min-width: 0; }
.client-table .cell-user .cell-main { display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-table .cell-user .cell-sub { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-table td[data-col="package"], .client-table td[data-col="mobile"] { white-space: nowrap; }
@media (max-width: 760px) { .cell-clip { max-width: 160px; } }

/* ---- One status per client: Online / Offline for active lines ---- */
.online-state.status-live { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 12.5px; font-weight: 650; }
.online-state.status-live .dot { width: 8px; height: 8px; }
.online-state.status-live.on { background: var(--success-soft); color: var(--success); }

/* ======== Customer portal v4 (brand bar, drawer, notice board, account tiles, live traffic) ======== */
.portal-body { padding-bottom: 0; }
.pt-main { max-width: 1180px; }
.pt-header.pt-topbar { background: linear-gradient(120deg, var(--primary-600), var(--primary)); border-bottom: 0; box-shadow: 0 8px 24px -16px color-mix(in srgb, var(--primary) 70%, transparent); backdrop-filter: none; -webkit-backdrop-filter: none; }
.pt-bar-inner { max-width: 1180px; margin: 0 auto; height: 64px; padding: 0 16px; display: flex; align-items: center; gap: 14px; color: #fff; }
.pt-bar-btn { width: 40px; height: 40px; flex: none; border: 0; border-radius: 12px; background: transparent; color: #fff; display: grid; place-items: center; cursor: pointer; }
.pt-bar-btn:hover { background: rgba(255, 255, 255, .14); }
.pt-bar-btn .svg-icon { width: 22px; height: 22px; }
.pt-bar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: #fff !important; text-decoration: none !important; }
.pt-bar-logo { width: 40px; height: 40px; flex: none; border-radius: 11px; background: #fff; display: grid; place-items: center; color: var(--primary); font-weight: 800; overflow: hidden; box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .4); }
.pt-bar-logo img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.pt-bar-name { font-weight: 800; font-size: 17px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-bar-nav { display: flex; gap: 4px; margin-left: 12px; }
.pt-bar-nav a { position: relative; padding: 8px 12px; border-radius: 10px; color: rgba(255, 255, 255, .85); font-weight: 600; font-size: 14px; text-decoration: none; }
.pt-bar-nav a:hover, .pt-bar-nav a.active { background: rgba(255, 255, 255, .16); color: #fff; }
.pt-bar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.pt-bar-actions form { margin: 0; }
.pt-bar-pay { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 11px; background: #fff; color: var(--primary-600) !important; font-weight: 700; font-size: 13.5px; text-decoration: none !important; white-space: nowrap; }
.pt-bar-pay .svg-icon { width: 16px; height: 16px; }
@media (max-width: 960px) {
  .pt-bar-nav, .pt-bar-theme, .pt-bar-pay { display: none; }
  .pt-bar-inner { position: relative; }
  .pt-bar-brand { position: absolute; left: 50%; transform: translateX(-50%); max-width: calc(100% - 140px); }
}
@media (min-width: 961px) { .pt-bar-inner > [data-drawer-open] { display: none; } }

.pt-drawer { position: fixed; inset: 0; z-index: 60; }
.pt-drawer[hidden] { display: none; }
.pt-drawer-backdrop { position: absolute; inset: 0; background: rgba(8, 15, 30, .45); animation: ptFade .2s ease; }
.pt-drawer-panel { position: absolute; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); display: flex; flex-direction: column; gap: 14px; padding: 18px 16px; overflow-y: auto;
  background: linear-gradient(170deg, var(--primary-600), var(--primary)); color: #fff; box-shadow: 12px 0 40px -20px rgba(0, 0, 0, .6); animation: ptSlide .22s ease; }
@keyframes ptSlide { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes ptFade { from { opacity: 0; } to { opacity: 1; } }
body.pt-drawer-open { overflow: hidden; }
.pt-drawer-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, .16); }
.pt-drawer-head b { display: block; font-size: 16px; }
.pt-drawer-head small { color: rgba(255, 255, 255, .7); font-size: 12.5px; }
.pt-drawer-x { margin-left: auto; width: 34px; height: 34px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; cursor: pointer; }
.pt-drawer-user { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); }
.pt-drawer-user > div { min-width: 0; }
.pt-drawer-user b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-drawer-user small { color: rgba(255, 255, 255, .7); font-size: 12px; }
.pt-drawer-nav { display: grid; gap: 2px; }
.pt-drawer-nav a { display: flex; align-items: center; gap: 12px; padding: 13px 12px; border-radius: 12px; color: rgba(255, 255, 255, .9); font-weight: 600; font-size: 15px; text-decoration: none; }
.pt-drawer-nav a .svg-icon { width: 20px; height: 20px; }
.pt-drawer-nav a:hover, .pt-drawer-nav a.active { background: rgba(255, 255, 255, .16); color: #fff; }
.pt-drawer-nav .pt-dot { margin-left: auto; }
.pt-drawer-pay { display: flex; align-items: center; justify-content: center; gap: 8px; height: 48px; border-radius: 14px; background: #22c55e; color: #fff !important; font-weight: 700; text-decoration: none !important; box-shadow: 0 10px 22px -12px rgba(0, 0, 0, .5); }
.pt-drawer-foot { margin-top: auto; display: grid; gap: 2px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .16); }
.pt-drawer-foot a, .pt-drawer-foot button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; color: rgba(255, 255, 255, .85); font: inherit; font-size: 14px; text-align: left; cursor: pointer; text-decoration: none; }
.pt-drawer-foot a:hover, .pt-drawer-foot button:hover { background: rgba(255, 255, 255, .12); }
.pt-drawer-foot form { margin: 0; }

.pt-viewing { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; padding: 14px 16px; border-radius: 14px; background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; font-size: 14px; }
.pt-viewing form { margin: 0; }
:root[data-theme="dark"] .pt-viewing { background: rgba(168, 85, 247, .14); color: #e9d5ff; border-color: rgba(168, 85, 247, .3); }
.pt-notice { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 18px 20px; border-radius: 18px; color: #fff;
  background: linear-gradient(120deg, var(--primary-600), var(--primary) 60%, var(--primary-500)); box-shadow: 0 14px 30px -20px color-mix(in srgb, var(--primary) 80%, transparent); }
.pt-notice-ico { width: 48px; height: 48px; flex: none; border-radius: 14px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; }
.pt-notice-ico .svg-icon { width: 22px; height: 22px; }
.pt-notice small { display: block; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.pt-notice b { display: block; margin-top: 2px; font-size: 16px; line-height: 1.45; white-space: pre-line; }
.pt-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 14px; padding: 12px 14px; border-radius: 14px; background: var(--danger-soft); color: var(--danger); font-size: 13.5px; }
.pt-alert > .svg-icon { width: 20px; height: 20px; flex: none; }
.pt-alert > div { flex: 1; min-width: 200px; color: var(--text); }
.pt-alert b { color: var(--danger); }

.pt-sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin: 4px 0 12px; }
.pt-sec-head h2 { margin: 0; font-size: 20px; letter-spacing: -.01em; }
.pt-sec-head span { color: var(--muted); font-size: 13px; }
.pt-sec-head span b { color: var(--text); letter-spacing: .03em; }
.pt-acc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.pt-acc { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 6px 18px -16px rgba(15, 40, 80, .5); color: var(--text); text-decoration: none !important; }
a.pt-acc:hover { border-color: var(--primary); }
.pt-acc > div { min-width: 0; }
.pt-acc small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pt-acc b { display: block; font-size: 17px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-acc em { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-acc-ico { width: 46px; height: 46px; flex: none; border-radius: 13px; display: grid; place-items: center; color: #fff; box-shadow: 0 8px 16px -10px rgba(0, 0, 0, .45); }
.pt-acc-ico .svg-icon { width: 21px; height: 21px; }
.pt-acc-ico.t-red { background: linear-gradient(140deg, #fb7185, #e11d48); }
.pt-acc-ico.t-green { background: linear-gradient(140deg, #4ade80, #16a34a); }
.pt-acc-ico.t-blue { background: linear-gradient(140deg, #60a5fa, #2563eb); }
.pt-acc-ico.t-indigo { background: linear-gradient(140deg, #818cf8, #4338ca); }
.pt-acc-ico.t-violet { background: linear-gradient(140deg, #a78bfa, #6d28d9); }
.pt-acc-ico.t-amber { background: linear-gradient(140deg, #fbbf24, #d97706); }
.pt-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pt-quick form { margin: 0; }
.pt-q { --c: var(--primary); display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: 11px; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  background: color-mix(in srgb, var(--c) 8%, var(--surface)); color: var(--c) !important; font: inherit; font-weight: 650; font-size: 13.5px; text-decoration: none !important; cursor: pointer; }
.pt-q .svg-icon { width: 16px; height: 16px; }
.pt-q.t-green { --c: #16a34a; } .pt-q.t-blue { --c: #2563eb; } .pt-q.t-red { --c: #e11d48; } .pt-q.t-violet { --c: #7c3aed; } .pt-q.t-amber { --c: #d97706; }

.pt-card { padding: 0; overflow: hidden; border-radius: 18px; margin-bottom: 14px; }
.pt-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.pt-card-head h3 { margin: 0; font-size: 15.5px; }
.pt-card-head > span { color: var(--muted); font-size: 12.5px; }
.pt-card-head > a { font-size: 13px; font-weight: 600; color: var(--primary); }
.pt-card-body { padding: 18px 20px 20px; }
.pt-card-foot { margin: 0; padding: 0 20px 16px; }
.pt-muted { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.pt-traffic-now { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.pt-traffic-now > div { padding: 14px; border-radius: 14px; text-align: center; }
.pt-traffic-now small { display: block; color: var(--muted); font-size: 13px; }
.pt-traffic-now b { display: block; margin-top: 4px; font-size: 22px; letter-spacing: -.01em; }
.pt-traffic-now .is-down { background: color-mix(in srgb, var(--primary) 9%, var(--surface)); }
.pt-traffic-now .is-down b { color: var(--primary); }
.pt-traffic-now .is-up { background: color-mix(in srgb, var(--success) 9%, var(--surface)); }
.pt-traffic-now .is-up b { color: var(--success); }
.pt-traffic-legend { display: flex; justify-content: center; gap: 16px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.pt-card-head .pt-traffic-legend { margin: 0; }
.pt-traffic-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 3px; vertical-align: -1px; }
.pt-traffic-legend .is-down::before { background: var(--primary); }
.pt-traffic-legend .is-up::before { background: var(--success); }
.pt-traffic-chart { display: block; width: 100%; height: 200px; }
.pt-traffic-note { margin: 10px 0 0; color: #b45309; font-size: 13.5px; }
.pt-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.pt-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.pt-span-2 { grid-column: 1 / -1; }
.pt-ip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pt-ip b { font-size: 22px; letter-spacing: .02em; }
.pt-tag { display: inline-block; padding: 2px 8px; border-radius: 7px; background: var(--surface-3); color: var(--text); font-size: 12px; font-weight: 600; }
.pt-data-big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.pt-data-split { margin: 4px 0 0; font-size: 14px; }
.pt-rows { list-style: none; margin: 0; padding: 8px 20px; }
.pt-rows li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.pt-rows li:last-child { border-bottom: 0; }
.pt-rows em { font-style: normal; font-weight: 600; }
.pt-sig-good, .pt-sig-too_strong { color: var(--success); }
.pt-sig-weak { color: #d97706; }
.pt-sig-critical { color: var(--danger); }
.pt-sig-none { color: var(--muted); }
.pt-daybars { display: flex; align-items: flex-end; gap: 4px; height: 170px; padding-bottom: 18px; }
.pt-daybars span { position: relative; flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; }
.pt-daybars i { display: block; width: 100%; }
.pt-daybars i.up { background: var(--success); border-radius: 4px 4px 0 0; }
.pt-daybars i.down { background: var(--primary); }
.pt-daybars small { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); }
.pt-daybars span:nth-child(even) small { visibility: hidden; }
.pt-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pt-table th { padding: 10px 16px; text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.pt-table td { padding: 11px 16px; border-top: 1px solid var(--border); }
.pt-table .num { text-align: right; }
.pt-list { list-style: none; margin: 0; padding: 4px 20px 10px; }
.pt-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.pt-list li:last-child { border-bottom: 0; }
.pt-list li b a { color: inherit; }
@media (max-width: 960px) { .pt-acc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pt-grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 680px) {
  .pt-grid-2 { grid-template-columns: 1fr; }
  .pt-acc { padding: 12px 10px; gap: 10px; }
  .pt-acc-ico { width: 40px; height: 40px; border-radius: 11px; }
  .pt-acc b { font-size: 15px; }
  .pt-card-head, .pt-card-body { padding-left: 16px; padding-right: 16px; }
  .pt-notice { padding: 16px; }
  .pt-notice b { font-size: 15px; }
}

/* Important links */
.pt-links-hero { position: relative; overflow: hidden; margin-bottom: 18px; padding: 24px; border-radius: 20px; color: #fff; background: linear-gradient(130deg, var(--primary-600), var(--primary) 70%, var(--primary-500)); }
.pt-links-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.pt-links-hero h1 { margin: 0; font-size: 26px; }
.pt-links-hero p { margin: 6px 0 14px; opacity: .85; max-width: 520px; }
.pt-links-count { display: inline-block; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .18); font-weight: 600; font-size: 14px; }
.pt-links-group { display: flex; align-items: center; gap: 12px; margin: 18px 0 10px; }
.pt-links-group b { display: block; font-size: 17px; text-transform: uppercase; letter-spacing: .02em; }
.pt-links-group small { color: var(--muted); }
.pt-links-letter { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 800; }
.pt-links-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 10px; }
.pt-link-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
a.pt-link-card:hover { border-color: var(--primary); }
.pt-link-num, .pt-link-logo { width: 46px; height: 46px; flex: none; border-radius: 12px; }
.pt-link-num { display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 800; font-size: 18px; }
.pt-link-logo { object-fit: contain; background: var(--surface-2); padding: 4px; }
.pt-link-text { min-width: 0; flex: 1; }
.pt-link-text b { font-size: 15px; }
.pt-link-text small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-link-go { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.pt-link-go .svg-icon { width: 16px; height: 16px; }
.pt-bar-inner { width: 100%; box-sizing: border-box; }
.pt-notice small, .pt-notice b { color: inherit; }
.pt-notice small { opacity: .85; }
@media (max-width: 960px) {
  .pt-bar-brand { position: static; transform: none; flex: 1; justify-content: center; max-width: none; min-width: 0; }
  .pt-bar-actions { margin-left: 0; }
}
.pt-bar-logo { color: var(--primary-600); font-size: 14px; }
.pt-rows li > span { color: var(--muted); }
.pt-rows .pill-green { color: var(--success); }
.pt-rows .pill-red { color: var(--danger); }
:root { --pt-up: #f59e0b; }
.pt-traffic-now .is-up { background: color-mix(in srgb, var(--pt-up) 10%, var(--surface)); }
.pt-traffic-now .is-up b { color: var(--pt-up); }
.pt-traffic-legend .is-up::before { background: var(--pt-up); }
.pt-daybars i.up { background: var(--pt-up); }
.pt-card-head { flex-wrap: wrap; }
.pt-links-hero h1, .pt-links-hero p { color: #fff; }
.imp-counts { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
.imp-counts .fix b { color: #d97706; }
.imp-fixes > div { background: #fffbeb; color: #92400e; }
.imp-row-fix td { background: #fffbeb !important; }

/* ---- Every table header in capitals (admin, panel users, resellers) ---- */
.table th { text-transform: uppercase; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; }
.table th .sr-only { text-transform: none; }

/* ---- Client lists: compact on wide screens so more columns fit without side-scrolling ---- */
@media (min-width: 900px) {
  .client-table { font-size: 12.5px; }
  .client-table th { padding: 10px 9px; font-size: 11px; letter-spacing: .03em; white-space: nowrap; }
  .client-table td { padding: 7px 9px; }
  .client-table td.check-col, .client-table th.check-col { width: 30px; padding-left: 12px; padding-right: 0; }
  .client-table .avatar { width: 30px; height: 30px; font-size: 11px; }
  .client-table .cell-user { gap: 8px; }
  .client-table .cell-user .cell-main { max-width: 170px; font-size: 12.5px; }
  .client-table .cell-sub { font-size: 11px; }
  .client-table .cell-user .cell-sub { max-width: 180px; }
  .client-table .code-tag { padding: 0 5px; font-size: 11px; }
  .client-table .mono { font-size: 11.5px; }
  .client-table .ip-tag { padding: 0 4px; font-size: 9.5px; }
  .client-table .cell-clip { max-width: 150px; }
  .client-table .badge { font-size: 11px; }
  .client-table td[data-col="router"] .svg-icon { width: 12px; height: 12px; }
  .client-table td.actions { padding-right: 10px; }
}
@media (min-width: 900px) {
  .client-table td.actions .icon-actions { display: grid; grid-template-columns: repeat(4, 26px); gap: 4px; justify-content: end; }
  .client-table td.actions .ia { width: 26px; height: 26px; border-radius: 7px; }
  .client-table td.actions .ia .svg-icon { width: 13px; height: 13px; }
  .client-table td[data-col="ip"] .ip-tag, .client-table td.ip-cell .ip-tag { display: block; width: max-content; margin-top: 2px; }
}
@media (min-width: 900px) {
  .client-table .cell-user { min-width: 150px; }
  .client-table .cell-user .cell-main { max-width: 150px; }
  .client-table .cell-user .cell-sub { max-width: 160px; }
  .client-table .cell-clip { max-width: 125px; }
}
/* Client lists: columns hug their content (extra width goes before the action buttons); every heading lines up with its values */
.client-table th, .client-table td { width: 1%; white-space: nowrap; text-align: left; }
.client-table th.num, .client-table td.num { text-align: left; }
.client-table th.actions, .client-table td.actions { width: auto; text-align: right; }
.client-table .cell-user { min-width: 0; }
@media (min-width: 900px) {
  .client-table th, .client-table td { padding-left: 12px; padding-right: 12px; }
  .client-table th:first-child, .client-table td:first-child { padding-left: 16px; }
  .client-table .cell-clip { max-width: 170px; }
}
@media (min-width: 900px) {
  .client-table th, .client-table td { padding-left: 8px; padding-right: 8px; }
  .client-table th:first-child, .client-table td:first-child { padding-left: 14px; }
  .client-table .cell-clip { max-width: 140px; }
  .client-table .cell-user .cell-main { max-width: 150px; }
  .client-table .cell-user .cell-sub { max-width: 150px; }
}
@media (min-width: 900px) {
  .client-table th { font-size: 10.5px; letter-spacing: .02em; }
  .client-table th:nth-last-child(2) { white-space: normal; line-height: 1.25; }
  .client-table .cell-clip { max-width: 120px; }
  .client-table .cell-user .cell-main, .client-table .cell-user .cell-sub { max-width: 140px; }
}
@media (min-width: 900px) {
  .client-table .cell-clip { max-width: 110px; }
  .client-table .cell-user .cell-main, .client-table .cell-user .cell-sub { max-width: 125px; }
  .client-table td.actions .icon-actions { grid-template-columns: repeat(4, 24px); gap: 3px; }
  .client-table td.actions .ia { width: 24px; height: 24px; }
}
@media (min-width: 900px) {
  .client-table th:first-child, .client-table td:first-child { padding-left: 10px; }
  .client-table th:last-child, .client-table td:last-child { padding-right: 8px; }
  .client-table td.check-col, .client-table th.check-col { width: 22px; }
}
/* Client lists: slim rows, wider address, one-line headings and action buttons */
@media (min-width: 900px) {
  .client-table th:nth-last-child(2) { white-space: nowrap; }
  .client-table td { padding-top: 5px; padding-bottom: 5px; line-height: 1.3; }
  .client-table th { padding-top: 9px; padding-bottom: 9px; }
  .client-table .avatar { width: 26px; height: 26px; font-size: 10.5px; }
  .client-table .cell-sub { margin-top: 0; line-height: 1.25; }
  .client-table .cell-clip { max-width: 220px; }
  .client-table td.actions .icon-actions { display: flex; flex-wrap: nowrap; gap: 3px; justify-content: flex-end; }
  .client-table td.actions .ia { width: 24px; height: 24px; }
  .client-table .badge, .client-table .days-pill { padding-top: 1px; padding-bottom: 1px; }
}

/* Other client lists (BW clients, sub-resellers, renewals, online, dues, bills, payments): same slim look as the client list */
@media (min-width: 900px) {
  .list-slim { font-size: 12.5px; }
  .list-slim th { padding: 9px 10px; font-size: 10.5px; letter-spacing: .02em; white-space: nowrap; }
  .list-slim td { padding: 6px 10px; line-height: 1.3; }
  .list-slim .avatar { width: 26px; height: 26px; font-size: 10.5px; }
  .list-slim .cell-user { gap: 8px; min-width: 0; }
  .list-slim .cell-main { font-size: 12.5px; }
  .list-slim .cell-sub { font-size: 11px; margin-top: 0; line-height: 1.25; }
  .list-slim .code-tag { padding: 0 5px; font-size: 11px; }
  .list-slim .badge, .list-slim .days-pill { padding-top: 1px; padding-bottom: 1px; font-size: 11px; }
  .list-slim .icon-actions { flex-wrap: nowrap; gap: 3px; }
  .list-slim .ia { width: 24px; height: 24px; border-radius: 7px; }
  .list-slim .ia .svg-icon { width: 13px; height: 13px; }
  .list-slim .btn-xs { height: 26px; padding: 0 8px; font-size: 11.5px; }
  .list-slim .cell-clip { max-width: 220px; }
}

/* ==========================================================================
   Dashboards (admin, reseller, owner): simple, professional KPI cards
   ========================================================================== */
.dash { display: grid; gap: 18px; }
.dash > .grid { margin: 0; }
.dash-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); gap: 14px; }
.dkpi { --k: var(--primary); --ks: var(--primary-soft); position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 16px 18px 15px; border-radius: 14px; background: var(--surface); border: 1px solid var(--card-border, var(--border));
  color: var(--text) !important; text-decoration: none !important; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.dkpi:hover { border-color: color-mix(in srgb, var(--k) 45%, var(--border)); box-shadow: 0 10px 24px -18px color-mix(in srgb, var(--k) 80%, transparent); }
.dkpi-ico { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--ks); color: var(--k); }
.dkpi-ico .svg-icon { width: 18px; height: 18px; }
.dkpi small { padding-right: 44px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.dkpi b { margin-top: 6px; font-size: 22px; line-height: 1.15; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dkpi b span { font-size: 14px; color: var(--muted); font-weight: 600; }
.dkpi em { margin-top: 2px; font-style: normal; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dkpi-bar { height: 4px; margin: 8px 0 2px; border-radius: 999px; background: var(--surface-3, var(--border)); overflow: hidden; }
.dkpi-bar i { display: block; height: 100%; border-radius: inherit; background: var(--k); }
.dkpi-tag { position: absolute; top: 18px; right: 56px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.dkpi-tag.up { background: var(--success-soft); color: var(--success); }
.dkpi-tag.down { background: var(--danger-soft); color: var(--danger); }
.dkpi.t-teal { --k: var(--primary); --ks: var(--primary-soft); }
.dkpi.t-green { --k: var(--success); --ks: var(--success-soft); }
.dkpi.t-blue { --k: var(--info); --ks: var(--info-soft); }
.dkpi.t-red { --k: var(--danger); --ks: var(--danger-soft); }
.dkpi.t-amber { --k: var(--warning); --ks: var(--warning-soft); }
.dkpi.t-rose { --k: #db2777; --ks: color-mix(in srgb, #db2777 11%, transparent); }
.dkpi.t-violet { --k: var(--violet); --ks: var(--violet-soft); }
.dkpi.t-sky { --k: #0284c7; --ks: color-mix(in srgb, #0284c7 11%, transparent); }
.dkpi.is-main { background: linear-gradient(150deg, color-mix(in srgb, var(--primary) 7%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.dash .shortcut-card .shortcut-grid { grid-template-columns: repeat(auto-fill, minmax(min(104px, 100%), 1fr)); gap: 8px; }
.dash .shortcut { min-height: 84px; padding: 12px 6px; }
.dash .shortcut-icon { width: 38px; height: 38px; }
@media (max-width: 760px) {
  .dash-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .dkpi { padding: 13px 13px 12px; }
  .dkpi b { font-size: 18px; }
  .dkpi-ico { top: 11px; right: 11px; width: 28px; height: 28px; border-radius: 8px; }
  .dkpi-ico .svg-icon { width: 15px; height: 15px; }
  .dkpi small { padding-right: 32px; font-size: 12px; }
  .dkpi-tag { display: none; }
  .dash .shortcut-card .shortcut-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.dash-kpi-grid.section-gap-sm { margin-bottom: 20px; }
@media (min-width: 761px) { .dash-kpi-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* Expired page: router check results */
.exp-check { list-style: none; margin: 0; padding: 4px 0; }
.exp-check li { display: flex; gap: 10px; padding: 9px 18px; border-top: 1px solid var(--border); }
.exp-check li:first-child { border-top: 0; }
.exp-check-dot { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.exp-check-dot .svg-icon { width: 13px; height: 13px; }
.exp-check li.is-warn .exp-check-dot { background: var(--warning-soft); color: var(--warning); }
.exp-check li.is-fail .exp-check-dot { background: var(--danger-soft); color: var(--danger); }
.exp-check b { display: block; font-size: 13px; }
.exp-check small { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }

/* Payments › SMS auto-verify */
.sv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 14px; }
.sv-stat { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--card-border, var(--border)); box-shadow: var(--shadow); }
.sv-stat small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.sv-stat b { font-size: 20px; }
.sv-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--faint, #cbd5e1); }
.sv-dot.on { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.sv-label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.sv-link { display: flex; align-items: center; gap: 8px; }
.sv-link code { flex: 1; min-width: 0; padding: 9px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; overflow-wrap: anywhere; }
.sv-steps { margin: 0; padding-left: 36px; display: grid; gap: 8px; font-size: 13.5px; line-height: 1.55; }
.sv-steps code { font-size: 12px; }

/* Settings › Customer apps */
.ca-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 18px; align-items: start; }
.ca-title { display: flex; align-items: center; gap: 12px; }
.ca-ico, .pt-app-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #e8f8ee; color: #16a34a; }
.ca-ico svg, .pt-app-ico svg { width: 22px; height: 22px; }
.ca-file { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.ca-file > div { flex: 1; min-width: 0; }
.ca-file b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-file small { color: var(--muted); font-size: 12px; }
.ca-actions { grid-column: 1 / -1; }

/* Customer portal: app download cards */
.pt-apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; margin-bottom: 18px; }
.pt-app { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text) !important; text-decoration: none !important; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.pt-app:hover { border-color: #16a34a; transform: translateY(-1px); }
.pt-app-text { flex: 1; min-width: 0; }
.pt-app-text b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-app-text small { color: var(--muted); font-size: 12px; }
.pt-app-dl { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: #16a34a; color: #fff; }
.pt-app-dl .svg-icon { width: 18px; height: 18px; }
.ca-grid > .card { margin: 0; }

/* ==========================================================================
   Phones: every list and screen fits without side-scrolling
   ========================================================================== */
@media (max-width: 760px) {
  /* Long codes, links and tokens wrap instead of pushing the page wide */
  code, pre, kbd, .mono, .code-tag { overflow-wrap: anywhere; word-break: break-word; }
  pre { white-space: pre-wrap; }
  .code-tag { white-space: normal; }

  /* Status chips, tab bars and bulk actions: one row you can swipe */
  .cs-chips, .segmented, .shortcut-tabs, .cs-bulk { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .cs-chips::-webkit-scrollbar, .segmented::-webkit-scrollbar, .cs-bulk::-webkit-scrollbar { display: none; }
  .cs-chips > *, .segmented > *, .cs-bulk > * { flex: none; }
  .cs-chips { margin-bottom: 14px; padding-bottom: 2px; }
  .cs-bulk .btn { height: 34px; padding: 0 10px; font-size: 12.5px; }
  .segmented { max-width: 100%; }

  /* Tables become cards: one card per row, label above value, two per line */
  .table-wrap:has(> table.is-stacked) { overflow: visible; }
  table.is-stacked thead { display: none; }
  table.is-stacked, table.is-stacked tbody, table.is-stacked tfoot { display: block; width: 100%; min-width: 0 !important; }
  table.is-stacked tr { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  table.is-stacked tbody tr:hover { background: none; }
  table.is-stacked td, table.is-stacked tbody th, table.is-stacked tfoot th { display: block; width: auto !important; min-width: 0; max-width: none !important; padding: 0 !important; border: 0 !important;
    white-space: normal !important; text-align: left !important; background: none !important; overflow-wrap: anywhere; font-size: 13.5px; }
  table.is-stacked td[data-label]::before, table.is-stacked th[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
  table.is-stacked .is-wide, table.is-stacked td.actions, table.is-stacked td[colspan] { grid-column: 1 / -1; }
  table.is-stacked .is-wide { font-size: 14.5px; }
  table.is-stacked .is-wide:has(.cell-user)::before, table.is-stacked td.actions::before, table.is-stacked td[colspan]::before { display: none; }
  table.is-stacked td.check-col { position: absolute; top: 14px; right: 16px; width: auto !important; }
  table.is-stacked td.check-col::before { display: none; }
  table.is-stacked tr:has(> td.check-col) > .is-wide { padding-right: 32px !important; }
  table.is-stacked td.actions .icon-actions, table.is-stacked td.actions .btn-row, table.is-stacked td.actions { display: flex; flex-wrap: wrap; justify-content: flex-start !important; gap: 6px; }
  table.is-stacked td.actions .ia { width: 34px !important; height: 34px !important; }
  table.is-stacked .cell-clip, table.is-stacked .cell-clip-2, table.is-stacked .cell-main, table.is-stacked .cell-sub { max-width: none !important; white-space: normal !important; -webkit-line-clamp: unset; }
  table.is-stacked .num { text-align: left !important; }
  table.is-stacked tfoot tr { background: var(--surface-2); font-weight: 700; }

  /* Summary tiles: two per row and compact */
  .cl-kpis, .sv-stats, .dash-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .cl-kpi, .sv-stat { padding: 12px; gap: 10px; }

  /* Forms and toolbars */
  .page-head .actions { flex-wrap: wrap; gap: 8px; }
  .toolbar { flex-wrap: wrap; }
  .card-head { flex-wrap: wrap; }
  .card-head > .segmented, .card-head > .btn-row { max-width: 100%; }
  .input, .select, textarea { max-width: 100%; }
}
@media (max-width: 400px) {
  table.is-stacked tr { padding: 12px 14px; gap: 8px 12px; }
  .cl-kpi-ico, .cl-kpi .cl-kpi-ico { display: none; }
}
@media (max-width: 760px) { table.is-stacked .is-wide { order: -1; } }
.callout > * { min-width: 0; }
@media (max-width: 760px) { .callout { display: block; } .callout > .svg-icon { float: left; margin: 2px 8px 0 0; } .callout::after { content: ""; display: table; clear: both; } }
.ca-grid { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
@media (max-width: 760px) {
  table.is-stacked td form.inline, table.is-stacked td .inline-form { display: flex !important; flex-wrap: wrap; gap: 6px; }
  table.is-stacked td form .input { flex: 1 1 90px; width: auto !important; min-width: 0; }
  .so-item { flex-wrap: wrap; }
  .so-item > :last-child:not(.so-item-main) { margin-left: auto; }
}

/* Vouchers: one voucher = one device switch */
.vc-lock { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 18px; }
.vc-lock-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.vc-lock-text { flex: 1; min-width: 0; }
.vc-lock-text b { display: block; font-size: 14px; }
.vc-lock-text small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
@media (max-width: 640px) { .vc-lock { flex-wrap: wrap; } .vc-lock-ico { display: none; } }
@media (max-width: 760px) {
  .cp-row-main .pill, .cp-row-main .badge { white-space: normal; text-align: left; }
  .gw-head { flex-wrap: wrap; gap: 6px; }
  .so-card, .gw-grid > * { min-width: 0; }
  .pill, .badge { max-width: 100%; }
}

/* Dashboard header: greeting, live clock and actions */
.dash-top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; margin-bottom: 18px; padding: 16px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--card-border, var(--border)); box-shadow: var(--shadow); }
.dash-top-main { flex: 1 1 200px; min-width: 0; }
.dash-top-greet { display: block; font-size: 13px; font-weight: 600; color: var(--primary); }
.dash-top h1 { margin: 2px 0 0; font-size: 24px; letter-spacing: -.02em; line-height: 1.2; }
.dash-top p { margin: 3px 0 0; color: var(--muted); font-size: 13.5px; }
.dash-clock { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 14px; background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent); }
.dash-clock-ico { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary); color: #fff; box-shadow: 0 8px 16px -10px var(--primary); }
.dash-clock-ico .svg-icon { width: 21px; height: 21px; }
.dash-clock-text b { display: block; font-size: 22px; line-height: 1.1; letter-spacing: .01em; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.dash-clock-text small { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.dash-clock-text small .svg-icon { width: 13px; height: 13px; }
.dash-top-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) {
  .dash-top { padding: 14px; gap: 12px; }
  .dash-top h1 { font-size: 21px; }
  .dash-clock { flex: 1 1 100%; }
  .dash-clock-text b { font-size: 20px; }
  .dash-top-actions { flex: 1 1 100%; }
  .dash-top-actions .btn { flex: 1 1 0; justify-content: center; }
}

/* Panel users: permissions as a short summary that opens into the full list */
.perm-cell { min-width: 150px; max-width: 280px; }
.perm-more summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; cursor: pointer; list-style: none; }
.perm-more summary::-webkit-details-marker { display: none; }
.perm-more summary .cell-sub { margin: 0; }
.perm-more[open] summary .cell-sub { display: none; }
.perm-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.perm-list span { padding: 1px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 11.5px; color: var(--text-2, var(--text)); }
.perm-cell { max-width: 220px; }
@media (min-width: 1400px) {
  .list-slim td.actions .btn-row, .list-slim td.actions .icon-actions { flex-wrap: nowrap; }
  .list-slim td.actions { white-space: nowrap; width: 1%; }
}
@media (min-width: 761px) and (max-width: 1399px) {
  .list-slim td.actions .btn-row { flex-wrap: nowrap; }
  .list-slim td.actions { white-space: nowrap; width: 1%; }
  .users-table td.actions .btn-xs { font-size: 0; gap: 0; width: 28px; padding: 0; justify-content: center; }
  .users-table td.actions .btn-xs .svg-icon { width: 14px; height: 14px; }
}
@media (max-width: 1399px) { .perm-cell { min-width: 120px; max-width: 170px; } .users-table td.cell-main { min-width: 0; } }

/* Customer portal › Usage: 30-day totals */
.pu-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.pu-tile { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--card-border, var(--border)); box-shadow: var(--shadow); }
.pu-tile small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.pu-tile b { font-size: 24px; line-height: 1.15; letter-spacing: -.02em; overflow-wrap: anywhere; }
.pu-tile em { font-style: normal; color: var(--muted); font-size: 12px; }
.pu-tile.is-main { background: linear-gradient(150deg, color-mix(in srgb, var(--primary) 12%, var(--surface)), var(--surface) 75%); border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.pu-tile.is-main b { font-size: 28px; color: var(--primary); }
.pu-bars .pt-bar small.is-hidden { visibility: hidden; }
.pu-bars { gap: 3px; }
@media (max-width: 760px) {
  .pu-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pu-tile.is-main { grid-column: 1 / -1; }
  .pu-tile { padding: 13px 14px; }
  .pu-tile b { font-size: 19px; }
  .pu-tile.is-main b { font-size: 24px; }
}
.pu-bars .pt-bar { min-width: 0; }
.pu-bars .pt-bar small { font-size: 10px; white-space: nowrap; }
@media (max-width: 760px) {
  .pu-bars { gap: 2px; height: 150px; }
  .pu-bars .pt-bar span { border-radius: 3px 3px 1px 1px; }
  .pu-tiles .pu-tile:last-child { grid-column: 1 / -1; }
}

/* MTC CONNECT app: header download menu and portal card */
.app-dd-menu { width: 260px; padding: 14px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.app-dd-head { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; }
.app-dd-ico { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--primary); color: #fff; }
.app-dd-ico .svg-icon { width: 20px; height: 20px; }
.app-dd-head b { display: block; font-size: 14px; }
.app-dd-head small { display: block; color: var(--muted); font-size: 12px; }
.app-dd-qr { width: 160px; height: 160px; padding: 6px; border-radius: 12px; background: #fff; border: 1px solid var(--border); display: grid; place-items: center; }
.app-dd-qr img, .app-dd-qr canvas { width: 148px !important; height: 148px !important; }
.app-dd-btn { width: 100%; justify-content: center; }
.app-dd-hint { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.app-dd-code { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; }
.app-dd-code span { color: var(--muted); }
.app-dd-code b { flex: 1; text-align: left; }
.pt-app.is-main { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); background: linear-gradient(150deg, color-mix(in srgb, var(--primary) 9%, var(--surface)), var(--surface) 70%); }
.pt-app.is-main .pt-app-ico { background: var(--primary); color: #fff; }
.pt-app.is-main .pt-app-ico .svg-icon { width: 21px; height: 21px; }
.pt-app.is-main .pt-app-dl { background: var(--primary); }
@media (max-width: 640px) { .app-dd-menu { width: min(260px, calc(100vw - 24px)); } }
.app-dd-menu a.app-dd-btn { height: 38px; background: var(--primary) !important; color: #fff !important; border-radius: 10px; font-weight: 700; }
.app-dd-menu a.app-dd-btn .svg-icon { color: #fff; }

/* ---- MTC CONNECT info ---- */
.mi { --mi-navy: #0b2a5b; --mi-blue: #1d4ed8; --mi-teal: #0fb5a3; --mi-cyan: #22c3e6; display: grid; gap: 20px; max-width: 1320px; margin: 0 auto; color: var(--text); font-size: 14px; }

/* Hero */
.mi-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 24px; align-items: stretch; padding: 24px; border-radius: 24px; border: 1px solid var(--border); background: radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--mi-cyan) 12%, transparent), transparent 45%), linear-gradient(135deg, var(--surface), var(--surface-2)); box-shadow: 0 12px 34px rgba(15, 35, 80, .07); }
.mi-hero-main { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; padding: 6px 0; }
.mi-kicker { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 18px; padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 800; letter-spacing: .12em; color: var(--mi-teal); background: color-mix(in srgb, var(--mi-teal) 11%, var(--surface)); border: 1px solid color-mix(in srgb, var(--mi-teal) 25%, transparent); }
.mi-kicker svg { width: 19px; height: 19px; }
.mi-logo { display: block; max-width: min(320px, 100%); max-height: 120px; object-fit: contain; }
.mi-wordmark { font-size: clamp(30px, 3.6vw, 46px); font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--mi-navy); }
.mi-tagline { margin-top: 10px; font-size: 13px; font-weight: 700; letter-spacing: .3em; color: var(--muted); }
.mi-about { margin: 14px 0 0; max-width: 540px; font-size: 14.5px; line-height: 1.65; color: var(--text-2); }
.mi-highlights { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 520px; }
.mi-highlights li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 13px; font-weight: 700; line-height: 1.25; }
.mi-highlights svg { flex: none; width: 30px; height: 30px; padding: 6px; border-radius: 9px; color: var(--mi-blue); background: color-mix(in srgb, var(--mi-blue) 10%, var(--surface)); }
.mi-hero-art { position: relative; overflow: hidden; min-height: 260px; border-radius: 20px; background: linear-gradient(140deg, #0fb5a3 0%, #1d4ed8 55%, #0b2a5b 100%); }
.mi-hero-art::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px); background-size: 28px 28px; mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 80%); }
.mi-glow { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .55; }
.mi-glow.g1 { width: 200px; height: 200px; top: -60px; right: -40px; background: #5eead4; }
.mi-glow.g2 { width: 220px; height: 220px; bottom: -90px; left: -60px; background: #60a5fa; }
.mi-screen { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); width: min(290px, 70%); aspect-ratio: 16 / 10; display: grid; place-content: center; gap: 8px; text-align: center; padding: 16px; border-radius: 14px; border: 7px solid #111c33; background: radial-gradient(circle at 30% 20%, #1e3a8a, #0b1736 72%); box-shadow: 0 24px 50px rgba(2, 12, 40, .5); color: #fff; }
.mi-screen::after { content: ""; position: absolute; left: -15%; right: -15%; bottom: -19px; height: 11px; border-radius: 0 0 12px 12px; background: linear-gradient(#e2e8f0, #94a3b8); }
.mi-screen img { max-width: 100%; max-height: 70px; object-fit: contain; margin: 0 auto; filter: brightness(0) invert(1); }
.mi-screen b { font-size: clamp(18px, 2vw, 26px); font-weight: 800; letter-spacing: -.01em; }
.mi-screen small { font-size: 8.5px; letter-spacing: .22em; opacity: .75; }
.mi-tile { position: absolute; z-index: 1; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .35); color: #fff; backdrop-filter: blur(6px); box-shadow: 0 10px 22px rgba(2, 12, 40, .22); animation: mi-float 5s ease-in-out infinite; }
.mi-tile svg { width: 23px; height: 23px; }
.mi-tile.t1 { top: 9%; left: 8%; }
.mi-tile.t2 { top: 9%; right: 8%; animation-delay: -1.2s; }
.mi-tile.t3 { bottom: 9%; right: 8%; animation-delay: -2.4s; }
.mi-tile.t4 { bottom: 9%; left: 8%; animation-delay: -3.6s; }
@keyframes mi-float { 50% { transform: translateY(-7px); } }
@media (prefers-reduced-motion: reduce) { .mi-tile { animation: none; } }

/* Sections */
.mi-block { padding: 20px 22px; border-radius: 22px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 8px 26px rgba(15, 35, 80, .05); }
.mi-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.mi-head > div { flex: 1; min-width: 200px; }
.mi-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.015em; }
.mi-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.mi-head-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--mi-teal), var(--mi-blue)); box-shadow: 0 8px 18px color-mix(in srgb, var(--mi-blue) 28%, transparent); }
.mi-head-ico svg { width: 21px; height: 21px; }
.mi-all { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--mi-teal); color: var(--mi-teal); font-weight: 700; font-size: 14px; }
.mi-all:hover { background: color-mix(in srgb, var(--mi-teal) 10%, var(--surface)); text-decoration: none; }
.mi-all svg { width: 15px; height: 15px; }

/* Support */
.mi-contacts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1440px) { .mi-contacts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .mi-contacts { grid-template-columns: minmax(0, 1fr); } }
.mi-contact { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 13px 14px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); transition: border-color .15s, transform .15s, box-shadow .15s; }
a.mi-contact:hover { border-color: color-mix(in srgb, var(--mi-blue) 45%, var(--border)); transform: translateY(-2px); box-shadow: 0 10px 22px rgba(15, 35, 80, .08); text-decoration: none; }
.mi-contact > span:last-child { display: grid; gap: 4px; min-width: 0; }
.mi-contact small { color: var(--muted); font-size: 12px; font-weight: 600; }
.mi-contact b { color: var(--mi-blue); font-size: 13.5px; overflow-wrap: anywhere; }
.mi-dot { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; }
.mi-dot svg { width: 18px; height: 18px; }
.mi-dot.is-green { background: #14b88a; }
.mi-dot.is-wa { background: #25d366; }
.mi-dot.is-red { background: #ef4444; }
.mi-dot.is-blue { background: #1d4ed8; }
.mi-wa-btn { display: inline-flex; align-items: center; gap: 4px; justify-self: start; max-width: 100%; padding: 5px 10px; border-radius: 8px; background: #16a34a; color: #fff !important; font-size: 12px; font-weight: 700; white-space: nowrap; }
.mi-wa-btn:hover { background: #15803d; text-decoration: none; }
.mi-wa-btn svg { width: 14px; height: 14px; }

/* Payment */
.mi-pay { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 18px; align-items: start; }
.mi-pay-box { display: grid; gap: 8px; padding: 14px; border-radius: 18px; border: 1px solid; }
.mi-pay-box.is-mobile { background: color-mix(in srgb, #e2136e 5%, var(--surface)); border-color: color-mix(in srgb, #e2136e 18%, var(--border)); }
.mi-pay-box.is-bank { background: color-mix(in srgb, var(--mi-blue) 5%, var(--surface)); border-color: color-mix(in srgb, var(--mi-blue) 16%, var(--border)); }
.mi-pay-box h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 2px; font-size: 15px; font-weight: 800; }
.mi-pay-box.is-mobile h3 svg { color: #e11d48; }
.mi-pay-box.is-bank h3 { color: var(--mi-blue); }
.mi-pay-box h3 svg { width: 20px; height: 20px; }
.mi-pay-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; align-items: center; gap: 10px; min-height: 48px; padding: 7px 12px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); }
.mi-pay-row.is-bank-row { grid-template-columns: 116px minmax(0, 1fr) 32px; }
.mi-pay-row.is-bank-row .mi-pay-num { font-weight: 600; }
.mi-pay-row:not(.is-bank-row) .mi-pay-num { white-space: nowrap; }
.mi-pay-label { font-weight: 600; font-size: 13px; color: var(--text-2); }
.mi-pay-num { font-size: 14px; font-weight: 800; letter-spacing: .01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mi-pay-row:not(.is-bank-row) { border-left: 4px solid var(--mi-wallet, var(--mi-blue)); }
.mi-pay-row.is-bkash { --mi-wallet: #e2136e; }
.mi-pay-row.is-nagad { --mi-wallet: #ec5a24; }
.mi-pay-row.is-rocket { --mi-wallet: #8c3494; }
.mi-pay-row.is-upay { --mi-wallet: #0054a6; }
.mi-pay-row.is-other { --mi-wallet: var(--muted); }
.mi-copy { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 9px; border: 0; cursor: pointer; font-size: 10px; font-weight: 700; color: var(--mi-blue); background: color-mix(in srgb, var(--mi-blue) 10%, var(--surface)); }
.mi-copy:hover { background: color-mix(in srgb, var(--mi-blue) 18%, var(--surface)); }

/* Services */
.mi-services { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.mi-service { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 36px 12px 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); transition: border-color .15s, transform .15s; }
.mi-service:hover { border-color: color-mix(in srgb, var(--mi-teal) 45%, var(--border)); transform: translateY(-2px); }
.mi-service::after { content: "\203A"; position: absolute; right: 18px; top: 50%; transform: translateY(-55%); font-size: 24px; color: var(--muted); }
.mi-service > span:last-child { display: grid; gap: 3px; min-width: 0; }
.mi-service b { font-size: 14px; }
.mi-service small { color: var(--muted); font-size: 12px; }
.mi-service-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: var(--mi-blue); background: color-mix(in srgb, var(--mi-blue) 9%, var(--surface)); }
.mi-service-ico svg { width: 21px; height: 21px; }

/* Developer */
.mi-dev-body { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 22px; align-items: stretch; }
.mi-dev-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px 18px; border-radius: 18px; color: #fff; background: radial-gradient(circle at 50% 0%, rgba(94, 234, 212, .35), transparent 60%), linear-gradient(160deg, #0b2a5b, #1d4ed8 130%); }
.mi-dev-photo { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .9); box-shadow: 0 0 0 6px rgba(255, 255, 255, .14), 0 14px 30px rgba(0, 0, 0, .3); }
.mi-dev-card h3 { color: #fff; margin: 14px 0 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; }
.mi-dev-role { margin-top: 4px; font-size: 12.5px; font-weight: 600; color: #a7f3d0; line-height: 1.4; }
.mi-dev-badge { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25); }
.mi-dev-badge span { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, .3); }
.mi-dev-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mi-dev-about { margin: 0; padding: 16px 18px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.mi-dev-label { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.mi-dev-skills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -4px; }
.mi-dev-skills span { padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--mi-blue); background: color-mix(in srgb, var(--mi-blue) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--mi-blue) 16%, transparent); }
.mi-dev-contact { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr)); gap: 10px; }
.mi-dev-contact li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); min-width: 0; }
.mi-dev-contact li > svg, .mi-dev-fb svg { flex: none; width: 32px; height: 32px; padding: 8px; border-radius: 10px; color: var(--mi-blue); background: color-mix(in srgb, var(--mi-blue) 10%, var(--surface)); }
.mi-dev-fb { display: grid; }
.mi-dev-contact div { display: grid; gap: 2px; min-width: 0; }
.mi-dev-contact small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.mi-dev-contact a, .mi-dev-contact span { font-size: 13px; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }

/* Footer */
.mi-foot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px 28px; padding: 22px 28px; border-radius: 22px; color: #fff; background: radial-gradient(circle at 100% 0%, rgba(34, 195, 230, .25), transparent 40%), linear-gradient(110deg, #071a3d, #0b2a5b 55%, #0e4a7a); }
.mi-foot-brand { display: grid; gap: 4px; }
.mi-foot-brand img { max-height: 42px; max-width: 170px; object-fit: contain; filter: brightness(0) invert(1); }
.mi-foot-brand b { font-size: 20px; font-weight: 800; }
.mi-foot-brand small { font-size: 10px; letter-spacing: .24em; opacity: .8; }
.mi-foot-text { display: grid; gap: 4px; text-align: center; padding: 0 20px; border-inline: 1px solid rgba(255, 255, 255, .18); }
.mi-foot-text b { font-size: 14.5px; }
.mi-foot-text span { font-size: 12.5px; opacity: .82; }
.mi-social { display: flex; gap: 10px; }
.mi-social a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; }
.mi-social a:hover { filter: brightness(1.12); text-decoration: none; }
.mi-social svg { width: 18px; height: 18px; }
.mi-social .is-fb { background: #1877f2; }
.mi-social .is-yt { background: #ff0000; }
.mi-social .is-wa { background: #25d366; }
.mi-social .is-web { background: #1d9bf0; }

:root[data-theme="dark"] .mi { --mi-navy: #bfdbfe; --mi-blue: #60a5fa; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mi { --mi-navy: #bfdbfe; --mi-blue: #60a5fa; }
}

/* Edit form */
.mi-edit-title { margin: 26px 0 12px; font-size: 18px; font-weight: 700; }
.mi-form { display: grid; gap: 16px; }
.mi-form > .card { margin: 0; }
.mi-form .card-head h3 { display: flex; align-items: center; gap: 8px; }
.mi-form .card-head h3 svg { width: 18px; height: 18px; color: var(--primary); }
.mi-form-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.mi-form-row .field { margin: 0; }
.mi-form-logo { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.mi-form-logo-box { display: grid; place-items: center; width: 180px; height: 90px; padding: 10px; border-radius: 12px; border: 1px dashed var(--border-strong); background: var(--surface-2); }
.mi-form-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mi-form-logo-box.is-photo { width: 96px; height: 96px; padding: 0; overflow: hidden; border-radius: 50%; }
.mi-form-logo-box.is-photo img { width: 100%; height: 100%; object-fit: cover; }
.mi-form-save { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; }
.mi-owner { display: grid; gap: 4px; }

@media (max-width: 980px) {
  .mi-hero { grid-template-columns: minmax(0, 1fr); }
  .mi-hero-art { min-height: 250px; }
  .mi-dev-body { grid-template-columns: minmax(0, 1fr); }
  .mi-foot { grid-template-columns: minmax(0, 1fr); text-align: center; justify-items: center; }
  .mi-foot-text { border-inline: 0; padding: 14px 0; border-block: 1px solid rgba(255, 255, 255, .18); width: 100%; }
}
@media (max-width: 760px) {
  .mi { gap: 14px; font-size: 14px; }
  .mi-hero { padding: 18px 14px; gap: 18px; border-radius: 20px; }
  .mi-kicker { margin-bottom: 14px; padding: 7px 14px; font-size: 13px; letter-spacing: .1em; }
  .mi-kicker svg { width: 16px; height: 16px; }
  .mi-wordmark { font-size: 34px; }
  .mi-tagline { margin-top: 8px; font-size: 10.5px; letter-spacing: .16em; }
  .mi-about { margin-top: 12px; font-size: 14.5px; line-height: 1.6; }
  .mi-highlights { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 16px; }
  .mi-highlights li { gap: 8px; font-size: 12.5px; padding: 8px; }
  .mi-highlights svg { width: 26px; height: 26px; padding: 5px; }
  .mi-head { gap: 12px; margin-bottom: 14px; }
  .mi-head-ico { width: 42px; height: 42px; border-radius: 12px; }
  .mi-head-ico svg { width: 21px; height: 21px; }
  .mi-head p { font-size: 13px; }
  .mi-contacts { gap: 10px; }
  .mi-contact { padding: 12px 14px; gap: 12px; border-radius: 14px; }
  .mi-dot { width: 42px; height: 42px; }
  .mi-dot svg { width: 19px; height: 19px; }
  .mi-pay-box { padding: 12px; border-radius: 16px; }
  .mi-pay-box h3 { font-size: 15.5px; }
  .mi-service { padding: 12px 36px 12px 12px; border-radius: 14px; }
  .mi-service-ico { width: 44px; height: 44px; }
  .mi-service-ico svg { width: 22px; height: 22px; }
  .mi-dev-card { padding: 20px 14px; }
  .mi-dev-photo { width: 116px; height: 116px; }
  .mi-dev-about { padding: 12px 14px; font-size: 14px; }
  .mi-foot { padding: 18px 16px; border-radius: 18px; }
  .mi-hero-art { min-height: 210px; }
  .mi-screen { width: min(200px, 54%); }
  .mi-tile { width: 40px; height: 40px; border-radius: 12px; }
  .mi-tile svg { width: 19px; height: 19px; }
  .mi-tile.t1, .mi-tile.t4 { left: 5%; }
  .mi-tile.t2, .mi-tile.t3 { right: 5%; }
  .mi-block { padding: 18px 14px; border-radius: 18px; }
  .mi-head h2 { font-size: 19px; }
  .mi-pay-row, .mi-pay-row.is-bank-row { grid-template-columns: minmax(0, 1fr) 32px; gap: 2px 12px; min-height: 0; padding: 10px 12px; }
  .mi-pay-row .mi-pay-label { grid-column: 1; grid-row: 1; font-size: 12.5px; color: var(--muted); }
  .mi-pay-row .mi-pay-num { grid-column: 1; grid-row: 2; font-size: 14px; }
  .mi-pay-row .mi-copy { grid-column: 2; grid-row: 1 / span 2; }
  .mi-form-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .mi-form-row .field:first-child { grid-column: 1 / -1; }
}

/* ---- Live traffic (MikroTik & reseller) ---- */
.lt-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px 16px; margin-bottom: 14px; }
.lt-toolbar .field { margin: 0; min-width: 180px; }
.lt-toolbar .field.grow { flex: 1; min-width: 220px; }
.lt-router-error { margin-bottom: 14px; }
.lt { --lt-down: #0ea5e9; --lt-up: #f59e0b; display: grid; gap: 14px; }
.lt-monitor { display: grid; gap: 14px; padding: 18px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-xs); }
.lt-monitor.is-empty { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; background: linear-gradient(135deg, var(--primary-soft), var(--surface) 70%); }
.lt-monitor.is-empty h2 { margin: 0; font-size: 17px; }
.lt-monitor.is-empty p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.lt-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.lt-head-ico { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #0b3b6e)); box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--primary) 80%, transparent); }
.lt-head-ico svg { width: 24px; height: 24px; }
.lt-head-ico.is-vlan { background: linear-gradient(135deg, #8b5cf6, #4f46e5); }
.lt-head-ico.is-client { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
.lt-title { flex: 1; min-width: 180px; }
.lt-kind { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.lt-title h2 { margin: 1px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -.01em; overflow-wrap: anywhere; }
.lt-title p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.lt-actions { display: flex; align-items: center; gap: 10px; }
.lt-live { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: #15803d; background: #dcfce7; }
.lt-live i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; animation: lt-pulse 1.6s ease-in-out infinite; }
.lt-monitor.is-paused .lt-live { color: var(--muted); background: var(--surface-3); }
.lt-monitor.is-paused .lt-live i { background: var(--muted); animation: none; }
.lt-monitor.is-error .lt-live { color: #b42318; background: #fee4e2; }
.lt-monitor.is-error .lt-live i { background: #ef4444; animation: none; }
@keyframes lt-pulse { 50% { box-shadow: 0 0 0 5px rgba(34, 197, 94, .2); } }
@media (prefers-reduced-motion: reduce) { .lt-live i { animation: none; } }
.lt-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lt-stat { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); min-width: 0; }
.lt-stat > div { display: grid; gap: 2px; min-width: 0; }
.lt-stat small { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.lt-stat small em { font-style: normal; opacity: .8; }
.lt-stat b { font-size: 24px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.lt-stat > div > span { font-size: 12px; color: var(--muted); }
.lt-stat strong { color: var(--text-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.lt-stat-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; }
.lt-stat-ico svg { width: 22px; height: 22px; }
.lt-stat.is-down .lt-stat-ico { color: var(--lt-down); background: color-mix(in srgb, var(--lt-down) 13%, var(--surface)); }
.lt-stat.is-down b { color: var(--lt-down); }
.lt-stat.is-up .lt-stat-ico { color: var(--lt-up); background: color-mix(in srgb, var(--lt-up) 15%, var(--surface)); }
.lt-stat.is-up b { color: #d97706; }
.lt-chart { position: relative; height: 260px; padding: 8px 4px 4px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.lt-chart canvas { display: block; width: 100%; height: 100%; }
.lt-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--muted); }
.lt-key { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-2); }
.lt-key i { width: 18px; height: 4px; border-radius: 4px; }
.lt-key.is-down i { background: var(--lt-down); }
.lt-key.is-up i { background: var(--lt-up); }
.lt-time { margin-left: auto; }
.lt-error { margin: 0; }
.lt-error[hidden] { display: none; }

.lt-picker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 260px); align-items: center; gap: 12px; padding: 16px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-xs); }
.lt-picker > .segmented { justify-self: start; }
.lt-picker > .tab-panel { grid-column: 1 / -1; }
.lt-picker .segmented button { display: inline-flex; align-items: center; gap: 6px; }
.lt-picker .segmented button .svg-icon { width: 15px; height: 15px; }
.lt-count { min-width: 20px; padding: 0 6px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; color: var(--muted); background: var(--surface-3); }
.lt-picker .segmented button.active .lt-count { color: #fff; background: var(--primary); }
.lt-search { position: relative; display: block; }
.lt-search .svg-icon { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.lt-search .input { padding-left: 34px; }
.lt-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 8px; max-height: 420px; overflow-y: auto; padding: 2px; }
.lt-item { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none; transition: border-color .12s, background .12s, transform .12s; }
.lt-item:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: var(--surface); text-decoration: none; transform: translateY(-1px); }
.lt-item.is-active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-ring); }
.lt-item[hidden] { display: none; }
.lt-item-ico { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--primary); background: color-mix(in srgb, var(--primary) 11%, var(--surface)); }
.lt-item-ico svg { width: 18px; height: 18px; }
.lt-item-text { display: grid; min-width: 0; flex: 1; }
.lt-item-text b { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-item-text small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.lt-dot.is-off { background: #cbd5e1; box-shadow: none; }
.lt-none { margin: 0; padding: 18px; border-radius: 12px; border: 1px dashed var(--border-strong); text-align: center; color: var(--muted); font-size: 13.5px; }
@media (max-width: 760px) {
  .lt-toolbar .field, .lt-toolbar .field.grow { min-width: 0; flex: 1 1 100%; }
  .lt-toolbar .btn { width: 100%; justify-content: center; }
  .lt-monitor, .lt-picker { padding: 14px 12px; border-radius: 16px; }
  .lt-head-ico { width: 42px; height: 42px; }
  .lt-title h2 { font-size: 17px; }
  .lt-actions { width: 100%; justify-content: space-between; }
  .lt-stats { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .lt-stat { padding: 12px; }
  .lt-stat b { font-size: 20px; }
  .lt-chart { height: 200px; }
  .lt-time { margin-left: 0; width: 100%; }
  .lt-picker { grid-template-columns: minmax(0, 1fr); }
  .lt-picker > .segmented { width: 100%; }
  .lt-items { max-height: none; }
}

/* ---- Share button (read-only links) ---- */
.share-pop { position: relative; display: inline-block; }
.share-pop > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.share-pop > summary::-webkit-details-marker { display: none; }
.share-pop[open] > summary { border-color: var(--primary); color: var(--primary); }
.share-pop-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 30; width: min(320px, calc(100vw - 32px)); padding: 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-lg); }
.share-pop-panel form, .share-result { display: grid; gap: 10px; }
.share-pop-panel b { font-size: 14.5px; }
.share-pop-panel p { margin: -4px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.share-pop-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.share-pop-row .select { width: auto; min-width: 120px; }
.share-result[hidden], .share-pop-panel form[hidden] { display: none; }
.share-result .input { font-size: 12.5px; }
.share-result-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.share-result small { color: var(--muted); font-size: 12px; }

/* ---- Ping tool ---- */
.pg { display: grid; gap: 14px; }
.pg-add { display: grid; gap: 14px; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-xs); }
.pg-add-tabs { justify-self: start; }
.pg-add-tabs button { display: inline-flex; align-items: center; gap: 6px; }
.pg-add-tabs .svg-icon { width: 16px; height: 16px; }
.pg-add-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.pg-add-row > form .btn { height: 100%; min-height: 44px; }
.pg-search { position: relative; flex: 1; min-width: 240px; }
.pg-search > .svg-icon { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pg-search .input { height: 44px; padding-left: 42px; font-size: 14px; }
.pg-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 25; display: grid; gap: 2px; max-height: 360px; overflow-y: auto; padding: 6px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-lg); }
.pg-results[hidden] { display: none; }
.pg-results button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.pg-results button:hover, .pg-results button:focus-visible { background: var(--primary-soft); }
.pg-results button > span:nth-child(2) { display: grid; flex: 1; min-width: 0; }
.pg-results b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-results small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-results em { flex: none; font-style: normal; font-size: 12px; font-weight: 700; color: var(--primary); }
.pg-results p { margin: 0; padding: 12px; color: var(--muted); font-size: 13px; text-align: center; }
.pg-res-ico { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-weight: 800; font-size: 13px; color: var(--primary); background: var(--primary-soft); }
.pg-hint { margin: 0; color: var(--muted); font-size: 13px; }
.pg-ip-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.pg-ip-form .field { margin: 0; min-width: 160px; }
.pg-ip-form .field.grow { flex: 1; min-width: 200px; }
.pg-msg { padding: 9px 12px; border-radius: 10px; font-size: 13.5px; font-weight: 600; }
.pg-msg.is-ok { color: #15803d; background: #dcfce7; }
.pg-msg.is-error { color: #b42318; background: #fee4e2; }
.pg-msg[hidden] { display: none; }
.pg-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.pg-counts { display: flex; flex-wrap: wrap; gap: 6px; }
.pg-count { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); }
.pg-count b { font-variant-numeric: tabular-nums; }
.pg-count.is-running { color: #15803d; background: #dcfce7; border-color: transparent; }
.pg-count.is-running i { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; animation: lt-pulse 1.6s ease-in-out infinite; }
.pg-count.is-down b { color: #dc2626; }
.pg-count.is-loss b { color: #d97706; }
.pg-filter { margin-left: auto; }
.pg-bulk { display: flex; gap: 6px; }
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 12px; }
.pg-none { grid-column: 1 / -1; margin: 0; padding: 20px; text-align: center; color: var(--muted); }
.pg-card { --pg: #22c55e; position: relative; display: grid; gap: 6px; min-width: 0; padding: 14px 14px 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-xs); overflow: hidden; }
.pg-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--pg); }
.pg-card.is-loss { --pg: #f59e0b; }
.pg-card.is-down { --pg: #ef4444; background: color-mix(in srgb, #ef4444 4%, var(--surface)); }
.pg-card.is-waiting { --pg: #60a5fa; }
.pg-card.is-stopped { --pg: #94a3b8; opacity: .8; }
.pg-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pg-state { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--pg); }
.pg-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--pg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pg) 22%, transparent); }
.pg-card.is-up .pg-state, .pg-card.is-waiting .pg-state { color: #15803d; }
.pg-card.is-waiting .pg-state { color: #2563eb; }
.pg-card.is-stopped .pg-state { color: var(--muted); }
.pg-kind { font-size: 11px; font-weight: 700; color: var(--muted); padding: 2px 8px; border-radius: 999px; background: var(--surface-3); }
.pg-name { font-size: 15px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.pg-name:hover { color: var(--primary); text-decoration: none; }
.pg-meta { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -4px; }
.pg-figures { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pg-figures b { font-size: 24px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--text); }
.pg-card.is-down .pg-figures b { color: #dc2626; font-size: 20px; }
.pg-figures span { font-size: 12px; color: var(--muted); }
.pg-bars { display: flex; align-items: flex-end; gap: 2px; height: 34px; padding: 3px; border-radius: 8px; background: var(--surface-2); }
.pg-bars i { flex: 1; min-width: 2px; border-radius: 2px; background: #22c55e; }
.pg-bars i.is-loss { background: #f59e0b; }
.pg-bars i.is-down { background: #ef4444; }
.pg-bars i.is-empty { height: 14%; background: var(--border); }
.pg-actions { display: flex; gap: 6px; margin-top: 2px; }
.pg-actions .btn { flex: 1; justify-content: center; }
.pg-actions .pg-remove { flex: 0 0 34px; padding: 0; color: var(--muted); }
.pg-actions .pg-remove:hover { color: #dc2626; border-color: #fca5a5; }
.pg-empty { display: grid; justify-items: center; gap: 6px; padding: 40px 16px; border-radius: 18px; border: 1px dashed var(--border-strong); text-align: center; background: var(--surface); }
.pg-empty[hidden] { display: none; }
.pg-empty > span { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; color: var(--primary); background: var(--primary-soft); }
.pg-empty > span svg { width: 26px; height: 26px; }
.pg-empty b { font-size: 16px; }
.pg-empty p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---- Ping history ---- */
.ph { --ph-line: #2563eb; display: grid; gap: 14px; padding: 18px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-xs); }
.ph-head { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; }
.ph-state { --pg: #22c55e; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 800; color: #fff; background: var(--pg); }
.ph-state i { width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.ph-state.is-loss { --pg: #f59e0b; }
.ph-state.is-down { --pg: #ef4444; }
.ph-state.is-waiting { --pg: #3b82f6; }
.ph-state.is-stopped { --pg: #94a3b8; }
.ph-title { flex: 1; min-width: 180px; }
.ph-title h2 { margin: 0; font-size: 19px; font-weight: 800; overflow-wrap: anywhere; }
.ph-title p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.ph-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.ph-stats > div { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); min-width: 0; }
.ph-stats small { font-size: 12px; font-weight: 600; color: var(--muted); }
.ph-stats b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ph-stats .is-loss b { color: #d97706; }
.ph-stats .is-up b { color: #16a34a; }
.ph-chart { position: relative; height: 300px; padding: 6px 4px 2px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.ph-chart canvas { display: block; width: 100%; height: 100%; }
.ph-none { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; font-size: 13.5px; color: var(--muted); }
.ph-none[hidden] { display: none; }
.ph-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--muted); }
.lt-key.is-ms i { background: #2563eb; }
.lt-key.is-lossbar i { background: #ef4444; height: 8px; width: 10px; border-radius: 2px; }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---- Shared (public) pages ---- */
.share-page { min-height: 100vh; background: var(--bg); }
.share-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; max-width: 1100px; margin: 0 auto; padding: 16px; }
.share-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.share-brand img { height: 38px; max-width: 160px; object-fit: contain; }
.share-brand b { font-size: 16px; font-weight: 800; color: var(--text); }
.share-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--primary); background: var(--primary-soft); }
.share-badge .svg-icon { width: 15px; height: 15px; }
.share-main { max-width: 1100px; margin: 0 auto; padding: 0 16px 24px; }
.share-foot { max-width: 1100px; margin: 0 auto; padding: 0 16px 24px; font-size: 12.5px; color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .ph-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .pg-add { padding: 14px 12px; border-radius: 16px; }
  .pg-add-tabs { width: 100%; }
  .pg-add-row > form, .pg-add-row > form .btn { width: 100%; justify-content: center; }
  .pg-ip-form .field, .pg-ip-form .field.grow { flex: 1 1 100%; min-width: 0; }
  .pg-ip-form .btn { width: 100%; justify-content: center; }
  .pg-filter { margin-left: 0; width: 100%; }
  .pg-bulk { width: 100%; }
  .pg-bulk form { flex: 1; }
  .pg-bulk .btn { width: 100%; justify-content: center; }
  .ph { padding: 14px 12px; border-radius: 16px; }
  .ph-tools { width: 100%; }
  .ph-tools .segmented { flex: 1 1 100%; min-width: 0; display: flex; }
  .ph-tools .segmented button { flex: 1; padding: 5px 4px; font-size: 12px; }
  .ph-tools .share-pop { margin-left: auto; }
  .ph-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ph-stats > div:last-child { grid-column: 1 / -1; }
  .ph-chart { height: 230px; }
}

/* ---- IVR bill reminders ---- */
.ir-hero { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.ir-hero b { font-size: 16px; }
.ir-hero p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.ir-hero-ico { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; color: #fff; background: #94a3b8; }
.ir-hero-ico svg { width: 22px; height: 22px; }
.ir-hero.is-on { border-color: color-mix(in srgb, #22c55e 35%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, #22c55e 9%, var(--surface)), var(--surface) 70%); }
.ir-hero.is-on .ir-hero-ico { background: linear-gradient(135deg, #22c55e, #15803d); box-shadow: 0 10px 22px -12px #16a34a; }
.ir-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 16px; align-items: start; margin-top: 16px; }
.ir-grid > .card { margin: 0; }
.ir-grid .card-head h3 { display: flex; align-items: center; gap: 8px; }
.ir-grid .card-head h3 .svg-icon { width: 18px; height: 18px; color: var(--primary); }
.ir-save { grid-column: 1 / -1; position: sticky; bottom: 12px; display: flex; justify-content: flex-end; }
.ir-tools { margin-top: 20px; }
.ir-test { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.ir-test .field { margin: 0; }
.ir-setup ol { margin: 0; padding-left: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; font-size: 13.5px; line-height: 1.55; }
.ir-setup li { min-width: 0; }
.ir-grid > * { min-width: 0; }
.ir-setup pre { margin: 6px 0; white-space: pre; max-height: 260px; overflow: auto; }
.ir-preview { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.ir-preview audio { height: 36px; max-width: 100%; }
.ir-preview audio[hidden] { display: none; }
.ir-preview-msg { font-size: 12.5px; color: var(--muted); }
.ir-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ir-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ir-status.is-ok { color: #15803d; background: #dcfce7; }
.ir-status.is-bad { color: #b42318; background: #fee4e2; }
.ir-status.is-wait { color: #1d4ed8; background: #dbeafe; }
.ir-status.is-muted { color: var(--muted); background: var(--surface-3); }
.ir-note { min-width: 180px; font-size: 12.5px; color: var(--text-2); }
.ir-log summary { cursor: pointer; font-size: 12px; color: var(--primary); font-weight: 600; }
.ir-log ul { margin: 6px 0 0; padding-left: 16px; color: var(--muted); font-size: 12px; }
.ir-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ir-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.ir-chip b { color: var(--text); font-variant-numeric: tabular-nums; }
.ir-chip:hover { border-color: var(--primary); text-decoration: none; }
.ir-chip.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.ir-period { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px 16px; margin-bottom: 16px; }
.ir-period .field { margin: 0; }
.ir-reasons { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 10px; margin: 16px 0; }
.ir-reason { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; }
.ir-reason b { font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
.ir-reason i { position: absolute; left: 0; bottom: 0; height: 3px; background: #ef4444; }
.ir-reason:hover { border-color: #fca5a5; text-decoration: none; }
.ir-reason.active { border-color: #ef4444; background: #fef2f2; }
.ir-help ul { margin: 0; padding: 14px 18px 14px 34px; display: grid; gap: 6px; font-size: 13px; color: var(--text-2); line-height: 1.55; }
@media (max-width: 760px) {
  .ir-test { grid-template-columns: minmax(0, 1fr); }
  .ir-test .btn { width: 100%; justify-content: center; }
  .ir-save .btn { width: 100%; justify-content: center; }
}

/* Package picker: which router the chosen package belongs to */
.pkg-router-hint { display: block; margin-top: 4px; font-weight: 600; color: var(--primary); }
.pkg-router-hint[hidden] { display: none; }

/* ---- Client lists on phones: one compact card per client (all panels) ---- */
@media (max-width: 760px) {
  table.client-table.is-stacked tbody { display: grid; gap: 10px; padding: 10px; background: var(--surface-2); }
  table.client-table.is-stacked tbody tr { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px 10px; padding: 12px 12px 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
  table.client-table.is-stacked tbody tr:has(td[colspan]) { display: block; }
  table.client-table.is-stacked td::before { font-size: 9.5px !important; letter-spacing: .05em !important; margin-bottom: 1px !important; }
  table.client-table.is-stacked td { font-size: 12.5px; line-height: 1.35; }
  table.client-table.is-stacked .cell-sub { font-size: 11px; }
  /* Name, avatar and username on top, the tick box at the right. */
  table.client-table.is-stacked td:has(.cell-user) { grid-column: 1 / -1; order: 0; padding: 0 34px 8px 0 !important; border-bottom: 1px dashed var(--border) !important; }
  table.client-table.is-stacked .cell-user { gap: 10px; }
  table.client-table.is-stacked .cell-user .avatar { width: 38px; height: 38px; font-size: 12px; }
  table.client-table.is-stacked .cell-user .cell-main { font-size: 14.5px; font-weight: 700; white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; }
  table.client-table.is-stacked .cell-user .cell-sub { white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; }
  table.client-table.is-stacked td.check-col { top: 14px; right: 12px; }
  /* Shown in the profile instead. */
  table.client-table.is-stacked td[data-col="pppoe"], table.client-table.is-stacked td[data-col="password"] { display: none !important; }
  /* Status · Expiry · Due, then Package · Router · Bill, then ID · Mobile, then Address. */
  table.client-table.is-stacked td[data-col="status"] { order: 1; }
  table.client-table.is-stacked td[data-col="bill"] { order: 2; }
  table.client-table.is-stacked td[data-col="due"] { order: 3; }
  table.client-table.is-stacked td[data-col="package"] { order: 4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.client-table.is-stacked td[data-col="router"] { order: 5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  table.client-table.is-stacked td[data-col="router"] .cell-sub, table.client-table.is-stacked td[data-col="package"] .cell-sub { display: none; }
  table.client-table.is-stacked td[data-col="monthly"] { order: 6; font-weight: 700; }
  table.client-table.is-stacked td[data-col="code"] { order: 7; }
  table.client-table.is-stacked td[data-col="mobile"] { order: 8; grid-column: span 2; }
  table.client-table.is-stacked td[data-col="address"] { order: 9; grid-column: 1 / -1; }
  table.client-table.is-stacked td[data-col="address"] .cell-clip { display: block; white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
  table.client-table.is-stacked .code-tag { padding: 0 6px; font-size: 11.5px; }
  table.client-table.is-stacked td[data-col="status"] .badge, table.client-table.is-stacked td[data-col="status"] .pill { font-size: 11px; padding: 2px 8px; }
  table.client-table.is-stacked td[data-col="status"] .cell-sub { display: none; }
  /* Actions: one row of small buttons. */
  table.client-table.is-stacked td.actions { order: 10; grid-column: 1 / -1; padding-top: 8px !important; border-top: 1px solid var(--border) !important; }
  table.client-table.is-stacked td.actions .icon-actions { display: flex !important; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scrollbar-width: none; justify-content: flex-start !important; }
  table.client-table.is-stacked td.actions .icon-actions::-webkit-scrollbar { display: none; }
  table.client-table.is-stacked td.actions .ia { flex: none; width: 32px !important; height: 32px !important; border-radius: 9px; }
  table.client-table.is-stacked td.actions .ia .svg-icon { width: 15px; height: 15px; }
  table.client-table.is-stacked td.actions .btn-row { display: flex; justify-content: flex-start !important; gap: 6px; }
}
@media (max-width: 760px) {
  /* Empty address or mobile: no line for it. */
  table.client-table.is-stacked td[data-col="address"]:has(.cell-clip[title="—"]), table.client-table.is-stacked td[data-col="mobile"]:has(> .faint) { display: none !important; }
}

/* Client lists: "Select all" next to the bulk buttons on phones (the table head is hidden there) */
.cs-select-all { display: none; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; flex: none; }
.cs-select-all input { width: 17px; height: 17px; accent-color: var(--primary); }
@media (max-width: 760px) {
  .cs-select-all { display: inline-flex; }
  .cs-select-all.is-reseller { margin: 10px 12px 0; }
}
@media (max-width: 760px) { .cs-select-all.stack-select-all { margin: 10px 12px 4px; } }

/* Saved passwords with an eye to show them */
.pw-wrap { position: relative; display: block; }
.pw-wrap > .input { padding-right: 44px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.pw-eye:hover { color: var(--primary); background: var(--primary-soft); }
.pw-eye .svg-icon { width: 18px; height: 18px; }
.pw-eye::after { content: ""; position: absolute; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transform: rotate(-45deg); }
.pw-eye.is-shown::after { display: none; }
.pw-eye.is-shown { color: var(--primary); }

/* Client status when its router cannot be reached */
.online-state.status-live.is-unknown { background: var(--warning-soft); color: var(--warning); }
.online-state.is-unknown .dot { background: var(--warning); }

/* ---- Owner dashboard: hero + clients by ISP ---- */
.od-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr); gap: 22px; align-items: center; padding: 26px 28px; border-radius: 20px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, rgba(255, 255, 255, .16), transparent 55%), linear-gradient(135deg, #07a78c 0%, #078a7a 45%, #0b5f74 100%); box-shadow: 0 18px 40px -26px rgba(7, 120, 110, .9); }
.od-hero::after { content: ""; position: absolute; right: -60px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%; border: 36px solid rgba(255, 255, 255, .06); pointer-events: none; }
.od-hero-main { position: relative; z-index: 1; min-width: 0; }
.od-hello { display: inline-block; padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.od-hero h1 { margin: 10px 0 4px; font-size: 26px; line-height: 1.2; letter-spacing: -.02em; color: #fff; }
.od-hero p { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .8); }
.od-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.od-hero-actions .btn { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .28); color: #fff; }
.od-hero-actions .btn:hover { background: rgba(255, 255, 255, .24); }
.od-hero-actions .btn-primary { background: #fff; border-color: #fff; color: #067a67; }
.od-hero-actions .btn-primary:hover { background: #effcf9; color: #067a67; }
.od-hero-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.od-hero-stats a { display: grid; gap: 2px; min-width: 0; padding: 15px 16px; border-radius: 16px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); color: #fff; text-decoration: none !important; backdrop-filter: blur(4px); transition: background .15s, transform .15s; }
.od-hero-stats a:hover { background: rgba(255, 255, 255, .2); transform: translateY(-2px); }
.od-hs-ico { width: 32px; height: 32px; margin-bottom: 6px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); }
.od-hs-ico .svg-icon { width: 17px; height: 17px; }
.od-hero-stats small { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, .82); }
.od-hero-stats b { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-hero-stats em { font-style: normal; font-size: 11.5px; color: rgba(255, 255, 255, .78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.od-isps { scroll-margin-top: 80px; }
.od-total { padding: 6px 12px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-600, var(--primary)); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.od-total b { font-size: 14px; }
.od-isp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 12px; }
.od-isp { display: grid; gap: 6px; min-width: 0; padding: 14px 15px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; }
.od-isp:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); box-shadow: 0 12px 26px -20px color-mix(in srgb, var(--primary) 80%, transparent); transform: translateY(-2px); }
.od-isp-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.od-isp-top .so-avatar { width: 36px; height: 36px; font-size: 13px; }
.od-isp-top .pill { flex: none; font-size: 11px; }
.od-isp-name { flex: 1; display: grid; min-width: 0; }
.od-isp-name b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-isp-name small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.od-isp-count { display: flex; align-items: baseline; gap: 6px; margin-top: 6px; }
.od-isp-count b { font-size: 26px; line-height: 1.1; letter-spacing: -.02em; }
.od-isp-count small { color: var(--muted); font-size: 12px; font-weight: 600; }
.od-isp-meter { height: 6px; border-radius: 99px; background: var(--surface-3, var(--border)); overflow: hidden; }
.od-isp-meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #34d399); }
.od-isp-meter i.is-high { background: linear-gradient(90deg, var(--warning), var(--danger)); }
.od-isp-limit { color: var(--muted); font-size: 11.5px; }
.od-isp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.od-isp-chips > span { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 11.5px; font-weight: 600; color: var(--text-2, var(--muted)); }
.od-isp-chips .svg-icon { width: 13px; height: 13px; }
.od-isp-chips .is-green { color: var(--success); background: var(--success-soft); border-color: transparent; }
.od-isp-chips .is-teal { color: var(--primary-600, var(--primary)); background: var(--primary-soft); border-color: transparent; }
@media (max-width: 1100px) { .od-hero { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .od-hero { padding: 18px 16px; border-radius: 16px; gap: 16px; }
  .od-hero h1 { font-size: 21px; }
  .od-hero-stats { gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .od-hero-stats a { padding: 11px 10px; border-radius: 13px; }
  .od-hs-ico { width: 26px; height: 26px; border-radius: 8px; margin-bottom: 4px; }
  .od-hero-stats b { font-size: 20px; }
  .od-hero-stats em { display: none; }
  .od-isps .so-card-head { flex-wrap: wrap; gap: 8px; }
}
.od-hero.section-gap-sm { margin-bottom: 18px; }
.od-isp-meter i.is-free { opacity: .35; }

/* ---- Owner: ISP login details card ---- */
.lc-card { margin-bottom: 16px; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border)); background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 8%, var(--surface)), var(--surface) 60%); overflow: hidden; box-shadow: 0 16px 34px -28px color-mix(in srgb, var(--primary) 90%, transparent); }
.lc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.lc-ico { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #07a78c, #0b5f74); }
.lc-ico .svg-icon { width: 20px; height: 20px; }
.lc-title { flex: 1; min-width: 200px; display: grid; }
.lc-title h3 { margin: 0; font-size: 16px; }
.lc-title small { color: var(--muted); font-size: 12.5px; }
.lc-sms { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-sms .svg-icon { width: 15px; height: 15px; flex: none; }
.lc-sms.is-sent { background: var(--success-soft); color: var(--success); }
.lc-sms.is-failed { background: var(--warning-soft); color: var(--warning); }
.lc-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; padding: 16px 18px 18px; }
.lc-rows { display: grid; gap: 8px; align-content: start; }
.lc-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 9px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); }
.lc-row-ico { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-600, var(--primary)); }
.lc-row-ico .svg-icon { width: 16px; height: 16px; }
.lc-row-main { flex: 1; display: grid; min-width: 0; }
.lc-row-main small { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.lc-row-main b { font-size: 14px; overflow-wrap: anywhere; }
.lc-copy { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; }
.lc-copy:hover { border-color: var(--primary); color: var(--primary); }
.lc-copy .svg-icon { width: 13px; height: 13px; }
.lc-message { display: grid; gap: 8px; min-width: 0; }
.lc-message-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lc-message pre { margin: 0; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed color-mix(in srgb, var(--primary) 40%, var(--border)); font-family: inherit; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 900px) { .lc-body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .lc-head, .lc-body { padding-left: 14px; padding-right: 14px; } .lc-sms { white-space: normal; } }

/* ---- Admin dashboard v2: hero, KPI cards, revenue, client & network status, activity ---- */
.tone-indigo { --sc: #4f46e5; --sc-soft: rgba(79, 70, 229, .1); }
.tone-sky { --sc: #0284c7; --sc-soft: rgba(2, 132, 199, .1); }
.ah-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(300px, 1fr) minmax(0, 340px) auto; align-items: center; gap: 18px; min-height: 132px; margin-bottom: 18px; padding: 22px 24px; border-radius: 20px; color: #fff;
  background: radial-gradient(90% 140% at 0% 0%, rgba(255, 255, 255, .18), transparent 60%), linear-gradient(110deg, color-mix(in srgb, var(--primary) 70%, #0b1f4d) 0%, var(--primary) 55%, color-mix(in srgb, var(--primary) 70%, #60a5fa) 100%);
  box-shadow: 0 18px 40px -28px color-mix(in srgb, var(--primary) 90%, #000); }
.ah-hero-text { position: relative; z-index: 1; min-width: 0; }
.ah-greet { font-size: 14px; font-weight: 600; opacity: .92; }
.ah-hero h1 { margin: 4px 0 4px; font-size: 27px; line-height: 1.15; letter-spacing: -.02em; color: #fff; }
.ah-hero p { margin: 0; font-size: 14px; opacity: .85; }
.ah-art { align-self: end; width: 100%; height: 130px; margin-bottom: -22px; pointer-events: none; }
.ah-waves { animation: ah-pulse 2.4s ease-in-out infinite; }
@keyframes ah-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.ah-side { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.ah-clock { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 16px; background: rgba(255, 255, 255, .9); color: #0f172a; box-shadow: 0 10px 24px -18px rgba(0, 0, 0, .6); }
.ah-clock-ico { width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--primary); color: #fff; }
.ah-clock-ico .svg-icon { width: 22px; height: 22px; }
.ah-clock b { display: block; font-size: 22px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ah-clock small { display: block; margin-top: 2px; font-size: 12.5px; color: #475569; white-space: nowrap; }
.ah-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ah-actions .btn { height: 46px; padding: 0 18px; border-radius: 13px; font-weight: 700; }
.ah-btn-light { background: #fff; border-color: #fff; color: #0f172a; }
.ah-btn-light:hover { background: #f1f5f9; color: #0f172a; }
.ah-btn-solid { background: color-mix(in srgb, var(--primary) 75%, #0b1f4d); border-color: rgba(255, 255, 255, .25); color: #fff; }
.ah-btn-solid:hover { background: color-mix(in srgb, var(--primary) 60%, #0b1f4d); color: #fff; }
:root[data-theme="dark"] .ah-clock { background: rgba(15, 23, 42, .75); color: #f1f5f9; }
:root[data-theme="dark"] .ah-clock small { color: #cbd5e1; }

.ak-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(178px, 100%), 1fr)); gap: 14px; margin-bottom: 18px; }
.ak { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: start; column-gap: 12px; row-gap: 6px; min-width: 0; padding: 16px 16px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--card-border, var(--border)); box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; overflow: hidden; transition: transform .15s, box-shadow .15s, border-color .15s; }
.ak:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--sc) 45%, var(--border)); box-shadow: 0 14px 28px -20px color-mix(in srgb, var(--sc) 80%, transparent); }
.ak-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--sc-soft); color: var(--sc); }
.ak-ico .svg-icon { width: 22px; height: 22px; }
.ak-body { display: grid; min-width: 0; }
.ak-body small { font-size: 12.5px; font-weight: 600; color: var(--text-2, var(--muted)); line-height: 1.3; }
.ak-body b { margin-top: 2px; font-size: 23px; line-height: 1.15; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ak em { grid-column: 1 / -1; font-style: normal; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ak-up { padding: 1px 6px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-weight: 700; }
.ak-bar { grid-column: 1 / -1; height: 5px; border-radius: 99px; background: var(--surface-3, var(--border)); overflow: hidden; }
.ak-bar i { display: block; height: 100%; border-radius: inherit; background: var(--sc); }
.ak-chart { grid-column: 1 / -1; width: 100%; height: 30px; color: var(--sc); }
.mini-chart { display: block; overflow: visible; }
.mini-chart rect { fill: currentColor; }
.mini-chart-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }

.dsh-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 18px; align-items: stretch; }
.dsh-row-2 { grid-template-columns: minmax(0, 2.3fr) minmax(0, 1fr); align-items: start; }
.dsh-card { margin: 0; padding: 18px; border-radius: 18px; }
.dsh-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.dsh-head h3 { margin: 0; font-size: 16.5px; }
.dsh-sub { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.dsh-head-end { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dsh-select { height: 34px; padding-top: 0; padding-bottom: 0; font-size: 13px; width: auto; }
.dsh-link { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 700; color: var(--primary); text-decoration: none !important; }
.dsh-link .svg-icon { width: 14px; height: 14px; }
.dsh-side-stack { display: grid; gap: 16px; min-width: 0; }
.dsh-row-2 .shortcut-card .shortcut-grid { padding: 0; grid-template-columns: repeat(auto-fill, minmax(min(88px, 100%), 1fr)); gap: 8px; }
.dsh-row-2 .shortcut-card .shortcut { min-height: 70px; padding: 9px 4px 8px; gap: 6px; border-radius: 12px; }

.rv-legend { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rv-legend span, .rv-totals span { display: inline-flex; align-items: center; gap: 6px; }
.rv-legend i, .rv-totals i { width: 10px; height: 10px; border-radius: 50%; }
.rv-legend .is-col, .rv-totals .is-col { background: var(--primary); }
.rv-legend .is-bill, .rv-totals .is-bill { background: #4f46e5; }
.rv-chart { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.rv-axis { display: flex; flex-direction: column; justify-content: space-between; height: 220px; padding: 2px 0 14px; font-size: 11px; color: var(--muted); text-align: right; white-space: nowrap; }
.rv-plot { min-width: 0; }
.rv-plot svg { display: block; width: 100%; height: 220px; overflow: visible; }
.rv-grid { stroke: var(--border); stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.rv-line { fill: none; stroke: #4f46e5; stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.rv-dot { fill: var(--surface); stroke: #4f46e5; stroke-width: 2; vector-effect: non-scaling-stroke; }
.rv-x { display: grid; margin-top: 6px; font-size: 11px; color: var(--muted); text-align: center; }
.rv-x span { white-space: nowrap; overflow: visible; }
.rv-totals { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--muted); }
.rv-totals b { color: var(--text); }
.rv-panel[hidden] { display: none; }

.cs-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.cs-donut { position: relative; width: 170px; height: 170px; flex: none; border-radius: 50%; }
.cs-donut::before { content: ""; position: absolute; inset: 20px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 2px 8px rgba(0, 0, 0, .06); }
.cs-donut span { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.cs-donut b { font-size: 28px; line-height: 1; }
.cs-donut small { margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.cs-legend { flex: 1 1 150px; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cs-legend li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.cs-legend i { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.cs-legend b { margin-left: auto; font-size: 14px; white-space: nowrap; }
.cs-legend b small { color: var(--muted); font-weight: 600; }
.cs-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cs-foot span { display: inline-flex; align-items: center; gap: 5px; }
.cs-foot .svg-icon { width: 14px; height: 14px; }

.ns-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ns { position: relative; display: flex; gap: 10px; min-width: 0; padding: 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-decoration: none !important; overflow: hidden; transition: border-color .15s, background .15s; }
.ns:hover { border-color: var(--sc); background: var(--surface); }
.ns-ico { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--sc-soft); color: var(--sc); }
.ns-ico .svg-icon { width: 20px; height: 20px; }
.ns-main { position: relative; z-index: 1; display: grid; justify-items: start; gap: 3px; min-width: 0; }
.ns-main b { font-size: 14px; }
.ns-main strong { font-size: 19px; line-height: 1.1; }
.ns-main small { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.ns-pill { padding: 1px 8px; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 11px; font-weight: 700; }
.ns-pill.is-off { background: var(--danger-soft); color: var(--danger); }
.ns-pill.is-none { background: var(--surface-3); color: var(--muted); }
.ns-chart { position: absolute; right: 0; bottom: 0; width: 55%; height: 30px; color: var(--sc); opacity: .7; }

.ra-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ra-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.ra-dot { width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--sc); box-shadow: 0 0 0 4px var(--sc-soft); }
.ra-main { display: grid; min-width: 0; }
.ra-main b { font-size: 13.5px; }
.ra-main small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ra-list time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.sa-list { display: grid; gap: 8px; }
.sa { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--sc-soft); border: 1px solid color-mix(in srgb, var(--sc) 25%, transparent); color: var(--text); text-decoration: none !important; font-size: 13px; font-weight: 600; }
.sa:hover { border-color: var(--sc); }
.sa-ico { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--sc); color: #fff; }
.sa-ico .svg-icon { width: 16px; height: 16px; }
.sa-text { flex: 1; min-width: 0; }
.sa-go { width: 14px; height: 14px; color: var(--muted); }
.sa-clear { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; background: var(--success-soft); color: var(--success); font-size: 13px; font-weight: 600; }
.sa-clear .svg-icon { width: 16px; height: 16px; }

@media (max-width: 1400px) { .dsh-row:not(.dsh-row-2) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .dsh-revenue { grid-column: 1 / -1; } }
@media (max-width: 1500px) { .ah-hero { grid-template-columns: minmax(0, 1fr) auto; } .ah-art { display: none; } }
@media (max-width: 1200px) { .dsh-row-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1100px) { .ah-hero { grid-template-columns: minmax(0, 1fr); } .ah-side { justify-content: flex-start; } }
@media (max-width: 900px) { .dsh-row:not(.dsh-row-2) { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .ah-hero { grid-template-columns: minmax(0, 1fr); padding: 18px 16px; border-radius: 16px; }
  .ah-hero h1 { font-size: 21px; }
  .ah-side { justify-content: stretch; }
  .ah-clock { flex: 1 1 100%; }
  .ah-actions { flex: 1 1 100%; }
  .ah-actions .btn { flex: 1 1 0; justify-content: center; height: 42px; }
  .ak-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .ak { padding: 12px 12px 10px; column-gap: 9px; }
  .ak-ico { width: 36px; height: 36px; border-radius: 11px; }
  .ak-ico .svg-icon { width: 18px; height: 18px; }
  .ak-body b { font-size: 18px; }
  .ak-body small { font-size: 11.5px; }
  .ak-grid > .ak:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .dsh-card { padding: 14px; }
  .rv-axis, .rv-plot svg { height: 170px; }
  .rv-dot { display: none; }
  .ns-grid { grid-template-columns: minmax(0, 1fr); }
  .cs-donut { width: 150px; height: 150px; }
}

/* ---- Customer app note + SMS forwarder app page ---- */
.ca-grid { max-width: 680px; }
.ca-note { display: flex; align-items: flex-start; gap: 10px; max-width: 680px; margin-bottom: 18px; padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); color: var(--text); font-size: 13.5px; line-height: 1.5; }
.ca-note .svg-icon { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--primary); }
.ca-ico.is-sms { background: var(--violet-soft); color: var(--violet); }
.ca-ico .svg-icon { width: 21px; height: 21px; }
.sf-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px; border-radius: 18px; color: #fff; background: radial-gradient(90% 140% at 0% 0%, rgba(255, 255, 255, .16), transparent 60%), linear-gradient(120deg, #6d28d9, #7c3aed 55%, #a855f7); box-shadow: 0 16px 34px -26px #6d28d9; }
.sf-ico { width: 56px; height: 56px; flex: none; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); }
.sf-ico .svg-icon { width: 28px; height: 28px; }
.sf-main { flex: 1 1 220px; min-width: 0; }
.sf-main h2 { margin: 0; font-size: 19px; color: #fff; }
.sf-main p { margin: 4px 0 0; font-size: 13px; opacity: .88; }
.sf-dl { height: 44px; padding: 0 18px; background: #fff; border-color: #fff; color: #5b21b6; font-weight: 700; }
.sf-dl:hover { background: #f5f3ff; color: #5b21b6; }
.sf-wait { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .16); font-size: 13px; font-weight: 600; }
.sf-wait .svg-icon { width: 15px; height: 15px; }
@media (max-width: 640px) { .sf-dl { flex: 1 1 100%; justify-content: center; } }

/* ---- Dashboard: top shortcut row (admin + reseller) and reseller packages ---- */
.qs-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(104px, 100%), 1fr)); gap: 10px; margin-bottom: 18px; }
.qs { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 84px; padding: 12px 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--card-border, var(--border)); box-shadow: var(--shadow); color: var(--text); text-decoration: none !important; text-align: center; transition: transform .15s, border-color .15s, box-shadow .15s; }
.qs:hover { transform: translateY(-2px); border-color: var(--sc); box-shadow: 0 12px 24px -18px color-mix(in srgb, var(--sc) 80%, transparent); }
.qs-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--sc-soft); color: var(--sc); }
.qs-ico .svg-icon { width: 20px; height: 20px; }
.qs-label { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.rp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.rp-list li { display: grid; gap: 6px; }
.rp-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.rp-top b { font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-top span { font-weight: 700; white-space: nowrap; }
.rp-top small { color: var(--muted); font-weight: 600; font-size: 11px; }
.rp-list > li > small { color: var(--muted); font-size: 12px; }
.rp-bar { height: 6px; border-radius: 99px; background: var(--surface-3, var(--border)); overflow: hidden; }
.rp-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #34d399); }
.rp-bar i.is-high { background: linear-gradient(90deg, var(--warning), var(--danger)); }
@media (max-width: 760px) {
  .qs-row { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .qs { min-height: 72px; padding: 8px 2px; border-radius: 12px; gap: 5px; }
  .qs-ico { width: 34px; height: 34px; border-radius: 10px; }
  .qs-ico .svg-icon { width: 17px; height: 17px; }
  .qs-label { font-size: 10.5px; }
}
@media (max-width: 340px) { .qs-row { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---- MikroTik import: package per secret ---- */
.mi-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mi-bulk label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.mi-bulk label .svg-icon { width: 16px; height: 16px; color: var(--primary); }
.mi-bulk .select { width: auto; min-width: 220px; max-width: 100%; }
.select.select-sm { height: 34px; padding-top: 0; padding-bottom: 0; font-size: 13px; min-width: 160px; }

/* ---- Customer portal v3: hero, quick tiles, account cards, phone tab bar ---- */
.pc-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; margin-bottom: 16px; padding: 22px 24px; border-radius: 22px; color: #fff;
  background: radial-gradient(90% 140% at 0% 0%, rgba(255, 255, 255, .18), transparent 60%), linear-gradient(120deg, color-mix(in srgb, var(--primary) 70%, #0b1f4d) 0%, var(--primary) 55%, color-mix(in srgb, var(--primary) 70%, #60a5fa) 100%);
  box-shadow: 0 18px 40px -28px color-mix(in srgb, var(--primary) 90%, #000); }
.pc-hero::after { content: ""; position: absolute; right: -70px; top: -80px; width: 240px; height: 240px; border-radius: 50%; border: 34px solid rgba(255, 255, 255, .07); pointer-events: none; }
.pc-hero-main { position: relative; z-index: 1; min-width: 0; }
.pc-greet { font-size: 13.5px; font-weight: 600; opacity: .9; }
.pc-hero h1 { margin: 4px 0 2px; font-size: 25px; line-height: 1.2; color: #fff; overflow-wrap: anywhere; }
.pc-hero p { margin: 0; font-size: 13.5px; opacity: .88; }
.pc-status { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 14px; padding: 7px 14px 7px 10px; border-radius: 999px; background: #fff; color: #0f172a; box-shadow: 0 8px 18px -14px rgba(0, 0, 0, .6); max-width: 100%; }
.pc-status b { font-size: 14px; }
.pc-status small { color: #475569; font-size: 12px; }
.pc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 20%, transparent); }
.pc-dot.is-on { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 22%, transparent); animation: pc-blink 2s ease-in-out infinite; }
@keyframes pc-blink { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--success) 8%, transparent); } }
.pc-hero-side { position: relative; z-index: 1; display: flex; align-items: center; gap: 16px; }
.pc-ring { --p: 0; width: 108px; height: 108px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .22) 0); }
.pc-ring span { width: 86px; height: 86px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: color-mix(in srgb, var(--primary) 75%, #0b1f4d); }
.pc-ring b { font-size: 26px; line-height: 1; }
.pc-ring small { font-size: 11px; opacity: .85; margin-top: 2px; }
.pc-due { display: grid; gap: 2px; min-width: 170px; padding: 14px 16px; border-radius: 16px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(4px); }
.pc-due small { font-size: 12px; font-weight: 600; opacity: .85; }
.pc-due b { font-size: 26px; line-height: 1.1; letter-spacing: -.02em; }
.pc-due em { font-style: normal; font-size: 12px; opacity: .85; }
.pc-pay { margin-top: 8px; height: 40px; justify-content: center; background: #fff; border-color: #fff; color: #0f172a; font-weight: 700; }
.pc-pay:hover { background: #f1f5f9; color: #0f172a; }
.pc-paid { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 12.5px; font-weight: 700; }
.pc-paid .svg-icon { width: 15px; height: 15px; }
.pc-quick form { display: contents; }
button.qs { font: inherit; cursor: pointer; width: 100%; }
.pc-cards { margin-bottom: 16px; }
.pc-cards .ak-body b { font-size: 19px; }

.pt-tabbar { display: none; }
@media (max-width: 760px) {
  .pc-hero { grid-template-columns: minmax(0, 1fr); padding: 18px 16px; border-radius: 18px; gap: 16px; }
  .pc-hero h1 { font-size: 21px; }
  .pc-hero-side { justify-content: space-between; }
  .pc-ring { width: 92px; height: 92px; }
  .pc-ring span { width: 72px; height: 72px; }
  .pc-ring b { font-size: 22px; }
  .pc-due { flex: 1; min-width: 0; }
  .pc-due b { font-size: 22px; }
  .pt-main { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
  .pt-tabbar { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 60; display: flex; align-items: flex-end; justify-content: space-around; padding: 6px 6px 8px; border-radius: 20px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--border); box-shadow: 0 16px 34px -18px rgba(15, 23, 42, .45); }
  .pt-tabbar a { position: relative; flex: 1; display: grid; justify-items: center; gap: 3px; padding: 6px 2px 2px; color: var(--muted); font-size: 11px; font-weight: 600; text-decoration: none !important; }
  .pt-tabbar a .svg-icon { width: 21px; height: 21px; }
  .pt-tabbar a.active { color: var(--primary); }
  .pt-tabbar a.active::before { content: ""; position: absolute; top: -6px; width: 22px; height: 3px; border-radius: 0 0 4px 4px; background: var(--primary); }
  .pt-tab-pay { color: var(--text) !important; }
  .pt-tab-pay-ico { width: 48px; height: 48px; margin-top: -24px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #0b1f4d)); box-shadow: 0 10px 20px -10px var(--primary); }
  .pt-tab-pay-ico .svg-icon { width: 22px !important; height: 22px !important; }
  .pt-tab-dot { position: absolute; top: 4px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
}
.pc-hero small, .pc-hero em { color: rgba(255, 255, 255, .86); }
.pc-status small { color: #475569; }
.pc-cards .ak-body b, .pc-cards .ak em { white-space: normal; overflow-wrap: anywhere; }

/* ---- Display size: the whole panel scales down on laptop screens so more fits (phones keep their own layout) ---- */
@media (min-width: 901px) and (max-width: 1199px) { .shell { zoom: .8; } }
@media (min-width: 1200px) and (max-width: 1439px) { .shell { zoom: .85; } }
@media (min-width: 1440px) and (max-width: 1679px) { .shell { zoom: .9; } }
@media (min-width: 901px) {
  :root[data-ui-size="small"] .shell { zoom: .8; }
  :root[data-ui-size="medium"] .shell { zoom: .9; }
  :root[data-ui-size="large"] .shell { zoom: 1; }
}
.ui-size { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.ui-size-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.ui-size-label .svg-icon { width: 16px; height: 16px; color: var(--muted); }
.ui-size-opts { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--surface-3); }
.dropdown-menu .ui-size-opts button { width: auto; min-width: 28px; padding: 3px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 700; justify-content: center; color: var(--muted); }
.dropdown-menu .ui-size-opts button.active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
@media (max-width: 900px) { .ui-size { display: none; } }

/* ---- Demo panel (owner panel › ISP › Demo mode) ---- */
.demo-notice { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 10px 14px; border-radius: 12px; background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); color: var(--text); font-size: 13.5px; }
.demo-notice .svg-icon { width: 18px; height: 18px; flex: none; color: var(--warning); }
.demo-card .card-head h3 { display: inline-flex; align-items: center; gap: 8px; }
.demo-card .card-head h3 .svg-icon { width: 17px; height: 17px; color: var(--warning); }
.demo-card.is-on { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); }

/* ---- Client profile device tiles: MACs and the ONU line never split mid-value ---- */
.cp-tile b.cp-mac { white-space: nowrap; word-break: normal; font-size: 13px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; }
.cp-tile b.cp-onu-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; word-break: normal; }
.cp-onu-line .pill, .cp-onu-line .cp-dbm { white-space: nowrap; }
.cp-tile-onu small { overflow-wrap: anywhere; }
.cp-tiles { grid-template-columns: repeat(auto-fit, minmax(min(215px, 100%), 1fr)); }

/* ---- Quick access: dense tiles like an app launcher ---- */
.dsh-row-2 .shortcut-card .shortcut-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--sc-soft); color: var(--sc); }
.dsh-row-2 .shortcut-card .shortcut-icon .svg-icon { width: 18px; height: 18px; }
.dsh-row-2 .shortcut-card .shortcut-label { font-size: 11.5px; line-height: 1.2; text-align: center; }
.dsh-row-2 .shortcut-card .shortcut:hover .shortcut-icon { background: var(--sc); color: #fff; }
.dsh-row-2 .shortcut-tabs { background: var(--surface-2); border-radius: 12px; padding: 3px; }
.dsh-row-2 .shortcut-tabs button.active { background: var(--primary); color: #fff; box-shadow: 0 6px 14px -8px var(--primary); }
@media (max-width: 760px) { .dsh-row-2 .shortcut-card .shortcut-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; } .dsh-row-2 .shortcut-card .shortcut { min-height: 66px; } .dsh-row-2 .shortcut-card .shortcut-label { font-size: 10.5px; } }

/* ---- Dashboard count sections: Clients and Network ---- */
.st-card .dsh-head h3 { display: inline-flex; align-items: center; gap: 10px; }
.st-head-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.st-head-ico .svg-icon { width: 16px; height: 16px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(132px, 100%), 1fr)); gap: 10px; }
.st { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); text-decoration: none !important; transition: border-color .15s, background .15s, transform .15s, box-shadow .15s; }
a.st:not(.is-static):hover { transform: translateY(-2px); border-color: var(--sc); background: var(--surface); box-shadow: 0 12px 24px -20px color-mix(in srgb, var(--sc) 80%, transparent); }
.st-ico { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--sc-soft); color: var(--sc); }
.st-ico .svg-icon { width: 19px; height: 19px; }
.st-body { display: grid; min-width: 0; }
.st-body small { font-size: 12px; font-weight: 600; color: var(--text-2, var(--muted)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-body b { font-size: 22px; line-height: 1.15; letter-spacing: -.02em; color: var(--sc); }
.st-body em { font-style: normal; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  .st-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .st { padding: 10px; gap: 8px; }
  .st-ico { width: 32px; height: 32px; border-radius: 9px; }
  .st-body b { font-size: 19px; }
}
.dsh-row.is-two { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
@media (max-width: 1400px) { .dsh-row.is-two .dsh-revenue { grid-column: auto; } }
@media (max-width: 900px) { .dsh-row.is-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .st-grid > .st:last-child:nth-child(odd) { grid-column: 1 / -1; } }

/* ---- Dashboard: full-width quick access and visual cards below it ---- */
.dsh-row-2.is-full { grid-template-columns: minmax(0, 1fr); }
.vz-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.vz-grid > .card { margin: 0; }
.vz-wide { grid-column: span 2; }
.vz-sub { margin: 0 0 10px; font-size: 13px; color: var(--text-2, var(--muted)); }
.vz-empty { display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 13px; list-style: none; }
.vz-empty .svg-icon { width: 16px; height: 16px; color: var(--success); }
/* bars shared by several cards: <i><u style="width:%"></u></i> */
.vz-bars i, .vz-due i, .vz-routers i { display: block; height: 7px; border-radius: 99px; background: var(--surface-3, var(--border)); overflow: hidden; }
.vz-bars u, .vz-due u, .vz-routers u { display: block; height: 100%; border-radius: inherit; text-decoration: none; }

.vz-billing-top { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.vz-ring { --p: 0; width: 112px; height: 112px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--success) calc(var(--p) * 1%), var(--surface-3, var(--border)) 0); }
.vz-ring span { width: 88px; height: 88px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: var(--surface); }
.vz-ring b { font-size: 24px; line-height: 1; }
.vz-ring small { margin-top: 3px; font-size: 11px; color: var(--muted); }
.vz-billing-sum { display: grid; gap: 1px; min-width: 0; }
.vz-billing-sum small { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.vz-billing-sum b { font-size: 19px; line-height: 1.2; margin-bottom: 4px; }
.vz-billing-sum b.is-green { color: var(--success); }
.vz-billing-sum em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.vz-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.vz-bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; font-size: 12.5px; }
.vz-bars li span { color: var(--text-2, var(--muted)); }
.vz-bars li b { font-size: 12.5px; }
.vz-bars li i { grid-column: 1 / -1; }
.vz-bars li u { background: var(--sc); }

.vz-due { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.vz-due li { display: flex; align-items: center; gap: 10px; }
.vz-due-main, .vz-router-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.vz-due-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.vz-due-top a, .vz-due-top span, .vz-due-top > b:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--text); }
.vz-due-top > b:last-child { flex: none; font-size: 13px; color: var(--danger); }
.vz-due-main small, .vz-router-main small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-due u { background: linear-gradient(90deg, #fb923c, var(--danger)); }
.vz-due li.is-debit .vz-due-top > b:last-child { color: var(--danger); }
.vz-res .vz-due .vz-due-top > b:last-child { color: var(--success); }
.vz-res .vz-due u { background: linear-gradient(90deg, var(--primary), #34d399); }
.vz-res .vz-due li.is-debit u { background: linear-gradient(90deg, #fb923c, var(--danger)); }
.vz-res .vz-due li.is-debit .vz-due-top > b:last-child { color: var(--danger); }
.vz-go { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.vz-go .svg-icon { width: 16px; height: 16px; }

.vz-days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-bottom: 12px; }
.vz-day { display: grid; justify-items: center; gap: 1px; padding: 9px 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); text-align: center; }
.vz-day small { font-size: 11px; font-weight: 700; color: var(--text-2, var(--muted)); }
.vz-day em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.vz-day b { margin-top: 4px; font-size: 22px; line-height: 1; color: var(--muted); }
.vz-day span { font-size: 10.5px; color: var(--muted); }
.vz-day.has { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.vz-day.has b { color: var(--warning); }
.vz-day.is-today.has { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.vz-day.is-today.has b { color: var(--danger); }
.vz-names { display: flex; flex-wrap: wrap; gap: 6px; }
.vz-names > span { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; font-weight: 600; }
.vz-names > span .avatar { width: 22px; height: 22px; font-size: 9.5px; }
.vz-names > span em { font-style: normal; font-weight: 500; color: var(--muted); }
.vz-res .vz-names > span { padding-left: 10px; }
.vz-names > span.is-urgent { background: var(--danger-soft); border-color: transparent; }
.vz-names > span.is-urgent em { color: var(--danger); }

.vz-pay { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 18px; }
.vz-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; height: 190px; padding: 8px 4px 0; border-radius: 14px; background: var(--surface-2); }
.vz-week-col { display: grid; grid-template-rows: auto 1fr auto; justify-items: center; height: 100%; gap: 4px; min-width: 0; }
.vz-week-col b { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; max-width: 100%; }
.vz-week-col i { position: relative; width: 70%; max-width: 30px; height: 100%; }
.vz-week-col u { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 45%, transparent)); text-decoration: none; }
.vz-week-col small { padding-bottom: 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.vz-week-col.is-today small { color: var(--primary); }
.vz-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.vz-feed li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.vz-feed-main { flex: 1; min-width: 0; display: grid; }
.vz-feed-main > a, .vz-feed-main > span { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-feed-main small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-feed-end { display: grid; justify-items: end; gap: 3px; }
.vz-feed-end b { font-size: 14px; color: var(--success); }

.vz-routers { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.vz-routers li { display: flex; align-items: center; gap: 10px; }
.vz-routers u { background: linear-gradient(90deg, var(--success), #a3e635); }
.vz-routers i.is-hot u { background: linear-gradient(90deg, var(--warning), var(--danger)); }
.vz-router-main .vz-due-top small { flex: none; font-size: 11.5px; font-weight: 700; color: var(--primary); }
.vz-pulse { width: 12px; height: 12px; flex: none; border-radius: 50%; background: var(--faint, var(--muted)); }
.vz-pulse.on { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 22%, transparent); animation: pc-blink 2s ease-in-out infinite; }
.vz-pulse.off { background: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 20%, transparent); }
.vz-incident { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 12.5px; }
.vz-incident .svg-icon { width: 15px; height: 15px; flex: none; }

.vz-res { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; }
.vz-res-tiles { display: grid; gap: 8px; align-content: start; }

.vz-timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.vz-timeline li { position: relative; display: flex; gap: 12px; padding-bottom: 14px; }
.vz-timeline li::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.vz-timeline li:last-child::before { display: none; }
.vz-timeline li > span { width: 12px; height: 12px; margin-top: 3px; flex: none; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.vz-timeline li.is-empty > span { background: var(--faint, var(--muted)); box-shadow: none; }
.vz-timeline p { margin: 0; font-size: 13px; line-height: 1.45; }
.vz-timeline small { font-size: 11.5px; color: var(--muted); }

@media (max-width: 1300px) {
  .vz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vz-res { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .vz-res-tiles { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .vz-grid { grid-template-columns: minmax(0, 1fr); }
  .vz-wide { grid-column: auto; }
  .vz-pay, .vz-res { grid-template-columns: minmax(0, 1fr); }
  .vz-res-tiles { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) { .vz-ring { width: 96px; height: 96px; } .vz-ring span { width: 74px; height: 74px; } .vz-week { height: 160px; } }

/* reseller: expiring clients with a day counter */
.vz-expiring { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 10px; }
.vz-expiring li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.vz-count { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-content: center; text-align: center; background: var(--sc-soft); color: var(--sc); }
.vz-count b { font-size: 20px; line-height: 1; }
.vz-count small { font-size: 10px; font-weight: 700; }
.vz-grid > .stack { min-width: 0; }

/* ---- Dashboard banner v2: slim, no greeting, glass clock on the far right ---- */
.ah-hero { grid-template-columns: minmax(240px, 1fr) minmax(0, 300px) auto; min-height: 0; gap: 18px; padding: 14px 18px 14px 26px; border-radius: 18px;
  background: radial-gradient(70% 160% at 0% 0%, rgba(255, 255, 255, .2), transparent 60%), radial-gradient(60% 140% at 100% 100%, rgba(255, 255, 255, .12), transparent 60%),
    linear-gradient(105deg, color-mix(in srgb, var(--primary) 72%, #0b1f4d) 0%, var(--primary) 50%, color-mix(in srgb, var(--primary) 70%, #60a5fa) 100%); }
.ah-hero h1 { margin: 0 0 3px; font-size: 22px; letter-spacing: -.01em; }
.ah-hero p { font-size: 13px; opacity: .82; }
.ah-art { height: 86px; margin: -14px 0 -18px; align-self: end; }
.ah-side { gap: 10px; flex-wrap: nowrap; }
.ah-actions .btn { height: 40px; padding: 0 16px; border-radius: 12px; font-size: 13.5px; }
.ah-clock { gap: 10px; padding: 7px 16px 7px 7px; border-radius: 14px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 10px 24px -18px rgba(0, 0, 0, .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.ah-clock-ico { width: 40px; height: 40px; border-radius: 11px; background: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }
.ah-clock-ico .svg-icon { width: 20px; height: 20px; }
.ah-clock b { font-size: 21px; letter-spacing: .03em; color: #fff; }
.ah-clock small { color: rgba(255, 255, 255, .82); font-size: 11.5px; }
:root[data-theme="dark"] .ah-clock { background: rgba(255, 255, 255, .1); color: #fff; }
:root[data-theme="dark"] .ah-clock small { color: rgba(255, 255, 255, .8); }
@media (max-width: 1500px) { .ah-hero { grid-template-columns: minmax(0, 1fr) auto; } }
@media (max-width: 760px) {
  .ah-hero { padding: 14px; gap: 12px; }
  .ah-hero h1 { font-size: 19px; }
  .ah-side { flex-wrap: wrap; }
  .ah-actions { order: 2; }
}

/* ---- Cards below Quick access: three stacked columns, no empty gaps ---- */
.vz-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; align-items: stretch; }
.vz-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.vz-col > .card { margin: 0; }
.vz-col > .card:last-child { flex: 1; }
.dash > .card.dsh-card { margin: 0; }
.vz-grid.is-stretch { align-items: stretch; }
@media (max-width: 1100px) { .ah-hero { grid-template-columns: minmax(0, 1fr); } .ah-side { justify-content: flex-start; } }
@media (max-width: 760px) { .ah-side { justify-content: stretch; } .ah-clock { flex: 1 1 100%; } .ah-actions { flex: 1 1 100%; } .ah-actions .btn { flex: 1 1 0; justify-content: center; } }

/* Subscription coupon box (ISP) and coupon edit panels (owner) */
.sub-coupon { margin-bottom: 16px; }
.sub-coupon label { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13.5px; margin-bottom: 8px; }
.sub-coupon-row { display: flex; gap: 8px; max-width: 420px; }
.sub-coupon-row .input { flex: 1; text-transform: uppercase; letter-spacing: .04em; }
.sub-coupon-msg { display: block; margin-top: 6px; font-size: 12.5px; min-height: 1em; }
.sub-coupon-msg.is-ok { color: var(--success, #16a34a); font-weight: 600; }
.sub-coupon-msg.is-bad { color: var(--danger, #dc2626); font-weight: 600; }
.sub-total s { font-size: 13px; font-weight: 600; margin-right: 4px; }
.coupon-edit { margin-top: 12px; }
.coupon-edit > summary { cursor: pointer; list-style: none; }
.coupon-edit > summary::-webkit-details-marker { display: none; }
.coupon-edit:not([open]) > summary { border-bottom: 0; }

/* Visual website editor: fields on the left, live preview (click to edit) on the right */
.le-studio { display: grid; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr); gap: 14px; height: 80vh; min-height: 560px; }
.le-studio [hidden] { display: none !important; }
.le-side { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: 0 6px 18px rgba(16, 24, 40, .05); }
.le-side-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--border); }
.le-side-head b { display: block; font-size: 15px; }
.le-side-head small { color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.le-dirty { flex: none; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #fef3c7; color: #92400e; }
.le-find { display: flex; align-items: center; gap: 8px; margin: 10px 12px 2px; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.le-find input { flex: 1; min-width: 0; height: 36px; border: 0; background: none; outline: 0; color: var(--text); font: inherit; font-size: 13.5px; }
.le-sections { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; }
.le-sections > * { flex: none; }
.le-studio .le-section { border-radius: 12px; }
.le-studio .le-section > summary { padding: 11px 14px; font-size: 14px; gap: 8px; }
.le-studio .le-section > summary > span { flex: 1; }
.le-studio .le-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px 14px 14px; }
.le-pill { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #dcfce7; color: #15803d; }
.le-pill.is-off { background: var(--surface-3, #e5e7eb); color: var(--muted); }
.le-hit { animation: le-hit 1.4s ease; border-radius: 10px; }
@keyframes le-hit { 0%, 55% { box-shadow: 0 0 0 3px #10b981, 0 0 0 8px rgba(16, 185, 129, .18); } 100% { box-shadow: 0 0 0 0 transparent; } }
.le-tips { margin: 2px 4px; font-size: 12px; color: var(--muted); }
.le-side-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.le-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface-2); }
.le-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
.le-devices { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); }
.le-devices button { width: 36px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.le-devices button.is-on { background: var(--surface); color: var(--primary); box-shadow: 0 1px 4px rgba(16, 24, 40, .12); }
.le-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.le-status i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.le-status.is-busy i { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .25); animation: le-pulse .8s ease-in-out infinite alternate; }
@keyframes le-pulse { to { opacity: .35; } }
.le-toolbar-end { display: flex; gap: 6px; margin-left: auto; }
.le-canvas { flex: 1; min-height: 0; display: flex; justify-content: center; padding: 12px; overflow: hidden; background-image: radial-gradient(color-mix(in srgb, var(--muted) 22%, transparent) 1px, transparent 1px); background-size: 16px 16px; }
.le-device { flex: none; position: relative; transform-origin: top center; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 12px 34px rgba(16, 24, 40, .18); }
.le-device.is-framed { border-radius: 26px; box-shadow: 0 0 0 10px #0f172a, 0 18px 40px rgba(16, 24, 40, .3); }
.le-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
@media (max-width: 1000px) {
  .le-studio { grid-template-columns: minmax(0, 1fr); height: auto; }
  .le-stage { order: -1; height: 72vh; }
  .le-sections { overflow: visible; }
  .le-toolbar-end .btn:not(.btn-primary) { display: none; }
}

/* ======== Customer portal v5: light header, one navigation per screen size (no repeats), calmer cards ======== */
.portal-body { background: color-mix(in srgb, var(--primary) 3%, var(--bg)); }
.pt-header.pt-topbar { background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); box-shadow: 0 10px 28px -26px rgba(16, 24, 40, .45); }
.pt-bar-inner { color: var(--text); }
.pt-bar-brand { color: var(--text) !important; }
.pt-bar-logo { background: var(--primary-soft); color: var(--primary); border: 1px solid var(--border); box-shadow: none; }
.pt-bar-btn { color: var(--text-2); }
.pt-bar-btn:hover { background: var(--surface-2); color: var(--text); }
.pt-bar-nav a { color: var(--text-2); }
.pt-bar-nav a:hover { background: var(--surface-2); color: var(--text); }
.pt-bar-nav a.active { background: var(--primary-soft); color: var(--primary); }
.pt-bar-pay { background: var(--primary); color: #fff !important; box-shadow: 0 8px 18px -10px var(--primary); }
.pt-bar-pay:hover { background: var(--primary-600); }
.pt-bar-me { display: none; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.pt-bar-me .avatar { width: 36px; height: 36px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary-ring); }

/* Menu: a clean sheet from the right with only the pages the bottom bar does not have. */
.pt-drawer { z-index: 80; }
.pt-drawer-panel { left: auto; right: 0; width: min(340px, 88vw); gap: 12px; padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); background: var(--surface); color: var(--text); box-shadow: -14px 0 40px -22px rgba(0, 0, 0, .5); animation: ptSlideR .22s ease; }
@keyframes ptSlideR { from { transform: translateX(100%); } to { transform: none; } }
.pt-drawer-head { border-bottom-color: var(--border); padding-bottom: 12px; }
.pt-drawer-head small { color: var(--muted); }
.pt-drawer-x { background: var(--surface-2); color: var(--text-2); }
.pt-drawer-user { background: linear-gradient(135deg, var(--primary), var(--primary-600)); border: 0; color: #fff; box-shadow: 0 12px 24px -16px var(--primary); }
.pt-drawer-user small { color: rgba(255, 255, 255, .8); }
.pt-drawer-nav { gap: 4px; }
.pt-drawer-nav a { padding: 9px 10px; color: var(--text); font-size: 14.5px; }
.pt-drawer-nav a:hover, .pt-drawer-nav a.active { background: var(--primary-soft); color: var(--primary); }
.pt-drawer-ico { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--surface-2); color: var(--primary); }
.pt-drawer-nav a .pt-drawer-ico .svg-icon { width: 18px; height: 18px; }
.pt-drawer-nav a .pt-drawer-go { width: 16px; height: 16px; margin-left: auto; color: var(--faint, var(--muted)); }
.pt-drawer-foot { border-top-color: var(--border); }
.pt-drawer-foot a, .pt-drawer-foot button { color: var(--text-2); }
.pt-drawer-foot a:hover, .pt-drawer-foot button:hover { background: var(--surface-2); color: var(--text); }
.pt-drawer-foot form button { color: var(--danger); }

/* Cards */
.portal-body .pt-card, .portal-body .card { border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 30px -26px rgba(16, 24, 40, .4); }
.pt-card-head { padding: 14px 18px; }
.pt-card-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.pt-usage-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 12px; }
.pt-usage-sum b { font-size: 24px; letter-spacing: -.02em; }
.pt-usage-sum span { color: var(--muted); font-size: 13px; }
.portal-body .ak { border-color: var(--border); box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 28px -26px rgba(16, 24, 40, .4); }
.portal-body .qs { border-color: var(--border); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.pc-quick { grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); }
.pt-notice { box-shadow: 0 14px 30px -24px var(--primary); }

/* Phones and tablets: the bottom bar is the navigation; the header keeps the brand, theme and account. */
@media (max-width: 960px) {
  .pt-bar-inner { height: 58px; gap: 8px; padding: 0 12px; }
  .pt-bar-brand { position: static; transform: none; flex: 1; max-width: none; justify-content: flex-start; margin: 0; }
  .pt-bar-name { font-size: 16px; }
  .pt-bar-logo { width: 36px; height: 36px; border-radius: 10px; }
  .pt-bar-theme { display: grid; }
  .pt-bar-logout { display: none; }
  .pt-bar-me { display: block; }
  .pt-main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .pt-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: space-around; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--border); border-radius: 0; background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 -12px 30px -26px rgba(16, 24, 40, .55); }
  .pt-tabbar a, .pt-tabbar button { position: relative; flex: 1; max-width: 104px; display: grid; justify-items: center; gap: 3px; padding: 6px 2px 2px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; text-decoration: none !important; cursor: pointer; }
  .pt-tabbar .svg-icon { width: 22px; height: 22px; }
  .pt-tabbar .active { color: var(--primary); }
  .pt-tabbar .active::before { content: ""; position: absolute; top: -7px; width: 26px; height: 3px; border-radius: 0 0 4px 4px; background: var(--primary); }
  .pt-tabbar .pt-tab-pay { color: var(--text) !important; }
  .pt-tabbar .pt-tab-pay::before { display: none; }
  .pt-tab-pay-ico { width: 50px; height: 50px; margin-top: -26px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-600)); box-shadow: 0 0 0 5px var(--surface), 0 12px 22px -10px var(--primary); }
  .pt-tab-pay-ico .svg-icon { width: 22px !important; height: 22px !important; }
  .pt-tab-dot { position: absolute; top: 4px; right: calc(50% - 16px); width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
  .pt-footer { padding-bottom: 8px; }
}
@media (max-width: 640px) {
  .pc-quick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .pc-quick .qs { min-height: 78px; padding: 10px 4px; }
  .pt-card-head { padding: 12px 14px; }
}
@media (max-width: 360px) { .pc-quick { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pt-list li.pt-muted { display: block; }

/* ======== Customer portal v6: menu button left, logo in the middle, labelled account chips ======== */
.pt-header.pt-topbar { border-top: 3px solid var(--primary); }
.pt-bar-brand.has-logo .pt-bar-logo { width: auto; height: 42px; padding: 0; border: 0; border-radius: 0; background: none; }
.pt-bar-brand.has-logo .pt-bar-logo img { width: auto; height: 100%; max-width: 180px; padding: 0; object-fit: contain; }
.pt-bar-me { text-decoration: none !important; }
.pt-drawer-panel { left: 0; right: auto; animation: ptSlide .22s ease; box-shadow: 14px 0 40px -22px rgba(0, 0, 0, .5); }
@media (max-width: 960px) {
  .pt-bar-inner { position: relative; height: 62px; }
  .pt-bar-menu { display: grid; width: 42px; height: 42px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
  .pt-bar-brand { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); flex: none; justify-content: center; max-width: calc(100% - 200px); }
  .pt-bar-brand.has-logo .pt-bar-name { display: none; }
  .pt-bar-brand.has-logo .pt-bar-logo { height: 44px; max-width: 100%; }
  .pt-bar-brand.has-logo .pt-bar-logo img { max-width: 100%; }
  .pt-bar-brand:not(.has-logo) .pt-bar-name { font-size: 15px; }
  .pt-bar-actions { margin-left: auto; gap: 4px; }
}
@media (max-width: 380px) { .pt-bar-brand:not(.has-logo) .pt-bar-name { display: none; } }

.pc-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.pc-meta span { display: grid; gap: 1px; min-width: 0; padding: 7px 12px; border-radius: 12px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .24); }
.pc-meta small { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .78) !important; }
.pc-meta b { font-size: 14px; line-height: 1.25; color: #fff; overflow-wrap: anywhere; }
.pc-meta .is-package { background: rgba(255, 255, 255, .92); border-color: transparent; }
.pc-meta .is-package small { color: var(--primary-600) !important; }
.pc-meta .is-package b { color: #0f172a; }
.pc-hero .pc-status { margin-top: 12px; }
@media (max-width: 520px) {
  .pc-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pc-meta .is-package { grid-column: 1 / -1; }
}
.pt-drawer-head .pt-bar-logo:has(img) { width: auto; max-width: 120px; height: 38px; padding: 0; border: 0; border-radius: 0; background: none; }
.pt-drawer-head .pt-bar-logo:has(img) img { width: auto; height: 100%; max-width: 100%; padding: 0; object-fit: contain; }

/* Customer portal home: compact account tiles and one row of quick buttons on phones */
.pc-cards .ak-body b, .pc-cards .ak em { white-space: nowrap; overflow-wrap: normal; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .pc-cards { gap: 10px; margin-bottom: 14px; }
  .pc-cards .ak { padding: 11px 12px 10px; column-gap: 9px; row-gap: 5px; border-radius: 14px; align-items: center; }
  .pc-cards .ak-ico { width: 32px; height: 32px; border-radius: 10px; }
  .pc-cards .ak-ico .svg-icon { width: 16px; height: 16px; }
  .pc-cards .ak-body small { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .pc-cards .ak-body b { margin-top: 1px; font-size: 15px !important; line-height: 1.2; letter-spacing: -.01em; }
  .pc-cards .ak em { font-size: 11px; }
  .pc-cards .ak-bar { height: 4px; }
  .pc-cards .ak-chart { height: 18px; }
  .pc-cards .pc-laser { grid-column: 1 / -1; }
  .pc-quick { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
  .pc-quick .qs { min-height: 70px; padding: 9px 3px; border-radius: 12px; gap: 5px; }
  .pc-quick .qs-ico { width: 32px; height: 32px; border-radius: 10px; }
  .pc-quick .qs-ico .svg-icon { width: 16px; height: 16px; }
  .pc-quick .qs-label { font-size: 10.5px; line-height: 1.2; }
}

/* Client lists: columns share the width (no empty gap before the buttons), light header, money right-aligned */
.client-table { border-collapse: separate; border-spacing: 0; }
.client-table th, .client-table td { width: auto; }
.client-table th.check-col, .client-table td.check-col, .client-table th.actions, .client-table td.actions { width: 1%; }
.client-table thead th { padding-top: 12px; padding-bottom: 12px; background: color-mix(in srgb, var(--primary) 9%, var(--surface)); color: color-mix(in srgb, var(--primary) 72%, var(--text)); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border)); }
.client-table thead th:first-child { border-top-left-radius: 12px; }
.client-table thead th:last-child { border-top-right-radius: 12px; }
.client-table tbody td { border-bottom: 1px solid var(--border); }
.client-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.client-table tbody tr:hover td { background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.client-table th[data-col="due"], .client-table td[data-col="due"], .client-table th[data-col="monthly"], .client-table td[data-col="monthly"] { text-align: right; }
.client-table th.actions { text-align: right; }
.client-table td[data-col="monthly"] { font-weight: 600; }
.client-table td[data-col="status"] .badge, .client-table td[data-col="status"] > span:first-child { margin: 0; }

/* Payment numbers: one card per bKash / Nagad / Rocket / Upay / bank account */
.pn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr)); gap: 10px; margin-bottom: 12px; }
.pn-card { position: relative; display: grid; gap: 3px; padding: 12px 14px 12px 16px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--pn) 28%, var(--border)); background: linear-gradient(135deg, color-mix(in srgb, var(--pn) 10%, var(--surface)), var(--surface) 70%); cursor: pointer; overflow: hidden; transition: box-shadow .15s, border-color .15s, transform .15s; }
.pn-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--pn); }
.pn-card:hover { transform: translateY(-1px); box-shadow: 0 10px 22px -16px var(--pn); }
.pn-card.is-on { border-color: var(--pn); box-shadow: 0 0 0 2px color-mix(in srgb, var(--pn) 35%, transparent); }
.pn-brand { justify-self: start; padding: 2px 9px; border-radius: 999px; background: var(--pn); color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .02em; }
.pn-number { font-size: 18px; letter-spacing: .03em; color: var(--text); overflow-wrap: anywhere; }
.pn-number.is-text { font-size: 13.5px; font-weight: 600; letter-spacing: 0; white-space: pre-line; }
.pn-card small { color: var(--muted); font-size: 12px; }
.pn-copy { position: absolute; top: 9px; right: 9px; display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.pn-copy .svg-icon { width: 13px; height: 13px; }
.pn-copy:hover { color: var(--pn); border-color: var(--pn); }
.pn-note { margin-bottom: 12px; }

/* Settings › Payment gateways › Manual payment */
.mp-auto { margin: 4px 0 18px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--border-strong, var(--border)); background: var(--surface-2); }
.mp-auto.is-on { border-style: solid; border-color: color-mix(in srgb, var(--success, #16a34a) 40%, var(--border)); background: color-mix(in srgb, var(--success, #16a34a) 7%, var(--surface)); }
.mp-auto p { margin: 6px 0 10px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.mp-auto-state { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 12.5px; }
.mp-auto-state a { margin-left: auto; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }
.mp-sub { margin: 4px 0 10px; font-size: 14px; }
.mp-sub small { color: var(--muted); font-weight: 500; font-size: 12px; margin-left: 6px; }
.mp-numbers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mp-number { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px; padding: 10px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--pn) 30%, var(--border)); border-left: 5px solid var(--pn); background: color-mix(in srgb, var(--pn) 5%, var(--surface)); }
.mp-number .mp-brand { grid-column: 1 / -1; justify-self: start; padding: 2px 9px; border-radius: 999px; background: var(--pn); color: #fff; font-size: 11.5px; font-weight: 800; }
.mp-number.is-bank { grid-template-columns: minmax(0, 1fr); }
.mp-number .input, .mp-number .select { height: 36px; }
@media (max-width: 760px) { .mp-numbers { grid-template-columns: minmax(0, 1fr); } }
.mp-auto-state .pill { white-space: normal; text-align: left; line-height: 1.35; height: auto; padding-top: 4px; padding-bottom: 4px; }
@media (max-width: 520px) { .mp-number { grid-template-columns: minmax(0, 1fr); } }

/* Owner panel › ISP: own-domain DNS check */
.dns-check { padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--border)); background: color-mix(in srgb, var(--danger) 6%, var(--surface)); font-size: 13px; }
.dns-check.is-ok { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); background: color-mix(in srgb, var(--success) 7%, var(--surface)); }
.dns-check > b { display: flex; align-items: center; gap: 6px; }
.dns-check ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.dns-check em { font-style: normal; font-weight: 800; margin-left: 6px; }
.dns-check em.ok { color: var(--success); }
.dns-check em.bad { color: var(--danger); }
.dns-check p { margin: 8px 0 0; color: var(--text-2); line-height: 1.5; }

/* Network › PRTG graphs */
.prtg-periods { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.prtg-periods a { padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.prtg-periods a.is-on { background: var(--surface); color: var(--primary); box-shadow: 0 1px 4px rgba(16, 24, 40, .12); }
.prtg-grid { display: grid; grid-template-columns: repeat(var(--prtg-cols, 3), minmax(0, 1fr)); gap: 14px; }
.prtg-card { margin: 0; display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.prtg-card figcaption { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.prtg-card figcaption b { display: block; font-size: 13.5px; }
.prtg-card figcaption small { color: var(--muted); font-size: 12px; }
.prtg-card img { display: block; width: 100%; height: auto; border-radius: 8px; background: #fff; border: 1px solid var(--border); }
.prtg-last { font-size: 12px; color: var(--muted); }
.prtg-pick { margin-top: 16px; }
.prtg-pick > summary, .prtg-pick + details > summary { cursor: pointer; list-style: none; }
.prtg-pick-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.prtg-pick-bar .input { flex: 1; min-width: 200px; }
.prtg-pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 6px; max-height: 460px; overflow: auto; }
.prtg-pick-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; }
.prtg-pick-item[hidden] { display: none; }
.prtg-pick-item:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.prtg-pick-item > span:nth-child(2) { flex: 1; min-width: 0; }
.prtg-pick-item b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prtg-pick-item small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1100px) { .prtg-grid:not([style*="--prtg-cols: 1"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .prtg-grid { grid-template-columns: minmax(0, 1fr); } }

/* Network › Traffic graphs (PRTG style) */
.tg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.tg-filter { display: flex; gap: 8px; flex-wrap: wrap; }
.tg-filter .select, .tg-filter .input { height: 36px; min-width: 180px; }
.tg-stamp { margin-left: auto; font-size: 12.5px; }
.tg-empty { display: flex; gap: 14px; align-items: flex-start; }
.tg-empty > .svg-icon { width: 28px; height: 28px; color: var(--primary); flex: none; }
.tg-empty p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; }
.tg-router { margin-bottom: 22px; }
.tg-router-head { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 17px; }
.tg-router-head .svg-icon { color: var(--primary); }
.tg-group { margin-bottom: 12px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); overflow: hidden; }
.tg-group > summary { display: flex; align-items: center; gap: 8px; padding: 11px 14px; cursor: pointer; list-style: none; font-weight: 700; font-size: 14px; }
.tg-group > summary::-webkit-details-marker { display: none; }
.tg-group > summary em { font-style: normal; font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tg-group > summary .svg-icon { margin-left: auto; width: 16px; height: 16px; color: var(--muted); transition: transform .15s; }
.tg-group[open] > summary { border-bottom: 1px solid var(--border); }
.tg-group[open] > summary .svg-icon { transform: rotate(180deg); }
.tg-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px; }
.tg-card { margin: 0; display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.tg-card[hidden] { display: none; }
.tg-card figcaption b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-card figcaption small { color: var(--muted); font-size: 11.5px; }
.tg-card canvas { display: block; width: 100%; height: 190px; }
.tg-stats { display: grid; gap: 2px; font-size: 11.5px; color: var(--muted); }
.tg-stats b { color: var(--text); }
.tg-stats .is-in::before, .tg-stats .is-out::before { content: ""; display: inline-block; width: 10px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.tg-stats .is-in::before { background: var(--tg-color, var(--text)); }
.tg-stats .is-out::before { background: var(--tg-color, #ec4899); height: 8px; }
.tg-stats .is-total::before { content: ""; display: inline-block; width: 10px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; background: var(--tg-color, #2dd4bf); }
@media (max-width: 1200px) { .tg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .tg-grid { grid-template-columns: minmax(0, 1fr); } .tg-stamp { margin-left: 0; } }
.input-suffix { display: inline-flex; align-items: center; gap: 6px; }
.input-suffix em { font-style: normal; font-weight: 700; color: var(--muted); }
.pt-bar-brand.has-logo .pt-bar-name { display: none; }

/* Customer portal › My profile: header card */
.pt-profile-head { gap: 16px; padding: 18px 20px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-600)); box-shadow: 0 14px 30px -22px var(--primary); margin-bottom: 16px; }
.pt-profile-head .avatar { box-shadow: 0 0 0 3px rgba(255, 255, 255, .55); }
.pt-profile-head .pt-photo-remove { color: rgba(255, 255, 255, .85); }
.pp-who { min-width: 0; }
.pp-who h1 { margin: 0 0 8px; font-size: 22px; line-height: 1.2; color: #fff; overflow-wrap: anywhere; }
.pp-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.pp-tags > span { display: grid; gap: 1px; padding: 6px 11px; border-radius: 11px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .24); }
.pp-tags small { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .78); }
.pp-tags b { font-size: 13.5px; color: #fff; }
.pp-tags .pp-state { display: inline-flex; align-items: center; gap: 6px; align-self: center; font-size: 13px; font-weight: 700; background: #fff; color: #b42318; border-color: transparent; }
.pp-tags .pp-state.is-on { color: #15803d; }
.pp-tags .pp-state i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
@media (max-width: 520px) { .pt-profile-head { padding: 14px; } .pp-who h1 { font-size: 19px; } }

/* Customer portal menu head: the logo alone when there is one */
.pt-drawer-head .pt-bar-logo.is-wide { width: auto; max-width: 200px; height: 46px; padding: 0; border: 0; border-radius: 0; background: none; }
.pt-drawer-head .pt-bar-logo.is-wide img { width: auto; height: 100%; max-width: 100%; padding: 0; object-fit: contain; }

/* Owner panel: ISP admin login (username + password) */
.admin-login { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2, transparent); }
.admin-login > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.admin-login span { width: 74px; flex: none; font-size: 12px; color: var(--muted); }
.admin-login b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-login b.reveal { cursor: pointer; }
.admin-login em { font-size: 12px; font-style: normal; }

/* MikroTik import: package / branch / reseller for the ticked secrets */
.mi-bulk.is-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 16px; align-items: end; }
.mi-bulk-item { display: grid; gap: 6px; min-width: 0; }
.mi-bulk-row { display: flex; gap: 8px; min-width: 0; }
.mi-bulk.is-grid .mi-bulk-row .select { flex: 1; min-width: 0; width: 100%; }
.mi-bulk-row .btn { flex: none; }
.mi-bulk-note { grid-column: 1 / -1; margin: 0; font-size: 13px; }

/* Bill lists: due / advance cells with an edit button, and the edit box */
.be-cell { white-space: nowrap; }
.be-edit { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 6px; padding: 0; vertical-align: middle; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: var(--muted); cursor: pointer; }
.be-edit:hover { color: var(--primary); border-color: var(--primary); }
.be-edit .svg-icon { width: 13px; height: 13px; }
.be-dialog { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.be-dialog::backdrop { background: rgba(15, 23, 42, .55); }
.be-form { display: grid; gap: 14px; padding: 18px 20px 20px; }
.be-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.be-head h3 { margin: 0; font-size: 17px; }
.be-head p { margin: 2px 0 0; font-size: 13px; }
.be-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.be-help { margin: -4px 0 0; font-size: 12.5px; }
.be-actions { display: flex; justify-content: flex-end; gap: 8px; }
.rb-pay { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.rb-pay form { display: inline-flex; gap: 6px; }
.rb-pay .input { width: 96px; height: 32px; }

/* Graph groups (Network › Graph groups) and their shared TV page */
.gb-new { margin-bottom: 18px; }
.gb-new .card-body { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.gb-new .field { flex: 1; min-width: min(320px, 100%); margin: 0; }
.gb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.gb-card { display: grid; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.gb-card-main { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.gb-card-main b { display: block; font-size: 15px; }
.gb-card-main small { color: var(--muted); font-size: 12.5px; }
.gb-card-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--primary-soft); color: var(--primary); }
.gb-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gb-card-foot .btn-primary { margin-left: auto; }
.gb-top { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.gb-top .card { margin: 0; }
.gb-top h3 { display: flex; align-items: center; gap: 8px; }
.gb-link { display: flex; gap: 8px; }
.gb-link .input { flex: 1; min-width: 0; font-size: 13px; }
.gb-hint { margin: 10px 0 12px; font-size: 13px; line-height: 1.5; }
.gb-share .btn-row form { display: inline; }
.gb-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.gb-settings .field { margin: 0; }
.tg-grid.gb-grid, .tg-grid.tv-grid { padding: 0; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); }
.tg-grid[data-cols="1"] { grid-template-columns: minmax(0, 1fr); }
.tg-grid[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tg-grid[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tg-grid[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tg-grid[data-cols="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tg-grid[data-cols="6"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.gb-grid .tg-card figcaption { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.gb-grid .tg-card figcaption > div:first-child { min-width: 0; flex: 1; }
.gb-label { width: 100%; padding: 2px 6px; margin-left: -6px; border: 1px dashed transparent; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 13.5px; font-weight: 700; }
.gb-label:hover, .gb-label:focus { border-color: var(--border); outline: none; background: var(--surface-2); }
.gb-tools { display: flex; gap: 2px; flex: none; }
.gb-add { margin-top: 18px; }
.gb-router { display: flex; align-items: center; gap: 8px; margin: 16px 0 6px; font-size: 14.5px; }
.gb-router:first-of-type { margin-top: 4px; }
.gb-router .svg-icon { color: var(--primary); }
.gb-kind { margin: 10px 0 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.gb-danger { margin-top: 18px; }
.gb-danger .card-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
@media (max-width: 900px) { .gb-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) { .tg-grid[data-cols] { grid-template-columns: minmax(0, 1fr); } }

.tv-page { min-height: 100vh; margin: 0; padding: 16px 20px 12px; background: var(--bg); color: var(--text); }
.tv-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 16px; }
.tv-brand { display: flex; align-items: center; gap: 12px; min-width: 0; margin-right: auto; }
.tv-brand img { height: 40px; width: auto; max-width: 140px; object-fit: contain; }
.tv-brand b { display: block; font-size: 20px; }
.tv-brand small { color: var(--muted); font-size: 13px; }
.tv-side { display: flex; align-items: center; gap: 14px; }
.tv-live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #22c55e; }
.tv-live i { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; animation: tv-pulse 1.6s ease-in-out infinite; }
@keyframes tv-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); } 50% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } }
.tv-clock { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; color: var(--text-2); }
.tv-page .tg-card { padding: 12px 14px; }
.tv-page .tg-card figcaption b { font-size: 15px; }
.tv-page .tg-card canvas { height: 210px; }
.tv-page .tg-stats { font-size: 12.5px; }
.tv-empty { padding: 60px 0; text-align: center; color: var(--muted); }
.tv-foot { margin-top: 12px; text-align: center; font-size: 12px; color: var(--muted); }
@media (max-width: 700px) { .tv-page { padding: 12px; } .tv-side { width: 100%; justify-content: space-between; } }
.gb-label::placeholder { color: var(--text); opacity: 1; }

/* Graph cards: the traffic-out value in the corner (like PRTG's mini gauge) */
.tg-card figcaption { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tg-card figcaption > div:first-child { min-width: 0; flex: 1; }
.tg-now { flex: none; padding: 2px 8px; border-radius: 999px; background: rgba(236, 72, 153, .14); color: #db2777; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tg-now:empty { display: none; }
.tv-page .tg-card figcaption b span { font-weight: 500; color: var(--muted); font-size: 12px; }
/* Light TV page: white like a PRTG map, dense graphs */
.tv-page.is-light { background: #fff; }
.tv-page.is-light .tg-card { border-color: #e5e7eb; box-shadow: none; background: #fff; }
.tv-page.is-light .tv-top { padding-bottom: 12px; border-bottom: 1px solid #e5e7eb; }
.tv-page .tg-grid.tv-grid { gap: 10px; }
.tv-page .tg-grid.tv-grid[data-cols="0"] { grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); }

/* OLT dashboard: summary, a card per OLT (CPU / RAM gauges, ONU bar and counts), recent drops */
.olt-summary { display: grid; grid-template-columns: minmax(260px, 1.6fr) repeat(4, minmax(140px, 1fr)); gap: 14px; margin-bottom: 18px; }
.olt-hero { display: grid; gap: 8px; padding: 18px 20px; border-radius: 18px; color: #fff;
  background: radial-gradient(120% 140% at 0% 0%, rgba(255, 255, 255, .16), transparent 55%), linear-gradient(125deg, color-mix(in srgb, var(--primary) 78%, #0b1f4d), var(--primary)); box-shadow: 0 16px 34px -24px color-mix(in srgb, var(--primary) 90%, #000); }
.olt-hero-label { font-size: 13px; font-weight: 600; opacity: .85; }
.olt-hero-value { font-size: 34px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.olt-hero-value small { margin-left: 6px; color: inherit; font-size: 15px; font-weight: 600; opacity: .75; }
.olt-hero-sub { font-size: 12.5px; opacity: .85; }
.olt-hero .olt-bar { background: rgba(255, 255, 255, .22); }
.olt-tile { display: grid; align-content: space-between; gap: 6px; padding: 16px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; transition: transform .12s, box-shadow .12s; }
.olt-tile:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -18px rgba(16, 24, 40, .45); }
.olt-tile .svg-icon { width: 34px; height: 34px; padding: 8px; border-radius: 10px; }
.olt-tile span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.olt-tile b { font-size: 26px; font-variant-numeric: tabular-nums; }
.olt-tile.is-power .svg-icon { background: rgba(245, 158, 11, .15); color: #d97706; }
.olt-tile.is-fiber .svg-icon { background: rgba(239, 68, 68, .14); color: #dc2626; }
.olt-tile.is-offline .svg-icon { background: rgba(100, 116, 139, .15); color: #64748b; }
.olt-tile.is-weak .svg-icon { background: rgba(168, 85, 247, .14); color: #9333ea; }
.olt-bar { display: flex; height: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.olt-bar.is-thin { height: 6px; margin: 14px 0 12px; }
.olt-bar span { height: 100%; }
.olt-bar .is-online { background: #22c55e; }
.olt-bar .is-power { background: #f59e0b; }
.olt-bar .is-fiber { background: #ef4444; }
.olt-bar .is-offline { background: #94a3b8; }

.oc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)); gap: 16px; margin-bottom: 20px; }
.oc-card { display: flex; flex-direction: column; padding: 16px 18px 12px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 10px 26px -22px rgba(16, 24, 40, .5); }
.oc-card.is-down { border-color: color-mix(in srgb, #ef4444 40%, var(--border)); background: linear-gradient(180deg, rgba(239, 68, 68, .05), var(--surface) 40%); }
.oc-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.oc-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .15); }
.oc-dot.is-on { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); }
.oc-title { flex: 1; min-width: 0; }
.oc-name { display: block; font-size: 16px; font-weight: 800; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-name:hover { color: var(--primary); }
.oc-title small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-state { flex: none; padding: 3px 11px; border-radius: 999px; background: rgba(239, 68, 68, .12); color: #dc2626; font-size: 12px; font-weight: 700; }
.oc-state.is-on { background: rgba(34, 197, 94, .14); color: #16a34a; }
.oc-body { display: flex; align-items: center; gap: 18px; margin-top: 14px; }
.oc-gauges { display: flex; gap: 12px; flex: none; }
.oc-gauge { position: relative; width: 84px; height: 84px; }
.oc-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg) scaleY(-1); }
.oc-gauge-track { fill: none; stroke: var(--surface-2); stroke-width: 3.6; }
.oc-gauge-fill { fill: none; stroke-width: 3.6; stroke-linecap: round; transition: stroke-dasharray .4s; }
.oc-gauge.is-low .oc-gauge-fill { stroke: #22c55e; }
.oc-gauge.is-mid .oc-gauge-fill { stroke: #f59e0b; }
.oc-gauge.is-high .oc-gauge-fill { stroke: #ef4444; }
.oc-gauge-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.oc-gauge-text b { font-size: 17px; font-variant-numeric: tabular-nums; }
.oc-gauge-text span { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.oc-gauge.is-none .oc-gauge-text b { font-size: 13px; color: var(--muted); }
.oc-total { display: grid; gap: 2px; min-width: 0; }
.oc-total > b { font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.oc-total > span { color: var(--muted); font-size: 12.5px; }
.oc-total small { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; color: var(--muted); font-size: 11.5px; }
.oc-total small .svg-icon { width: 12px; height: 12px; }
.oc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.oc-chips a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 12px; text-decoration: none; }
.oc-chips a:hover { background: var(--primary-soft); color: var(--primary); }
.oc-chips b { color: var(--text); font-variant-numeric: tabular-nums; }
.oc-chips i { width: 8px; height: 8px; border-radius: 50%; }
.oc-chips .is-online i { background: #22c55e; }
.oc-chips .is-power i { background: #f59e0b; }
.oc-chips .is-fiber i { background: #ef4444; }
.oc-chips .is-offline i { background: #94a3b8; }
.oc-chips .is-weak i { background: #a855f7; }
.oc-error { display: flex; gap: 6px; align-items: flex-start; margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(239, 68, 68, .08); color: #b91c1c; font-size: 12px; line-height: 1.4; }
.oc-error .svg-icon { flex: none; width: 14px; height: 14px; margin-top: 1px; }
.oc-foot { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; }
.oc-foot .muted { display: inline-flex; align-items: center; gap: 5px; margin-right: auto; }
.oc-foot .muted .svg-icon { width: 13px; height: 13px; }
.oc-empty { grid-column: 1 / -1; }

.olt-down .card-head { align-items: center; }
.olt-down-list { display: grid; }
.olt-down-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 11px 20px; border-top: 1px solid var(--border); color: inherit; text-decoration: none; }
.olt-down-row:hover { background: var(--surface-2); }
.olt-reason { display: inline-flex; align-items: center; gap: 6px; min-width: 112px; padding: 4px 10px; border-radius: 999px; background: rgba(100, 116, 139, .14); color: var(--text-2); font-size: 12px; font-weight: 700; }
.olt-reason .svg-icon { width: 13px; height: 13px; }
.olt-reason.is-power { background: rgba(245, 158, 11, .15); color: #b45309; }
.olt-reason.is-fiber { background: rgba(239, 68, 68, .13); color: #b91c1c; }
.olt-who { min-width: 0; }
.olt-who b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.olt-who small { color: var(--muted); font-size: 12px; }
.olt-when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
@media (max-width: 1100px) { .olt-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } .olt-hero { grid-column: 1 / -1; } }
@media (max-width: 520px) { .oc-body { flex-direction: column; align-items: flex-start; } .olt-reason { min-width: 0; } .olt-down-row { grid-template-columns: minmax(0, 1fr) auto; } .olt-reason { grid-column: 1 / -1; justify-self: start; } }

/* ONU list: PPPoE users, RX quality and why it last went down */
.onu-users { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.onu-users span { padding: 1px 7px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-size: 12px; }
.rx-tag { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; vertical-align: 1px; }
.rx-green { background: rgba(34, 197, 94, .14); color: #16a34a; }
.rx-blue { background: rgba(59, 130, 246, .14); color: #2563eb; }
.rx-amber { background: rgba(245, 158, 11, .16); color: #d97706; }
.rx-red { background: rgba(239, 68, 68, .14); color: #dc2626; }
.down-reason { font-weight: 600; }
.down-reason.is-power { color: #d97706; }
.down-reason.is-fiber { color: #dc2626; }

/* ONU RX history chart */
.rx-chart svg { display: block; width: 100%; height: 300px; overflow: visible; }
.rx-grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.rx-axis { fill: var(--muted); font-size: 12px; }
.rx-limit { stroke-width: 1.5; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.rx-limit.is-warn { stroke: #f59e0b; }
.rx-limit.is-crit { stroke: #ef4444; }
.rx-line { fill: none; stroke: var(--primary); stroke-width: 2.2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.rx-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.rx-legend span::before { content: ""; display: inline-block; width: 14px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.rx-legend .is-line::before { background: var(--primary); }
.rx-legend .is-warn::before { background: #f59e0b; }
.rx-legend .is-crit::before { background: #ef4444; }

/* Quick add OLT: one short form like an OLT monitor */
.qo-card { max-width: 1040px; }
.qo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 18px; }
.qo-grid .field { margin: 0; }
.qo-set { margin: 18px 0 0; padding: 0; border: 0; }
.qo-set legend { margin-bottom: 8px; font-size: 13px; font-weight: 700; }
.qo-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qo-chip { position: relative; cursor: pointer; }
.qo-chip input { position: absolute; opacity: 0; pointer-events: none; }
.qo-chip span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--text-2); }
.qo-chip span::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border); }
.qo-chip input:checked + span { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.qo-chip input:checked + span::before { border-color: var(--primary); background: radial-gradient(circle, var(--primary) 45%, transparent 50%); }
.qo-chip input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.qo-snmp { max-width: 340px; margin-top: 16px; }
.qo-snmp[hidden] { display: none; }
.qo-note { margin: 8px 0 0; font-size: 13px; }
.qo-actions { padding: 0 20px 20px; }
@media (max-width: 900px) { .qo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .qo-grid { grid-template-columns: minmax(0, 1fr); } }
.qo-set[hidden] { display: none; }

/* Owner panel › Server transfer */
.st-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.st-steps .so-card { margin: 0; }
.st-steps .so-card-head h3 { display: flex; align-items: center; gap: 10px; }
.st-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 13px; font-weight: 800; flex: none; }
.st-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; line-height: 1.5; }
.st-checks { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 8px; }
.st-checks li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); }
.st-checks li.is-ok { border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .06); }
.st-checks li.is-bad { border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .06); }
.st-checks b { display: block; font-size: 13.5px; }
.st-checks small { color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.st-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none; background: var(--surface-2); color: var(--muted); font-weight: 800; font-size: 12px; }
.st-mark .svg-icon { width: 13px; height: 13px; }
.st-checks .is-ok .st-mark { background: #22c55e; color: #fff; }
.st-checks .is-bad .st-mark { background: #ef4444; color: #fff; }
.st-sub { margin: 4px 0 8px; font-size: 14px; }
@media (max-width: 900px) { .st-steps { grid-template-columns: minmax(0, 1fr); } .st-steps .so-span-2 { grid-column: auto; } }

/* Owner panel › ISP page: delete ISP */
.isp-danger { border-color: rgba(239, 68, 68, .35); }
.isp-danger > summary { cursor: pointer; list-style: none; }
.isp-danger > summary::-webkit-details-marker { display: none; }
.isp-danger h3 { display: flex; align-items: center; gap: 8px; color: #dc2626; }
.isp-danger-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(239, 68, 68, .08); color: #b91c1c; font-size: 13px; line-height: 1.5; }

/* Graph lines & colours */
.gs-lines { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.gs-line { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 13px; }
.gs-line input[type="color"] { width: 28px; height: 22px; padding: 0; border: 1px solid var(--border); border-radius: 5px; background: none; cursor: pointer; }
.gs-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.gb-settings .gs-lines { grid-column: 1 / -1; }

/* Customer portal: AI chat */
.ai-fab { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border: 0; border-radius: 999px; background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 14px 30px -14px rgba(15, 23, 42, .55); cursor: pointer; }
.ai-fab .icon { width: 18px; height: 18px; }
.ai-chat { position: fixed; right: 18px; bottom: 18px; z-index: 80; width: min(380px, calc(100vw - 32px)); height: min(540px, calc(100vh - 110px)); display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: 0 24px 60px -24px rgba(15, 23, 42, .55); overflow: hidden; }
.ai-chat[hidden] { display: none; }
.ai-head { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ai-head > div { flex: 1; min-width: 0; }
.ai-head b { display: block; font-size: 14px; }
.ai-head small { color: var(--muted); font-size: 12px; }
.ai-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.ai-msg { margin: 0; max-width: 85%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-msg.is-bot { align-self: flex-start; background: var(--primary-soft); color: var(--text); border-bottom-left-radius: 4px; }
.ai-msg.is-me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.ai-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.ai-form .input { flex: 1; min-width: 0; }
@media (max-width: 900px) {
  .ai-fab { bottom: calc(92px + env(safe-area-inset-bottom)); right: 14px; padding: 10px 13px; }
  .ai-chat { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); height: min(540px, calc(100vh - 40px)); }
}

/* One graph's own lines & colours */
.tg-style { position: relative; }
.tg-style > summary { list-style: none; position: relative; }
.tg-style > summary::-webkit-details-marker { display: none; }
.tg-style-dot { position: absolute; top: 2px; right: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.tg-style-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(320px, calc(100vw - 40px)); display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 18px 40px -18px rgba(15, 23, 42, .45); text-align: left; font-weight: 400; }
.tg-style-pop small { font-size: 12px; }
.tg-style-pop .gs-lines { flex-direction: column; align-items: stretch; }
.tg-card figcaption .gb-tools { display: flex; align-items: center; gap: 4px; }

/* ---------- Owner panel › ISP panels (cards) ---------- */
.il-tabs { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.il-tabs::-webkit-scrollbar { display: none; }
.il-tab { display: inline-flex; align-items: center; gap: 8px; flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none !important; white-space: nowrap; transition: border-color .15s, background .15s; }
.il-tab b { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11.5px; text-align: center; }
.il-tab:hover { border-color: var(--primary); color: var(--text); }
.il-tab.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.il-tab.is-on b { background: rgba(255, 255, 255, .22); color: #fff; }
.il-tab-soon:not(.is-on) b, .il-tab-grace:not(.is-on) b { background: var(--warning-soft); color: var(--warning); }
.il-tab-expired:not(.is-on) b { background: var(--danger-soft); color: var(--danger); }

.il-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; padding: 10px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.il-search { position: relative; flex: 1 1 260px; min-width: 0; margin: 0; }
.il-search .svg-icon { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.il-search .input { width: 100%; padding-left: 34px; }
.il-toolbar .select { width: auto; flex: 0 1 190px; min-width: 0; }
.il-views { display: inline-flex; margin-left: auto; padding: 3px; border-radius: 10px; background: var(--surface-3); }
.il-views a { display: grid; place-items: center; width: 32px; height: 30px; border-radius: 8px; color: var(--muted); }
.il-views a.is-on { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.il-views .svg-icon { width: 16px; height: 16px; }

.il-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(310px, 100%), 1fr)); gap: 16px; margin-bottom: 16px; }
.il-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); min-width: 0; overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.il-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--primary); }
.il-card.is-trial::before { background: #3b82f6; }
.il-card.is-grace::before { background: var(--warning); }
.il-card.is-expired::before { background: var(--danger); }
.il-card.is-suspended::before { background: var(--faint); }
.il-card:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); box-shadow: 0 18px 36px -28px color-mix(in srgb, var(--primary) 70%, transparent); transform: translateY(-2px); }
.il-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.il-name { min-width: 0; }
.il-name b { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.il-name small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.il-name > span:last-child { min-width: 0; }
.il-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; flex: none; }
.il-host { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.il-host .svg-icon { flex: none; width: 14px; height: 14px; color: var(--primary); }
.il-plan { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-2); }
.il-plan span { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.il-plan .svg-icon { width: 14px; height: 14px; color: var(--muted); }
.il-plan b { font-size: 17px; color: var(--text); }
.il-plan b small { font-size: 12px; color: var(--muted); font-weight: 600; }
.il-usage { display: grid; gap: 9px; padding: 12px; border-radius: 14px; background: var(--surface-2); }
.il-meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--muted); }
.il-meter-top span:first-child { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.il-meter-top .svg-icon { width: 14px; height: 14px; }
.il-meter-top b { color: var(--text); font-size: 13.5px; }
.il-meter-top small { font-size: 12px; }
.il-bar { height: 6px; margin-top: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.il-bar.is-unlimited { background: repeating-linear-gradient(90deg, var(--surface-3) 0 6px, transparent 6px 10px); }
.il-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #34d399); }
.il-bar i.is-warn { background: linear-gradient(90deg, #f59e0b, var(--warning)); }
.il-bar i.is-full { background: var(--danger); }
.il-online { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); }
.il-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.il-foot { display: flex; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.il-foot > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.il-foot small { font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.il-foot b { font-size: 13.5px; }
.il-foot .so-days { align-self: flex-start; }
.il-used { text-align: right; align-items: flex-end; }
.il-actions { display: flex; gap: 8px; margin-top: auto; }
.il-actions .btn-primary { flex: 1; justify-content: center; }
.il-actions .btn:not(.btn-primary):not(.btn-ghost) { flex: 1; justify-content: center; }
.il-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px; text-align: center; color: var(--muted); }
.il-empty .svg-icon { width: 28px; height: 28px; color: var(--primary); }
.il-empty b { color: var(--text); font-size: 15px; }
@media (max-width: 700px) {
  .il-toolbar .select { flex: 1 1 calc(50% - 4px); }
  .il-views { margin-left: 0; }
  .il-card { padding: 16px; }
}

/* ---------- Owner panel › Cron jobs ---------- */
.cr-due { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 14px; font-size: 13px; }
.cr-run-now { margin-top: 10px; }
.cr-isps { margin-top: 6px; font-size: 12.5px; }
.cr-isps summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.cr-isps summary code { font-weight: 400; color: var(--muted); }
.cr-isps ul { margin: 8px 0 2px; padding: 0; list-style: none; display: grid; gap: 4px; max-height: 260px; overflow-y: auto; }
.cr-isps li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; background: var(--surface-2); }
.cr-isps li > span:first-child { font-weight: 600; flex: 1 1 140px; min-width: 0; }
.cr-jobs td:first-child { min-width: 320px; }

/* ---------- New client: 0 days ---------- */
[data-zero-off][hidden] { display: none !important; }
.switch.zero-day { margin-bottom: 14px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 12px; background: var(--surface-2); }
.input.is-locked { background: var(--surface-2); color: var(--text); font-weight: 700; cursor: not-allowed; }

/* ---------- Owner dashboard: greeting, income bars, ISP health ---------- */
.od-hero-hello { display: inline-block; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.dkpi-spark { width: 100%; height: 30px; margin-top: 8px; }
.dkpi-spark .spark-a { fill: none; stroke: var(--k); stroke-width: 2; vector-effect: non-scaling-stroke; }
.od-chart-empty { display: grid; place-items: center; gap: 4px; min-height: 220px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: 14px; }
.od-chart-empty .svg-icon { width: 28px; height: 28px; color: var(--primary); }
.od-chart-empty b { color: var(--text); }
.od-chart-empty span { font-size: 12.5px; }
.od-bars { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; height: 240px; }
.od-bars-axis { display: flex; flex-direction: column; justify-content: space-between; padding-bottom: 22px; font-size: 11px; font-weight: 600; color: var(--muted); text-align: right; }
.od-bars-plot { position: relative; display: flex; align-items: stretch; gap: 8px; padding-bottom: 22px; background: linear-gradient(var(--border) 1px, transparent 1px) 0 0 / 100% 50%; background-clip: content-box; border-bottom: 1px solid var(--border); }
.od-bar { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.od-bar i { display: block; width: 100%; max-width: 38px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #8ee3d2, #c8f1e7); transition: height .4s; }
.od-bar.is-now i { background: linear-gradient(180deg, var(--primary), #34d399); box-shadow: 0 10px 20px -12px color-mix(in srgb, var(--primary) 80%, transparent); }
.od-bar:hover i { filter: brightness(.95); }
.od-bar small { position: absolute; bottom: -20px; font-size: 11px; font-weight: 600; color: var(--muted); }
.od-bar.is-now small { color: var(--primary); }
.od-bar-val { margin-bottom: 4px; font-size: 10.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; opacity: 0; transition: opacity .15s; }
.od-bar:hover .od-bar-val, .od-bar.is-now .od-bar-val { opacity: 1; }
.od-health { display: flex; gap: 3px; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.od-health i { display: block; min-width: 6px; }
.od-health-legend { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px 14px; margin: 14px 0 0; padding: 0; list-style: none; }
.od-health-legend a { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--text-2); font-size: 13px; text-decoration: none !important; }
.od-health-legend a:hover { color: var(--primary); }
.od-health-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.od-health-legend b { margin-left: auto; color: var(--text); }
@media (max-width: 700px) { .od-bars { height: 200px; } .od-bar-val { display: none; } .od-bars-plot { gap: 4px; } }
/* =====================================================================
   Owner panel — professional theme (everything scoped to body.saas-ui)
   ===================================================================== */
.saas-ui {
  --bg: #f3f6fa; --table-head: #f7f9fc; --table-head-text: #667085;
  --ow-side: linear-gradient(180deg, #06201f 0%, #08302c 55%, #0a3a34 100%);
  --sidebar-bg: var(--ow-side);
  --nav-text: #a7c4bf; --nav-text-strong: #fff; --nav-section: #5e8a83; --nav-border: rgba(255, 255, 255, .07);
  --nav-icon-bg: rgba(255, 255, 255, .06); --nav-icon-hover: rgba(255, 255, 255, .12); --nav-hover: rgba(255, 255, 255, .05); --nav-accent: #6ee7c8;
  --ow-card-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 14px 32px -26px rgba(16, 24, 40, .28);
  --ow-ring: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent);
}
:root[data-theme="dark"] .saas-ui { --bg: #0a111e; --table-head: #142036; --table-head-text: #93a3b8; --ow-card-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .saas-ui { --bg: #0a111e; --table-head: #142036; --table-head-text: #93a3b8; --ow-card-shadow: 0 1px 2px rgba(0, 0, 0, .35); } }

/* Top bar: page title, ISP finder, notifications */
.saas-ui .appbar { height: 66px; background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: 0 1px 0 var(--border); gap: 14px; }
.ow-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; padding-left: 4px; }
.ow-title b { font-size: 16px; font-weight: 750; letter-spacing: -.01em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 28ch; }
.ow-title small { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.ow-search { position: relative; flex: 1; max-width: 420px; margin-left: auto; }
.ow-search .svg-icon { position: absolute; left: 13px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ow-search input { width: 100%; height: 42px; padding: 0 14px 0 40px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13.5px; transition: border-color .15s, box-shadow .15s, background .15s; }
.ow-search input:focus { outline: 0; border-color: var(--primary); background: var(--surface); box-shadow: var(--ow-ring); }
.saas-ui .appbar-actions { margin-left: 0; gap: 10px; }
.ow-bell { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); cursor: pointer; transition: border-color .15s, color .15s; }
.ow-bell:hover { border-color: var(--primary); color: var(--primary); }
.ow-bell .svg-icon { width: 19px; height: 19px; }
.ow-bell-count { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; display: grid; place-items: center; background: #ef4444; color: #fff; font-size: 10.5px; font-weight: 800; border: 2px solid var(--surface); }
.ow-alerts { min-width: 280px; }
.ow-alert-n { margin-left: auto; min-width: 24px; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text); font-size: 12px; text-align: center; }

/* Sidebar */
.saas-ui .sidebar { border-right: 0; box-shadow: 1px 0 0 rgba(255, 255, 255, .03); }
.saas-ui .nav { padding: 4px 14px 18px; }
.saas-ui .nav-section { padding: 18px 10px 8px; font-size: 10.5px; letter-spacing: .14em; }
.saas-ui .nav-single { gap: 12px; padding: 6px 10px 6px 6px; margin-bottom: 2px; border-radius: 12px; font-size: 13.8px; }
.saas-ui .nav-single > .svg-icon:first-child { width: 32px; height: 32px; padding: 7.5px; border-radius: 10px; }
.saas-ui .nav-single.active { color: #fff; background: linear-gradient(90deg, rgba(52, 211, 153, .2), rgba(52, 211, 153, .06)); box-shadow: inset 0 0 0 1px rgba(110, 231, 200, .18); }
.saas-ui .nav-single.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: #34d399; box-shadow: 0 0 12px rgba(52, 211, 153, .7); }
.saas-ui .nav-single.active > .svg-icon:first-child { color: #fff; background: linear-gradient(135deg, var(--primary), #34d399); box-shadow: 0 6px 14px -6px rgba(52, 211, 153, .8); }
.ow-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: rgba(110, 231, 200, .16); color: #b8f5e4; font-size: 11px; font-weight: 800; text-align: center; }
.ow-count.is-warn { background: #f59e0b; color: #1f1300; }
.saas-ui .so-side-card { background: linear-gradient(135deg, rgba(52, 211, 153, .14), rgba(255, 255, 255, .04)); border-color: rgba(110, 231, 200, .14); }

/* Page area */
.saas-ui .content { max-width: 1480px; margin: 0 auto; padding: 26px 30px 40px; }
.saas-ui .page-head { margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.saas-ui .page-head h1 { font-size: 25px; font-weight: 780; letter-spacing: -.025em; }
.saas-ui .page-head .subtitle { font-size: 13.5px; max-width: 75ch; }

/* Cards */
.saas-ui .card, .saas-ui .so-card { border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--ow-card-shadow); }
.saas-ui .card-head { padding: 16px 20px; min-height: 60px; border-bottom-color: var(--border); }
.saas-ui .card-head h3, .saas-ui .so-card-head h3 { font-size: 15.5px; font-weight: 720; letter-spacing: -.01em; }
.saas-ui .card-sub, .saas-ui .so-card-head > div > span { font-size: 12.5px; color: var(--muted); }
.saas-ui .saas-stat { border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--ow-card-shadow); padding: 16px 18px; position: relative; overflow: hidden; }
.saas-ui .saas-stat::after { content: ""; position: absolute; right: -24px; top: -24px; width: 80px; height: 80px; border-radius: 50%; background: var(--primary-soft); pointer-events: none; }
.saas-ui .saas-stat > span { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.saas-ui .so-stat, .saas-ui .dkpi { box-shadow: var(--ow-card-shadow); border-color: var(--border); }

/* Hero banners */
.saas-ui .so-hero, .saas-ui .od-hero {
  background:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .09) 1px, transparent 0) 0 0 / 22px 22px,
    radial-gradient(700px 260px at 92% -30%, rgba(52, 211, 153, .5), transparent 60%),
    linear-gradient(120deg, #0b7a68 0%, #075e52 45%, #04362f 100%);
  box-shadow: 0 24px 50px -32px rgba(4, 54, 47, .9);
}

/* Tables */
.saas-ui .table th { background: var(--table-head); color: var(--table-head-text); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; padding-top: 11px; padding-bottom: 11px; border-bottom: 1px solid var(--border); }
.saas-ui .table td { padding: 13px 16px; }
.saas-ui .table tbody tr { transition: background .12s; }
.saas-ui .table tbody tr:hover td { background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.saas-ui .table tbody tr:last-child td { border-bottom: 0; }

/* Forms & buttons */
.saas-ui .input, .saas-ui .select, .saas-ui .textarea { border-radius: 11px; border-color: var(--border-strong, var(--border)); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.saas-ui .input:focus, .saas-ui .select:focus, .saas-ui .textarea:focus { border-color: var(--primary); box-shadow: var(--ow-ring); }
.saas-ui .field > label { font-weight: 600; font-size: 13px; }
.saas-ui .btn { border-radius: 11px; font-weight: 600; }
.saas-ui .btn-primary { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #065f46)); border-color: transparent; box-shadow: 0 8px 18px -12px var(--primary); }
.saas-ui .btn-primary:hover { filter: brightness(1.05); box-shadow: 0 10px 22px -12px var(--primary); }
.saas-ui .btn-danger { box-shadow: 0 8px 18px -12px #dc2626; }
.saas-ui .pill { font-weight: 700; letter-spacing: .01em; }
.saas-ui .alert { border-radius: 14px; }

@media (max-width: 1100px) { .ow-title { display: none; } .ow-search { margin-left: 0; } }
@media (max-width: 720px) {
  .ow-search { display: none; }
  .saas-ui .appbar-actions { margin-left: auto; gap: 8px; }
  .ow-bell { width: 38px; height: 38px; }
  .saas-ui .content { padding: 18px 16px 32px; }
  .saas-ui .page-head h1 { font-size: 21px; }
}

/* Light buttons on the green hero banners keep their white look. */
.saas-ui .od-hero-actions .btn-primary, .saas-ui .so-hero .btn-primary { background: #fff; color: #067a67; border-color: #fff; box-shadow: none; filter: none; }

/* Owner panel: status tabs as pills; head text styles stay off badges */
.saas-ui .tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; border: 0; background: none; }
.saas-ui .tabs a { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600; text-decoration: none; margin: 0; }
.saas-ui .tabs a:hover { border-color: var(--primary); color: var(--text); }
.saas-ui .tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 8px 18px -12px var(--primary); }
.saas-ui .tabs a.active::after { display: none; }

/* Settings › Website: packages shown on the website */
.ws-packages { margin-bottom: 18px; }
.ws-packages .card-head h3 { display: flex; align-items: center; gap: 8px; }
.ws-pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); gap: 10px; }
.ws-pk { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.ws-pk:hover { border-color: var(--primary); }
.ws-pk:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.ws-pk input { margin-top: 3px; accent-color: var(--primary); }
.ws-pk b { display: block; font-size: 14px; }
.ws-pk small { display: block; color: var(--muted); font-size: 12.5px; }

/* ---------- Owner panel › Plans: pricing cards and the edit dialog ---------- */
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 18px; margin-bottom: 18px; }
.pl-card { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 22px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--ow-card-shadow, var(--shadow)); min-width: 0; transition: transform .15s, box-shadow .15s, border-color .15s; }
.pl-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); box-shadow: 0 22px 40px -28px color-mix(in srgb, var(--primary) 70%, transparent); }
.pl-card.is-pop { border: 2px solid var(--primary); background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 7%, var(--surface)), var(--surface) 45%); }
.pl-card.is-off { opacity: .72; }
.pl-ribbon { position: absolute; top: -12px; left: 22px; padding: 3px 12px; border-radius: 999px; background: linear-gradient(135deg, var(--primary), #34d399); color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .03em; box-shadow: 0 8px 16px -8px var(--primary); }
.pl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pl-head h3 { margin: 0; font-size: 18px; font-weight: 780; letter-spacing: -.01em; }
.pl-head p { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pl-price { display: flex; align-items: baseline; gap: 6px; padding-bottom: 16px; border-bottom: 1px dashed var(--border); }
.pl-price b { font-size: 34px; line-height: 1; font-weight: 800; letter-spacing: -.03em; color: var(--text); }
.pl-price span { font-size: 13px; color: var(--muted); font-weight: 600; }
.pl-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pl-stats > div { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.pl-stats small { font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pl-stats b { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-sub { font-size: 11.5px; color: var(--muted); }
.pl-bar { display: block; height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.pl-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), #34d399); }
.pl-limits-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.pl-limits-list li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.pl-li-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); flex: none; }
.pl-li-ico .svg-icon { width: 15px; height: 15px; }
.pl-modules { display: grid; gap: 7px; padding: 12px; border-radius: 14px; border: 1px solid var(--border); }
.pl-modules-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; color: var(--text-2); }
.pl-modules-top span { display: inline-flex; align-items: center; gap: 6px; }
.pl-modules-top .svg-icon { width: 15px; height: 15px; color: var(--primary); }
.pl-modules small { font-size: 12px; color: var(--muted); line-height: 1.45; }
.pl-foot { display: flex; gap: 8px; margin-top: auto; }
.pl-foot .btn-primary { flex: 1; justify-content: center; }
.pl-new { align-items: center; justify-content: center; gap: 8px; min-height: 280px; border: 2px dashed var(--border-strong, var(--border)); background: transparent; box-shadow: none; color: var(--muted); font: inherit; cursor: pointer; text-align: center; }
.pl-new:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.pl-new b { font-size: 16px; color: var(--text); }
.pl-new small { font-size: 12.5px; }
.pl-new-ico { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: linear-gradient(135deg, var(--primary), #34d399); color: #fff; box-shadow: 0 12px 24px -12px var(--primary); }
.pl-new-ico .svg-icon { width: 24px; height: 24px; }
.pl-dialog { width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
.pl-dialog .be-form { overflow-y: auto; max-height: calc(100vh - 42px); }
.pl-form { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); gap: 20px; align-items: start; }
.pl-form-fields { display: grid; gap: 12px; }
.pl-limits { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.pl-sale { margin-bottom: 9px; }
.plan-mods { background: var(--surface-2); border-color: var(--border); }
.plan-mods-all { border-bottom-color: var(--border); }
@media (max-width: 820px) { .pl-form { grid-template-columns: 1fr; } }

/* MikroTik › PPPoE audit */
.au-filters { margin-bottom: 16px; }
.au-issue { font-size: 12.5px; font-weight: 600; color: var(--danger); white-space: nowrap; }
.lg-msg { font-size: 12.5px; white-space: normal; word-break: break-word; }

/* Inventory */
.inv-types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.inv-types label { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.inv-types label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.inv-types b { display: block; font-size: 14px; }
.inv-types small { display: block; font-size: 12px; color: var(--muted); }
.inv-types input { margin-top: 3px; accent-color: var(--primary); }
.inv-cat-dialog { width: min(560px, calc(100vw - 32px)); }
.inv-cat-row { display: flex; gap: 8px; align-items: center; }
.inv-cat-row .input { flex: 1; min-width: 0; }
.rs-quote { padding: 10px 12px; border-radius: 10px; background: var(--primary-soft); color: var(--text-2); font-size: 13px; }

/* MikroTik › Server change */
.sc-card { margin-bottom: 18px; }
.sc-card .card-head h3 { display: flex; align-items: center; gap: 8px; }
.sc-form { display: flex; gap: 8px; }
.sc-form .select { flex: 1; min-width: 0; }
.bl-state { display: flex; align-items: center; gap: 4px; }
.bl-state form { display: inline; }
.bl-pay { min-width: 140px; }

/* Billing › bill sheet (the old panel's layout) */
.bl-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; margin-bottom: 18px; }
.bl-card { display: flex; align-items: flex-start; gap: 14px; padding: 20px; border-radius: 22px; color: #fff; box-shadow: 0 14px 30px -20px rgba(15, 23, 42, .6); }
.bl-card .svg-icon { width: 34px; height: 34px; padding: 6px; border-radius: 9px; background: rgba(255, 255, 255, .92); color: inherit; flex: none; }
.bl-card small { display: block; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; line-height: 1.25; opacity: .95; }
.bl-card b { display: block; margin-top: 8px; font-size: 22px; }
.bl-card.is-teal { background: #5aa47c; } .bl-card.is-teal .svg-icon { color: #5aa47c; }
.bl-card.is-blue { background: #4f8be0; } .bl-card.is-blue .svg-icon { color: #4f8be0; }
.bl-card.is-red { background: #d4574b; } .bl-card.is-red .svg-icon { color: #d4574b; }
.bl-card.is-violet { background: #5a55b8; } .bl-card.is-violet .svg-icon { color: #5a55b8; }
.bl-head { justify-content: center; }
.bl-head h3 { font-size: 19px; }
.bl-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.bl-filters .field { margin: 0; min-width: 150px; }
.bl-filters .bl-grow { flex: 1 1 200px; }
.bl-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.bl-table th { white-space: nowrap; }
.bl-remark { min-width: 160px; font-size: 12.5px; }
.bl-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: #4f8be0; cursor: pointer; }
.bl-icon:hover { background: var(--surface-3); }
.bl-icon.is-due { color: #d4574b; }
.bl-icon .svg-icon { width: 20px; height: 20px; }
.btn-success { background: #22a55a; border-color: #22a55a; color: #fff; }
.btn-success:hover { background: #1c8f4d; color: #fff; text-decoration: none; }
.bl-card small, .bl-card b { color: #fff; }
.saas-ui .bl-card small, .bl-cards .bl-card small { color: #fff !important; }

/* OLT card: the whole error on demand */
details.oc-error { display: block; }
details.oc-error summary { display: flex; gap: 6px; align-items: flex-start; cursor: pointer; list-style: none; }
details.oc-error summary::-webkit-details-marker { display: none; }
details.oc-error summary u { font-weight: 600; white-space: nowrap; }
details.oc-error[open] summary span { display: none; }
details.oc-error[open] summary::after { content: "Full message"; font-weight: 600; text-decoration: underline; }
details.oc-error p { margin: 6px 0 0 20px; word-break: break-word; }
