/* =====================================================================
   Modern Theme for phpNuxBill (Pamoja)
   - Emerald accent, light (default) + dark (html.dark) palettes
   - Restyles AdminLTE 2 / Bootstrap 3 so all pages inherit a modern look
   - Loaded LAST so it overrides cortech.css / modern-AdminLTE.min.css
   ===================================================================== */

:root {
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --bg: #f1f5f9;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --text: #0f172a;
    --text-muted: #5b6677;
    --border: #e6eaf0;

    --accent: #10b981;
    --accent-600: #059669;
    --accent-700: #047857;
    --accent-contrast: #ffffff;
    --accent-soft: rgba(16, 185, 129, .12);
    /* Link colour is darker than the brand accent so body links meet AA (4.5:1)
       on white surfaces; the accent stays for buttons/badges where text is white. */
    --link: #047857;
    --link-hover: #065f46;

    --blue: #3b82f6;
    --amber: #f59e0b;
    --rose: #f43f5e;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
    --shadow: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
    --shadow-lg: 0 12px 28px -8px rgba(15, 23, 42, .18);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;

    /* Sidebar is a permanent dark rail in both light and dark page modes
       (matches cortech.css rgb(28 36 52) so the under-menu fill is seamless). */
    --sidebar-bg: #1c2434;
    --sidebar-text: #aeb9cb;
    --sidebar-muted: #9aa7bd;
    --sidebar-hover: rgba(255, 255, 255, .06);
    --sidebar-active-bg: rgba(16, 185, 129, .16);
    --sidebar-active-text: #34d399;
    --header-bg: rgba(255, 255, 255, .85);
}

html.dark {
    --bg: #0b1220;
    --surface: #111a2e;
    --surface-2: #16213a;
    --surface-3: #1c2942;
    --text: #e5edf7;
    --text-muted: #94a3b8;
    --border: #243049;

    --accent: #10b981;
    --accent-600: #34d399;
    --accent-700: #6ee7b7;
    --accent-soft: rgba(16, 185, 129, .16);
    /* On dark surfaces links use a light emerald (high contrast). */
    --link: #34d399;
    --link-hover: #6ee7b7;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 2px 6px rgba(0, 0, 0, .45);
    --shadow-lg: 0 16px 40px -10px rgba(0, 0, 0, .6);

    --sidebar-bg: #1a202c;
    --sidebar-text: #aeb9cb;
    --sidebar-muted: #9aa7bd;
    --sidebar-hover: rgba(255, 255, 255, .06);
    --sidebar-active-bg: rgba(16, 185, 129, .18);
    --sidebar-active-text: #34d399;
    --header-bg: rgba(12, 20, 36, .82);
}

/* ----------------------------- Base ----------------------------- */
body {
    font-family: var(--font) !important;
    background: var(--bg) !important;
    color: var(--text) !important;
    -webkit-font-smoothing: antialiased;
    letter-spacing: .1px;
}

a {
    color: var(--link);
}

a:hover,
a:focus {
    color: var(--link-hover);
}

.content-wrapper {
    background: var(--bg) !important;
}

.content-header {
    padding: 22px 22px 6px;
}

.content-header > h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.3px;
}

.content-header > h1 > small {
    color: var(--text-muted);
}

.content {
    padding: 14px 22px 22px;
}

/* ----------------------------- Header / Navbar ----------------------------- */
.main-header .navbar,
.main-header .logo {
    /* NOTE: do NOT use backdrop-filter/filter/transform here — the search
       overlay (#searchOverlay) is a position:fixed descendant of .navbar, and
       any of those properties would make this element its containing block,
       trapping the overlay inside the header instead of the viewport. */
    background: var(--surface) !important;
    border-bottom: 1px solid var(--border);
    box-shadow: none;
}

.main-header .logo {
    color: var(--text) !important;
    font-weight: 700;
    border-right: 1px solid var(--border);
}

.main-header .logo .logo-lg {
    color: var(--text) !important;
}

.main-header .logo:hover {
    background: var(--surface-2) !important;
}

.main-header .navbar .nav > li > a {
    color: var(--text-muted) !important;
}

.main-header .navbar .nav > li > a:hover {
    color: var(--accent-600) !important;
    background: transparent !important;
}

.sidebar-toggle:before {
    content: "\f0c9";
    font-family: "FontAwesome";
    color: var(--text-muted);
}

.navbar .toggle-icon {
    font-style: normal;
    font-size: 18px;
}

.user-menu .user-image {
    border: 2px solid var(--accent);
}

/* Search overlay (must sit above the fixed header) */
.search-overlay {
    background: rgba(15, 23, 42, .55) !important;
    z-index: 1100 !important;
    padding: 20px;
}

.search-container {
    background: var(--surface) !important;
    color: var(--text) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-lg);
    max-width: 560px;
}

.searchTerm {
    background: var(--surface-2) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    padding: 11px 14px;
}

.searchTerm:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-soft);
    outline: none;
}

.cancelButton {
    background: var(--surface-2) !important;
    color: var(--text) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600;
}

.cancelButton:hover {
    background: var(--surface-3) !important;
}

.search-results {
    border-radius: var(--radius-sm);
}

/* ----------------------------- Sidebar ----------------------------- */
/* AdminLTE's .main-sidebar is position:absolute and only as tall as its menu.
   The area below it shows the .wrapper background, so match it to the sidebar
   colour — otherwise a stray white block appears under the menu. */
.wrapper {
    background: var(--sidebar-bg) !important;
}

.main-sidebar,
.main-sidebar .sidebar {
    background: var(--sidebar-bg) !important;
    min-height: 100%;
}

.main-sidebar {
    border-right: 1px solid rgba(255, 255, 255, .04);
    box-shadow: none !important;
}

/* logo block above the sidebar shares the rail colour */
.main-header .logo {
    background: var(--sidebar-bg) !important;
    color: #fff !important;
    border-right: none;
}

.main-header .logo .logo-lg,
.main-header .logo .logo-mini {
    color: #fff !important;
}

.sidebar-menu > li > a {
    color: var(--sidebar-text) !important;
    font-weight: 500;
    font-size: 14px;
    margin: 2px 10px;
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    border-left: 0 !important;
    transition: background .15s ease, color .15s ease;
}

.sidebar-menu > li > a > .fa,
.sidebar-menu > li > a > .ion {
    color: var(--sidebar-muted);
    width: 22px;
    transition: color .15s ease;
}

.sidebar-menu > li:hover > a,
.sidebar-menu > li.active > a,
.sidebar-menu > li.menu-open > a {
    background: var(--sidebar-hover) !important;
    color: #fff !important;
}

.sidebar-menu > li.active > a {
    background: var(--sidebar-active-bg) !important;
    color: var(--sidebar-active-text) !important;
    font-weight: 600;
}

.sidebar-menu > li.active > a > .fa,
.sidebar-menu > li.active > a > .ion,
.sidebar-menu > li:hover > a > .fa,
.sidebar-menu > li:hover > a > .ion {
    color: var(--sidebar-active-text);
}

.sidebar-menu .treeview-menu {
    background: transparent !important;
    padding: 2px 10px 6px 18px;
}

.sidebar-menu .treeview-menu > li > a {
    color: var(--sidebar-muted) !important;
    font-size: 13.5px;
    padding: 8px 12px;
    border-radius: var(--radius-xs);
}

.sidebar-menu .treeview-menu > li > a:hover,
.sidebar-menu .treeview-menu > li.active > a {
    color: var(--sidebar-active-text) !important;
    background: var(--sidebar-hover) !important;
}

.sidebar-menu .treeview-menu > li > a > .fa-angle-double-right {
    display: none;
}

/* ----------------------------- Cards / Boxes ----------------------------- */
.box {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow) !important;
    border-top-width: 1px !important;
}

.box.box-primary,
.box.box-success,
.box.box-info,
.box.box-warning,
.box.box-danger {
    border-top: 3px solid var(--accent) !important;
}

.box.box-info { border-top-color: var(--blue) !important; }
.box.box-warning { border-top-color: var(--amber) !important; }
.box.box-danger { border-top-color: var(--rose) !important; }

.box-header {
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding: 16px 18px;
}

.box-header .box-title {
    font-weight: 600;
    font-size: 16px;
}

.box-body {
    color: var(--text);
    padding: 18px;
}

.box-footer {
    background: transparent;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

.nav-tabs-custom {
    background: var(--surface) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow) !important;
    border: 1px solid var(--border);
}

.nav-tabs-custom > .nav-tabs {
    border-bottom: 1px solid var(--border);
}

/* ----------------------------- Panels (Bootstrap) ----------------------------- */
/* Many admin pages use .panel instead of .box — give them the same modern look. */
.panel {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow) !important;
}

.panel > .panel-heading {
    background: transparent !important;
    color: var(--text) !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    font-weight: 600;
    padding: 14px 18px;
}

.panel-body {
    color: var(--text);
    padding: 16px 18px;
}

.panel > .panel-footer {
    background: var(--surface-2) !important;
    border-top: 1px solid var(--border) !important;
    color: var(--text-muted);
    border-radius: 0 0 var(--radius) var(--radius) !important;
}

/* Coloured top accent instead of Bootstrap's solid-colour headers. */
.panel-primary,
.panel-success {
    border-top: 3px solid var(--accent) !important;
}

.panel-info { border-top: 3px solid var(--blue) !important; }
.panel-warning { border-top: 3px solid var(--amber) !important; }
.panel-danger { border-top: 3px solid var(--rose) !important; }

.panel-primary > .panel-heading,
.panel-info > .panel-heading,
.panel-success > .panel-heading,
.panel-warning > .panel-heading,
.panel-danger > .panel-heading {
    background: transparent !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
}

/* Grouped buttons (e.g. Audit / Delete) — spaced, rounded, and kept on ONE row.
   Bootstrap floats nested .btn-group, which makes them wrap/stack in narrow
   table cells; force inline-block + nowrap so they never stack. */
.btn-group {
    white-space: nowrap;
}

/* Scope the inline-block fix to NON-justified groups. Bootstrap's
   .btn-group-justified lays its children out as table-cells; forcing them to
   inline-block collapses the table so the buttons overlap (the Voucher page). */
.btn-group:not(.btn-group-justified) > .btn-group {
    float: none;
    display: inline-block;
    vertical-align: top;
}

.btn-group > .btn {
    border-radius: var(--radius-sm) !important;
}

.btn-group:not(.btn-group-justified) > .btn-group + .btn-group,
.btn-group:not(.btn-group-justified) > .btn + .btn {
    margin-left: 4px;
}

/* Re-assert Bootstrap's justified layout so buttons share the row evenly. */
.btn-group-justified {
    display: table;
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
}

.btn-group-justified > .btn,
.btn-group-justified > .btn-group {
    display: table-cell;
    float: none;
    width: 1%;
}

.btn-group-justified > .btn-group .btn {
    width: 100%;
}

/* ----------------------------- Stat cards (small-box) ----------------------------- */
.small-box {
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow) !important;
    overflow: hidden;
    color: #fff;
    border: none;
}

.small-box > .inner {
    padding: 20px 18px 12px;
}

/* Consistent, prominent KPI number across all cards (income, counts, etc.).
   Fluid size so long values (e.g. "497/5347") don't overflow/clip on the
   half-width cards on small screens. */
.small-box h3,
.small-box h4,
.small-box .inner > p {
    font-weight: 800 !important;
    letter-spacing: -.3px;
    font-size: clamp(20px, 3.4vw, 28px) !important;
    line-height: 1.15;
    margin: 0 0 2px;
    white-space: normal;
    word-break: break-word;
}

.small-box .inner > p > span {
    font-size: 64% !important;
    font-weight: 600;
    opacity: .85;
}

/* Footer reads as a clean metric label. */
.small-box > a.small-box-footer,
.small-box > .small-box-footer {
    text-transform: uppercase;
    letter-spacing: .6px;
    font-size: 11px;
}

.small-box .icon {
    font-size: 58px;
    top: 12px;
    right: 16px;
    color: rgba(255, 255, 255, .22);
}

.small-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg) !important;
    transition: all .18s ease;
}

.small-box > a.small-box-footer,
.small-box > .small-box-footer {
    /* Darker strip so the white footer link text meets AA (4.5:1) over any card colour. */
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-weight: 600;
}

/* Gradients darkened where needed so white card text is legible (green & amber
   were too light — white fell below the large-text 3:1 threshold). */
.small-box.bg-aqua { background: linear-gradient(135deg, #2563eb, #1d4ed8) !important; }
.small-box.bg-green { background: linear-gradient(135deg, #047857, #065f46) !important; }
.small-box.bg-yellow { background: linear-gradient(135deg, #d97706, #b45309) !important; }
.small-box.bg-red { background: linear-gradient(135deg, #f43f5e, #e11d48) !important; }

/* AdminLTE sets `.bg-aqua{background-color:#00c0ef!important}` (too light for white
   text). Override with a higher-specificity solid colour so contrast holds even if
   the gradient image is suppressed. */
body .small-box.bg-aqua { background-color: #1d4ed8 !important; }
body .small-box.bg-green { background-color: #065f46 !important; }
body .small-box.bg-yellow { background-color: #b45309 !important; }
body .small-box.bg-red { background-color: #e11d48 !important; }

/* ----------------------------- Buttons ----------------------------- */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    border: 1px solid transparent;
    padding: 8px 16px;
    transition: all .15s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary,
.btn-success {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: var(--accent-contrast) !important;
}

.btn-primary:hover,
.btn-success:hover,
.btn-primary:focus,
.btn-success:focus {
    background: var(--accent-600) !important;
    border-color: var(--accent-600) !important;
    box-shadow: 0 6px 16px -6px var(--accent);
}

.btn-default {
    background: var(--surface) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

.btn-default:hover {
    background: var(--surface-2) !important;
    border-color: var(--text-muted) !important;
}

.btn-info { background: var(--blue) !important; border-color: var(--blue) !important; }
.btn-warning { background: var(--amber) !important; border-color: var(--amber) !important; color: #fff !important; }
.btn-danger { background: var(--rose) !important; border-color: var(--rose) !important; }

.btn-flat { border-radius: var(--radius-sm); }

/* ----------------------------- Forms ----------------------------- */
.form-control,
.select2-container--bootstrap .select2-selection,
.select2-selection--single {
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text) !important;
    box-shadow: none !important;
    height: auto;
    min-height: 40px;
    padding: 8px 12px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.form-control:focus,
.select2-container--focus .select2-selection {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-soft) !important;
}

.form-control::placeholder { color: var(--text-muted); opacity: .7; }

label { color: var(--text); font-weight: 600; font-size: 13.5px; }

.input-group-addon {
    background: var(--surface-2) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
    border-radius: var(--radius-sm);
}

/* ----------------------------- Tables ----------------------------- */
.table {
    color: var(--text);
}

.table > thead > tr > th {
    border-bottom: 1px solid var(--border) !important;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    padding: 9px 14px;
}

.table > tbody > tr > td {
    border-top: 1px solid var(--border) !important;
    padding: 9px 14px;
    vertical-align: middle;
}

/* Denser variant for data-heavy lists (add class="table-condensed"). */
.table-condensed > thead > tr > th,
.table-condensed > tbody > tr > td {
    padding: 6px 12px;
}

.table-hover > tbody > tr:hover {
    background: var(--surface-2) !important;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background: var(--surface-2);
}

.box-body.no-padding .table { margin-bottom: 0; }

/* ----------------------------- Labels / Badges ----------------------------- */
.label,
.badge {
    border-radius: 999px;
    font-weight: 600;
    padding: .3em .7em;
    font-size: 11.5px;
}

.label-success, .badge-success, .bg-green { background: var(--accent) !important; }
.label-primary { background: var(--accent) !important; }
.label-info, .bg-aqua { background: var(--blue) !important; }
.label-warning, .bg-yellow { background: var(--amber) !important; color: #fff !important; }
.label-danger, .bg-red { background: var(--rose) !important; }

/* ----------------------------- Alerts ----------------------------- */
.alert {
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
}

.alert-success { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-700); }
.alert-info { background: rgba(59, 130, 246, .12); border-color: var(--blue); color: var(--blue); }
.alert-warning { background: rgba(245, 158, 11, .14); border-color: var(--amber); color: #b45309; }
.alert-danger { background: rgba(244, 63, 94, .12); border-color: var(--rose); color: var(--rose); }

/* ----------------------------- Modals / Dropdowns ----------------------------- */
.modal-content {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.modal-header,
.modal-footer {
    border-color: var(--border);
}

.dropdown-menu {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 6px;
}

.dropdown-menu > li > a {
    color: var(--text);
    border-radius: var(--radius-xs);
    padding: 8px 12px;
}

.dropdown-menu > li > a:hover {
    background: var(--accent-soft);
    color: var(--accent-600);
}

/* ----------------------------- Pagination / Tabs ----------------------------- */
.pagination > li > a,
.pagination > li > span {
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    margin: 0 2px;
    border-radius: var(--radius-xs) !important;
}

.pagination > .active > a,
.pagination > .active > span {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
}

.nav-tabs {
    border-bottom: 1px solid var(--border);
}

.nav-tabs > li > a {
    color: var(--text-muted);
    border: none !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0;
    font-weight: 600;
}

.nav-tabs > li.active > a,
.nav-tabs > li > a:hover {
    color: var(--accent-600) !important;
    background: transparent !important;
    border-bottom: 2px solid var(--accent) !important;
}

/* ----------------------------- Footer / misc ----------------------------- */
.main-footer {
    background: var(--surface) !important;
    border-top: 1px solid var(--border);
    color: var(--text-muted) !important;
    border-radius: 0;
}

.main-footer a { color: var(--link); }

/* Force card text fully white so superscripts/labels stay legible on gradients. */
.small-box,
.small-box h3,
.small-box h4,
.small-box p,
.small-box span,
.small-box sup,
.small-box small {
    color: #fff !important;
    opacity: 1 !important;
}

/* Some widgets inherit lighter cortech colours that fail AA contrast. Force
   secondary text and in-content links to the accessible theme tokens. */
.box small,
.box-body small,
.box .text-muted,
.box-body .text-muted,
.table th,
td small {
    color: var(--text-muted) !important;
}

.box-body a:not(.btn):not(.label),
.table td a:not(.btn):not(.label),
td a:not(.btn):not(.label) {
    color: var(--link) !important;
}

hr { border-top: 1px solid var(--border); }

.text-muted, small, .small { color: var(--text-muted) !important; }

.notification-top-bar {
    background: var(--amber);
    color: #fff;
}

/* progress bars */
.progress { background: var(--surface-3); border-radius: 999px; }
.progress-bar { background: var(--accent); border-radius: 999px; }

/* ----------------------------- Customer portal tweaks ----------------------------- */
.user-panel,
.box-profile {
    color: var(--text);
}

.list-group-item {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

/* ----------------------------- Scrollbar ----------------------------- */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); background-clip: content-box; }

/* ----------------------------- Loading spinner (submit buttons) ----------------------------- */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, .5);
    border-top-color: #fff;
    border-radius: 50%;
    animation: modern-spin .6s linear infinite;
    vertical-align: middle;
}

@keyframes modern-spin { to { transform: rotate(360deg); } }

/* subtle fade-in for content */
.content-wrapper > .content { animation: modern-fade .25s ease; }
@keyframes modern-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ===================================================================
   UX / Accessibility enhancements
   =================================================================== */

/* (A2) Visible keyboard focus rings — AdminLTE/Bootstrap strip outlines,
   leaving keyboard users with no "where am I" cue. Only show for keyboard
   (:focus-visible), so mouse clicks stay clean. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.sidebar-menu a:focus-visible,
.toggle-container:focus-visible {
    outline: 2px solid var(--accent) !important;
    outline-offset: 2px;
    border-radius: 6px;
}

.sidebar-menu a:focus-visible {
    outline-offset: -2px;
}

/* (B4) Tabular figures so numbers/currency align in columns and don't
   jitter when values change (income cards, amounts, transaction tables). */
.table,
.table td,
.table th,
.small-box h3,
.small-box h4,
.number {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1;
}

/* (B6) Clear "current page" cue: accent bar on the active sidebar item. */
.sidebar-menu > li.active > a {
    box-shadow: inset 3px 0 0 0 var(--accent);
}

/* ===================================================================
   Responsive application shell
   Shared by the admin and customer Smarty layouts.
   =================================================================== */

html {
    overflow-x: hidden;
    background: var(--bg);
}

body.search-open {
    overflow: hidden;
}

.content-wrapper,
.content,
.content .row,
.box-body,
.panel-body,
.form-group {
    min-width: 0;
}

/* cortech.css marks its legacy content spacing as !important. Scope the
   override to this theme so desktop and responsive spacing use one system. */
body.modern-theme .content {
    padding: 14px 22px 22px !important;
    background: var(--bg) !important;
}

img,
svg,
video,
canvas,
iframe {
    max-width: 100%;
}

pre {
    max-width: 100%;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 12px;
    z-index: 2000;
    padding: 10px 14px;
    color: var(--accent-contrast) !important;
    background: var(--accent-700);
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-lg);
    transform: translateY(-150%);
    transition: transform .15s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

/* Button elements now back the navigation controls, so reset their native
   chrome while retaining AdminLTE's familiar 50px header rhythm. */
.main-header .sidebar-toggle {
    height: 50px;
    border: 0;
    background: transparent;
    line-height: 20px;
}

.main-header .sidebar-toggle:hover,
.main-header .sidebar-toggle:focus {
    color: var(--accent-600) !important;
    background: var(--surface-2) !important;
}

.navbar-nav > li > .topbar-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    padding: 0;
    color: var(--text-muted);
    background: transparent;
    border: 0;
}

.navbar-nav > li > .topbar-action:hover,
.navbar-nav > li > .topbar-action:focus {
    color: var(--accent-600);
    background: var(--surface-2);
}

.account-summary {
    color: inherit;
    font-variant-numeric: tabular-nums;
}

/* Keep the customer shell anchored while pages scroll. */
.customer-shell .main-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1030;
}

.customer-shell .main-sidebar {
    position: fixed;
}

.customer-shell .content-wrapper {
    padding-top: 50px;
}

/* Compact, predictable search trigger replacing the legacy percentage sizing. */
.main-header .navbar .wrap {
    left: 50%;
    width: auto;
}

.main-header .navbar .search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-contrast);
    box-shadow: 0 5px 14px -7px var(--accent-700);
}

.main-header .navbar .search:hover,
.main-header .navbar .search:focus {
    background: var(--accent-600);
}

.search-overlay {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
        max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.search-container {
    width: min(100%, 560px) !important;
    max-height: min(80vh, 680px);
    max-height: min(80dvh, 680px);
    overflow: hidden;
}

.search-results {
    max-height: min(45vh, 360px);
    max-height: min(45dvh, 360px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.navbar-nav > .user-menu > .dropdown-menu > .user-header {
    background: linear-gradient(135deg, var(--accent-700), var(--accent-600)) !important;
    color: #fff !important;
}

.navbar-nav > .user-menu > .dropdown-menu > .user-header p,
.navbar-nav > .user-menu > .dropdown-menu > .user-header small {
    color: #fff !important;
}

/* Cards, forms and data regions should be allowed to shrink inside any grid. */
.panel-heading,
.box-header {
    overflow-wrap: anywhere;
}

.panel-heading::after,
.box-header::after,
.md-whiteframe-z1::after {
    display: table;
    clear: both;
    content: "";
}

.select2-container,
.form-horizontal .select2-container {
    max-width: 100%;
}

textarea.form-control {
    min-height: 96px;
    resize: vertical;
}

.input-group {
    width: 100%;
}

.input-group-addon {
    white-space: normal;
}

.help-block {
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

/* The old base stylesheet made every first table cell sticky with a fixed light
   background. That caused overlap and dark-mode artifacts. Scrolling remains
   available through the responsive wrapper without freezing arbitrary columns. */
body.modern-theme .table > thead > tr > th:first-child,
body.modern-theme .table > tbody > tr > td:first-child,
body.modern-theme .table > tfoot > tr > td:first-child {
    position: static;
    background: inherit;
}

.table-responsive {
    width: 100%;
    max-width: 100%;
    margin-bottom: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 0;
    border-radius: var(--radius-sm);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
}

.table-responsive > .table {
    margin-bottom: 0;
}

.table-responsive > .table > thead > tr > th,
.table-responsive > .table > tbody > tr > td {
    white-space: nowrap;
}

.table-responsive > .table td.description {
    min-width: 240px;
    white-space: normal;
}

.table td .btn {
    margin-block: 2px;
}

.nav-tabs-custom,
.nav-tabs-custom > .nav-tabs,
.nav-tabs {
    max-width: 100%;
}

.nav-tabs-custom > .nav-tabs,
.nav-tabs {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.nav-tabs > li {
    flex: 0 0 auto;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 100%;
}

.pagination > li > a,
.pagination > li > span {
    margin: 0;
}

.modal-dialog {
    max-width: calc(100% - 24px);
}

.modal-body {
    max-height: calc(100vh - 190px);
    max-height: calc(100dvh - 190px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.main-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 18px;
}

.main-footer .pull-right {
    float: none !important;
}

.notification-top-bar {
    height: auto;
    min-height: 44px;
    padding: 10px 18px;
    line-height: 1.5;
}

.notification-top-bar p {
    margin: 0;
}

/* Medium screens: reclaim a little room without making data-heavy pages feel
   cramped. Bootstrap's grid continues to control actual column stacking. */
@media (max-width: 1199px) {
    .content-header {
        padding: 18px 18px 5px;
    }

    body.modern-theme .content {
        padding: 12px 18px 20px !important;
    }

    .panel-body,
    .box-body {
        padding: 16px;
    }

    .md-whiteframe-z1 > [class*="col-lg-"] {
        margin-bottom: 10px;
    }
}

/* Phones and small tablets: off-canvas navigation, compact cards, stacked
   actions, touch-friendly controls and viewport-safe dialogs. */
@media (max-width: 767px) {
    .customer-shell .content-wrapper {
        padding-top: 100px;
    }

    .main-sidebar {
        position: fixed !important;
        height: 100vh;
        height: 100dvh;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .main-header .navbar-custom-menu {
        max-width: calc(100% - 54px);
    }

    .main-header .navbar .nav > li > a,
    .navbar-nav > li > .topbar-action {
        min-width: 44px;
        padding-right: 12px;
        padding-left: 12px;
    }

    .main-header .navbar .wrap {
        left: 50%;
    }

    .content-header {
        padding: 16px 12px 4px;
    }

    .content-header > h1 {
        margin: 0;
        font-size: clamp(19px, 6vw, 23px);
        line-height: 1.25;
    }

    body.modern-theme .content {
        padding: 10px 12px 18px !important;
        background: var(--bg) !important;
    }

    .row {
        margin-right: -6px;
        margin-left: -6px;
    }

    .row > [class*="col-"] {
        padding-right: 6px;
        padding-left: 6px;
    }

    .panel,
    .box,
    .nav-tabs-custom,
    .small-box {
        margin-bottom: 12px;
        border-radius: 12px !important;
    }

    .panel > .panel-heading,
    .box-header {
        padding: 13px 14px;
        border-radius: 12px 12px 0 0 !important;
    }

    .panel-body,
    .box-body {
        padding: 14px;
    }

    .panel-heading > .pull-right,
    .box-header > .pull-right {
        float: none !important;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
        margin: 0 0 10px;
    }

    .panel-heading > .pull-right .btn,
    .box-header > .pull-right .btn {
        flex: 1 1 auto;
    }

    .form-horizontal .control-label {
        padding-top: 0;
        margin-bottom: 6px;
        text-align: left;
    }

    .form-control,
    .select2-search__field,
    .select2-container--bootstrap .select2-selection {
        font-size: 16px;
    }

    /* These controls deliberately sit at 12-13px on desktop (see their own
       rules elsewhere) but iOS Safari zooms the whole page on focus when an
       input's font-size is under 16px. Bump just the mobile font-size to
       16px so focus no longer triggers zoom; desktop sizing is untouched. */
    .customer-credential-row input,
    .customer-directory-filter-card select,
    .service-plan-filter-card select,
    .service-plan-search input,
    .customer-directory-search-field input,
    .customer-form-field input,
    .customer-form-field select,
    .customer-form-field textarea,
    .customer-existing-fields input,
    .customer-new-field-row input,
    .bandwidth-directory-search input,
    .admin-password-input .form-control,
    .subscription-directory-search input,
    .subscription-directory-filter-card select,
    .coupon-directory-search input {
        font-size: 16px;
    }

    .btn-group:not(.btn-group-justified) {
        max-width: 100%;
        overflow-x: auto;
        vertical-align: middle;
    }

    .table > thead > tr > th,
    .table > tbody > tr > td {
        padding: 9px 10px;
    }

    .table-responsive {
        margin-right: 0;
        margin-left: 0;
        border: 1px solid var(--border);
    }

    .modal-dialog {
        width: auto;
        max-width: none;
        margin: 12px;
    }

    .modal-content {
        border-radius: 12px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 14px;
    }

    .modal-footer {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .modal-footer .btn + .btn {
        margin-left: 0;
    }

    .main-footer {
        padding: 14px 12px max(14px, env(safe-area-inset-bottom));
        font-size: 12px;
        text-align: center;
    }

    .main-footer > * {
        width: 100%;
    }

    .notification-top-bar {
        padding-right: 12px;
        padding-left: 12px;
    }

    .small-box > .inner {
        padding: 16px 14px 10px;
    }

    .small-box .icon {
        right: 10px;
        font-size: 48px;
    }

    .dropdown-menu {
        max-width: calc(100vw - 16px);
    }

    .navbar-nav > .user-menu > .dropdown-menu {
        right: 4px;
        left: auto;
        width: min(280px, calc(100vw - 8px));
    }
}

@media (max-width: 479px) {
    .customer-shell .user-menu .dropdown-toggle > span {
        display: none;
    }

    .main-header .navbar .search {
        width: 36px;
        height: 36px;
    }

    .search-overlay {
        align-items: flex-start;
    }

    .search-container {
        margin-top: 8vh;
        padding: 14px !important;
    }

    .input-group-addon {
        padding-right: 8px;
        padding-left: 8px;
        font-size: 12px;
    }

    .pagination > li > a,
    .pagination > li > span {
        min-width: 36px;
        padding: 7px 9px;
        text-align: center;
    }

    .btn-group-justified > .btn-group .btn {
        padding-right: 8px;
        padding-left: 8px;
        white-space: normal;
    }
}

@media (hover: none) and (pointer: coarse) {
    .btn,
    .form-control,
    .select2-container--bootstrap .select2-selection,
    .cancelButton {
        min-height: 44px;
    }

    /* The row-action buttons above are styled by two-class selectors
       (e.g. `.customer-directory-actions .btn { min-height: 30px }`), which outrank
       the single-class rule above. Without restating them here at matching
       specificity they stay ~30px on any touch device WIDER than the breakpoints
       that resize them -- iPads in landscape, Android tablets, touch laptops. */
    .customer-directory-actions .btn,
    .subscription-directory-actions .btn,
    .coupon-card > footer .btn {
        min-width: 44px;
        min-height: 44px;
    }

    .small-box:hover {
        transform: none;
    }
}

@media print {
    .skip-link,
    .main-header,
    .main-sidebar,
    .main-footer {
        display: none !important;
    }

    .content-wrapper {
        padding-top: 0 !important;
        margin-left: 0 !important;
        background: #fff !important;
    }

    body.modern-theme .content {
        padding: 0 !important;
    }
}

/* =====================================================================
   Message log
   Keep large provider payloads contained while preserving quick access.
   ===================================================================== */

.message-log-page {
    max-width: 1440px;
    margin-right: auto;
    margin-left: auto;
}

.message-log-panel > .panel-body {
    padding: clamp(16px, 2.4vw, 26px);
}

.message-log-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
}

.message-log-search {
    width: min(100%, 430px);
}

.message-log-retention {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.message-log-retention .input-group {
    width: min(100%, 290px);
}

.message-log-retention input[type="number"] {
    min-width: 72px;
}

.message-log-table-wrap {
    margin-bottom: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.message-log-table {
    min-width: 960px;
    table-layout: fixed;
}

.message-log-table > thead > tr > th {
    padding: 11px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.message-log-table > tbody > tr > td {
    padding: 13px 12px;
    border-color: var(--border);
    color: var(--text);
    vertical-align: middle;
}

.message-log-table th.message-log-id {
    width: 64px;
}

.message-log-table th.message-log-date {
    width: 155px;
}

.message-log-table th.message-log-recipient {
    width: 160px;
}

.message-log-table th.message-log-type {
    width: 105px;
}

.message-log-table th.message-log-status {
    width: 105px;
}

.message-log-table th.message-log-details {
    width: 370px;
}

.message-log-table td.message-log-recipient {
    overflow: hidden;
    color: var(--text-muted);
    text-overflow: ellipsis;
}

.message-log-type-label {
    display: inline-flex;
    max-width: 100%;
    padding: 5px 8px;
    overflow: hidden;
    border-radius: 7px;
    background: var(--surface-3);
    color: var(--text);
    font-size: 11px;
    font-weight: 600;
    text-overflow: ellipsis;
}

.message-log-table > tbody > tr > td.message-log-details-cell {
    white-space: normal;
}

.message-log-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.message-log-entry + .message-log-entry {
    margin-top: 9px;
    padding-top: 9px;
    border-top: 1px solid var(--border);
}

.message-log-preview-text {
    display: -webkit-box;
    min-width: 0;
    max-height: 3.1em;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    word-break: break-word;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.message-log-error-entry .message-log-preview-text {
    color: var(--rose);
}

.message-log-entry .btn {
    margin: 0;
    white-space: nowrap;
}

.message-log-empty,
.message-log-empty-state {
    color: var(--text-muted);
}

.message-log-empty-state {
    padding: 32px !important;
    text-align: center;
}

.message-log-modal .modal-dialog {
    width: min(780px, calc(100% - 30px));
}

.message-log-modal .modal-header {
    padding-bottom: 13px;
}

.message-log-modal .modal-title {
    padding-right: 30px;
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
}

.message-log-modal-meta {
    margin: 5px 30px 0 0;
    color: var(--text-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.message-log-modal .modal-body {
    max-height: none;
    padding: 18px;
}

.message-log-modal-body {
    max-height: min(62vh, 560px);
    max-height: min(62dvh, 560px);
    margin: 0;
    padding: 16px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.65;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    word-break: break-word;
}

.message-log-modal .modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

@media (max-width: 767px) {
    .message-log-panel > .panel-body {
        padding: 14px 12px;
    }

    .message-log-toolbar,
    .message-log-retention {
        align-items: stretch;
        flex-direction: column;
    }

    .message-log-search,
    .message-log-retention,
    .message-log-retention .input-group,
    .message-log-retention .btn {
        width: 100%;
        max-width: none;
    }

    .message-log-modal .modal-dialog {
        width: auto;
        margin: 12px;
    }

    .message-log-modal .modal-body {
        padding: 12px;
    }

    .message-log-modal-body {
        max-height: 58vh;
        max-height: 58dvh;
        padding: 13px;
    }

    .message-log-modal .modal-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .message-log-modal .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

/* =====================================================================
   Router edit / WireGuard fields
   ===================================================================== */

.router-edit-page {
    max-width: 1240px;
    margin-right: auto;
    margin-left: auto;
}

.router-edit-panel > .panel-body {
    padding: clamp(18px, 3vw, 30px);
}

.router-edit-form .form-group {
    margin-bottom: 20px;
}

.router-edit-form .control-label {
    color: var(--text);
    font-weight: 600;
}

.router-connection-options {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 22px;
    min-height: 40px;
}

.router-connection-options .radio-inline {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 9px 13px 9px 34px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
}

.router-connection-options .radio-inline input {
    margin-top: 0;
    margin-left: -20px;
}

.router-connection-options .help-block {
    flex-basis: 100%;
    margin: 0;
}

.router-wireguard-fields {
    margin: 6px 0 24px;
    padding: 24px 20px 5px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 13px;
    background: var(--surface-2);
}

.router-wireguard-fields .form-group {
    margin-right: -5px;
    margin-left: -5px;
}

.router-wireguard-fields .form-control[readonly] {
    border-color: var(--border);
    background: var(--surface-3) !important;
    color: var(--text) !important;
    opacity: 1;
}

.router-tunnel-status {
    display: flex;
    align-items: center;
    min-height: 40px;
}

.router-tunnel-status .label {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
}

.router-script-box {
    min-height: 168px !important;
    padding: 14px !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
    font-size: 12px !important;
    line-height: 1.55;
    white-space: pre;
}

.router-wireguard-fields .alert {
    margin-bottom: 0;
    border-radius: 10px;
}

.router-wireguard-fields .alert pre {
    margin: 12px 0 0;
    border-color: rgba(15, 23, 42, .12);
    background: rgba(255, 255, 255, .6);
    color: #172033;
    font-size: 12px;
}

.router-map {
    margin-top: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
}

.router-form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.router-form-actions .btn,
.router-form-actions > a {
    margin: 0;
}

.router-form-actions > div {
    flex-basis: 100%;
}

.router-wireguard-management {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    max-width: 820px;
    margin: 10px 0 4px 16.666667%;
    padding: 18px;
    border: 1px solid rgba(245, 158, 11, .32);
    border-radius: 13px;
    background: rgba(245, 158, 11, .08);
}

.router-wireguard-management-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 11px;
    background: rgba(245, 158, 11, .16);
    color: #b45309;
    font-size: 17px;
}

.router-wireguard-management-content {
    min-width: 0;
    flex: 1 1 auto;
}

.router-wireguard-management h3 {
    margin: 0 0 5px;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.router-wireguard-management-content > p {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.55;
}

.router-wireguard-management label {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.router-wireguard-management textarea {
    min-height: 78px;
}

.router-wireguard-management-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px 12px;
    margin-top: 10px;
}

.router-wireguard-management-actions span {
    color: var(--text-muted);
    font-size: 11px;
}

html.dark .router-wireguard-fields .alert pre {
    border-color: rgba(255, 255, 255, .12);
    background: rgba(15, 23, 42, .35);
    color: #e5edf7;
}

html.dark .router-wireguard-management-icon {
    color: #fbbf24;
}

@media (max-width: 991px) {
    .router-wireguard-management {
        max-width: none;
        margin-left: 0;
    }
}

@media (max-width: 600px) {
    .router-edit-panel > .panel-body {
        padding: 16px 13px;
    }

    .router-connection-options {
        align-items: stretch;
        flex-direction: column;
        gap: 8px;
    }

    .router-connection-options .radio-inline {
        width: 100%;
    }

    .router-wireguard-fields {
        margin-right: -4px;
        margin-left: -4px;
        padding: 18px 12px 2px;
    }

    .router-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .router-form-actions .btn {
        width: 100%;
        white-space: normal;
    }

    .router-wireguard-management {
        flex-direction: column;
        padding: 15px;
    }
}

/* (A1) Respect reduced-motion: kill non-essential animation/transition for
   users who request it (vestibular safety, WCAG 2.3.3). */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }

    .content-wrapper > .content {
        animation: none !important;
    }

    .small-box:hover {
        transform: none !important;
    }
}

/* =====================================================================
   Modern invoice view
   ===================================================================== */

.modern-invoice-page {
    max-width: 1320px;
    margin: 0 auto;
}

.invoice-view-active .content-header,
.invoice-public-shell .form-head {
    display: none;
}

.invoice-public-shell {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 32px 0;
    background: var(--bg);
    color: var(--text);
}

.invoice-view-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.invoice-view-eyebrow {
    margin: 0 0 6px;
    color: var(--accent-700);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.invoice-view-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 700;
    letter-spacing: -.035em;
}

.invoice-view-heading h2 span {
    color: var(--text-muted);
    font-weight: 600;
}

.invoice-view-heading p:last-child {
    margin: 7px 0 0;
    color: var(--text-muted);
}

.invoice-status-badge {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid rgba(16, 185, 129, .28);
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-700);
    font-size: 13px;
    font-weight: 700;
}

.invoice-view-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 24px;
    align-items: start;
}

.invoice-document {
    min-width: 0;
    padding: clamp(24px, 4vw, 48px);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 45px -24px rgba(15, 23, 42, .3);
    color: #172033;
}

.invoice-document-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 3px solid var(--accent);
}

.invoice-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 14px;
}

.invoice-brand img {
    width: auto;
    max-width: 150px;
    height: auto;
    max-height: 58px;
    object-fit: contain;
}

.invoice-brand-mark {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    font-size: 21px;
}

.invoice-brand h3 {
    margin: 0 0 4px;
    color: #172033;
    font-size: 18px;
    font-weight: 700;
}

.invoice-brand p,
.invoice-parties p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.55;
}

.invoice-number-block {
    flex: 0 0 auto;
    text-align: right;
}

.invoice-number-block span {
    display: block;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.invoice-number-block strong {
    color: #172033;
    font-size: clamp(18px, 2.3vw, 25px);
}

.invoice-parties {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    padding: 28px 0;
}

.invoice-parties > div {
    min-width: 0;
    padding-right: 28px;
}

.invoice-parties > div + div {
    padding-right: 0;
    padding-left: 28px;
    border-left: 1px solid #e2e8f0;
}

.invoice-label {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .075em;
    text-transform: uppercase;
}

.invoice-parties strong {
    display: block;
    margin-bottom: 5px;
    color: #172033;
    font-size: 15px;
}

.invoice-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 28px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.invoice-meta-grid > div {
    min-width: 0;
    padding: 15px 16px;
}

.invoice-meta-grid > div + div {
    border-left: 1px solid #e2e8f0;
}

.invoice-meta-grid strong {
    display: block;
    overflow-wrap: anywhere;
    color: #172033;
    font-size: 13px;
}

.invoice-items-wrap {
    overflow-x: auto;
    border-radius: 10px 10px 0 0;
}

.invoice-items {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
}

.invoice-items th {
    padding: 12px 14px;
    border: 0;
    background: #172033;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .045em;
    text-align: left;
    text-transform: uppercase;
}

.invoice-items td {
    padding: 17px 14px;
    border-bottom: 1px solid #e2e8f0;
    color: #172033;
    vertical-align: top;
}

.invoice-items td strong,
.invoice-items td span {
    display: block;
}

.invoice-items td span {
    margin-top: 3px;
    color: #64748b;
    font-size: 12px;
}

.invoice-items .invoice-amount {
    text-align: right;
    white-space: nowrap;
}

.invoice-total-row {
    display: flex;
    justify-content: flex-end;
    margin: 20px 0 26px;
}

.invoice-total-row > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(100%, 310px);
    gap: 24px;
    padding: 15px 17px;
    border-top: 3px solid #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.invoice-total-row span,
.invoice-total-row strong {
    font-size: 17px;
    font-weight: 700;
}

.invoice-service-period {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid #e2e8f0;
    border-radius: 11px;
    background: #f8fafc;
}

.invoice-service-period i {
    color: #94a3b8;
}

.invoice-service-period strong {
    color: #172033;
    font-size: 13px;
}

.invoice-service-period > div:last-child {
    text-align: right;
}

.invoice-note {
    margin-top: 20px;
    padding: 14px 16px;
    border-left: 4px solid #f59e0b;
    background: #fffbeb;
    color: #713f12;
}

.invoice-note pre {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.invoice-document-footer {
    margin-top: 30px;
    padding-top: 17px;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 12px;
    text-align: center;
}

.invoice-document-footer p {
    margin: 0 0 4px;
}

.invoice-actions {
    position: sticky;
    top: 82px;
}

.invoice-actions-card,
.invoice-thermal-card {
    padding: 19px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.invoice-actions-card h3 {
    margin: 0 0 5px;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
}

.invoice-actions-card > p {
    margin: 0 0 17px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.invoice-action {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
    margin-top: 9px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    text-align: left;
    text-decoration: none !important;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.invoice-action:hover,
.invoice-action:focus {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--text);
    text-decoration: none;
    transform: translateY(-1px);
}

.invoice-action > i {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 9px;
    background: var(--surface-3);
    color: var(--accent-700);
}

.invoice-action span,
.invoice-action strong,
.invoice-action small {
    display: block;
}

.invoice-action strong {
    color: inherit;
    font-size: 13px;
}

.invoice-action small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
}

.invoice-action-primary {
    border-color: var(--accent-600);
    background: var(--accent-600);
    color: var(--accent-contrast);
}

.invoice-action-primary:hover,
.invoice-action-primary:focus {
    border-color: var(--accent-700);
    background: var(--accent-700);
    color: var(--accent-contrast);
}

.invoice-action-primary > i {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.invoice-action-primary small {
    color: rgba(255, 255, 255, .78);
}

.invoice-action.is-copied {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.invoice-thermal-card {
    margin-top: 14px;
}

.invoice-thermal-card summary {
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

.invoice-thermal-card summary i {
    margin-right: 7px;
    color: var(--accent-700);
}

.invoice-thermal-card form {
    margin-top: 14px;
}

.invoice-thermal-card .btn {
    margin-top: 8px;
}

.invoice-back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 17px 4px 0;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.invoice-back-link:hover,
.invoice-back-link:focus {
    color: var(--link);
}

@media (max-width: 1050px) {
    .invoice-view-layout {
        grid-template-columns: minmax(0, 1fr) 270px;
    }

    .invoice-document {
        padding: 28px;
    }
}

@media (max-width: 850px) {
    .invoice-view-layout {
        grid-template-columns: 1fr;
    }

    .invoice-actions {
        position: static;
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 600px) {
    .invoice-view-heading {
        align-items: flex-start;
    }

    .invoice-document {
        padding: 20px 16px;
        border-radius: 13px;
    }

    .invoice-document-header {
        align-items: flex-start;
    }

    .invoice-brand {
        align-items: flex-start;
        flex-direction: column;
    }

    .invoice-brand img {
        max-width: 120px;
        max-height: 46px;
    }

    .invoice-parties,
    .invoice-meta-grid {
        grid-template-columns: 1fr;
    }

    .invoice-parties > div {
        padding: 0 0 18px;
    }

    .invoice-parties > div + div {
        padding: 18px 0 0;
        border-top: 1px solid #e2e8f0;
        border-left: 0;
    }

    .invoice-meta-grid > div + div {
        border-top: 1px solid #e2e8f0;
        border-left: 0;
    }

    .invoice-items thead {
        display: none;
    }

    .invoice-items,
    .invoice-items tbody,
    .invoice-items tr,
    .invoice-items td {
        display: block;
        width: 100%;
    }

    .invoice-items tr {
        border: 1px solid #e2e8f0;
        border-radius: 10px;
    }

    .invoice-items td {
        display: grid;
        grid-template-columns: 95px minmax(0, 1fr);
        padding: 12px 14px;
        border-bottom: 1px solid #e2e8f0;
        text-align: left !important;
        white-space: normal !important;
    }

    .invoice-items td::before {
        content: attr(data-label);
        color: #64748b;
        font-size: 10px;
        font-weight: 700;
        letter-spacing: .06em;
        text-transform: uppercase;
    }

    .invoice-items td:last-child {
        border-bottom: 0;
    }

    .invoice-total-row > div {
        width: 100%;
    }

    .invoice-service-period {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .invoice-service-period i {
        display: none;
    }

    .invoice-service-period > div:last-child {
        text-align: left;
    }
}

@media print {
    .modern-invoice-page .invoice-view-heading,
    .modern-invoice-page .invoice-actions,
    .invoice-public-shell .form-head {
        display: none !important;
    }

    .modern-invoice-page,
    .invoice-view-layout {
        display: block !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .invoice-document {
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
}

/* =====================================================================
   Captive portal administration
   ===================================================================== */

.portal-admin-page {
    max-width: 1440px;
    margin-right: auto;
    margin-left: auto;
}

.portal-page-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 22px;
    padding: clamp(24px, 4vw, 40px);
    overflow: hidden;
    border-radius: 20px;
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .17), transparent 31%),
        linear-gradient(135deg, #064e3b 0%, #047857 48%, #0f766e 100%);
    color: #fff;
    box-shadow: 0 18px 42px -28px rgba(4, 120, 87, .8);
}

.portal-page-hero::after {
    position: absolute;
    right: -70px;
    bottom: -110px;
    width: 260px;
    height: 260px;
    border: 38px solid rgba(255, 255, 255, .07);
    border-radius: 50%;
    content: "";
}

.portal-page-hero-copy,
.portal-page-summary {
    position: relative;
    z-index: 1;
}

.portal-page-hero-copy {
    max-width: 680px;
}

.portal-page-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, .72);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.portal-page-hero h2 {
    margin: 0 0 8px;
    color: #fff;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 750;
    letter-spacing: -.025em;
}

.portal-page-hero p {
    max-width: 620px;
    margin: 0;
    color: rgba(255, 255, 255, .8);
    font-size: 14px;
    line-height: 1.65;
}

.portal-page-summary {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.portal-summary-pill {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: rgba(4, 47, 46, .26);
    color: rgba(255, 255, 255, .84);
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
    backdrop-filter: blur(8px);
}

.portal-summary-primary {
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

.portal-section {
    overflow: hidden;
    border: 1px solid var(--border) !important;
    border-top: 0 !important;
    border-radius: 16px !important;
    background: var(--surface);
    box-shadow: var(--shadow) !important;
}

.portal-section::before {
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), #14b8a6);
    content: "";
}

.portal-section > .portal-section-heading {
    display: flex;
    align-items: center;
    min-height: 72px;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface) !important;
    color: var(--text) !important;
}

.portal-section-heading > span:not(.portal-section-icon):not(.portal-count-badge),
.portal-section-title > span:last-child {
    min-width: 0;
}

.portal-section-heading strong,
.portal-section-heading small {
    display: block;
}

.portal-section-heading strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.portal-section-heading small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
}

.portal-section-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-700);
    font-size: 15px;
}

.portal-section-heading-split {
    justify-content: space-between;
}

.portal-section-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.portal-count-badge {
    display: grid;
    min-width: 32px;
    height: 32px;
    place-items: center;
    flex: 0 0 auto;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

.portal-section > .panel-body {
    padding: clamp(18px, 2.6vw, 28px);
}

.portal-settings-form {
    max-width: 1160px;
    margin: 0 auto;
}

.portal-fieldset {
    min-width: 0;
    margin: 0 0 26px;
    padding: 0;
    border: 0;
}

.portal-fieldset > legend {
    margin-bottom: 12px;
    border: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.portal-template-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.portal-template-option {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 82px;
    gap: 13px;
    margin: 0;
    padding: 15px 48px 15px 15px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease, transform .18s ease;
}

.portal-template-option:hover,
.portal-template-option:focus-within {
    border-color: rgba(16, 185, 129, .55);
    transform: translateY(-1px);
}

.portal-template-option.is-selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, .08);
}

.portal-template-option > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.portal-template-option-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 11px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 16px;
}

.portal-template-option.is-selected .portal-template-option-icon {
    background: var(--accent);
    color: #fff;
}

.portal-template-option-copy {
    min-width: 0;
}

.portal-template-option-copy strong,
.portal-template-option-copy small {
    display: block;
}

.portal-template-option-copy strong {
    margin-bottom: 4px;
    color: var(--text);
    font-size: 13px;
}

.portal-template-option-copy small {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.45;
}

.portal-template-check {
    position: absolute;
    top: 50%;
    right: 17px;
    color: var(--accent);
    font-size: 18px;
    opacity: 0;
    transform: translateY(-50%) scale(.7);
    transition: opacity .18s ease, transform .18s ease;
}

.portal-template-option.is-selected .portal-template-check {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.portal-fieldset-intro {
    margin: -5px 0 14px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.55;
}

.portal-theme-designer {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface-2);
}

.portal-theme-studio {
    display: grid;
    grid-template-columns: minmax(310px, 390px) minmax(0, 1fr);
    align-items: start;
    gap: 18px;
}

.portal-theme-picker {
    min-width: 0;
    transition: opacity .18s ease;
}

.portal-theme-designer.is-inactive .portal-theme-picker {
    opacity: .52;
    pointer-events: none;
}

.portal-theme-options {
    display: grid;
    gap: 9px;
}

.portal-theme-option {
    position: relative;
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 78px;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 8px 12px 8px 8px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.portal-theme-option:hover,
.portal-theme-option:focus-within {
    border-color: rgba(16, 185, 129, .55);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.portal-theme-option.is-selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.portal-theme-option > input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.portal-theme-swatch {
    position: relative;
    display: grid;
    width: 88px;
    height: 60px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .28);
    border-radius: 9px;
    background: #eef4fa;
}

.portal-theme-swatch::before {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 25%, rgba(255, 255, 255, .22), transparent 72%);
    content: "";
}

.portal-theme-swatch[data-theme="clean"] {
    background:
        linear-gradient(rgba(100, 116, 139, .1) 1px, transparent 1px) 0 0 / 13px 13px,
        linear-gradient(90deg, rgba(100, 116, 139, .1) 1px, transparent 1px) 0 0 / 13px 13px,
        linear-gradient(145deg, #f8fbff, #dfeef8);
}

.portal-theme-swatch[data-theme="emerald"] {
    background:
        radial-gradient(circle at 18% 18%, rgba(52, 211, 153, .55), transparent 32%),
        linear-gradient(145deg, #022c22, #0f766e);
}

.portal-theme-swatch[data-theme="midnight"] {
    background:
        linear-gradient(120deg, transparent 44%, rgba(56, 189, 248, .2) 45%, transparent 46%),
        linear-gradient(145deg, #020617, #172554);
}

.portal-theme-swatch[data-theme="ocean"] {
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, .62), transparent 27%),
        linear-gradient(145deg, #cffafe, #0284c7);
}

.portal-theme-swatch[data-theme="sunset"] {
    background:
        radial-gradient(circle at 18% 18%, rgba(254, 215, 170, .66), transparent 30%),
        linear-gradient(145deg, #fff7ed, #fb7185 52%, #7e22ce);
}

.portal-theme-swatch-card {
    position: relative;
    z-index: 1;
    display: grid;
    width: 53px;
    height: 36px;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 6px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 6px 12px -7px rgba(15, 23, 42, .7);
}

.portal-theme-swatch-card i,
.portal-theme-swatch-card b,
.portal-theme-swatch-card em {
    display: block;
    border-radius: 2px;
}

.portal-theme-swatch-card i {
    background: rgba(148, 163, 184, .28);
}

.portal-theme-swatch-card b {
    background: rgba(148, 163, 184, .18);
}

.portal-theme-swatch-card em {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 18px;
    height: 4px;
    background: #0d6efd;
}

.portal-theme-swatch[data-theme="emerald"] em { background: #10b981; }
.portal-theme-swatch[data-theme="midnight"] em { background: #38bdf8; }
.portal-theme-swatch[data-theme="ocean"] em { background: #0891b2; }
.portal-theme-swatch[data-theme="sunset"] em { background: #f97316; }

.portal-theme-option-copy {
    min-width: 0;
}

.portal-theme-option-copy strong,
.portal-theme-option-copy small {
    display: block;
}

.portal-theme-option-copy strong {
    margin-bottom: 3px;
    color: var(--text);
    font-size: 12px;
}

.portal-theme-option-copy small {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.4;
}

.portal-theme-check {
    color: var(--accent);
    font-size: 17px;
    opacity: 0;
    transform: scale(.75);
    transition: opacity .16s ease, transform .16s ease;
}

.portal-theme-option.is-selected .portal-theme-check {
    opacity: 1;
    transform: scale(1);
}

.portal-theme-guidance {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 11px;
    padding: 10px 11px;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.5;
}

.portal-theme-guidance i {
    margin-top: 2px;
    color: var(--accent-700);
}

.portal-live-preview {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.portal-preview-toolbar {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 11px 9px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 10px;
}

.portal-preview-toolbar strong {
    color: var(--text);
}

.portal-preview-toolbar b {
    color: var(--accent-700);
    font-weight: 700;
}

.portal-preview-device-options {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
}

.portal-preview-device-options button {
    display: grid;
    width: 30px;
    height: 27px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
}

.portal-preview-device-options button.is-active {
    background: var(--surface);
    color: var(--accent-700);
    box-shadow: var(--shadow-sm);
}

.portal-preview-viewport {
    display: grid;
    min-height: 510px;
    place-items: center;
    padding: 15px;
    background:
        linear-gradient(45deg, var(--surface-2) 25%, transparent 25%) 0 0 / 20px 20px,
        linear-gradient(-45deg, var(--surface-2) 25%, transparent 25%) 0 0 / 20px 20px,
        var(--surface-3);
}

.portal-preview-device {
    position: relative;
    width: 100%;
    max-width: 690px;
    margin: auto;
    overflow: hidden;
    border: 7px solid #1e293b;
    border-radius: 15px;
    background: #1e293b;
    box-shadow: 0 20px 45px -24px rgba(15, 23, 42, .75);
    transition: max-width .22s ease;
}

.portal-preview-device.is-mobile {
    max-width: 285px;
    border-width: 8px;
    border-radius: 24px;
}

.portal-preview-screen {
    --preview-accent: #0d6efd;
    --preview-accent-soft: rgba(13, 110, 253, .12);
    --preview-brand-bg: rgba(255, 255, 255, .9);
    --preview-brand-text: #475569;
    --preview-card-surface: rgba(255, 255, 255, .96);
    --preview-media-surface: rgba(241, 245, 249, .74);
    --preview-access-surface: rgba(255, 255, 255, .72);
    --preview-section-surface: rgba(248, 250, 252, .82);
    --preview-plan-surface: rgba(255, 255, 255, .94);
    --preview-text: #1e293b;
    --preview-muted: #64748b;
    --preview-divider: rgba(148, 163, 184, .28);
    --preview-powered: #475569;
    position: relative;
    min-height: 455px;
    padding: 17px;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(145deg, #f8fbff, #e5eff7);
}

.portal-preview-screen::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
}

.portal-preview-screen[data-theme="clean"] {
    background:
        radial-gradient(circle at 12% 10%, rgba(14, 165, 233, .16), transparent 28%),
        radial-gradient(circle at 88% 86%, rgba(16, 185, 129, .13), transparent 31%),
        linear-gradient(145deg, #f8fbff, #e5eff7);
}
.portal-preview-screen[data-theme="clean"]::before {
    opacity: .45;
    background-image:
        linear-gradient(rgba(100, 116, 139, .1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(100, 116, 139, .1) 1px, transparent 1px);
    background-size: 24px 24px;
}

.portal-preview-screen[data-theme="emerald"] {
    --preview-accent: #10b981;
    --preview-accent-soft: rgba(16, 185, 129, .13);
    --preview-brand-bg: rgba(6, 78, 59, .74);
    --preview-brand-text: #d1fae5;
    --preview-card-surface: rgba(236, 253, 245, .95);
    --preview-media-surface: rgba(209, 250, 229, .58);
    --preview-access-surface: rgba(236, 253, 245, .82);
    --preview-section-surface: rgba(209, 250, 229, .52);
    --preview-plan-surface: rgba(255, 255, 255, .78);
    --preview-text: #052e2b;
    --preview-muted: #3f665f;
    --preview-divider: rgba(5, 150, 105, .22);
    --preview-powered: #ecfdf5;
    background:
        radial-gradient(circle at 14% 18%, rgba(52, 211, 153, .34), transparent 27%),
        radial-gradient(circle at 88% 78%, rgba(20, 184, 166, .29), transparent 31%),
        linear-gradient(145deg, #022c22, #064e3b 48%, #0f766e);
}
.portal-preview-screen[data-theme="emerald"]::before {
    background: repeating-radial-gradient(circle at 20% 20%, transparent 0 18px, rgba(167, 243, 208, .07) 19px 20px);
}

.portal-preview-screen[data-theme="midnight"] {
    --preview-accent: #38bdf8;
    --preview-accent-soft: rgba(56, 189, 248, .14);
    --preview-brand-bg: rgba(15, 23, 42, .8);
    --preview-brand-text: #dbeafe;
    --preview-card-surface: rgba(15, 23, 42, .94);
    --preview-media-surface: rgba(15, 23, 42, .92);
    --preview-access-surface: rgba(30, 41, 59, .88);
    --preview-section-surface: rgba(30, 41, 59, .78);
    --preview-plan-surface: rgba(30, 41, 59, .94);
    --preview-text: #f8fafc;
    --preview-muted: #bfdbfe;
    --preview-divider: rgba(125, 211, 252, .22);
    --preview-powered: #e0f2fe;
    background:
        radial-gradient(circle at 84% 12%, rgba(59, 130, 246, .34), transparent 27%),
        linear-gradient(145deg, #020617, #0f172a 48%, #172554);
}
.portal-preview-screen[data-theme="midnight"]::before {
    background: linear-gradient(120deg, transparent 44%, rgba(56, 189, 248, .13) 44.4%, transparent 45%);
}

.portal-preview-screen[data-theme="ocean"] {
    --preview-accent: #0891b2;
    --preview-accent-soft: rgba(8, 145, 178, .13);
    --preview-brand-bg: rgba(236, 254, 255, .88);
    --preview-brand-text: #155e75;
    --preview-card-surface: rgba(236, 254, 255, .94);
    --preview-media-surface: rgba(207, 250, 254, .72);
    --preview-access-surface: rgba(240, 253, 250, .84);
    --preview-section-surface: rgba(207, 250, 254, .56);
    --preview-plan-surface: rgba(255, 255, 255, .82);
    --preview-text: #083344;
    --preview-muted: #3f6672;
    --preview-divider: rgba(8, 145, 178, .23);
    --preview-powered: #ecfeff;
    background:
        radial-gradient(circle at 15% 20%, rgba(255, 255, 255, .55), transparent 22%),
        radial-gradient(circle at 86% 78%, rgba(34, 211, 238, .31), transparent 30%),
        linear-gradient(145deg, #dff7ff, #7dd3fc 44%, #0e7490);
}

.portal-preview-screen[data-theme="sunset"] {
    --preview-accent: #f97316;
    --preview-accent-soft: rgba(249, 115, 22, .14);
    --preview-brand-bg: rgba(255, 247, 237, .9);
    --preview-brand-text: #9a3412;
    --preview-card-surface: rgba(255, 247, 237, .95);
    --preview-media-surface: rgba(255, 237, 213, .7);
    --preview-access-surface: rgba(255, 247, 237, .86);
    --preview-section-surface: rgba(254, 215, 170, .46);
    --preview-plan-surface: rgba(255, 255, 255, .82);
    --preview-text: #431407;
    --preview-muted: #7c4a3a;
    --preview-divider: rgba(234, 88, 12, .22);
    --preview-powered: #fff7ed;
    background:
        radial-gradient(circle at 12% 18%, rgba(254, 215, 170, .58), transparent 25%),
        radial-gradient(circle at 85% 78%, rgba(216, 180, 254, .38), transparent 32%),
        linear-gradient(145deg, #fff7ed, #fb7185 48%, #7e22ce);
}

.portal-preview-brand,
.portal-preview-card,
.portal-preview-powered {
    position: relative;
    z-index: 1;
}

.portal-preview-brand {
    display: flex;
    max-width: 235px;
    align-items: center;
    gap: 9px;
    margin: 0 auto 12px;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, .25);
    border-radius: 10px;
    background: var(--preview-brand-bg);
    color: var(--preview-brand-text);
}

.portal-preview-brand img {
    width: 92px;
    height: 24px;
    object-fit: contain;
}

.portal-preview-brand span {
    min-width: 0;
    overflow: hidden;
    font-size: 7px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-preview-card {
    width: min(100%, 590px);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--preview-divider);
    border-radius: 12px;
    background: var(--preview-card-surface);
    box-shadow: 0 18px 40px -24px rgba(15, 23, 42, .72);
}

.portal-preview-greeting {
    padding: 9px;
    border-bottom: 1px solid var(--preview-divider);
    background: var(--preview-section-surface);
    color: var(--preview-text);
    font-size: 8px;
    text-align: center;
}

.portal-preview-balances {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 8px 13px;
    border-bottom: 1px solid var(--preview-divider);
    background: var(--preview-section-surface);
    color: var(--preview-muted);
    font-size: 6px;
    text-align: center;
}

.portal-preview-balances span,
.portal-preview-balances strong {
    display: block;
}

.portal-preview-balances strong {
    margin-top: 2px;
    color: var(--preview-accent);
    font-size: 10px;
}

.portal-preview-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 11px;
    background: linear-gradient(90deg, var(--preview-media-surface) 0 50%, var(--preview-access-surface) 50% 100%);
}

.portal-preview-slide-frame {
    position: relative;
    min-height: 150px;
    overflow: hidden;
    border: 4px solid var(--preview-accent-soft);
    border-radius: 10px;
    background: var(--preview-plan-surface);
}

.portal-preview-slide,
.portal-preview-sample-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    inset: 0;
    opacity: 0;
    transition: opacity .35s ease;
}

.portal-preview-slide {
    object-fit: contain;
    object-position: center;
}

.portal-preview-slide.is-active,
.portal-preview-sample-slide.is-active {
    opacity: 1;
}

.portal-preview-sample-slide {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    background: linear-gradient(145deg, var(--preview-accent-soft), var(--preview-plan-surface));
    color: var(--preview-accent);
    text-align: center;
}

.portal-preview-sample-slide i { font-size: 25px; }
.portal-preview-sample-slide strong { font-size: 9px; }
.portal-preview-sample-slide small { color: var(--preview-muted); font-size: 6px; }

.portal-preview-slide-count {
    position: absolute;
    z-index: 2;
    right: 7px;
    bottom: 7px;
    padding: 3px 5px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    font-size: 6px;
}

.portal-preview-login {
    display: flex;
    flex-direction: column;
    padding: 5px 2px;
    color: var(--preview-text);
    text-align: center;
}

.portal-preview-login > strong { font-size: 9px; }
.portal-preview-login > small { margin: 2px 0 8px; color: var(--preview-muted); font-size: 6px; }

.portal-preview-input {
    height: 20px;
    border: 1px solid var(--preview-divider);
    border-radius: 5px 5px 0 0;
    background: var(--preview-plan-surface);
}

.portal-preview-button {
    padding: 5px;
    border-radius: 0 0 5px 5px;
    background: var(--preview-accent);
    color: #fff;
    font-size: 6px;
    font-weight: 700;
}

.portal-preview-action {
    margin-top: 7px;
    padding: 6px;
    border: 1px solid var(--preview-accent-soft);
    border-radius: 6px;
    background: var(--preview-accent-soft);
    background: linear-gradient(135deg, var(--preview-accent-soft), var(--preview-plan-surface));
    color: var(--preview-text);
    font-size: 6px;
    font-weight: 650;
}

.portal-preview-action i {
    margin-right: 3px;
    color: var(--preview-accent);
}

.portal-preview-plans {
    display: grid;
    gap: 4px;
    margin-top: 7px;
}

.portal-preview-plans span {
    height: 18px;
    border: 1px solid var(--preview-divider);
    border-radius: 5px;
    background: linear-gradient(90deg, var(--preview-plan-surface) 70%, var(--preview-accent-soft) 70%);
}

.portal-preview-powered {
    display: block;
    margin-top: 9px;
    color: var(--preview-powered);
    font-size: 6px;
    text-align: center;
}

.portal-preview-device.is-mobile .portal-preview-screen {
    min-height: 525px;
    padding: 13px 9px;
}

.portal-preview-device.is-mobile .portal-preview-brand {
    max-width: 180px;
}

.portal-preview-device.is-mobile .portal-preview-columns {
    grid-template-columns: 1fr;
    background: linear-gradient(180deg, var(--preview-media-surface) 0 43%, var(--preview-access-surface) 43% 100%);
}

.portal-preview-device.is-mobile .portal-preview-slide-frame {
    min-height: 115px;
}

.portal-preview-device.is-mobile .portal-preview-login {
    padding: 1px 6px 6px;
}

.portal-preview-device.is-mobile .portal-preview-plans {
    grid-template-columns: 1fr 1fr;
}

.portal-preview-inactive {
    position: absolute;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 7px;
    padding: 24px;
    border-radius: 7px;
    background: rgba(15, 23, 42, .82);
    color: #fff;
    text-align: center;
    inset: 0;
    backdrop-filter: blur(7px);
}

.portal-preview-inactive[hidden] {
    display: none;
}

.portal-preview-inactive i {
    font-size: 25px;
}

.portal-preview-inactive strong {
    font-size: 13px;
}

.portal-preview-inactive span {
    max-width: 310px;
    color: rgba(255, 255, 255, .75);
    font-size: 10px;
    line-height: 1.5;
}

.portal-preview-note {
    margin: 0;
    padding: 9px 13px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.45;
}

.portal-preview-note i {
    margin-right: 4px;
    color: var(--accent-700);
}

.portal-contact-setting {
    max-width: 620px;
    margin-bottom: 28px;
}

.portal-contact-setting > label,
.portal-setting-field > label,
.portal-setting-label {
    display: block;
    margin-bottom: 7px;
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
}

.portal-contact-setting .help-block {
    margin: 7px 2px 0;
    font-size: 11px;
    line-height: 1.5;
}

.portal-contact-setting .input-group-addon {
    color: #16a34a;
}

.portal-trial-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface-2);
}

.portal-trial-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.portal-trial-heading strong {
    display: block;
    margin: 0 0 3px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.portal-trial-heading small {
    color: var(--text-muted);
    font-size: 11px;
}

.portal-trial-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    gap: 18px;
}

.portal-setting-field {
    min-width: 0;
}

.portal-setting-wide {
    grid-column: span 2;
}

.portal-segmented-options {
    display: inline-flex;
    max-width: 100%;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.portal-segmented-options label {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.portal-segmented-options input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.portal-segmented-options span {
    display: block;
    padding: 8px 13px;
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}

.portal-segmented-options input:checked + span {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 3px 9px -5px var(--accent-700);
}

.portal-segmented-options input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.portal-trial-window {
    display: grid;
    grid-column: span 2;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 10px;
}

.portal-trial-window[hidden] {
    display: none !important;
}

.portal-time-separator {
    display: grid;
    height: 40px;
    place-items: center;
    color: var(--text-muted);
}

.portal-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0 0 22px;
    padding: 15px 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
}

.portal-notice > i {
    margin-top: 2px;
    flex: 0 0 auto;
    font-size: 17px;
}

.portal-notice p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
}

.portal-notice strong {
    display: block;
    margin-bottom: 5px;
    color: var(--text);
}

.portal-notice-info {
    border-color: rgba(59, 130, 246, .25);
    background: rgba(59, 130, 246, .08);
}

.portal-notice-info > i {
    color: var(--blue);
}

.portal-notice-warning {
    border-color: rgba(245, 158, 11, .3);
    background: rgba(245, 158, 11, .08);
}

.portal-notice-warning > i {
    color: var(--amber);
}

.portal-router-command {
    max-height: 240px;
    margin: 12px 0;
    padding: 13px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text);
    font-size: 11px;
    line-height: 1.55;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.portal-save-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.portal-save-bar > span {
    color: var(--text-muted);
    font-size: 11px;
}

.portal-save-bar > span i {
    margin-right: 5px;
    color: var(--accent-700);
}

.portal-assets-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.portal-asset-card {
    display: flex;
    min-width: 0;
    min-height: 350px;
    flex-direction: column;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
}

.portal-asset-heading {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
    margin-bottom: 13px;
}

.portal-asset-heading > span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 9px;
    background: var(--surface-3);
    color: var(--accent-700);
}

.portal-asset-heading h3,
.portal-asset-heading p {
    margin: 0;
}

.portal-asset-heading h3 {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
}

.portal-asset-heading p {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 10px;
}

.portal-asset-preview {
    position: relative;
    display: grid;
    min-height: 138px;
    place-items: center;
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px dashed var(--border);
    border-radius: 11px;
    background:
        linear-gradient(45deg, var(--surface-3) 25%, transparent 25%) 0 0 / 18px 18px,
        linear-gradient(-45deg, var(--surface-3) 25%, transparent 25%) 0 0 / 18px 18px,
        var(--surface);
}

.portal-asset-preview img {
    max-width: calc(100% - 24px);
    max-height: 100px;
    object-fit: contain;
}

.portal-favicon-preview img {
    max-width: 58px;
    max-height: 58px;
}

.portal-asset-preview small {
    position: absolute;
    right: 7px;
    bottom: 7px;
    left: 7px;
    padding: 4px 6px;
    overflow: hidden;
    border-radius: 5px;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    font-size: 9px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-asset-placeholder {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 7px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
}

.portal-asset-placeholder i {
    font-size: 23px;
    opacity: .55;
}

.portal-slide-upload-card {
    border-color: rgba(16, 185, 129, .35);
    background: var(--accent-soft);
}

.portal-upload-form {
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: flex-end;
    gap: 10px;
}

.portal-file-picker {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
    margin: 0;
    cursor: pointer;
}

.portal-file-picker-button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    gap: 7px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text);
    font-size: 11px;
    font-weight: 650;
}

.portal-file-picker:hover .portal-file-picker-button,
.portal-file-picker:focus-within .portal-file-picker-button {
    border-color: var(--accent);
    color: var(--accent-700);
}

.portal-file-name {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 500;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-file-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.portal-upload-form > .btn {
    width: 100%;
    margin: 0;
}

.portal-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    flex-direction: column;
    padding: 28px;
    border: 1px dashed var(--border);
    border-radius: 13px;
    background: var(--surface-2);
    color: var(--text-muted);
    text-align: center;
}

.portal-empty-state > i {
    margin-bottom: 10px;
    color: var(--accent-700);
    font-size: 28px;
    opacity: .65;
}

.portal-empty-state h3,
.portal-empty-state p {
    margin: 0;
}

.portal-empty-state h3 {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.portal-empty-state p {
    margin-top: 5px;
    font-size: 11px;
}

.portal-empty-state-compact {
    min-height: 110px;
}

.portal-slides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px;
}

.portal-slide-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-2);
}

.portal-slide-card > img {
    display: block;
    width: 100%;
    height: 130px;
    object-fit: cover;
    background: var(--surface-3);
}

.portal-slide-number {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 1;
    display: grid;
    min-width: 24px;
    height: 24px;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .75);
    color: #fff;
    font-size: 9px;
    font-weight: 700;
}

.portal-slide-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 8px;
    padding: 9px 10px;
}

.portal-slide-footer > span {
    min-width: 0;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-slide-footer form,
.portal-slide-footer .btn {
    margin: 0;
}

.portal-slide-order-help {
    margin: -3px 0 14px;
    color: var(--text-muted);
    font-size: 11px;
}

.portal-slide-order-help i {
    margin-right: 4px;
    color: var(--accent-700);
}

.portal-slide-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
}

.portal-slide-actions form {
    display: inline-flex;
}

.portal-slide-actions .btn {
    display: inline-grid;
    width: 25px;
    height: 25px;
    place-items: center;
    padding: 0;
}

.portal-deployment-note {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 17px;
    padding: 13px 15px;
    border: 1px solid rgba(16, 185, 129, .25);
    border-radius: 11px;
    background: var(--accent-soft);
}

.portal-deployment-note.is-disabled {
    border-color: var(--border);
    background: var(--surface-2);
}

.portal-deployment-note > i {
    margin-top: 2px;
    color: var(--accent-700);
    font-size: 16px;
}

.portal-deployment-note.is-disabled > i {
    color: var(--text-muted);
}

.portal-deployment-note p {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.55;
}

.portal-router-table-wrap {
    margin: 0;
    border: 1px solid var(--border);
    background: var(--surface);
}

.portal-router-table {
    min-width: 720px;
}

.portal-router-table > thead > tr > th {
    padding: 11px 13px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.portal-router-table > tbody > tr > td {
    padding: 13px;
    border-color: var(--border);
    color: var(--text);
    vertical-align: middle;
}

.portal-router-name {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.portal-router-name > i {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    background: var(--surface-3);
    color: var(--accent-700);
}

.portal-router-name strong {
    font-size: 12px;
}

.portal-router-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 650;
}

.portal-router-status > i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rose);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, .12);
}

.portal-router-status.is-online > i {
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.portal-router-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.portal-router-actions form,
.portal-router-actions .btn {
    margin: 0;
}

@media (max-width: 1100px) {
    .portal-page-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-page-summary {
        justify-content: flex-start;
    }

    .portal-assets-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-trial-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-theme-studio {
        grid-template-columns: 1fr;
    }

    .portal-theme-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .portal-page-hero {
        margin-right: -2px;
        margin-left: -2px;
        padding: 23px 18px;
        border-radius: 15px;
    }

    .portal-page-summary {
        width: 100%;
    }

    .portal-summary-pill {
        justify-content: center;
        flex: 1 1 auto;
    }

    .portal-section {
        border-radius: 13px !important;
    }

    .portal-section > .portal-section-heading {
        min-height: 66px;
        padding: 13px 15px;
    }

    .portal-section > .panel-body {
        padding: 16px 13px;
    }

    .portal-template-options,
    .portal-theme-options,
    .portal-assets-grid,
    .portal-trial-grid {
        grid-template-columns: 1fr;
    }

    .portal-setting-wide,
    .portal-trial-window {
        grid-column: auto;
    }

    .portal-trial-card {
        padding: 16px 13px;
    }

    .portal-theme-designer {
        padding: 14px 11px;
    }

    .portal-theme-option {
        grid-template-columns: 76px minmax(0, 1fr) auto;
        padding-left: 6px;
    }

    .portal-theme-swatch {
        width: 76px;
    }

    .portal-preview-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-preview-viewport {
        min-height: 420px;
        padding: 9px;
    }

    .portal-preview-device:not(.is-mobile) .portal-preview-screen {
        min-height: 410px;
        padding: 12px 8px;
    }

    .portal-preview-device:not(.is-mobile) .portal-preview-columns {
        grid-template-columns: 1fr;
    }

    .portal-preview-device:not(.is-mobile) .portal-preview-slide-frame {
        min-height: 115px;
    }

    .portal-trial-window {
        grid-template-columns: 1fr;
    }

    .portal-time-separator {
        display: none;
    }

    .portal-segmented-options {
        display: flex;
        width: 100%;
    }

    .portal-segmented-options label {
        flex: 1 1 0;
    }

    .portal-segmented-options span {
        text-align: center;
    }

    .portal-notice,
    .portal-save-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .portal-save-bar .btn {
        width: 100%;
        margin: 0;
    }

    .portal-assets-grid {
        gap: 12px;
    }

    .portal-asset-card {
        min-height: 0;
    }

    .portal-slides-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .portal-slide-card > img {
        height: 105px;
    }
}

/* =====================================================================
   Customer package catalog
   ===================================================================== */

.package-catalog-page {
    max-width: 1360px;
    margin: 0 auto;
}

.package-catalog-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 235px;
    gap: 28px;
    margin-bottom: 18px;
    padding: clamp(27px, 4.5vw, 48px);
    overflow: hidden;
    border-radius: 22px;
    background:
        radial-gradient(circle at 88% 15%, rgba(255, 255, 255, .16), transparent 28%),
        radial-gradient(circle at 72% 115%, rgba(45, 212, 191, .35), transparent 34%),
        linear-gradient(135deg, #0f172a 0%, #064e3b 58%, #0f766e 100%);
    color: #fff;
    box-shadow: 0 22px 50px -32px rgba(4, 120, 87, .9);
}

.package-catalog-hero::before,
.package-catalog-hero::after {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 50%;
    content: "";
}

.package-catalog-hero::before {
    right: -85px;
    bottom: -150px;
    width: 360px;
    height: 360px;
}

.package-catalog-hero::after {
    right: 76px;
    bottom: -116px;
    width: 250px;
    height: 250px;
}

.package-catalog-hero-copy,
.package-catalog-hero-mark {
    position: relative;
    z-index: 1;
}

.package-catalog-hero-copy {
    max-width: 720px;
}

.package-catalog-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: #5eead4;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.package-catalog-hero h1 {
    margin: 0 0 11px;
    color: #fff;
    font-size: clamp(27px, 4vw, 42px);
    font-weight: 750;
    letter-spacing: -.035em;
    line-height: 1.08;
}

.package-catalog-hero-copy > p {
    max-width: 660px;
    margin: 0;
    color: rgba(255, 255, 255, .74);
    font-size: 14px;
    line-height: 1.65;
}

.package-catalog-account {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.package-catalog-account > span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    background: rgba(15, 23, 42, .24);
    color: rgba(255, 255, 255, .82);
    font-size: 12px;
    font-weight: 650;
    backdrop-filter: blur(7px);
}

.package-catalog-hero-mark {
    display: grid;
    width: 170px;
    height: 150px;
    place-items: center;
    flex: 0 0 auto;
}

.package-catalog-hero-mark > span {
    display: grid;
    width: 120px;
    height: 120px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 50%;
    background: rgba(255, 255, 255, .09);
    color: #5eead4;
    font-size: 50px;
    box-shadow: inset 0 0 45px rgba(255, 255, 255, .05);
    backdrop-filter: blur(9px);
}

.package-catalog-hero-mark > i {
    position: absolute;
    right: 3px;
    bottom: 10px;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 4px solid #0f766e;
    border-radius: 50%;
    background: #fff;
    color: #047857;
    font-size: 24px;
}

.package-catalog-toolbar {
    position: sticky;
    top: 64px;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto;
    align-items: center;
    gap: 12px 18px;
    margin-bottom: 22px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.package-catalog-search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.package-catalog-search > i {
    position: absolute;
    left: 13px;
    z-index: 1;
    color: var(--text-muted);
}

.package-catalog-search input {
    width: 100%;
    height: 40px;
    padding: 9px 42px 9px 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: 0;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
}

.package-catalog-search input:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.package-catalog-search button {
    position: absolute;
    right: 7px;
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
}

.package-catalog-search button:hover,
.package-catalog-search button:focus {
    background: var(--surface-3);
    color: var(--text);
}

.package-catalog-filters {
    display: flex;
    min-width: 0;
    gap: 5px;
    padding: 3px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
    scrollbar-width: none;
}

.package-catalog-filters::-webkit-scrollbar {
    display: none;
}

.package-catalog-filters button {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    gap: 6px;
    padding: 7px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.package-catalog-filters button:hover,
.package-catalog-filters button:focus {
    color: var(--text);
    background: var(--surface-3);
}

.package-catalog-filters button.is-active {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 10px -7px var(--accent-700);
}

.package-catalog-filters button > span {
    display: grid;
    min-width: 19px;
    height: 19px;
    place-items: center;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .08);
    font-size: 10px;
}

.package-catalog-filters button.is-active > span {
    background: rgba(255, 255, 255, .18);
}

.package-catalog-result-count {
    grid-column: 1 / -1;
    margin: -4px 2px 0;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.package-catalog-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 22px;
}

.package-network {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.package-network-heading {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--surface-2), var(--surface));
}

.package-network-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-700);
    font-size: 17px;
}

.package-network-label {
    display: block;
    margin-bottom: 3px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.package-network-heading h2,
.package-network-heading p {
    margin: 0;
}

.package-network-heading h2 {
    color: var(--text);
    font-size: 17px;
    font-weight: 750;
}

.package-network-heading p {
    max-width: 720px;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.55;
}

.package-network > .package-plan-group {
    padding: 20px 22px 23px;
}

.package-network > .package-plan-group + .package-plan-group {
    border-top: 1px solid var(--border);
}

.package-catalog-content > .package-plan-group {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.package-plan-group-heading {
    margin-bottom: 14px;
}

.package-plan-group-heading > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.package-plan-group-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 9px;
    background: var(--surface-3);
    color: var(--accent-700);
}

.package-plan-group-heading h2,
.package-plan-group-heading p {
    margin: 0;
}

.package-plan-group-heading h2 {
    color: var(--text);
    font-size: 15px;
    font-weight: 750;
}

.package-plan-group-heading p {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
}

.package-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    align-items: stretch;
    gap: 13px;
}

.package-plan-card {
    display: flex;
    min-width: 0;
    min-height: 350px;
    flex-direction: column;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.package-plan-card:hover,
.package-plan-card:focus-within {
    border-color: rgba(16, 185, 129, .48);
    box-shadow: 0 16px 28px -25px rgba(4, 120, 87, .72);
    transform: translateY(-2px);
}

.package-plan-card-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 13px;
}

.package-plan-type,
.package-plan-offer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.package-plan-type {
    padding: 6px 8px;
    background: var(--surface-3);
    color: var(--text-muted);
}

.package-plan-offer {
    padding: 5px 8px;
    background: rgba(245, 158, 11, .14);
    color: #b45309;
}

html.dark .package-plan-offer {
    color: #fbbf24;
}

.package-plan-card > h3 {
    min-height: 2.7em;
    margin: 0 0 8px;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 16px;
    font-weight: 750;
    line-height: 1.35;
}

.package-plan-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 17px;
}

.package-plan-price strong {
    color: var(--accent-700);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.025em;
}

.package-plan-price del {
    color: var(--text-muted);
    font-size: 12px;
}

.package-plan-facts {
    display: grid;
    gap: 0;
    margin: 0 0 17px;
}

.package-plan-facts > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.package-plan-facts dt,
.package-plan-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.45;
}

.package-plan-facts dt {
    color: var(--text-muted);
    font-weight: 600;
}

.package-plan-facts dt i {
    width: 15px;
    color: var(--accent-700);
}

.package-plan-facts dd {
    color: var(--text);
    font-weight: 700;
    text-align: right;
}

.package-plan-actions {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
    margin-top: auto;
}

.package-plan-actions .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    gap: 8px;
    margin: 0;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 700;
    white-space: normal;
}

.package-plan-buy {
    justify-content: space-between !important;
    padding-right: 13px;
    padding-left: 13px;
}

.package-plan-friend {
    color: var(--text);
}

.package-catalog-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    flex-direction: column;
    padding: 35px;
    border: 1px dashed var(--border);
    border-radius: 17px;
    background: var(--surface-2);
    text-align: center;
}

.package-catalog-empty[hidden],
.package-plan-card[hidden],
.package-plan-group[hidden],
.package-network[hidden] {
    display: none !important;
}

.package-catalog-empty > span {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-700);
    font-size: 21px;
}

.package-catalog-empty h2,
.package-catalog-empty p {
    margin: 0;
}

.package-catalog-empty h2 {
    color: var(--text);
    font-size: 17px;
    font-weight: 750;
}

.package-catalog-empty p {
    margin: 6px 0 15px;
    color: var(--text-muted);
    font-size: 12px;
}

@media (max-width: 900px) {
    .package-catalog-toolbar {
        grid-template-columns: 1fr;
    }

    .package-catalog-result-count {
        grid-column: auto;
    }

    .package-catalog-filters {
        width: 100%;
    }
}

@media (max-width: 700px) {
    .package-catalog-hero {
        min-height: 0;
        padding: 27px 20px;
        border-radius: 17px;
    }

    .package-catalog-hero-mark {
        display: none;
    }

    .package-catalog-toolbar {
        position: static;
    }

    .package-network-heading,
    .package-network > .package-plan-group,
    .package-catalog-content > .package-plan-group {
        padding-right: 15px;
        padding-left: 15px;
    }

    .package-plan-grid {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    }
}

@media (max-width: 480px) {
    .package-catalog-account > span {
        justify-content: center;
        flex: 1 1 auto;
    }

    .package-catalog-toolbar {
        padding: 10px;
        border-radius: 13px;
    }

    .package-catalog-filters button {
        flex: 0 0 auto;
    }

    .package-plan-grid {
        grid-template-columns: 1fr;
    }

    .package-plan-card {
        min-height: 0;
    }
}

/* =====================================================================
   Admin customer detail workspace
   ===================================================================== */

.customer-detail-page {
    max-width: 1440px;
    margin: 0 auto;
}

.customer-detail-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(320px, auto);
    gap: 24px;
    margin-bottom: 20px;
    padding: clamp(22px, 3.4vw, 38px);
    overflow: hidden;
    border-radius: 22px;
    background:
        radial-gradient(circle at 92% 0, rgba(94, 234, 212, .2), transparent 30%),
        linear-gradient(135deg, #111827 0%, #064e3b 60%, #0f766e 100%);
    color: #fff;
    box-shadow: 0 24px 52px -38px rgba(4, 120, 87, .9);
}

.customer-detail-hero::after {
    position: absolute;
    right: -105px;
    bottom: -190px;
    width: 380px;
    height: 380px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    content: "";
}

.customer-detail-identity,
.customer-detail-actions,
.customer-detail-metrics,
.customer-sync-status {
    position: relative;
    z-index: 1;
}

.customer-detail-identity {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 17px;
}

.customer-detail-avatar {
    display: block;
    width: 82px;
    height: 82px;
    padding: 3px;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 20px;
    background: rgba(255, 255, 255, .12);
    box-shadow: 0 12px 28px -20px #000;
}

.customer-detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.customer-detail-heading {
    min-width: 0;
}

.customer-detail-kicker {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 7px;
    color: rgba(255, 255, 255, .65);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.customer-detail-kicker .customer-status-badge {
    border-color: rgba(255, 255, 255, .15);
    background: rgba(15, 23, 42, .3);
    color: #d1fae5;
}

.customer-detail-kicker .customer-status-badge.is-danger {
    color: #fecaca;
}

.customer-detail-heading h1 {
    margin: 0;
    overflow-wrap: anywhere;
    color: #fff;
    font-size: clamp(25px, 3vw, 36px);
    font-weight: 750;
    letter-spacing: -.035em;
    line-height: 1.1;
}

.customer-detail-heading > p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, .72);
    font-size: 13px;
}

.customer-detail-actions {
    display: flex;
    align-content: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.customer-detail-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    gap: 7px;
    margin: 0;
    border-color: rgba(255, 255, 255, .15);
    border-radius: 10px;
    background: rgba(15, 23, 42, .3);
    color: rgba(255, 255, 255, .88);
    font-size: 12px;
    font-weight: 650;
    backdrop-filter: blur(8px);
}

.customer-detail-actions .btn:hover,
.customer-detail-actions .btn:focus {
    border-color: rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

.customer-detail-actions .btn-primary {
    border-color: #10b981;
    background: #10b981;
    color: #fff;
}

.customer-detail-actions .btn-primary:hover,
.customer-detail-actions .btn-primary:focus {
    background: #059669;
}

.customer-detail-metrics {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
}

.customer-detail-metrics > div {
    min-width: 0;
    padding: 13px 15px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    background: rgba(15, 23, 42, .24);
    backdrop-filter: blur(8px);
}

.customer-detail-metrics span,
.customer-detail-metrics strong {
    display: block;
}

.customer-detail-metrics span {
    margin-bottom: 4px;
    color: rgba(255, 255, 255, .56);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.customer-detail-metrics strong {
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-sync-status {
    grid-column: 1 / -1;
    min-height: 0;
}

.customer-sync-status:empty {
    display: none;
}

.customer-detail-layout {
    display: grid;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
    align-items: start;
    gap: 20px;
}

.customer-detail-sidebar,
.customer-detail-main {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 16px;
}

.customer-info-card,
.customer-plans-section,
.customer-workspace {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.customer-info-card {
    padding: 17px;
}

.customer-info-card > header {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 13px;
}

.customer-info-card > header > i {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent-700);
}

.customer-info-card h2 {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 750;
}

.customer-info-list {
    display: grid;
    gap: 0;
    margin: 0;
}

.customer-info-list > div {
    display: grid;
    grid-template-columns: minmax(90px, .75fr) minmax(0, 1.25fr);
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
}

.customer-info-list > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.customer-info-list dt,
.customer-info-list dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.45;
}

.customer-info-list dt {
    color: var(--text-muted);
    font-weight: 600;
}

.customer-info-list dd {
    color: var(--text);
    font-weight: 650;
    text-align: right;
}

.customer-info-list dd a {
    color: var(--accent-700);
}

.customer-copy-value {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 6px;
}

.customer-copy-value button,
.customer-credential-row button {
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--text-muted);
}

.customer-copy-value button:hover,
.customer-copy-value button:focus,
.customer-credential-row button:hover,
.customer-credential-row button:focus,
.customer-credential-row button.is-active {
    border-color: var(--accent);
    color: var(--accent-700);
}

.customer-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.customer-status-badge.is-success {
    border-color: rgba(16, 185, 129, .2);
    background: rgba(16, 185, 129, .11);
    color: #047857;
}

.customer-status-badge.is-danger {
    border-color: rgba(239, 68, 68, .2);
    background: rgba(239, 68, 68, .1);
    color: #b91c1c;
}

html.dark .customer-status-badge.is-success {
    color: #6ee7b7;
}

html.dark .customer-status-badge.is-danger {
    color: #fca5a5;
}

.customer-credential-row + .customer-credential-row {
    margin-top: 12px;
}

.customer-credential-row > label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 650;
}

.customer-credential-row > div {
    display: flex;
    align-items: center;
    gap: 5px;
}

.customer-credential-row input {
    min-width: 0;
    height: 35px;
    flex: 1 1 auto;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: 0;
    background: var(--surface-2);
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
}

.customer-location-map {
    width: 100%;
    height: 180px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
}

.customer-location-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: var(--accent-700);
    font-size: 12px;
    font-weight: 650;
}

.customer-danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border: 1px solid rgba(239, 68, 68, .22);
    border-radius: 14px;
    background: rgba(239, 68, 68, .055);
}

.customer-danger-zone strong,
.customer-danger-zone p {
    margin: 0;
}

.customer-danger-zone strong {
    color: var(--text);
    font-size: 12px;
}

.customer-danger-zone p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.45;
}

.customer-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 19px 21px;
    border-bottom: 1px solid var(--border);
}

.customer-section-heading span,
.customer-section-heading h2 {
    display: block;
    margin: 0;
}

.customer-section-heading > div > span {
    margin-bottom: 3px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.customer-section-heading h2 {
    color: var(--text);
    font-size: 17px;
    font-weight: 750;
}

.customer-section-count {
    display: grid !important;
    min-width: 32px;
    height: 32px;
    place-items: center;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-700);
    font-size: 12px;
    font-weight: 750;
}

.customer-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
    gap: 13px;
    padding: 17px;
}

.customer-plan-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 16px;
    border: 1px solid var(--border);
    border-top: 3px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
}

/* COLLISION FIX (2026-08): .customer-plan-card / .customer-plan-grid are ALSO defined lower
   in this file for the customer-DASHBOARD plan widget, and that later definition wins by
   source order -- forcing overflow:hidden onto THIS admin customer-view card and clipping
   its footer (the Deactivate/Recharge buttons were cut off). The two components share a
   class name but not an ancestor: this card lives in .customer-plans-section, the dashboard
   one does not. Scope the view card back to its intended overflow so the footer is never
   clipped. Proper long-term fix is to give the two components distinct class names. */
.customer-plans-section .customer-plan-card {
    overflow: visible;
    /* ROOT FIX: the two-column .customer-detail-layout stretches this card's column to match
       the taller sidebar, making the card taller than its content. That surplus height is what
       caused every footer symptom (gap, clipped buttons, oversized buttons, spill below the
       card). align-self:start sizes the card to its content, so the footer sits naturally right
       after the last row and nothing overflows. */
    align-self: start;
}

.customer-plan-card.is-active {
    border-top-color: #10b981;
}

.customer-plan-card.is-inactive {
    border-top-color: #ef4444;
}

.customer-plan-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.customer-plan-type {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.customer-plan-card h3 {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 15px;
    font-weight: 750;
    line-height: 1.35;
}

.customer-plan-router-state:empty {
    display: none;
}

.customer-plan-router-state {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.customer-plan-connection {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
}

.customer-plan-connection > span {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 680;
}

.customer-plan-warning {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    margin-top: 12px;
    padding: 10px;
    border: 1px solid rgba(245, 158, 11, .22);
    border-radius: 10px;
    background: rgba(245, 158, 11, .09);
    color: var(--text);
}

.customer-plan-warning > i {
    color: #d97706;
}

.customer-plan-warning strong,
.customer-plan-warning p {
    display: block;
    margin: 0;
}

.customer-plan-warning strong {
    font-size: 11px;
}

.customer-plan-warning p {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
}

.customer-plan-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
    margin: 13px 0 0;
}

.customer-plan-facts > div {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.customer-plan-facts dt,
.customer-plan-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.customer-plan-facts dt {
    margin-bottom: 3px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.customer-plan-facts dd {
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
}

.customer-plan-usage {
    margin-top: 13px;
}

.customer-plan-usage > div,
.customer-plan-reason {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-muted);
    font-size: 11px;
}

.customer-plan-usage strong,
.customer-plan-reason strong {
    color: var(--text);
    font-weight: 700;
}

.customer-plan-usage progress {
    width: 100%;
    height: 7px;
    margin-top: 7px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: var(--surface-3);
    accent-color: var(--accent);
}

.customer-plan-reason {
    margin-top: 12px;
    padding: 9px 10px;
    border-radius: 9px;
    background: var(--surface-3);
}

.customer-plan-reason .is-warning {
    color: #b45309;
}

.customer-plan-reason .is-info {
    color: var(--accent-700);
}

.customer-plan-actions {
    /* Sit directly below the card content (no margin-top:auto pushing to the card bottom),
       and never stretch the buttons vertically (align-items:center). */
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    padding-top: 12px;
}

.customer-plan-actions .btn {
    /* Compact, content-width, never stretched or full-width. flex:0 0 auto + width:auto
       defeat any grid/flex stretch that was ballooning these into large squares. */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    min-height: 32px;
    height: auto;
    padding: 6px 14px;
    gap: 7px;
    margin: 0;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.2;
}

.customer-plan-deactivate {
    /* Destructive action -> danger (red) outline, so it is unmistakably NOT the green
       Recharge button beside it. Distinguished by colour AND fill style AND label AND icon,
       so it holds up for colour-blind operators and in low-quality screenshots alike.
       !important overrides .btn-default's own !important colour/border. */
    color: var(--rose) !important;
    border-color: var(--rose) !important;
    background: var(--surface) !important;
}

.customer-plan-deactivate:hover,
.customer-plan-deactivate:focus {
    color: #fff !important;
    background: var(--rose) !important;
    border-color: var(--rose) !important;
}

/* --- Plan-card button label VISIBILITY (2026-08) ---------------------------------------
   Symptom: the "Deactivate"/"Recharge" words were present in the DOM but rendered
   invisible in-browser (confirmed via inspect, in incognito, so not cache/extension).
   `color` alone did not fix it, which is the signature of `-webkit-text-fill-color`
   (an INHERITED property that overrides `color`) being transparent somewhere up the tree.
   These rules win by specificity + !important and set BOTH `color` and the fill colour
   explicitly, so the labels are legible regardless of what an ancestor does. */
.customer-plan-actions a.btn.customer-plan-deactivate,
.customer-plan-actions a.btn.customer-plan-deactivate * {
    color: var(--rose) !important;
    -webkit-text-fill-color: var(--rose) !important;
}
.customer-plan-actions a.btn.btn-success,
.customer-plan-actions a.btn.btn-success * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.customer-workspace-tabs {
    display: flex;
    gap: 5px;
    padding: 11px 13px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    scrollbar-width: none;
}

.customer-workspace-tabs::-webkit-scrollbar {
    display: none;
}

.customer-workspace-tabs > * {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    gap: 6px;
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 650;
}

.customer-workspace-tabs > *:hover,
.customer-workspace-tabs > *:focus {
    background: var(--surface-3);
    color: var(--text);
}

.customer-workspace-tabs > *.is-active {
    background: var(--accent);
    color: #fff;
}

.customer-workspace-panel[hidden] {
    display: none !important;
}

.customer-responsive-table {
    min-width: 0;
    overflow-x: auto;
}

.customer-responsive-table .table,
.customer-live-content .table {
    width: 100%;
    margin: 0;
    background: transparent;
}

.customer-responsive-table .table > thead > tr > th,
.customer-live-content .table > thead > tr > th {
    padding: 11px 13px;
    border-color: var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.customer-responsive-table .table > tbody > tr > td,
.customer-live-content .table > tbody > tr > td {
    padding: 12px 13px;
    border-color: var(--border);
    color: var(--text);
    font-size: 12px;
    vertical-align: middle;
}

.customer-responsive-table td strong,
.customer-responsive-table td small {
    display: block;
}

.customer-responsive-table td small {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 10px;
}

.customer-order-status {
    display: inline-flex;
    padding: 5px 7px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 750;
}

.customer-order-status.is-1 {
    background: rgba(245, 158, 11, .12);
    color: #b45309;
}

.customer-order-status.is-2 {
    background: rgba(16, 185, 129, .11);
    color: #047857;
}

.customer-order-status.is-3,
.customer-order-status.is-4 {
    background: rgba(239, 68, 68, .11);
    color: #b91c1c;
}

.customer-panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 15px 17px;
    border-bottom: 1px solid var(--border);
}

.customer-panel-toolbar h3,
.customer-panel-toolbar p {
    margin: 0;
}

.customer-panel-toolbar h3 {
    color: var(--text);
    font-size: 14px;
    font-weight: 750;
}

.customer-panel-toolbar p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

.customer-panel-toolbar > div:last-child {
    display: flex;
    gap: 6px;
}

.customer-panel-toolbar .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    border-radius: 8px;
    color: var(--text);
    font-size: 11px;
}

.customer-panel-toolbar .btn.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-700);
}

.customer-panel-toolbar .btn.is-loading i {
    animation: fa-spin 1s infinite linear;
}

.customer-live-content {
    min-height: 170px;
    overflow-x: auto;
}

.customer-loading,
.customer-live-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 170px;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.customer-live-error {
    color: #dc2626;
}

.customer-empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 190px;
    flex-direction: column;
    padding: 28px;
    text-align: center;
}

.customer-empty-state > i {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    margin-bottom: 10px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-700);
    font-size: 18px;
}

.customer-empty-state h3,
.customer-empty-state p {
    margin: 0;
}

.customer-empty-state h3 {
    color: var(--text);
    font-size: 15px;
}

.customer-empty-state p {
    max-width: 430px;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

.customer-back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 17px 2px 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 650;
}

.customer-detail-modal .modal-content {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.customer-detail-modal .modal-header,
.customer-detail-modal .modal-footer {
    border-color: var(--border);
    background: var(--surface-2);
}

.customer-detail-modal .modal-title,
.customer-detail-modal .modal-body,
.customer-detail-modal .close {
    color: var(--text);
}

.customer-modal-current {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 13px;
    padding: 11px 12px;
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--text-muted);
}

.customer-modal-current strong {
    color: var(--text);
}

.customer-copy-notice {
    position: fixed;
    right: 22px;
    bottom: max(22px, env(safe-area-inset-bottom));
    z-index: 2000;
    padding: 10px 14px;
    border-radius: 9px;
    background: #0f172a;
    color: #fff;
    box-shadow: var(--shadow-lg);
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 1120px) {
    .customer-detail-hero {
        grid-template-columns: 1fr;
    }

    .customer-detail-actions {
        justify-content: flex-start;
    }

    .customer-detail-layout {
        grid-template-columns: 290px minmax(0, 1fr);
    }
}

@media (max-width: 850px) {
    .customer-detail-layout {
        grid-template-columns: 1fr;
    }

    .customer-detail-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .customer-danger-zone {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .customer-detail-hero {
        padding: 22px 18px;
        border-radius: 17px;
    }

    .customer-detail-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-detail-actions .btn {
        flex: 1 1 calc(50% - 8px);
    }

    .customer-responsive-table {
        overflow: visible;
        padding: 11px;
    }

    .customer-responsive-table .table,
    .customer-responsive-table tbody,
    .customer-responsive-table tr,
    .customer-responsive-table td {
        display: block;
        width: 100%;
    }

    .customer-responsive-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .customer-responsive-table .table > tbody > tr {
        margin-bottom: 10px;
        padding: 7px 11px;
        border: 1px solid var(--border);
        border-radius: 11px;
        background: var(--surface-2);
    }

    .customer-responsive-table .table > tbody > tr > td {
        display: grid;
        grid-template-columns: minmax(88px, .7fr) minmax(0, 1.3fr);
        gap: 10px;
        padding: 8px 0;
        border: 0;
        border-bottom: 1px solid var(--border);
        text-align: right;
    }

    .customer-responsive-table .table > tbody > tr > td:last-child {
        border-bottom: 0;
    }

    .customer-responsive-table td::before {
        color: var(--text-muted);
        content: attr(data-label);
        font-size: 10px;
        font-weight: 650;
        text-align: left;
    }

    .customer-panel-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 540px) {
    .customer-detail-identity {
        align-items: flex-start;
    }

    .customer-detail-avatar {
        width: 66px;
        height: 66px;
        border-radius: 16px;
    }

    .customer-detail-avatar img {
        border-radius: 12px;
    }

    .customer-detail-sidebar {
        display: flex;
    }

    .customer-detail-metrics {
        grid-template-columns: 1fr;
    }

    .customer-plan-grid {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .customer-plan-warning {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .customer-plan-warning .btn {
        grid-column: 1 / -1;
    }

    .customer-plan-facts {
        grid-template-columns: 1fr;
    }

    .customer-plan-actions,
    .customer-danger-zone {
        align-items: stretch;
        flex-direction: column;
    }

    .customer-plan-actions .btn,
    .customer-danger-zone .btn {
        width: 100%;
    }

    .customer-section-heading {
        padding: 16px;
    }
}

/* =====================================================================
   Customer directory
   ===================================================================== */

.customer-directory-page,
.service-plan-page {
    max-width: 1440px;
    margin: 0 auto;
}

.customer-directory-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, auto);
    align-items: start;
    gap: 22px;
    margin-bottom: 16px;
    padding: clamp(23px, 3.5vw, 38px);
    overflow: hidden;
    border-radius: 20px;
    background:
        radial-gradient(circle at 91% 8%, rgba(94, 234, 212, .19), transparent 28%),
        linear-gradient(135deg, #111827, #064e3b 62%, #0f766e);
    color: #fff;
    box-shadow: 0 22px 48px -36px rgba(4, 120, 87, .9);
}

.customer-directory-hero::after {
    position: absolute;
    right: -90px;
    bottom: -190px;
    width: 350px;
    height: 350px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    content: "";
}

.customer-directory-hero > div {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.customer-directory-hero > div:first-child > span,
.service-plan-hero-title > div > span {
    display: block;
    margin-bottom: 5px;
    color: #5eead4;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .09em;
    line-height: 1.35;
    text-transform: uppercase;
}

.customer-directory-hero h1,
.customer-directory-hero p {
    margin: 0;
}

.customer-directory-hero h1 {
    color: #fff;
    font-size: clamp(27px, 3.8vw, 40px);
    font-weight: 750;
    letter-spacing: -.035em;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.customer-directory-hero p {
    max-width: 620px;
    margin-top: 8px;
    color: rgba(255, 255, 255, .68);
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.customer-directory-hero-actions,
.service-plan-hero-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.customer-directory-hero-actions .btn,
.service-plan-hero-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    gap: 7px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 10px;
    background: rgba(15, 23, 42, .28);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(8px);
}

.customer-directory-hero-actions .btn:hover,
.customer-directory-hero-actions .btn:focus,
.service-plan-hero-actions .btn:hover,
.service-plan-hero-actions .btn:focus {
    border-color: rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

.customer-directory-hero-actions .btn-primary,
.service-plan-hero-actions .btn-primary {
    border-color: #10b981;
    background: #10b981;
}

.customer-directory-summary {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.customer-directory-summary > div {
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 11px;
    background: rgba(15, 23, 42, .24);
}

.customer-directory-summary span,
.customer-directory-summary strong {
    display: block;
}

.customer-directory-summary span {
    margin-bottom: 3px;
    color: rgba(255, 255, 255, .55);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
    text-transform: uppercase;
}

.customer-directory-summary strong {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.customer-directory-filter-card,
.customer-directory-card,
.service-plan-filter-card,
.service-plan-results {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.customer-directory-filter-card {
    margin-bottom: 16px;
    padding: 14px;
}

.customer-directory-filter-card form {
    display: grid;
    grid-template-columns: minmax(230px, 1.6fr) repeat(3, minmax(135px, .75fr)) auto;
    align-items: end;
    gap: 10px;
}

.customer-directory-filter-card label,
.service-plan-filter-card label {
    display: block;
    min-width: 0;
    margin: 0;
}

.customer-directory-filter-card label > span,
.service-plan-filter-card label > span {
    display: block;
    margin: 0 0 5px 2px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.customer-directory-filter-card select,
.service-plan-filter-card select,
.service-plan-search input {
    width: 100%;
    height: 39px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: 0;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 12px;
}

.customer-directory-search-field,
.service-plan-search {
    position: relative;
    min-width: 0;
}

.customer-directory-search-field > i,
.service-plan-search > i {
    position: absolute;
    top: 50%;
    left: 13px;
    color: var(--text-muted);
    transform: translateY(-50%);
}

.customer-directory-search-field input {
    width: 100%;
    height: 39px;
    padding: 8px 12px 8px 37px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: 0;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 12px;
}

.customer-directory-search-field input:focus,
.customer-directory-filter-card select:focus,
.service-plan-search input:focus,
.service-plan-filter-card select:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.customer-directory-filter-actions,
.service-plan-filter-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.customer-directory-filter-actions .btn,
.service-plan-filter-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 39px;
    gap: 6px;
    margin: 0;
    border-radius: 9px;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
}

.customer-directory-card-heading,
.service-plan-results-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 17px 19px;
    border-bottom: 1px solid var(--border);
}

.customer-directory-card-heading h2,
.customer-directory-card-heading p,
.service-plan-results-heading h2,
.service-plan-results-heading p {
    margin: 0;
}

.customer-directory-card-heading h2,
.service-plan-results-heading h2 {
    color: var(--text);
    font-size: 16px;
    font-weight: 750;
}

.customer-directory-card-heading p,
.service-plan-results-heading p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

.customer-directory-card-heading > span,
.service-plan-results-heading > span {
    padding: 6px 9px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.customer-directory-table-wrap {
    min-width: 0;
    overflow-x: auto;
}

.customer-directory-table {
    width: 100%;
    border-collapse: collapse;
}

.customer-directory-table th,
.customer-directory-table td {
    padding: 12px 11px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 12px;
    text-align: left;
    vertical-align: middle;
}

.customer-directory-table th {
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.customer-directory-table tbody tr:last-child td {
    border-bottom: 0;
}

.customer-directory-table tbody tr:hover td {
    background: var(--surface-2);
}

.customer-directory-row.is-inactive td {
    background: rgba(239, 68, 68, .025);
}

.customer-directory-select {
    width: 42px;
    text-align: center !important;
}

.customer-directory-select input,
.customer-directory-table th input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

.customer-directory-person {
    display: flex;
    align-items: center;
    min-width: 180px;
    gap: 9px;
}

.customer-directory-person img {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-3);
}

.customer-directory-person strong,
.customer-directory-person small,
.customer-directory-service strong,
.customer-directory-service span,
.customer-directory-network strong,
.customer-directory-network small {
    display: block;
}

.customer-directory-person strong,
.customer-directory-network strong {
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 12px;
}

.customer-directory-person small,
.customer-directory-network small,
.customer-directory-date {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 10px;
}

.customer-directory-contact {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.customer-directory-contact a {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    gap: 5px;
    padding: 5px 7px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 10px;
}

.customer-directory-contact a span {
    display: none;
}

.customer-directory-contact a:hover,
.customer-directory-contact a:focus {
    border-color: var(--accent);
    color: var(--accent-700);
}

.customer-directory-service {
    min-width: 110px;
}

.customer-directory-service strong {
    margin-bottom: 3px;
    color: var(--text);
    font-size: 11px;
}

.customer-directory-service span {
    color: var(--text-muted);
    font-size: 10px;
}

.customer-directory-live-plans {
    display: flex !important;
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
}

.customer-directory-service .customer-directory-plan {
    display: inline-flex;
    max-width: 190px;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 5px 7px;
    border-radius: 8px;
    line-height: 1.35;
    white-space: normal;
}

.customer-directory-plan-name {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #fff !important;
}

/* Router presence is deliberately distinct from the customer's billing status. */
.customer-online-state,
.customer-directory-service .customer-online-state,
.customer-plan-router-state .customer-online-state {
    display: inline-flex;
    min-height: 27px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .045em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.customer-online-state > i {
    font-size: 10px;
}

.customer-online-state.is-online,
.customer-directory-service .customer-online-state.is-online,
.customer-plan-router-state .customer-online-state.is-online {
    border-color: rgba(22, 163, 74, .32);
    background: rgba(34, 197, 94, .16);
    color: #166534;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .07);
}

.customer-online-state.is-offline,
.customer-directory-service .customer-online-state.is-offline,
.customer-plan-router-state .customer-online-state.is-offline {
    border-color: rgba(217, 119, 6, .32);
    background: rgba(245, 158, 11, .17);
    color: #92400e;
}

.customer-online-state.is-error,
.customer-directory-service .customer-online-state.is-error,
.customer-plan-router-state .customer-online-state.is-error {
    border-color: rgba(220, 38, 38, .28);
    background: rgba(239, 68, 68, .13);
    color: #b91c1c;
}

.customer-online-state.is-checking,
.customer-directory-service .customer-online-state.is-checking,
.customer-plan-router-state .customer-online-state.is-checking {
    border-color: var(--border);
    background: var(--surface-3);
    color: var(--text-muted);
}

html.dark .customer-online-state.is-online {
    border-color: rgba(74, 222, 128, .32);
    background: rgba(34, 197, 94, .18);
    color: #86efac;
}

html.dark .customer-online-state.is-offline {
    border-color: rgba(251, 191, 36, .28);
    background: rgba(245, 158, 11, .16);
    color: #fcd34d;
}

html.dark .customer-online-state.is-error {
    border-color: rgba(248, 113, 113, .28);
    background: rgba(239, 68, 68, .15);
    color: #fca5a5;
}

.customer-directory-balance {
    color: var(--accent-700) !important;
    font-weight: 750;
    white-space: nowrap;
}

.customer-directory-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.customer-directory-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    min-height: 30px;
    gap: 5px;
    margin: 0;
    padding: 5px 7px;
    border-radius: 7px;
}

.customer-directory-actions .btn span {
    display: none;
}

.customer-directory-pagination,
.service-plan-pagination {
    padding: 11px 17px;
    border-top: 1px solid var(--border);
}

.customer-directory-selection {
    position: fixed;
    right: 24px;
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.customer-directory-selection[hidden] {
    display: none !important;
}

.customer-directory-selection > div {
    display: flex;
    align-items: baseline;
    gap: 5px;
    padding: 0 8px;
    color: var(--text-muted);
    font-size: 10px;
}

.customer-directory-selection > div strong {
    color: var(--text);
    font-size: 16px;
}

.customer-directory-selection .btn {
    display: inline-flex;
    align-items: center;
    min-height: 37px;
    gap: 6px;
    margin: 0;
    border-radius: 8px;
    font-size: 11px;
}

.customer-directory-modal .modal-content {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

.customer-directory-modal .modal-header,
.customer-directory-modal .modal-footer {
    border-color: var(--border);
    background: var(--surface-2);
}

.customer-directory-modal .modal-title,
.customer-directory-modal .close,
.customer-directory-modal label {
    color: var(--text);
}

.customer-message-recipient-count {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 11px 13px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--text-muted);
}

.customer-message-recipient-count strong {
    color: var(--accent-700);
    font-size: 18px;
}

/* =====================================================================
   Shared Hotspot, PPPoE and VPN plan management
   ===================================================================== */

.service-plan-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    padding: clamp(22px, 3vw, 32px);
    border-radius: 19px;
    background: linear-gradient(135deg, #111827, #164e63 68%, #0e7490);
    color: #fff;
    box-shadow: 0 20px 45px -35px rgba(14, 116, 144, .9);
}

.service-plan-page-pppoe .service-plan-hero {
    background: linear-gradient(135deg, #111827, #1e3a8a 68%, #2563eb);
}

.service-plan-page-vpn .service-plan-hero {
    background: linear-gradient(135deg, #111827, #4c1d95 68%, #7c3aed);
}

.service-plan-hero-title {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 15px;
}

.service-plan-hero-icon {
    display: grid;
    width: 57px;
    height: 57px;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 16px;
    background: rgba(255, 255, 255, .1);
    color: #a7f3d0;
    font-size: 23px;
}

.service-plan-hero-title h1,
.service-plan-hero-title p {
    margin: 0;
}

.service-plan-hero-title h1 {
    color: #fff;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 750;
    letter-spacing: -.03em;
}

.service-plan-hero-title p {
    margin-top: 5px;
    color: rgba(255, 255, 255, .65);
    font-size: 12px;
}

.service-plan-hero-count {
    display: grid;
    min-width: 78px;
    place-items: center;
    padding: 10px 13px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    background: rgba(15, 23, 42, .24);
}

.service-plan-hero-count span,
.service-plan-hero-count small {
    color: rgba(255, 255, 255, .58);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.service-plan-hero-count strong {
    color: #fff;
    font-size: 22px;
}

.service-plan-filter-card {
    margin-bottom: 16px;
    padding: 14px;
}

.service-plan-filter-card form {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    align-items: end;
    gap: 10px;
}

.service-plan-search {
    grid-column: span 2;
}

.service-plan-search input {
    padding-left: 37px;
}

.service-plan-filter-actions {
    grid-column: span 2;
    justify-content: flex-end;
}

.service-plan-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
    align-items: stretch;
    gap: 13px;
    padding: 17px;
}

.service-plan-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 16px;
    border: 1px solid var(--border);
    border-top: 3px solid #10b981;
    border-radius: 14px;
    background: var(--surface-2);
}

.service-plan-card.is-disabled {
    border-top-color: #ef4444;
    opacity: .86;
}

.service-plan-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.service-plan-kind {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.service-plan-card h3 {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 16px;
    font-weight: 750;
    line-height: 1.35;
}

.service-plan-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 11px;
}

.service-plan-tags > span,
.service-plan-radius {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 7px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
}

.service-plan-tags > span.is-accent,
.service-plan-radius {
    background: var(--accent-soft);
    color: var(--accent-700);
}

.service-plan-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
}

.service-plan-price strong {
    color: var(--accent-700);
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.025em;
}

.service-plan-price del {
    color: var(--text-muted);
    font-size: 12px;
}

.service-plan-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
    margin: 13px 0 0;
}

.service-plan-facts > div {
    min-width: 0;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.service-plan-facts dt,
.service-plan-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.service-plan-facts dt {
    margin-bottom: 3px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 650;
}

.service-plan-facts dd {
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

.service-plan-expiry {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 12px;
    padding: 10px;
    border: 1px solid rgba(245, 158, 11, .2);
    border-radius: 9px;
    background: rgba(245, 158, 11, .08);
    color: #d97706;
}

.service-plan-expiry span,
.service-plan-expiry strong {
    display: block;
}

.service-plan-expiry span {
    color: var(--text-muted);
    font-size: 9px;
}

.service-plan-expiry strong {
    margin-top: 2px;
    color: var(--text);
    font-size: 11px;
}

.service-plan-card > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
}

.service-plan-card > footer > div {
    display: flex;
    gap: 6px;
}

.service-plan-card > footer .btn {
    display: inline-flex;
    align-items: center;
    min-height: 35px;
    gap: 6px;
    margin: 0;
    border-radius: 8px;
    font-size: 11px;
}

.service-plan-id {
    color: var(--text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 10px;
}

.service-plan-delete {
    color: #b91c1c;
}

html.dark .service-plan-delete {
    color: #fca5a5;
}

.service-plan-help {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 15px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-2);
    color: var(--accent-700);
}

.service-plan-help strong,
.service-plan-help p {
    display: block;
    margin: 0;
}

.service-plan-help strong {
    color: var(--text);
    font-size: 12px;
}

.service-plan-help p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

@media (max-width: 1180px) {
    .customer-directory-filter-card form {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .customer-directory-search-field {
        grid-column: span 2;
    }

    .customer-directory-filter-actions {
        grid-column: span 2;
        justify-content: flex-end;
    }

    .service-plan-filter-card form {
        grid-template-columns: repeat(4, minmax(135px, 1fr));
    }
}

@media (max-width: 1100px) {
    .customer-directory-hero {
        grid-template-columns: minmax(0, 1fr);
    }

    .customer-directory-hero-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    .customer-directory-hero,
    .service-plan-hero {
        grid-template-columns: 1fr;
    }

    .customer-directory-hero-actions,
    .service-plan-hero-actions {
        justify-content: flex-start;
    }

    .service-plan-hero-count {
        display: flex;
        justify-content: flex-start;
        gap: 7px;
    }

    .customer-directory-table-wrap {
        overflow: visible;
        padding: 11px;
    }

    .customer-directory-table,
    .customer-directory-table tbody,
    .customer-directory-table tr,
    .customer-directory-table td {
        display: block;
        width: 100%;
    }

    .customer-directory-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .customer-directory-table tr {
        position: relative;
        margin-bottom: 11px;
        padding: 11px;
        border: 1px solid var(--border);
        border-radius: 13px;
        background: var(--surface-2);
    }

    .customer-directory-table td {
        display: grid;
        grid-template-columns: minmax(90px, .65fr) minmax(0, 1.35fr);
        gap: 10px;
        padding: 8px 0;
        border: 0;
        border-bottom: 1px solid var(--border);
        background: transparent !important;
        text-align: right;
    }

    .customer-directory-table td::before {
        color: var(--text-muted);
        content: attr(data-label);
        font-size: 10px;
        font-weight: 650;
        text-align: left;
    }

    .customer-directory-table td:last-child {
        border-bottom: 0;
    }

    .customer-directory-table .customer-directory-select {
        position: absolute;
        top: 15px;
        right: 14px;
        display: block;
        width: auto;
        padding: 0;
        border: 0;
        z-index: 1;
    }

    .customer-directory-select::before {
        display: none;
    }

    .customer-directory-person,
    .customer-directory-contact,
    .customer-directory-actions {
        justify-content: flex-end;
    }

    .customer-directory-person {
        min-width: 0;
    }

    .customer-directory-contact a span,
    .customer-directory-actions .btn span {
        display: inline;
    }

    .service-plan-filter-card form {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    /* Fix 5: the table-to-card conversion for .customer-directory-* starts at
       this same 900px breakpoint, so the action buttons must become
       touch-friendly here too, not at 650px — otherwise 651-900px viewports
       (tablets, foldables, landscape phones) are stuck with the card layout
       but tiny 30x30px icon buttons. Mirrors .subscription-directory-actions,
       which already applies this at 900px. */
    .customer-directory-table .customer-directory-actions-cell {
        display: block;
        padding-top: 12px;
        text-align: left;
    }

    .customer-directory-actions-cell::before {
        display: block;
        margin-bottom: 8px;
    }

    .customer-directory-actions {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .customer-directory-actions .btn {
        width: 100%;
        min-height: 42px;
        gap: 7px;
        border-radius: 9px;
        font-size: 11px;
    }
}

@media (max-width: 650px) {
    .customer-directory-hero,
    .service-plan-hero {
        padding: 21px 18px;
        border-radius: 17px;
    }

    .customer-directory-summary,
    .customer-directory-filter-card form,
    .service-plan-filter-card form {
        grid-template-columns: 1fr;
    }

    .customer-directory-search-field,
    .customer-directory-filter-actions,
    .service-plan-search,
    .service-plan-filter-actions {
        grid-column: auto;
    }

    .customer-directory-filter-actions,
    .service-plan-filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .customer-directory-filter-actions .btn,
    .service-plan-filter-actions .btn {
        width: 100%;
    }

    .customer-directory-selection {
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        left: 12px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .service-plan-hero-title {
        align-items: flex-start;
    }

    .service-plan-hero-icon {
        width: 48px;
        height: 48px;
    }

    .service-plan-card-grid {
        grid-template-columns: 1fr;
        padding: 12px;
    }
}

@media (max-width: 460px) {
    .customer-directory-hero-actions .btn,
    .service-plan-hero-actions .btn {
        width: 100%;
    }

    .customer-directory-table td {
        grid-template-columns: 78px minmax(0, 1fr);
    }

    .customer-directory-contact,
    .customer-directory-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .customer-directory-contact a,
    .customer-directory-actions .btn {
        width: 100%;
    }

    .service-plan-facts {
        grid-template-columns: 1fr;
    }

    .service-plan-card > footer {
        align-items: stretch;
        flex-direction: column;
    }

    .service-plan-card > footer > div,
    .service-plan-card > footer .btn {
        width: 100%;
    }

    .service-plan-card > footer .btn {
        justify-content: center;
    }
}

/* =====================================================================
   Recharge confirmation
   ===================================================================== */

.recharge-confirm-page,
.customer-form-page {
    max-width: 1380px;
    margin: 0 auto;
}

.recharge-confirm-hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 17px;
    margin-bottom: 17px;
    padding: clamp(22px, 3vw, 32px);
    border-radius: 20px;
    background: radial-gradient(circle at 92% 10%, rgba(253, 230, 138, .18), transparent 26%), linear-gradient(135deg, #111827, #064e3b 64%, #0f766e);
    color: #fff;
    box-shadow: 0 22px 48px -36px rgba(4, 120, 87, .95);
}

.recharge-confirm-icon,
.customer-form-hero-icon {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 17px;
    background: rgba(255, 255, 255, .1);
    color: #a7f3d0;
    font-size: 23px;
}

.recharge-confirm-hero > div > span,
.customer-form-hero-title > div > span {
    display: block;
    margin-bottom: 4px;
    color: #5eead4;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.recharge-confirm-hero h1,
.recharge-confirm-hero p,
.customer-form-hero h1,
.customer-form-hero p { margin: 0; }

.recharge-confirm-hero h1,
.customer-form-hero h1 {
    color: #fff;
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 750;
    letter-spacing: -.035em;
}

.recharge-confirm-hero p,
.customer-form-hero p {
    max-width: 680px;
    margin-top: 5px;
    color: rgba(255, 255, 255, .66);
    font-size: 12px;
    line-height: 1.55;
}

.recharge-confirm-step {
    padding: 9px 13px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 12px;
    background: rgba(15, 23, 42, .24);
    color: rgba(255, 255, 255, .64);
    font-size: 11px;
    font-weight: 700;
}

.recharge-confirm-step strong { color: #fff; font-size: 19px; }

.recharge-confirm-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    align-items: start;
    gap: 17px;
}

.recharge-confirm-main { display: grid; min-width: 0; gap: 17px; }

.recharge-review-card,
.recharge-payment-card,
.customer-form-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.recharge-review-card > header,
.customer-form-card > header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.recharge-review-card > header > span:first-child,
.customer-form-card > header > span:first-child {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-700);
}

.recharge-review-card > header > div,
.customer-form-card > header > div { min-width: 0; flex: 1 1 auto; }

.recharge-review-card header small {
    display: block;
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.recharge-review-card header h2,
.customer-form-card header h2,
.customer-form-card header p { margin: 0; }

.recharge-review-card header h2,
.customer-form-card header h2 {
    overflow: hidden;
    color: var(--text);
    font-size: 15px;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recharge-review-card > header > a { flex: 0 0 auto; font-size: 11px; font-weight: 650; }

.recharge-review-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 8px 18px;
}

.recharge-review-list > div {
    display: flex;
    min-width: 0;
    align-items: baseline;
    justify-content: space-between;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.recharge-review-list > div:nth-last-child(-n + 2) { border-bottom: 0; }
.recharge-review-list > div:nth-child(odd) { padding-right: 18px; }
.recharge-review-list > div:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--border); }
.recharge-review-list dt { color: var(--text-muted); font-size: 10px; font-weight: 620; }

.recharge-review-list dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 11px;
    font-weight: 680;
    text-align: right;
}

.recharge-review-list dd.is-accent { color: var(--accent-700); }

.recharge-payment-card { position: sticky; top: 72px; padding: 20px; }
.recharge-payment-heading { margin-bottom: 18px; }

.recharge-payment-heading span {
    color: var(--accent-700);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.recharge-payment-heading h2 { margin: 3px 0 0; color: var(--text); font-size: 19px; font-weight: 750; }
.recharge-payment-card > label { display: block; margin-bottom: 7px; color: var(--text-muted); font-size: 10px; font-weight: 680; }

.recharge-payment-select,
.customer-form-control-icon,
.customer-password-control,
.customer-coordinate-control { position: relative; display: flex; min-width: 0; align-items: center; }

.recharge-payment-select > i,
.customer-form-control-icon > i { position: absolute; left: 12px; z-index: 1; color: var(--text-muted); pointer-events: none; }

.recharge-payment-select select {
    width: 100%;
    height: 42px;
    padding: 0 35px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: 0;
    background: var(--surface-2);
    color: var(--text);
}

.recharge-payment-select select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.recharge-charge-lines { margin-top: 20px; padding: 7px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.recharge-charge-lines > div,
.recharge-charge-total { display: flex; justify-content: space-between; gap: 15px; padding: 8px 0; color: var(--text-muted); font-size: 11px; }

.recharge-charge-lines strong { color: var(--text); font-weight: 680; }
.recharge-charge-subtotal { margin-top: 4px; border-top: 1px dashed var(--border); }
.recharge-charge-total { align-items: baseline; padding: 16px 0 13px; color: var(--text); font-weight: 720; }
.recharge-charge-total strong { color: var(--accent-700); font-size: 21px; letter-spacing: -.02em; }

.recharge-zero-notice {
    margin-bottom: 13px;
    padding: 10px 11px;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent-700);
    font-size: 10px;
    line-height: 1.45;
}

.recharge-confirm-submit { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: center; gap: 7px; border-radius: 10px; }
.recharge-confirm-cancel { display: block; margin-top: 11px; color: var(--text-muted); font-size: 10px; font-weight: 620; text-align: center; }

/* =====================================================================
   Shared customer add / edit workspace
   ===================================================================== */

.customer-form-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 17px;
    padding: clamp(22px, 3vw, 30px);
    border-radius: 20px;
    background: radial-gradient(circle at 90% 10%, rgba(147, 197, 253, .18), transparent 28%), linear-gradient(135deg, #111827, #164e63 66%, #0e7490);
    color: #fff;
    box-shadow: 0 22px 48px -36px rgba(14, 116, 144, .95);
}

.customer-form-hero-title { display: flex; min-width: 0; align-items: center; gap: 16px; }

.customer-form-hero > .btn {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    flex: 0 0 auto;
    gap: 7px;
    margin: 0;
    border-color: rgba(255, 255, 255, .18) !important;
    background: rgba(255, 255, 255, .1) !important;
    color: #fff !important;
}

.customer-form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    align-items: start;
    gap: 17px;
}

.customer-form-main,
.customer-form-sidebar { display: flex; min-width: 0; flex-direction: column; gap: 17px; }
.customer-form-card header p { margin-top: 3px; color: var(--text-muted); font-size: 10px; line-height: 1.4; }

/* Row gap is deliberately larger than the column gap: each field's label sits directly
   below the PREVIOUS row's input, so the row gap is the only thing separating them. At the
   old uniform 15px those labels read as touching the box above (reported 2026-08-09). */
.customer-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 15px; padding: 18px; }
.customer-form-field { display: block; min-width: 0; margin: 0; }
.customer-form-field-wide { grid-column: 1 / -1; }

/* City / District / State / Zip are short values and read better four-up. This modifier
   previously had NO rules at all, so the address block rendered two-up like every other
   grid. Collapses on breakpoints this file already uses (900, then 700 -> 1fr below). */
.customer-address-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 12px, not 10px: below ~12px these labels are hard to read, and combined with the old
   tight rhythm they collided with the input above. Paired with the row gap above. */
.customer-form-field > span,
.customer-existing-fields label > span,
.customer-welcome-methods > span { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: 12px; font-weight: 680; line-height: 1.35; }
.customer-form-field > span b { color: var(--rose); }

.customer-form-field input,
.customer-form-field select,
.customer-form-field textarea,
.customer-existing-fields input,
.customer-new-field-row input {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: 0;
    background: var(--surface-2);
    color: var(--text);
    font-size: 12px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.customer-form-field input,
.customer-form-field select,
.customer-existing-fields input,
.customer-new-field-row input { height: 41px; padding: 0 12px; }
.customer-form-field textarea { min-height: 78px; padding: 10px 12px; resize: vertical; }

.customer-form-field input:focus,
.customer-form-field select:focus,
.customer-form-field textarea:focus,
.customer-existing-fields input:focus,
.customer-new-field-row input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }

.customer-form-field small { display: block; margin-top: 6px; color: var(--text-muted); font-size: 9px; font-weight: 500; }
.customer-form-control-icon input { padding-left: 35px; }
.customer-password-control input { padding-right: 43px; }

.customer-password-control button {
    position: absolute;
    right: 4px;
    display: grid;
    width: 34px;
    height: 33px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    outline: 0;
    background: transparent;
    color: var(--text-muted);
}

.customer-password-control button:hover,
.customer-password-control button:focus { background: var(--surface-3); color: var(--accent-700); }

.customer-network-divider { display: flex; align-items: center; gap: 10px; margin: 0 18px; padding: 10px 12px; border-radius: 9px; background: var(--surface-2); }
.customer-network-divider span { color: var(--accent-700); font-size: 10px; font-weight: 780; letter-spacing: .06em; }
.customer-network-divider p { margin: 0; color: var(--text-muted); font-size: 9px; }
.customer-field-warning { color: var(--rose) !important; font-size: 9px; }
.customer-coordinate-control { align-items: stretch; }
.customer-coordinate-control input { border-radius: 10px 0 0 10px; }

.customer-coordinate-control button {
    flex: 0 0 auto;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-left: 0;
    border-radius: 0 10px 10px 0;
    background: var(--surface-3);
    color: var(--link);
    font-size: 10px;
    font-weight: 680;
}

.customer-form-map { height: 260px; margin: 0 18px 18px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.customer-form-map .leaflet-control-attribution { color: #475569; font-size: 8px; }
.customer-photo-card { padding-bottom: 16px; }

.customer-photo-card > img {
    display: block;
    width: 104px;
    height: 104px;
    margin: 18px auto 13px;
    border: 4px solid var(--surface-3);
    border-radius: 25px;
    object-fit: cover;
    box-shadow: var(--shadow);
}

.customer-file-control { display: block; margin: 0 16px 10px; cursor: pointer; }
.customer-file-control input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

.customer-file-control span {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px dashed var(--border);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--link);
    font-size: 10px;
    font-weight: 680;
}

.customer-file-control:focus-within span,
.customer-file-control:hover span { border-color: var(--accent); background: var(--accent-soft); }

.customer-checkbox-row { display: flex; align-items: flex-start; gap: 8px; margin: 0 16px; color: var(--text-muted); font-size: 10px; font-weight: 560; line-height: 1.4; }
.customer-checkbox-row input,
.customer-delete-field input,
.customer-welcome-methods input { margin: 2px 0 0; accent-color: var(--accent-600); }
.customer-remove-photo { display: block; margin: 11px 16px 0; color: var(--rose); font-size: 10px; font-weight: 650; text-align: center; }

.customer-status-help { margin: 0 16px 16px; padding: 10px 11px; border-radius: 9px; background: var(--surface-2); }
.customer-status-help p { margin: 0 0 6px; color: var(--text-muted); font-size: 9px; line-height: 1.45; }
.customer-status-help p:last-child { margin-bottom: 0; }
.customer-status-help strong { color: var(--text); }

.customer-welcome-toggle { margin-top: 16px; margin-bottom: 16px; padding: 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-700); }
.customer-welcome-methods { display: grid; gap: 7px; margin: 0 16px 16px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; outline: 0; background: var(--surface-2); }
.customer-welcome-methods[hidden] { display: none; }
.customer-welcome-methods label { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--text); font-size: 10px; font-weight: 600; }

.customer-existing-fields,
.customer-new-fields { display: grid; gap: 10px; padding: 16px 16px 0; }

.customer-existing-fields > div,
.customer-new-field-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.customer-existing-fields label { min-width: 0; margin: 0; }
.customer-delete-field { display: flex; min-height: 41px; align-items: center; gap: 5px; color: var(--rose); }
.customer-delete-field > span { margin: 0 !important; color: inherit !important; }
.customer-new-field-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; }

.customer-remove-field { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 8px; background: rgba(244, 63, 94, .1); color: var(--rose); }
.customer-add-field { margin: 14px 16px 16px; }

.customer-form-savebar {
    position: sticky;
    bottom: 12px;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 17px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: color-mix(in srgb, var(--surface) 91%, transparent);
    box-shadow: 0 15px 38px -22px rgba(15, 23, 42, .45);
    backdrop-filter: blur(12px);
}

.customer-form-savebar .btn { display: inline-flex; min-height: 40px; align-items: center; justify-content: center; gap: 7px; margin: 0; }

@supports not (background: color-mix(in srgb, white 50%, transparent)) {
    .customer-form-savebar { background: var(--surface); }
}

@media (max-width: 1000px) {
    .recharge-confirm-layout,
    .customer-form-layout { grid-template-columns: 1fr; }
    .recharge-payment-card { position: static; }
    .customer-form-sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
    .customer-attributes-card:last-child { grid-column: 1 / -1; }
}

/* Address block: four-up is too tight below ~900. Must stay ABOVE the 700px block, which
   drops every .customer-form-grid to a single column and wins there by source order. */
@media (max-width: 900px) {
    .customer-address-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .recharge-confirm-hero,
    .customer-form-hero { border-radius: 17px; }
    .recharge-review-list { grid-template-columns: 1fr; }
    .recharge-review-list > div,
    .recharge-review-list > div:nth-child(odd),
    .recharge-review-list > div:nth-child(even) { padding-right: 0; padding-left: 0; border-left: 0; border-bottom: 1px solid var(--border); }
    .recharge-review-list > div:nth-last-child(2) { border-bottom: 1px solid var(--border); }
    .recharge-review-list > div:last-child { border-bottom: 0; }
    .customer-form-grid { grid-template-columns: 1fr; }
    .customer-form-field-wide { grid-column: auto; }
    .customer-form-sidebar { display: flex; }
    .customer-form-hero { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
    .recharge-confirm-hero { grid-template-columns: auto minmax(0, 1fr); padding: 20px 17px; }
    .recharge-confirm-step { grid-column: 1 / -1; justify-self: start; }
    .recharge-confirm-icon,
    .customer-form-hero-icon { width: 48px; height: 48px; border-radius: 14px; font-size: 19px; }
    .recharge-review-card > header { align-items: flex-start; flex-wrap: wrap; }
    .recharge-review-card > header > a,
    .recharge-review-card > header > .customer-status-badge { margin-left: 48px; }
    .recharge-review-list > div { align-items: flex-start; flex-direction: column; gap: 3px; }
    .recharge-review-list dd { text-align: left; }
    .recharge-payment-card { padding: 17px; }
    .customer-form-hero { padding: 20px 17px; }
    .customer-form-hero-title { align-items: flex-start; }
    .customer-form-hero > .btn,
    .customer-form-savebar .btn { width: 100%; }
    .customer-form-grid { padding: 15px; }
    .customer-network-divider { align-items: flex-start; flex-direction: column; margin: 0 15px; }
    .customer-coordinate-control { align-items: stretch; flex-direction: column; gap: 7px; }
    .customer-coordinate-control input,
    .customer-coordinate-control button { min-height: 41px; border: 1px solid var(--border); border-radius: 10px; }
    .customer-form-map { height: 220px; margin: 0 15px 15px; }
    .customer-new-field-row { grid-template-columns: 1fr 32px; }
    .customer-new-field-row input:first-child { grid-column: 1 / -1; }
    .customer-form-savebar { position: static; align-items: stretch; flex-direction: column-reverse; }
}

/* =====================================================================
   Shared modern admin workspaces
   Routes without a dedicated modern template use this scoped layer.
   ===================================================================== */

body.admin-modern-workspace .content-wrapper > .content-header {
    padding: 22px 22px 5px;
}

body.admin-modern-workspace .content-wrapper > .content-header > h1 {
    position: relative;
    display: flex;
    min-height: 108px;
    align-items: center;
    gap: 16px;
    margin: 0 auto;
    padding: 24px clamp(21px, 3vw, 34px);
    overflow: hidden;
    border-radius: 20px;
    background:
        radial-gradient(circle at 91% 5%, rgba(94, 234, 212, .2), transparent 28%),
        linear-gradient(135deg, #111827, #164e63 66%, #0f766e);
    color: #fff;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 760;
    letter-spacing: -.035em;
    line-height: 1.15;
    box-shadow: 0 22px 48px -36px rgba(14, 116, 144, .9);
}

body.admin-modern-workspace .content-wrapper > .content-header > h1::before {
    display: inline-grid;
    width: 54px;
    height: 54px;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 16px;
    background: rgba(255, 255, 255, .1);
    color: #a7f3d0;
    content: "\f085";
    font-family: FontAwesome;
    font-size: 20px;
    letter-spacing: normal;
}

body.admin-route-plan .content-wrapper > .content-header > h1::before { content: "\f0e7"; }
body.admin-route-maps .content-wrapper > .content-header > h1::before { content: "\f041"; }
body.admin-route-reports .content-wrapper > .content-header > h1::before { content: "\f080"; }
body.admin-route-message .content-wrapper > .content-header > h1::before { content: "\f0e0"; }
body.admin-route-routers .content-wrapper > .content-header > h1::before,
body.admin-route-pool .content-wrapper > .content-header > h1::before { content: "\f1eb"; }
body.admin-route-pages .content-wrapper > .content-header > h1::before { content: "\f15c"; }
body.admin-route-settings .content-wrapper > .content-header > h1::before,
body.admin-route-customfield .content-wrapper > .content-header > h1::before { content: "\f013"; }
body.admin-route-widgets .content-wrapper > .content-header > h1::before { content: "\f00a"; }
body.admin-route-paymentgateway .content-wrapper > .content-header > h1::before { content: "\f09d"; }
body.admin-route-logs .content-wrapper > .content-header > h1::before { content: "\f1da"; }
body.admin-route-plugin .content-wrapper > .content-header > h1::before { content: "\f1e6"; }

body.admin-modern-workspace .content-wrapper > .content {
    max-width: 1484px;
    margin: 0 auto;
    padding: 16px 22px 26px;
}

body.admin-modern-workspace .content > .row,
body.admin-modern-workspace .content > form > .row {
    margin-right: -8px;
    margin-left: -8px;
}

body.admin-modern-workspace .content > .row > [class*="col-"],
body.admin-modern-workspace .content > form > .row > [class*="col-"] {
    padding-right: 8px;
    padding-left: 8px;
}

body.admin-modern-workspace .content .panel,
body.admin-modern-workspace .content .box,
body.admin-modern-workspace .content .card {
    border: 1px solid var(--border) !important;
    border-top-width: 1px !important;
    border-radius: 16px !important;
    background: var(--surface) !important;
    color: var(--text);
    box-shadow: var(--shadow) !important;
}

body.admin-modern-workspace .content .panel > .panel-heading,
body.admin-modern-workspace .content .box > .box-header,
body.admin-modern-workspace .content .card > .card-header {
    min-height: 58px;
    padding: 15px 18px;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
    background: var(--surface-2) !important;
    color: var(--text) !important;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.35;
}

body.admin-modern-workspace .content .panel > .panel-body,
body.admin-modern-workspace .content .box > .box-body,
body.admin-modern-workspace .content .card > .card-body {
    padding: clamp(16px, 2.2vw, 24px);
    background: var(--surface);
    color: var(--text);
}

body.admin-modern-workspace .content .panel > .panel-footer,
body.admin-modern-workspace .content .box > .box-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text-muted);
}

body.admin-modern-workspace .panel-heading .pull-right,
body.admin-modern-workspace .box-header .pull-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

body.admin-modern-workspace .panel-heading .btn,
body.admin-modern-workspace .box-header .btn {
    margin-top: -4px;
    margin-bottom: -4px;
}

body.admin-modern-workspace .md-whiteframe-z1 {
    display: flow-root;
    margin-bottom: 18px !important;
    padding: 14px !important;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-2);
    box-shadow: none;
}

body.admin-modern-workspace .form-group {
    margin-bottom: 0;
    padding-top: 13px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--border);
}

body.admin-modern-workspace .form-group:last-child {
    border-bottom: 0;
}

body.admin-modern-workspace .control-label,
body.admin-modern-workspace .form-label,
body.admin-modern-workspace form > label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 680;
    line-height: 1.45;
}

body.admin-modern-workspace .form-control,
body.admin-modern-workspace .select2-selection,
body.admin-modern-workspace .input-group-addon {
    min-height: 41px;
    border-color: var(--border) !important;
    background: var(--surface-2) !important;
    color: var(--text) !important;
}

body.admin-modern-workspace .form-control,
body.admin-modern-workspace .select2-selection {
    border-radius: 9px !important;
}

body.admin-modern-workspace .input-group > .form-control:not(:first-child):not(:last-child) {
    border-radius: 0 !important;
}

body.admin-modern-workspace textarea.form-control {
    min-height: 112px;
    resize: vertical;
    line-height: 1.55;
}

body.admin-modern-workspace .help-block,
body.admin-modern-workspace .text-muted {
    color: var(--text-muted) !important;
    line-height: 1.55;
}

body.admin-modern-workspace input[type="checkbox"],
body.admin-modern-workspace input[type="radio"] {
    accent-color: var(--accent-600);
}

body.admin-modern-workspace .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    border: 0;
    border-radius: 12px;
    background: var(--surface);
    scrollbar-color: var(--border-strong) transparent;
}

body.admin-modern-workspace .table {
    margin-bottom: 0;
    background: var(--surface);
    color: var(--text);
}

body.admin-modern-workspace .table > thead > tr > th {
    padding: 11px 12px;
    border-color: var(--border) !important;
    background: var(--surface-3) !important;
    color: var(--text-muted) !important;
    font-size: 9px;
    font-weight: 760;
    letter-spacing: .045em;
    line-height: 1.35;
    text-transform: uppercase;
    white-space: nowrap;
}

body.admin-modern-workspace .table > tbody > tr > td {
    padding: 11px 12px;
    border-color: var(--border) !important;
    background: var(--surface) !important;
    color: var(--text) !important;
    font-size: 11px;
    line-height: 1.45;
    vertical-align: middle;
}

body.admin-modern-workspace .table > tbody > tr:hover > td {
    background: var(--accent-soft) !important;
}

body.admin-modern-workspace .table > tbody > tr.danger > td {
    background: rgba(244, 63, 94, .08) !important;
}

body.admin-modern-workspace .table td .btn {
    margin: 2px;
}

body.admin-modern-workspace .pagination {
    display: flex;
    float: none !important;
    flex-wrap: wrap;
    gap: 4px;
    margin: 14px 0 0;
}

body.admin-modern-workspace .pagination > li > a,
body.admin-modern-workspace .pagination > li > span {
    float: none;
    margin: 0;
    border-color: var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}

body.admin-modern-workspace .bs-callout {
    margin: 16px 0 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: 11px;
    background: var(--surface-2);
    color: var(--text-muted);
}

body.admin-modern-workspace .bs-callout h4 {
    margin-top: 0;
    color: var(--text);
    font-size: 13px;
}

/* Operational directories: plans, vouchers, routers, pools and activity lists */

body.admin-route-plan.admin-action-refill .content > .row > [class*="col-"],
body.admin-route-plan.admin-action-recharge .content > .row > [class*="col-"],
body.admin-action-mikrotik_import_ui .content > form > .row > [class*="col-"] {
    float: none;
    width: min(100%, 1060px);
    margin-right: auto;
    margin-left: auto;
}

body.admin-route-plan.admin-action-refill .panel-body,
body.admin-route-plan.admin-action-recharge .panel-body {
    padding-top: 12px !important;
}

body.admin-route-plan.admin-action-refill .form-horizontal,
body.admin-route-plan.admin-action-recharge .form-horizontal {
    max-width: 900px;
    margin: 0 auto;
}

body.admin-route-plan.admin-action-list .panel-body > .row,
body.admin-route-plan.admin-action-voucher .panel-body > .row,
body.admin-route-routers .panel-body > .row,
body.admin-route-pool .panel-body > .row,
body.admin-route-logs .panel-body > .row {
    margin-right: -6px;
    margin-left: -6px;
}

body.admin-route-plan.admin-action-list #site-search .row,
body.admin-route-plan.admin-action-voucher #site-search .row {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 9px;
    padding: 0 !important;
}

body.admin-route-plan.admin-action-list #site-search [class*="col-"],
body.admin-route-plan.admin-action-voucher #site-search [class*="col-"] {
    float: none;
    width: auto;
    padding: 0;
}

.router-sensitive-cell {
    min-width: 116px;
    cursor: help;
    outline: 0;
}

.router-sensitive-cell > span {
    display: inline-block;
    filter: blur(5px);
    opacity: .62;
    transition: filter .16s ease, opacity .16s ease;
    user-select: none;
}

.router-sensitive-cell:hover > span,
.router-sensitive-cell:focus > span {
    filter: none;
    opacity: 1;
    user-select: text;
}

.router-sensitive-cell:focus {
    box-shadow: inset 0 0 0 2px var(--accent);
}

/* Map workspaces */

.modern-map-workspace {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.modern-map-toolbar {
    padding: 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.modern-map-search {
    width: min(100%, 680px);
}

.modern-map-canvas {
    z-index: 1;
    width: 100%;
    min-height: 520px;
    height: min(70vh, 760px);
    height: min(70dvh, 760px);
    background: var(--surface-3);
}

.modern-map-pagination {
    display: flow-root;
    padding: 0 14px 14px;
    border-top: 1px solid var(--border);
}

.modern-map-workspace .leaflet-popup-content-wrapper,
.modern-map-workspace .leaflet-popup-tip {
    background: var(--surface);
    color: var(--text);
}

/* Reports */

body.admin-route-reports .content > .row {
    display: grid;
    grid-template-columns: minmax(245px, 310px) minmax(0, 1fr);
    gap: 14px;
    margin: 0;
}

body.admin-route-reports .content > .row > [class*="col-"] {
    float: none;
    width: auto;
    padding: 0;
}

body.admin-route-reports .box-header[onclick] {
    cursor: pointer;
}

body.admin-route-reports #filter_box label {
    display: block;
    margin: 10px 0 5px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
}

body.admin-route-reports #filter_box .select2-container {
    width: 100% !important;
}

body.admin-route-reports #chart_area .box-body {
    overflow: hidden;
}

/* Messaging */

body.admin-route-message .content .panel {
    max-width: 1120px;
    margin-right: auto;
    margin-left: auto;
}

body.admin-action-send .panel-body > .form-horizontal {
    max-width: 980px;
    margin: 0 auto;
}

.bulk-message-page .bulk-message-compose,
.bulk-message-history {
    max-width: 1180px !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

.bulk-message-history-table {
    max-height: 520px;
}

.bulk-message-history #historyTable td:nth-child(4) {
    min-width: 240px;
    max-width: 430px;
    overflow-wrap: anywhere;
    white-space: normal;
}

.bulk-message-page #status .alert,
.bulk-message-history #status .alert {
    border-radius: 10px;
}

/* System logs */

.system-log-description {
    min-width: 260px;
    max-width: 620px;
}

.system-log-description > div {
    max-height: 88px;
    overflow: auto;
    overflow-wrap: anywhere;
    white-space: normal;
    scrollbar-width: thin;
}

/* Shared content-page editor */

.modern-page-editor > .row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 330px);
    gap: 15px;
    margin: 0;
}

.modern-page-editor > .row > [class*="col-"] {
    float: none;
    width: auto;
    padding: 0;
}

.modern-page-editor > .row > .col-md-12 {
    grid-column: 1 / -1;
}

.modern-page-editor .note-editor {
    margin: 0;
    border: 0;
    background: var(--surface);
}

.modern-page-editor .note-toolbar {
    border-color: var(--border);
    background: var(--surface-2);
}

.modern-page-editor .note-editable {
    min-height: 430px;
    background: var(--surface) !important;
    color: var(--text) !important;
}

.modern-page-editor .col-md-4 > .panel {
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease;
}

.modern-page-editor .col-md-4 > .panel:hover,
.modern-page-editor .col-md-4 > .panel:focus-within {
    border-color: var(--accent) !important;
    transform: translateY(-2px);
}

/* Settings and widget management */

body.admin-route-settings .content > form,
body.admin-route-customfield .content > form {
    max-width: 1240px;
    margin: 0 auto;
}

body.admin-route-settings.admin-action-localisation .content > .row > [class*="col-"],
body.admin-route-settings.admin-action-maintenance .content > .row > [class*="col-"],
body.admin-route-settings.admin-action-dbstatus .content > .row,
body.admin-route-settings.admin-action-users .content > .row,
body.admin-route-customfield .content > form,
body.admin-route-settings.admin-action-miscellaneous .content > form,
body.admin-route-settings.admin-action-notifications .content > form {
    max-width: 1240px;
    margin-right: auto;
    margin-left: auto;
}

body.admin-route-settings.admin-action-localisation .content > .row > [class*="col-"] ,
body.admin-route-settings.admin-action-maintenance .content > .row > [class*="col-"] {
    float: none;
    width: 100%;
}

body.admin-route-settings.admin-action-app .content > form > .panel {
    margin-bottom: 10px;
    overflow: hidden;
}

body.admin-route-settings.admin-action-app .content > form > .panel > .panel-heading {
    position: relative;
    min-height: 59px;
    padding: 0;
}

body.admin-route-settings.admin-action-app .panel-title {
    margin: 0;
    font-size: 13px !important;
}

body.admin-route-settings.admin-action-app .panel-title > a {
    display: flex;
    min-height: 58px;
    align-items: center;
    padding: 15px 50px 15px 18px;
    color: var(--text);
}

body.admin-route-settings.admin-action-app .panel-title > a::after {
    position: absolute;
    top: 19px;
    right: 20px;
    color: var(--text-muted);
    content: "\f078";
    font-family: FontAwesome;
    font-size: 10px;
}

body.admin-route-settings.admin-action-app .panel-collapse > .panel-body {
    padding: 10px clamp(16px, 2.4vw, 28px) 22px;
}

body.admin-route-settings.admin-action-app .bs-callout {
    max-width: 1240px;
    margin-right: auto;
    margin-left: auto;
}

body.admin-route-widgets .content > .nav-tabs {
    display: flex;
    margin-bottom: 14px;
    padding: 5px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

body.admin-route-widgets .nav-tabs > li {
    flex: 1 0 auto;
}

body.admin-route-widgets .nav-tabs > li > a {
    margin: 0;
    border: 0 !important;
    border-radius: 8px;
    color: var(--text-muted);
}

body.admin-route-widgets .nav-tabs > li.active > a {
    background: var(--accent-soft) !important;
    color: var(--accent-700) !important;
}

body.admin-route-widgets .panel .panel {
    margin-bottom: 10px;
    box-shadow: none !important;
}

body.admin-route-paymentgateway .content > form > .row > .col-md-6 {
    float: none;
    width: min(100%, 820px);
    margin: 0 auto;
}

body.admin-route-paymentgateway .table td:first-child {
    width: 42px;
}

/* Plugin workspaces */

body.admin-route-plugin .content > .panel,
body.admin-route-plugin .content > form,
body.admin-route-plugin .content > .mikrotik-monitor-page,
body.admin-route-plugin .content > .hotspot-settings-workspace {
    max-width: 1380px;
    margin-right: auto;
    margin-left: auto;
}

.hotspot-settings-workspace {
    color: var(--text);
}

.hotspot-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.hotspot-settings-header h6 {
    margin: 0;
    color: var(--text) !important;
    font-size: 18px;
    font-weight: 750;
}

.hotspot-settings-header nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.hotspot-settings-header .breadcrumb {
    display: none;
}

.hotspot-settings-workspace > .content {
    min-height: 0;
    padding: 0;
}

.hotspot-settings-workspace .card {
    margin-bottom: 15px;
    overflow: hidden;
}

.hotspot-settings-config-card {
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    background: var(--surface);
}

.hotspot-settings-config-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--accent-soft), var(--surface) 72%);
}

.hotspot-settings-config-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(135deg, #10b981, #047857);
    box-shadow: 0 9px 22px rgba(5, 150, 105, .2);
    font-size: 18px;
}

.hotspot-settings-config-heading h3 {
    margin: 0 0 4px;
    color: var(--text);
    font-size: 17px;
    font-weight: 750;
}

.hotspot-settings-config-heading p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.5;
}

.hotspot-settings-config-card .card-body {
    padding: 26px 24px;
}

.hotspot-settings-form {
    width: min(100%, 880px);
    margin: 0 auto;
}

.hotspot-settings-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    /* Row gap separates a label from the PREVIOUS row's input, so it carries more weight
       than the column gap. Raised from 22px after labels read as touching the box above
       (reported 2026-08-09, same symptom as .customer-form-grid). */
    gap: 30px 28px;
}

.hotspot-settings-workspace .hotspot-settings-form .hotspot-settings-field {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    min-width: 0;
    margin-bottom: 0;
}

.hotspot-settings-form .form-label {
    display: flex;
    align-items: center;
    gap: 7px;
    position: static;
    width: 100%;
    min-height: 20px;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.hotspot-settings-form .form-label .fa {
    width: 18px;
    color: var(--accent-600);
    text-align: center;
}

.hotspot-settings-form .form-control {
    display: block;
    flex: 0 0 auto;
    box-sizing: border-box !important;
    width: 100%;
    max-width: 100% !important;
    min-width: 0;
    height: 46px;
    border-color: var(--border);
    border-radius: 11px;
    background: var(--surface-2);
}

.hotspot-settings-form .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.hotspot-settings-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.hotspot-settings-form-actions .btn {
    min-width: 170px;
}

.hotspot-settings-workspace .mb-3 { margin-bottom: 15px; }
.hotspot-settings-workspace .mb-4 { margin-bottom: 20px; }
.hotspot-settings-workspace .me-3 { margin-right: 12px; }
.hotspot-settings-workspace .d-flex { display: flex; }
.hotspot-settings-workspace .align-items-center { align-items: center; }
.hotspot-settings-workspace .justify-content-between { justify-content: space-between; }
.hotspot-settings-workspace .fw-bold { font-weight: 700; }
.hotspot-settings-workspace .text-white { color: #fff !important; }
.hotspot-settings-workspace .bg-info { background: #0891b2 !important; }
.hotspot-settings-workspace .rounded { border-radius: 10px; }
.hotspot-settings-workspace .p-3 { padding: 12px; }
.hotspot-settings-workspace .shadow { box-shadow: var(--shadow-sm); }

body.admin-action-jobs_monitor_ui .panel-body > p:first-child {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

body.admin-action-jobs_monitor_ui .panel-body > p:first-child .btn {
    margin: 0;
}

body.admin-action-mpesa_transactions .form-inline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

body.admin-action-mpesa_transactions .form-inline .form-group {
    min-width: min(100%, 340px);
    padding: 0;
    border: 0;
}

body.admin-action-mpesa_transactions .form-inline .form-control {
    width: 100%;
    min-width: 0 !important;
}

body.admin-action-mikrotik_monitor_ui .mikrotik-monitor-page {
    padding: 0 !important;
}

body.admin-action-mikrotik_monitor_ui .monitor-router-tabs {
    display: flex;
    padding: 5px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

body.admin-action-mikrotik_monitor_ui .monitor-router-tabs > li > a {
    border: 0 !important;
    border-radius: 8px;
    color: var(--text-muted);
    white-space: nowrap;
}

body.admin-action-mikrotik_monitor_ui .monitor-router-tabs > li.active > a {
    background: var(--accent-soft) !important;
    color: var(--accent-700) !important;
}

@media (max-width: 1199px) {
    .hotspot-settings-form {
        width: min(100%, 620px);
    }

    .hotspot-settings-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 991px) {
    body.admin-route-plan.admin-action-list #site-search .row,
    body.admin-route-plan.admin-action-voucher #site-search .row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.admin-route-reports .content > .row {
        grid-template-columns: 1fr;
    }

    body.admin-route-reports #filter_box.hidden-xs.hidden-sm.hidden-md {
        display: block !important;
    }

    .modern-page-editor > .row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    body.admin-modern-workspace .content-wrapper > .content-header {
        padding: 15px 12px 3px;
    }

    body.admin-modern-workspace .content-wrapper > .content-header > h1 {
        min-height: 86px;
        padding: 18px;
        border-radius: 16px;
        font-size: 24px;
    }

    body.admin-modern-workspace .content-wrapper > .content-header > h1::before {
        width: 46px;
        height: 46px;
        border-radius: 13px;
    }

    body.admin-modern-workspace .content-wrapper > .content {
        padding: 12px;
    }

    body.admin-modern-workspace .content .panel > .panel-heading,
    body.admin-modern-workspace .content .box > .box-header,
    body.admin-modern-workspace .content .card > .card-header {
        min-height: 52px;
        padding: 13px 14px;
    }

    body.admin-modern-workspace .content .panel > .panel-body,
    body.admin-modern-workspace .content .box > .box-body,
    body.admin-modern-workspace .content .card > .card-body {
        padding: 14px 12px;
    }

    body.admin-modern-workspace .form-horizontal .control-label {
        padding-top: 0;
        text-align: left;
    }

    body.admin-modern-workspace .table-responsive {
        margin-bottom: 0;
        border: 1px solid var(--border);
    }

    body.admin-modern-workspace .table {
        min-width: 680px;
    }

    body.admin-route-plan.admin-action-list #site-search .row,
    body.admin-route-plan.admin-action-voucher #site-search .row {
        grid-template-columns: 1fr;
    }

    .modern-map-canvas {
        min-height: 430px;
        height: 62vh;
        height: 62dvh;
    }

    .hotspot-settings-header {
        align-items: stretch;
        flex-direction: column;
    }

    .hotspot-settings-header nav,
    .hotspot-settings-header .btn {
        width: 100%;
    }

    .hotspot-settings-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    body.admin-modern-workspace .content-wrapper > .content-header > h1 {
        align-items: flex-start;
        flex-direction: column;
        font-size: 22px;
    }

    body.admin-modern-workspace .panel-heading .pull-right,
    body.admin-modern-workspace .box-header .pull-right {
        float: none !important;
        margin: 8px 0 0;
    }

    body.admin-modern-workspace .panel-heading .pull-right .btn,
    body.admin-modern-workspace .box-header .pull-right .btn,
    body.admin-modern-workspace .form-group .btn {
        white-space: normal;
    }

    body.admin-route-message .form-group .btn,
    body.admin-route-plan.admin-action-refill .form-group .btn,
    body.admin-route-plan.admin-action-recharge .form-group .btn {
        width: 100%;
        margin: 0 0 7px;
    }

    .hotspot-settings-config-heading,
    .hotspot-settings-config-card .card-body {
        padding-right: 16px;
        padding-left: 16px;
    }

    .hotspot-settings-form-actions .btn {
        width: 100%;
    }
}

/* =====================================================================
   Shared admin Add / Edit workspace
   Modernizes inherited core forms without duplicating their business markup.
   ===================================================================== */

body.admin-record-form .content-header,
body.admin-record-form .content {
    width: min(100%, 1280px);
    margin-right: auto;
    margin-left: auto;
}

/* =====================================================================
   Bandwidth profile directory
   ===================================================================== */

.bandwidth-directory-page {
    max-width: 1380px;
    margin: 0 auto;
}

.bandwidth-directory-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    padding: clamp(22px, 3vw, 32px);
    overflow: hidden;
    border-radius: 19px;
    background:
        radial-gradient(circle at 92% 7%, rgba(147, 197, 253, .2), transparent 27%),
        linear-gradient(135deg, #111827, #1e3a8a 67%, #2563eb);
    color: #fff;
    box-shadow: 0 20px 45px -35px rgba(37, 99, 235, .95);
}

.bandwidth-directory-hero-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 15px;
}

.bandwidth-directory-hero-icon {
    display: grid;
    width: 57px;
    height: 57px;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 16px;
    background: rgba(255, 255, 255, .1);
    color: #bfdbfe;
    font-size: 23px;
}

.bandwidth-directory-hero-title > div > span {
    display: block;
    margin-bottom: 4px;
    color: #93c5fd;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.bandwidth-directory-hero h1,
.bandwidth-directory-hero p {
    margin: 0;
}

.bandwidth-directory-hero h1 {
    overflow-wrap: anywhere;
    color: #fff;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 750;
    letter-spacing: -.03em;
    line-height: 1.2;
}

.bandwidth-directory-hero p {
    max-width: 620px;
    margin-top: 5px;
    color: rgba(255, 255, 255, .67);
    font-size: 12px;
    line-height: 1.55;
}

.bandwidth-directory-hero-actions .btn {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
}

.bandwidth-directory-hero-count {
    display: grid;
    min-width: 78px;
    place-items: center;
    padding: 10px 13px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 12px;
    background: rgba(15, 23, 42, .24);
}

.bandwidth-directory-hero-count span,
.bandwidth-directory-hero-count small {
    color: rgba(255, 255, 255, .58);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.bandwidth-directory-hero-count strong {
    color: #fff;
    font-size: 22px;
}

.bandwidth-directory-filter-card,
.bandwidth-directory-results {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.bandwidth-directory-filter-card {
    margin-bottom: 16px;
    padding: 14px;
}

.bandwidth-directory-filter-card form {
    display: grid;
    grid-template-columns: minmax(230px, 1fr) auto auto;
    align-items: end;
    gap: 9px;
}

.bandwidth-directory-filter-card label {
    grid-column: 1 / -1;
    margin: 0 0 -2px 2px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 680;
}

.bandwidth-directory-search {
    position: relative;
    min-width: 0;
}

.bandwidth-directory-search > i {
    position: absolute;
    top: 50%;
    left: 13px;
    z-index: 1;
    color: var(--text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.bandwidth-directory-search input {
    width: 100%;
    height: 41px;
    padding: 0 13px 0 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: 0;
    background: var(--surface-2);
    color: var(--text);
    font-size: 12px;
}

.bandwidth-directory-search input:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.bandwidth-directory-filter-card .btn {
    display: inline-flex;
    min-height: 41px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
}

.bandwidth-directory-results {
    overflow: hidden;
}

.bandwidth-directory-results-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 17px 19px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.bandwidth-directory-results-heading > div > span {
    display: block;
    margin-bottom: 3px;
    color: var(--accent-700);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.bandwidth-directory-results-heading h2,
.bandwidth-directory-results-heading p {
    margin: 0;
}

.bandwidth-directory-results-heading h2 {
    color: var(--text);
    font-size: 16px;
    font-weight: 750;
}

.bandwidth-directory-results-heading p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 10px;
}

.bandwidth-directory-results-heading > span {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-700);
    font-size: 9px;
    font-weight: 720;
}

.bandwidth-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: stretch;
    gap: 13px;
    padding: 17px;
}

.bandwidth-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 16px;
    border: 1px solid var(--border);
    border-top: 3px solid #3b82f6;
    border-radius: 14px;
    background: var(--surface-2);
}

.bandwidth-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.bandwidth-card-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.bandwidth-card-identity > span {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    background: rgba(59, 130, 246, .12);
    color: #2563eb;
}

html.dark .bandwidth-card-identity > span {
    color: #93c5fd;
}

.bandwidth-card-identity > div {
    min-width: 0;
}

.bandwidth-card-identity small {
    display: block;
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 720;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.bandwidth-card h3 {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 15px;
    font-weight: 750;
    line-height: 1.35;
}

.bandwidth-burst-badge {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    gap: 4px;
    padding: 5px 7px;
    border-radius: 999px;
    background: rgba(245, 158, 11, .14);
    color: #b45309;
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}

html.dark .bandwidth-burst-badge {
    color: #fcd34d;
}

.bandwidth-rate-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 15px;
}

.bandwidth-rate-grid > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
}

.bandwidth-rate-grid span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 680;
}

.bandwidth-rate-grid .is-download span i {
    color: #2563eb;
}

.bandwidth-rate-grid .is-upload span i {
    color: var(--accent-700);
}

.bandwidth-rate-grid strong {
    color: var(--text);
    font-size: 21px;
    font-weight: 780;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.bandwidth-rate-grid small {
    margin-left: 3px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 650;
}

.bandwidth-burst-summary {
    min-width: 0;
    margin-top: 10px;
    padding: 10px 11px;
    border-radius: 9px;
    background: var(--surface-3);
}

.bandwidth-burst-summary > span {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 720;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.bandwidth-burst-summary code,
.bandwidth-burst-summary strong {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 9px;
    font-weight: 620;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bandwidth-burst-summary code {
    padding: 0;
    background: transparent;
}

.bandwidth-burst-summary.is-empty strong {
    color: var(--text-muted);
}

.bandwidth-card-actions {
    position: relative;
    z-index: 2;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.bandwidth-card-actions .btn {
    display: inline-flex;
    flex: 1 1 0;
    min-height: 35px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 680;
    line-height: 1.2;
}

.bandwidth-card-actions .bandwidth-edit {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: var(--accent-contrast) !important;
}

.bandwidth-card-actions .bandwidth-edit:hover,
.bandwidth-card-actions .bandwidth-edit:focus {
    background: var(--accent-600) !important;
    border-color: var(--accent-600) !important;
    color: var(--accent-contrast) !important;
}

.bandwidth-card-actions .bandwidth-delete {
    background: #dc2626 !important;
    border-color: #dc2626 !important;
    color: #ffffff !important;
}

.bandwidth-card-actions .bandwidth-delete:hover,
.bandwidth-card-actions .bandwidth-delete:focus {
    background: #b91c1c !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
}

.bandwidth-directory-pagination {
    position: relative;
    z-index: 1;
    display: flow-root;
    clear: both;
    padding: 11px 17px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.bandwidth-directory-pagination .pagination {
    position: static !important;
    display: flex;
    float: none !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
}

.bandwidth-directory-pagination .pagination > li {
    display: block;
}

.bandwidth-directory-pagination .pagination > li > a,
.bandwidth-directory-pagination .pagination > li > span {
    float: none;
    margin: 0;
}

.bandwidth-directory-help {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 15px;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-2);
    color: var(--accent-700);
}

.bandwidth-directory-help strong,
.bandwidth-directory-help p {
    display: block;
    margin: 0;
}

.bandwidth-directory-help strong {
    color: var(--text);
    font-size: 12px;
}

.bandwidth-directory-help p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.5;
}

@media (max-width: 900px) {
    .bandwidth-directory-hero {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .bandwidth-directory-hero-count {
        grid-column: 1 / -1;
        display: flex;
        justify-content: flex-start;
        gap: 7px;
    }
}

@media (max-width: 650px) {
    .bandwidth-directory-hero {
        grid-template-columns: 1fr;
        padding: 21px 18px;
        border-radius: 17px;
    }

    .bandwidth-directory-hero-actions,
    .bandwidth-directory-hero-actions .btn {
        width: 100%;
    }

    .bandwidth-directory-filter-card form {
        grid-template-columns: 1fr;
    }

    .bandwidth-directory-filter-card .btn {
        width: 100%;
    }

    .bandwidth-card-grid {
        grid-template-columns: 1fr;
        padding: 12px;
    }
}

@media (max-width: 460px) {
    .bandwidth-directory-hero-title {
        align-items: flex-start;
    }

    .bandwidth-directory-hero-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
        font-size: 19px;
    }

    .bandwidth-directory-results-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .bandwidth-rate-grid {
        grid-template-columns: 1fr;
    }

    .bandwidth-card-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .bandwidth-card-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

body.admin-record-form .content-header {
    padding: 22px 22px 4px;
}

body.admin-record-form .content-header > h1 {
    position: relative;
    display: flex;
    min-height: 96px;
    align-items: center;
    gap: 15px;
    margin: 0;
    padding: 22px clamp(20px, 3vw, 32px);
    overflow: hidden;
    border-radius: 19px;
    background:
        radial-gradient(circle at 91% 5%, rgba(94, 234, 212, .18), transparent 27%),
        linear-gradient(135deg, #111827, #164e63 68%, #0f766e);
    color: #fff;
    font-size: clamp(24px, 3vw, 33px);
    font-weight: 760;
    letter-spacing: -.035em;
    line-height: 1.2;
    box-shadow: 0 22px 48px -36px rgba(14, 116, 144, .9);
}

body.admin-record-form .content-header > h1::before {
    display: inline-grid;
    width: 52px;
    height: 52px;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 15px;
    background: rgba(255, 255, 255, .1);
    color: #a7f3d0;
    content: "\f067";
    font-family: FontAwesome;
    font-size: 19px;
    letter-spacing: normal;
}

body.admin-record-form-edit .content-header > h1::before {
    content: "\f040";
}

body.admin-record-form .content > .row,
body.admin-record-form .content > form > .row {
    margin-right: -8px;
    margin-left: -8px;
}

body.admin-record-form .content > .row > [class*="col-"],
body.admin-record-form .content > form > .row > [class*="col-"] {
    padding-right: 8px;
    padding-left: 8px;
}

body.admin-record-form .content .panel {
    overflow: hidden;
    border-top-width: 1px !important;
    border-color: var(--border) !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 32px -26px rgba(15, 23, 42, .48) !important;
}

body.admin-record-form .content .panel:hover {
    box-shadow: 0 18px 38px -29px rgba(15, 23, 42, .55) !important;
}

body.admin-record-form .content .panel > .panel-heading {
    display: flex;
    min-height: 61px;
    align-items: center;
    gap: 11px;
    padding: 14px 18px;
    border-radius: 0 !important;
    background: var(--surface-2) !important;
    color: var(--text) !important;
    font-size: 15px;
    font-weight: 750;
    line-height: 1.35;
}

body.admin-record-form .content .panel > .panel-heading::before {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-700);
    content: "\f0ae";
    font-family: FontAwesome;
    font-size: 13px;
}

body.admin-record-form-add .content .panel > .panel-heading::before {
    content: "\f067";
}

body.admin-record-form .content .panel > .panel-body {
    padding: clamp(18px, 2.5vw, 26px);
}

body.admin-record-form .panel-body > .panel-heading {
    margin: 22px calc(clamp(18px, 2.5vw, 26px) * -1) 8px;
    padding: 13px clamp(18px, 2.5vw, 26px);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: var(--surface-2) !important;
    color: var(--text) !important;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: .055em;
    text-transform: uppercase;
}

body.admin-record-form .form-horizontal > .form-group,
body.admin-record-form .panel-body > .form-group {
    margin-right: 0;
    margin-bottom: 0;
    margin-left: 0;
    padding-top: 13px;
    padding-bottom: 13px;
    border-bottom: 1px solid var(--border);
}

body.admin-record-form .form-horizontal > .form-group:last-child,
body.admin-record-form .panel-body > .form-group:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

body.admin-record-form .form-horizontal .control-label {
    padding-top: 10px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 680;
    line-height: 1.45;
}

body.admin-record-form .form-horizontal .control-label .btn-link {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    margin: -4px 0 -4px 4px;
    padding: 0;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-700);
}

body.admin-record-form .form-horizontal .form-control,
body.admin-record-form .form-horizontal .select2-selection {
    min-height: 42px;
    border-radius: 10px !important;
    background: var(--surface-2) !important;
}

body.admin-record-form .form-horizontal textarea.form-control {
    min-height: 92px;
    line-height: 1.55;
}

body.admin-record-form .form-horizontal input[type="radio"],
body.admin-record-form .form-horizontal input[type="checkbox"] {
    accent-color: var(--accent-600);
}

body.admin-record-form .form-horizontal .radio-inline,
body.admin-record-form .form-horizontal .checkbox-inline {
    color: var(--text);
    line-height: 1.45;
}

body.admin-record-form .form-horizontal .help-block {
    margin-top: 7px;
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.55;
}

body.admin-record-form .form-horizontal .input-group-addon {
    min-width: 41px;
    font-size: 12px;
}

body.admin-record-form .form-horizontal .btn:not(.btn-xs) {
    min-height: 40px;
}

body.admin-record-form .form-horizontal .col-lg-offset-2 > .btn,
body.admin-record-form .form-horizontal .col-md-offset-2 > .btn {
    margin-right: 5px;
}

body.admin-record-form .form-horizontal pre,
body.admin-record-form .form-horizontal textarea[style*="Courier"] {
    border-color: var(--border);
    border-radius: 10px;
    background: var(--surface-3) !important;
    color: var(--text) !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    font-size: 12px;
    line-height: 1.55;
}

body.admin-record-form .select2-container {
    width: 100% !important;
}

.router-secret-control {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
}

.router-secret-control .form-control {
    padding-right: 44px;
}

.router-secret-control button {
    position: absolute;
    right: 4px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    outline: 0;
    background: transparent;
    color: var(--text-muted);
}

.router-secret-control button:hover,
.router-secret-control button:focus {
    background: var(--accent-soft);
    color: var(--accent-700);
}

@media (max-width: 767px) {
    body.admin-record-form .content-header {
        padding: 16px 12px 3px;
    }

    body.admin-record-form .content-header > h1 {
        min-height: 82px;
        padding: 18px;
        border-radius: 16px;
    }

    body.admin-record-form .content-header > h1::before {
        width: 45px;
        height: 45px;
        border-radius: 13px;
    }

    body.admin-record-form .content .panel > .panel-heading {
        min-height: 55px;
        padding: 12px 14px;
    }

    body.admin-record-form .content .panel > .panel-body {
        padding: 15px 13px;
    }

    body.admin-record-form .form-horizontal > .form-group,
    body.admin-record-form .panel-body > .form-group {
        padding-top: 11px;
        padding-bottom: 11px;
    }

    body.admin-record-form .form-horizontal .control-label {
        padding-top: 0;
    }
}

@media (max-width: 520px) {
    body.admin-record-form .content-header > h1 {
        align-items: flex-start;
        flex-direction: column;
        font-size: 23px;
    }

    body.admin-record-form .form-horizontal .col-lg-offset-2 > .btn,
    body.admin-record-form .form-horizontal .col-md-offset-2 > .btn,
    body.admin-record-form .router-form-actions .btn {
        width: 100%;
        margin: 0 0 7px;
    }
}

/* =====================================================================
   Configurable admin dashboard
   ===================================================================== */

body.admin-dashboard-shell .content-header {
    display: none;
}

body.admin-dashboard-shell .content {
    padding-top: 22px !important;
}

.admin-dashboard-page {
    max-width: 1440px;
    margin: 0 auto;
}

.admin-dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    padding: clamp(24px, 3.4vw, 36px);
    overflow: hidden;
    border-radius: 21px;
    background:
        radial-gradient(circle at 90% 8%, rgba(94, 234, 212, .2), transparent 27%),
        linear-gradient(135deg, #111827, #064e3b 62%, #0f766e);
    color: #fff;
    box-shadow: 0 24px 52px -38px rgba(4, 120, 87, .95);
}

.admin-dashboard-hero-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 16px;
}

.admin-dashboard-hero-icon {
    display: grid;
    width: 61px;
    height: 61px;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 18px;
    background: rgba(255, 255, 255, .1);
    color: #a7f3d0;
    font-size: 24px;
}

.admin-dashboard-hero-title > div > span {
    display: block;
    margin-bottom: 4px;
    color: #5eead4;
    font-size: 10px;
    font-weight: 760;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.admin-dashboard-hero h1,
.admin-dashboard-hero p {
    margin: 0;
}

.admin-dashboard-hero h1 {
    overflow-wrap: anywhere;
    color: #fff;
    font-size: clamp(25px, 3.2vw, 37px);
    font-weight: 760;
    letter-spacing: -.04em;
    line-height: 1.16;
}

.admin-dashboard-hero p {
    max-width: 660px;
    margin-top: 6px;
    color: rgba(255, 255, 255, .67);
    font-size: 12px;
    line-height: 1.55;
}

.admin-dashboard-hero-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-dashboard-hero-actions .btn {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    border-color: rgba(255, 255, 255, .16) !important;
    background: rgba(15, 23, 42, .25) !important;
    color: #fff !important;
}

.admin-dashboard-hero-actions .btn-primary {
    border-color: #10b981 !important;
    background: #10b981 !important;
}

.admin-dashboard-period {
    display: grid;
    min-width: 176px;
    gap: 3px;
    padding: 11px 13px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    background: rgba(15, 23, 42, .24);
}

.admin-dashboard-period span,
.admin-dashboard-period small {
    color: rgba(255, 255, 255, .56);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.admin-dashboard-period strong {
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.admin-dashboard-layout,
.admin-dashboard-row,
.admin-dashboard-column,
.admin-dashboard-widget {
    min-width: 0;
}

.admin-dashboard-row {
    margin-right: -7px;
    margin-left: -7px;
}

.admin-dashboard-column {
    padding-right: 7px;
    padding-left: 7px;
}

.admin-dashboard-widget:empty {
    display: none;
}

.admin-dashboard-page .panel,
.admin-dashboard-page .box {
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--border) !important;
    border-top-width: 1px !important;
    border-radius: 15px !important;
    background: var(--surface) !important;
    box-shadow: var(--shadow) !important;
}

.admin-dashboard-page .panel > .panel-heading,
.admin-dashboard-page .box > .box-header {
    min-height: 56px;
    padding: 15px 17px;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
    background: var(--surface-2) !important;
    color: var(--text) !important;
    font-size: 14px;
    font-weight: 740;
}

.admin-dashboard-page .panel-heading a,
.admin-dashboard-page .box-header a {
    color: var(--text);
}

.admin-dashboard-page .panel-body,
.admin-dashboard-page .box-body {
    padding: 16px;
    background: var(--surface);
    color: var(--text);
}

.admin-dashboard-page .box-tools .btn {
    min-width: 32px;
    min-height: 32px;
    padding: 5px 8px;
    border-radius: 8px;
    background: var(--surface-3) !important;
    color: var(--text-muted) !important;
}

.admin-dashboard-page .table-responsive {
    margin: 0;
    border: 0;
}

.admin-dashboard-page .table {
    margin-bottom: 0;
}

.admin-dashboard-page .table select {
    width: 100% !important;
    min-height: 34px;
    padding: 5px 8px;
    border: 1px solid var(--border) !important;
    border-radius: 8px;
    outline: 0;
    background: var(--surface-2) !important;
    color: var(--text) !important;
}

.admin-dashboard-page .table td,
.admin-dashboard-page .table th {
    overflow-wrap: anywhere;
}

.admin-dashboard-page .panel-cron-success,
.admin-dashboard-page .panel-cron-warning,
.admin-dashboard-page .panel-cron-danger {
    border-left-width: 4px !important;
}

.admin-dashboard-page .panel-cron-success {
    border-left-color: var(--accent) !important;
}

.admin-dashboard-page .panel-cron-warning {
    border-left-color: var(--amber) !important;
}

.admin-dashboard-page .panel-cron-danger {
    border-left-color: var(--rose) !important;
}

.admin-dashboard-page .activities .panel-body {
    max-height: 340px;
    overflow-y: auto;
}

.admin-dashboard-page .activities li {
    position: relative;
    padding: 0 0 13px 18px;
    border-left: 1px solid var(--border);
}

.admin-dashboard-page .activities li:last-child {
    padding-bottom: 0;
}

.admin-dashboard-page .activities li .point {
    position: absolute;
    top: 4px;
    left: -5px;
    width: 9px;
    height: 9px;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background: var(--accent);
}

.admin-dashboard-page .activities li p {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 11px;
    line-height: 1.5;
}

.dashboard-router-revenue {
    margin-bottom: 14px !important;
}

.admin-dashboard-page .dashboard-router-revenue > .dashboard-router-revenue-header {
    display: flex;
    min-height: 82px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 17px;
}

.dashboard-router-revenue-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.dashboard-router-revenue-icon {
    display: grid;
    width: 43px;
    height: 43px;
    place-items: center;
    flex: 0 0 43px;
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
    border-radius: 13px;
    background: var(--accent-soft);
    color: var(--accent-700);
    font-size: 17px;
}

.admin-dashboard-page .dashboard-router-revenue-heading .box-title {
    float: none;
    margin: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 760;
    line-height: 1.3;
}

.dashboard-router-revenue-heading p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.45;
}

.dashboard-router-revenue-summary {
    display: grid;
    min-width: 190px;
    gap: 2px;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    text-align: right;
}

.dashboard-router-revenue-summary span,
.dashboard-router-revenue-summary small {
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.dashboard-router-revenue-summary strong {
    color: var(--accent-700);
    font-size: 18px;
    font-weight: 780;
    letter-spacing: -.025em;
}

.admin-dashboard-page .dashboard-router-revenue > .dashboard-router-revenue-body {
    padding: 14px 17px 10px;
}

.dashboard-router-revenue-chart {
    position: relative;
    width: 100%;
    height: 350px;
    min-height: 280px;
}

.dashboard-router-revenue-empty {
    display: grid;
    min-height: 230px;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 28px;
    text-align: center;
}

.dashboard-router-revenue-empty > span {
    display: grid;
    width: 49px;
    height: 49px;
    place-items: center;
    margin-bottom: 3px;
    border-radius: 15px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 19px;
}

.dashboard-router-revenue-empty strong {
    color: var(--text);
    font-size: 14px;
}

.dashboard-router-revenue-empty p {
    max-width: 430px;
    margin: 0;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.55;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-kpi-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 112px;
    align-items: center;
    gap: 12px;
    padding: 17px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.dashboard-kpi-card::after {
    position: absolute;
    right: -30px;
    bottom: -55px;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: currentColor;
    content: "";
    opacity: .045;
}

.dashboard-kpi-card:hover,
.dashboard-kpi-card:focus {
    border-color: currentColor;
    color: var(--text);
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.dashboard-kpi-icon {
    display: grid;
    width: 43px;
    height: 43px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    background: rgba(59, 130, 246, .12);
    color: #2563eb;
    font-size: 17px;
}

.dashboard-kpi-copy {
    min-width: 0;
}

.dashboard-kpi-copy small,
.dashboard-kpi-copy strong {
    display: block;
}

.dashboard-kpi-copy small {
    min-height: 27px;
    margin-bottom: 3px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .045em;
    line-height: 1.4;
    text-transform: uppercase;
}

.dashboard-kpi-copy strong {
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: clamp(19px, 2.2vw, 27px);
    font-weight: 790;
    letter-spacing: -.035em;
    line-height: 1.15;
}

.dashboard-kpi-copy strong em {
    margin-right: 3px;
    color: var(--text-muted);
    font-size: .48em;
    font-style: normal;
    font-weight: 700;
    letter-spacing: normal;
    vertical-align: top;
}

.dashboard-kpi-arrow {
    color: var(--text-muted);
    font-size: 10px;
}

.dashboard-kpi-card.is-emerald .dashboard-kpi-icon {
    background: var(--accent-soft);
    color: var(--accent-700);
}

.dashboard-kpi-card.is-amber .dashboard-kpi-icon {
    background: rgba(245, 158, 11, .14);
    color: #b45309;
}

.dashboard-kpi-card.is-rose .dashboard-kpi-icon {
    background: rgba(244, 63, 94, .12);
    color: #be123c;
}

html.dark .dashboard-kpi-card.is-blue .dashboard-kpi-icon {
    color: #93c5fd;
}

html.dark .dashboard-kpi-card.is-amber .dashboard-kpi-icon {
    color: #fcd34d;
}

html.dark .dashboard-kpi-card.is-rose .dashboard-kpi-icon {
    color: #fda4af;
}

.dashboard-context-bar {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.dashboard-context-period,
.dashboard-context-balance {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
}

.dashboard-context-period > span {
    display: grid;
    width: 35px;
    height: 35px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-700);
}

.dashboard-context-period small,
.dashboard-context-period strong,
.dashboard-context-balance span,
.dashboard-context-balance strong {
    display: block;
}

.dashboard-context-period small,
.dashboard-context-balance span {
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 720;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.dashboard-context-period strong {
    color: var(--text);
    font-size: 10px;
}

.dashboard-context-balance {
    justify-content: flex-end;
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
}

.dashboard-context-balance strong {
    color: var(--accent-700);
    font-size: 17px;
    font-weight: 770;
}

.dashboard-context-balance strong small {
    display: inline;
    margin-right: 3px;
    color: var(--text-muted);
    font-size: 8px;
}

.dashboard-context-balance > i {
    color: var(--text-muted);
    font-size: 10px;
}

@media (max-width: 1180px) {
    .admin-dashboard-hero {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .admin-dashboard-period {
        grid-column: 1 / -1;
    }

    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    body.admin-dashboard-shell .content {
        padding-top: 12px !important;
    }

    .admin-dashboard-hero {
        grid-template-columns: 1fr;
        padding: 21px 18px;
        border-radius: 17px;
    }

    .admin-dashboard-hero-actions {
        justify-content: flex-start;
    }

    .admin-dashboard-period {
        grid-column: auto;
    }

    .admin-dashboard-column {
        float: none;
        width: 100%;
    }

    .admin-dashboard-page .panel > .panel-heading,
    .admin-dashboard-page .box > .box-header {
        min-height: 52px;
        padding: 13px 14px;
    }

    .admin-dashboard-page .dashboard-router-revenue > .dashboard-router-revenue-header {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-router-revenue-summary {
        width: 100%;
        min-width: 0;
        text-align: left;
    }

    .dashboard-router-revenue-chart {
        height: 310px;
    }

    .dashboard-context-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-context-balance {
        justify-content: space-between;
    }
}

@media (max-width: 520px) {
    .admin-dashboard-hero-title {
        align-items: flex-start;
    }

    .admin-dashboard-hero-icon {
        width: 49px;
        height: 49px;
        border-radius: 14px;
        font-size: 19px;
    }

    .admin-dashboard-hero-actions,
    .admin-dashboard-hero-actions .btn {
        width: 100%;
    }

    .admin-dashboard-period strong {
        white-space: normal;
    }

    .dashboard-kpi-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-kpi-card {
        min-height: 98px;
    }

    .dashboard-router-revenue-heading {
        align-items: flex-start;
    }

    .dashboard-router-revenue-icon {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
        border-radius: 11px;
        font-size: 15px;
    }

    .admin-dashboard-page .dashboard-router-revenue > .dashboard-router-revenue-body {
        padding: 10px 10px 6px;
    }

    .dashboard-router-revenue-chart {
        height: 285px;
    }

    .dashboard-context-period {
        align-items: flex-start;
    }
}

/* =====================================================================
   Workspace regression isolation: reports and rich-text editors
   ===================================================================== */

.reports-workspace {
    display: grid;
    grid-template-columns: minmax(245px, 300px) minmax(0, 1fr);
    align-items: start;
    gap: 15px;
}

.reports-filter-column,
.reports-results-column {
    min-width: 0;
}

.reports-filter-column {
    position: sticky;
    top: 16px;
}

body.admin-route-reports .reports-filter-header {
    min-height: 0 !important;
    padding: 0 !important;
}

.reports-filter-toggle {
    display: flex;
    width: 100%;
    min-height: 57px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 17px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    font-weight: 740;
    text-align: left;
}

.reports-filter-toggle > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.reports-filter-toggle > .fa-chevron-up {
    color: var(--text-muted);
    font-size: 9px;
    transition: transform .16s ease;
}

.reports-filter-toggle.is-collapsed > .fa-chevron-up {
    transform: rotate(180deg);
}

.reports-filter-toggle:hover,
.reports-filter-toggle:focus {
    background: var(--accent-soft);
    color: var(--accent-700);
}

body.admin-route-reports .reports-filter-body {
    padding: 14px !important;
}

.reports-chart-toggle {
    margin-bottom: 12px;
    padding: 9px 10px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface-2);
}

.reports-chart-toggle label {
    display: flex !important;
    align-items: center;
    gap: 7px;
    margin: 0 !important;
    color: var(--text) !important;
}

.reports-filter-body > .form-control,
.reports-filter-body > .select2-container {
    margin-bottom: 3px;
}

.reports-filter-body > .btn {
    margin-top: 15px;
}

.reports-chart-area > .box,
.reports-data-card {
    margin-bottom: 15px !important;
}

body.admin-route-reports .reports-chart-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.reports-chart-card {
    min-width: 0;
    min-height: 210px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
}

body.admin-route-reports .reports-line-chart {
    position: relative;
    height: 320px;
    min-height: 320px;
}

.reports-table-inner {
    min-width: 760px;
    padding: 10px;
}

.reports-pagination {
    display: flow-root;
    margin-top: 2px;
}

/* Summernote uses Bootstrap panel classes internally. Keep the admin panel
   modernizer away from its toolbar, dropdowns and editable canvas. */
body.admin-modern-workspace .content .note-editor.note-frame.panel {
    margin: 0 !important;
    overflow: visible !important;
    border: 1px solid var(--border) !important;
    border-radius: 11px !important;
    background: var(--surface) !important;
    box-shadow: none !important;
}

body.admin-modern-workspace .content .note-editor.note-frame > .note-toolbar.panel-heading {
    display: block !important;
    min-height: 0 !important;
    padding: 6px 7px !important;
    overflow: visible !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 10px 10px 0 0 !important;
    background: var(--surface-2) !important;
    line-height: normal !important;
}

body.admin-modern-workspace .content .note-editor.note-frame > .note-toolbar.panel-heading::before {
    display: none !important;
    content: none !important;
}

body.admin-modern-workspace .note-toolbar .note-btn-group {
    display: inline-block;
    margin: 2px 3px 2px 0;
    vertical-align: middle;
}

body.admin-modern-workspace .note-toolbar .note-btn {
    min-width: 30px;
    min-height: 30px !important;
    margin: 0;
    padding: 5px 8px;
    border-color: var(--border) !important;
    background: var(--surface) !important;
    color: var(--text) !important;
    line-height: 1.2;
}

body.admin-modern-workspace .note-toolbar .dropdown-menu {
    z-index: 1060;
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

body.admin-modern-workspace .note-editing-area,
body.admin-modern-workspace .note-editing-area .note-editable {
    border-radius: 0;
    background: var(--surface) !important;
    color: var(--text) !important;
}

body.admin-modern-workspace .note-statusbar {
    border-color: var(--border) !important;
    border-radius: 0 0 10px 10px !important;
    background: var(--surface-2) !important;
}

.modern-page-editor.is-voucher-editor > .row {
    grid-template-columns: minmax(0, 1fr) minmax(270px, 330px);
    align-items: start;
}

.modern-page-editor .page-editor-main-panel {
    min-width: 0;
    overflow: visible !important;
}

.page-template-gallery {
    display: grid;
    max-height: 760px;
    align-content: start;
    gap: 10px;
    overflow-y: auto;
    scrollbar-width: thin;
}

body.admin-modern-workspace .content .page-template-card {
    margin: 0 !important;
    cursor: pointer;
    overflow: hidden;
    box-shadow: none !important;
}

.page-template-card > .panel-body {
    position: relative;
    max-height: 170px;
    overflow: hidden;
    pointer-events: none;
}

.page-template-card > .panel-body::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 42px;
    background: linear-gradient(transparent, var(--surface));
    content: "";
}

.widget-editor-form {
    max-width: 1080px;
    margin: 0 auto;
}

.widget-editor-panel {
    overflow: visible !important;
}

.widget-editor-form .form-group::before,
.widget-editor-form .form-group::after {
    display: table;
    content: " ";
}

.widget-editor-form .form-group::after {
    clear: both;
}

.widget-editor-form .note-editor {
    margin-top: 2px !important;
}

.widget-editor-actions .btn-group-justified {
    display: flex;
    gap: 8px;
}

.widget-editor-actions .btn-group-justified > .btn,
.widget-editor-actions .btn-group-justified > .btn-group {
    display: block;
    width: 50%;
}

@media (max-width: 1180px) {
    body.admin-route-reports .reports-chart-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .reports-workspace,
    .modern-page-editor.is-voucher-editor > .row {
        grid-template-columns: 1fr;
    }

    .reports-filter-column {
        position: static;
    }

    .page-template-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 600px) {
    body.admin-route-reports .reports-chart-grid,
    .page-template-gallery {
        grid-template-columns: 1fr;
    }

    .reports-chart-card {
        min-height: 190px;
    }

    body.admin-route-reports .reports-line-chart {
        height: 260px;
        min-height: 260px;
    }

    .widget-editor-actions .btn-group-justified {
        flex-direction: column;
    }

    .widget-editor-actions .btn-group-justified > .btn,
    .widget-editor-actions .btn-group-justified > .btn-group {
        width: 100%;
    }
}

/* =====================================================================
   Modern content-page and Voucher editor
   ===================================================================== */

.content-page-editor {
    max-width: 1440px;
    margin: 0 auto;
}

.content-page-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
    padding: 17px 19px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.content-page-editor-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 13px;
}

.content-page-editor-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    background: var(--accent-soft);
    color: var(--accent-700);
    font-size: 16px;
}

.content-page-editor-identity > div,
.content-page-editor-card > header > div {
    min-width: 0;
}

.content-page-editor-identity span:not(.content-page-editor-icon),
.content-page-editor-card > header span,
.content-page-template-library > header > span,
.content-page-placeholders > span {
    display: block;
    margin-bottom: 3px;
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.content-page-editor-identity h2,
.content-page-editor-identity p,
.content-page-editor-card h3,
.content-page-template-library h3,
.content-page-template-library p {
    margin: 0;
}

.content-page-editor-identity h2 {
    color: var(--text);
    font-size: 17px;
    font-weight: 760;
    overflow-wrap: anywhere;
}

.content-page-editor-identity p,
.content-page-template-library p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.45;
}

.content-page-editor-status > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 9px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 720;
    white-space: nowrap;
}

.content-page-editor-status .is-ready {
    background: var(--accent-soft);
    color: var(--accent-700);
}

.content-page-editor-status .is-error {
    background: rgba(244, 63, 94, .12);
    color: #be123c;
}

.content-page-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 15px;
}

.content-page-editor.is-voucher-editor .content-page-editor-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
}

.content-page-editor-card,
.content-page-template-library {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

.content-page-editor-card > header,
.content-page-template-library > header {
    display: flex;
    min-height: 62px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 17px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.content-page-editor-card h3,
.content-page-template-library h3 {
    color: var(--text);
    font-size: 14px;
    font-weight: 750;
}

.content-page-editor-canvas {
    padding: 14px;
    background:
        linear-gradient(45deg, var(--surface-2) 25%, transparent 25%),
        linear-gradient(-45deg, var(--surface-2) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--surface-2) 75%),
        linear-gradient(-45deg, transparent 75%, var(--surface-2) 75%);
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;
    background-size: 16px 16px;
}

.content-page-editor-canvas > textarea {
    width: 100%;
    min-height: 430px;
}

.content-page-editor-canvas .note-editor.note-frame.panel {
    overflow: visible !important;
    border-radius: 11px !important;
    box-shadow: 0 12px 30px -25px rgba(15, 23, 42, .55) !important;
}

.content-page-editor-canvas .note-editable {
    min-height: 430px !important;
    padding: clamp(18px, 3vw, 32px) !important;
}

.content-page-editor.is-voucher-editor .note-editable > table {
    width: min(100%, 720px) !important;
    margin: 14px auto !important;
    border: 1px solid var(--border) !important;
    border-radius: 10px;
    background: #fff;
    color: #111827;
    box-shadow: 0 18px 38px -30px rgba(15, 23, 42, .55);
}

.content-page-editor.is-voucher-editor .note-editable table {
    max-width: 100% !important;
    border-collapse: collapse;
}

.content-page-editor.is-voucher-editor .note-editable td {
    overflow-wrap: anywhere;
}

.content-page-editor.is-voucher-editor .note-editable img {
    max-width: 100%;
    height: auto;
}

.content-page-editor-options {
    display: grid;
    gap: 13px;
    padding: 16px 17px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.content-page-template-save {
    display: grid;
    grid-template-columns: minmax(220px, .8fr) minmax(240px, 1.2fr);
    align-items: end;
    gap: 14px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
}

.content-page-check-option {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 0;
    color: var(--text);
    cursor: pointer;
}

.content-page-check-option input {
    margin-top: 3px;
}

.content-page-check-option strong,
.content-page-check-option small {
    display: block;
}

.content-page-check-option strong {
    font-size: 11px;
}

.content-page-check-option small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 500;
}

.content-page-template-save > div > label,
.content-page-public-url > label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
}

.content-page-placeholders {
    padding: 12px 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-2);
}

.content-page-placeholders > div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.content-page-placeholders code {
    padding: 5px 7px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--surface);
    color: var(--accent-700);
    font-size: 9px;
}

.content-page-public-url .input-group {
    max-width: 760px;
}

.content-page-public-url [data-copy-content-url].is-copied {
    border-color: var(--accent) !important;
    background: var(--accent-soft) !important;
    color: var(--accent-700) !important;
}

.content-page-editor-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 13px;
    padding: 14px 17px;
    border-top: 1px solid var(--border);
    background: var(--surface-2);
}

.content-page-editor-actions p {
    margin: 0;
    color: var(--text-muted);
    font-size: 9px;
    line-height: 1.45;
}

.content-page-editor-actions .btn {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
}

.content-page-editor-readonly {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 15px;
    padding: 14px;
    border: 1px solid rgba(244, 63, 94, .25);
    border-radius: 11px;
    background: rgba(244, 63, 94, .08);
    color: #be123c;
}

.content-page-editor-readonly p {
    margin: 3px 0 0;
    color: var(--text-muted);
}

.content-page-template-library {
    position: sticky;
    top: 16px;
}

.content-page-template-library > header {
    display: block;
}

.content-page-template-list {
    display: grid;
    max-height: 760px;
    gap: 10px;
    padding: 12px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.content-page-template-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: 0;
    background: var(--surface);
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.content-page-template-card:hover,
.content-page-template-card:focus,
.content-page-template-card.is-selected {
    border-color: var(--accent);
    box-shadow: 0 12px 26px -22px rgba(5, 150, 105, .8);
    transform: translateY(-1px);
}

.content-page-template-card > header {
    display: flex;
    min-height: 43px;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
}

.content-page-template-card > header strong {
    overflow: hidden;
    font-size: 10px;
    font-weight: 720;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content-page-template-card > header span {
    color: var(--text-muted);
    font-size: 9px;
}

.content-page-template-card.is-selected > header span {
    color: var(--accent-700);
}

.content-page-template-preview {
    position: relative;
    height: 165px;
    padding: 12px;
    overflow: hidden;
    background: #fff;
    color: #111827;
    pointer-events: none;
}

.content-page-template-preview::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 44px;
    background: linear-gradient(transparent, #fff);
    content: "";
}

.content-page-template-preview table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse;
    table-layout: fixed;
}

.content-page-template-preview td {
    padding: 3px !important;
    overflow: hidden;
    font-size: 10px !important;
    overflow-wrap: anywhere;
}

.content-page-template-preview strong {
    font-size: 16px !important;
}

.content-page-template-preview img {
    display: block;
    max-width: 100%;
    max-height: 54px;
    margin: 0 auto;
    object-fit: contain;
}

@media (max-width: 1050px) {
    .content-page-editor.is-voucher-editor .content-page-editor-layout {
        grid-template-columns: 1fr;
    }

    .content-page-template-library {
        position: static;
    }

    .content-page-template-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-height: none;
        overflow: visible;
    }
}

@media (max-width: 767px) {
    .content-page-editor-toolbar,
    .content-page-editor-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .content-page-editor-status {
        align-self: flex-start;
    }

    .content-page-template-save {
        grid-template-columns: 1fr;
    }

    .content-page-template-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-page-editor-actions .btn {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .content-page-editor-toolbar {
        padding: 14px;
    }

    .content-page-editor-identity {
        align-items: flex-start;
    }

    .content-page-editor-card > header {
        align-items: flex-start;
        flex-direction: column;
    }

    .content-page-editor-canvas {
        padding: 8px;
    }

    .content-page-editor-canvas .note-editable {
        padding: 14px !important;
    }

    .content-page-template-list {
        grid-template-columns: 1fr;
    }
}

/* =====================================================================
   Platform billing workspace
   ===================================================================== */
body.admin-route-platform_billing .content-wrapper > .content-header {
    display: none;
}

body.admin-route-platform_billing .content-wrapper > .content {
    padding-top: 22px;
}

.platform-billing-page {
    width: min(100%, 1460px);
    margin: 0 auto;
}

.platform-billing-hero {
    position: relative;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 28px;
    min-height: 172px;
    padding: 30px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 88% 18%, rgba(52, 211, 153, .25), transparent 30%),
        linear-gradient(125deg, #172033 0%, #203451 58%, #16634f 130%);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 20px;
    box-shadow: 0 18px 36px -26px rgba(15, 23, 42, .8);
}

.platform-billing-hero::after {
    position: absolute;
    right: -74px;
    bottom: -112px;
    width: 280px;
    height: 280px;
    content: "";
    border: 42px solid rgba(255, 255, 255, .035);
    border-radius: 50%;
    pointer-events: none;
}

.platform-billing-hero-copy {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    min-width: 0;
}

.platform-billing-hero-icon {
    display: grid;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    place-items: center;
    font-size: 26px;
    color: #6ee7b7;
    background: rgba(16, 185, 129, .16);
    border: 1px solid rgba(110, 231, 183, .22);
    border-radius: 16px;
}

.platform-billing-eyebrow,
.platform-billing-card-header > div > span,
.platform-billing-pay-card header div > span,
.platform-billing-paybill-card header > span {
    display: block;
    margin-bottom: 7px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.platform-billing-eyebrow {
    color: #6ee7b7;
}

.platform-billing-hero h1 {
    margin: 0;
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 750;
    line-height: 1.12;
    letter-spacing: -.04em;
    color: #fff;
}

.platform-billing-hero-copy p {
    max-width: 660px;
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.7;
    color: #cbd5e1;
}

.platform-billing-hero-status {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 0 0 248px;
    flex-direction: column;
    justify-content: center;
    padding: 20px 22px;
    background: rgba(8, 15, 29, .3);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    backdrop-filter: blur(8px);
}

.platform-billing-hero-status > span {
    margin-bottom: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    color: #cbd5e1;
    text-transform: uppercase;
}

.platform-billing-hero-status strong {
    overflow-wrap: anywhere;
    font-size: 24px;
    line-height: 1.25;
    color: #fff;
}

.platform-billing-hero-status small {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    font-weight: 600;
    color: #fbbf24 !important;
}

.platform-billing-hero-status.is-current small {
    color: #6ee7b7 !important;
}

.platform-billing-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.platform-billing-metric {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.platform-billing-metric-icon {
    display: grid;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    place-items: center;
    font-size: 21px;
    color: var(--accent-700);
    background: var(--accent-soft);
    border-radius: 13px;
}

.platform-billing-metric.is-balance .platform-billing-metric-icon {
    color: #e11d48;
    background: rgba(244, 63, 94, .11);
}

.platform-billing-metric.is-paybill .platform-billing-metric-icon {
    color: #2563eb;
    background: rgba(59, 130, 246, .11);
}

html.dark .platform-billing-metric.is-balance .platform-billing-metric-icon {
    color: #fb7185;
}

html.dark .platform-billing-metric.is-paybill .platform-billing-metric-icon {
    color: #60a5fa;
}

.platform-billing-metric > div {
    min-width: 0;
}

.platform-billing-metric > div > span {
    display: block;
    margin-bottom: 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .07em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.platform-billing-metric strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: clamp(18px, 2vw, 24px);
    line-height: 1.25;
    letter-spacing: -.025em;
    color: var(--text);
}

.platform-billing-metric small {
    display: block;
    margin-top: 5px;
    overflow: hidden;
    font-size: 11px;
    color: var(--text-muted) !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.platform-billing-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 350px);
    gap: 18px;
    align-items: start;
    margin-top: 18px;
}

.platform-billing-main,
.platform-billing-sidebar {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.platform-billing-sidebar {
    position: sticky;
    top: 74px;
}

.platform-billing-card,
.platform-billing-pay-card,
.platform-billing-paybill-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.platform-billing-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 21px 22px 18px;
    border-bottom: 1px solid var(--border);
}

.platform-billing-card-header > div > span,
.platform-billing-paybill-card header > span {
    color: var(--accent-700);
}

.platform-billing-card-header h2,
.platform-billing-pay-card h2,
.platform-billing-paybill-card h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 750;
    line-height: 1.3;
    letter-spacing: -.02em;
    color: var(--text);
}

.platform-billing-card-header p,
.platform-billing-paybill-card > p {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-muted);
}

.platform-billing-card-icon {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    color: var(--accent-700);
    background: var(--accent-soft);
    border-radius: 11px;
}

.platform-billing-document-brand {
    display: flex;
    flex: 0 0 auto;
    width: min(150px, 28vw);
    min-height: 38px;
    max-height: 54px;
    align-items: center;
    justify-content: flex-end;
    padding: 5px 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.platform-billing-document-brand img {
    display: block;
    max-width: 100%;
    max-height: 42px;
    object-fit: contain;
}

.platform-billing-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.platform-billing-table {
    width: 100%;
    min-width: 720px;
    margin: 0;
    border-collapse: collapse;
}

.platform-billing-table th {
    padding: 11px 16px;
    font-size: 10px;
    font-weight: 750;
    line-height: 1.3;
    letter-spacing: .075em;
    color: var(--text-muted);
    text-align: left;
    text-transform: uppercase;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.platform-billing-table td {
    padding: 15px 16px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.platform-billing-table tbody tr:last-child td {
    border-bottom: 0;
}

.platform-billing-table tbody tr:hover td {
    background: var(--surface-2);
}

.platform-billing-table td strong {
    font-weight: 700;
    color: var(--text);
}

.platform-billing-amount-owed {
    font-weight: 750;
    color: #e11d48 !important;
}

html.dark .platform-billing-amount-owed {
    color: #fb7185 !important;
}

.platform-billing-reference {
    max-width: 180px;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px !important;
}

.platform-billing-rail,
.platform-billing-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 4px 9px;
    font-size: 10px;
    font-weight: 750;
    line-height: 1;
    letter-spacing: .035em;
    color: var(--text-muted);
    text-transform: capitalize;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 999px;
    white-space: nowrap;
}

.platform-billing-status.is-success {
    color: #047857;
    background: rgba(16, 185, 129, .12);
    border-color: rgba(16, 185, 129, .2);
}

.platform-billing-status.is-warning {
    color: #b45309;
    background: rgba(245, 158, 11, .12);
    border-color: rgba(245, 158, 11, .22);
}

.platform-billing-status.is-danger {
    color: #be123c;
    background: rgba(244, 63, 94, .11);
    border-color: rgba(244, 63, 94, .2);
}

html.dark .platform-billing-status.is-success {
    color: #6ee7b7;
}

html.dark .platform-billing-status.is-warning {
    color: #fbbf24;
}

html.dark .platform-billing-status.is-danger {
    color: #fda4af;
}

.platform-billing-empty-row td {
    padding: 36px 20px !important;
    text-align: center;
}

.platform-billing-empty-row td > span {
    display: grid;
    width: 42px;
    height: 42px;
    margin: 0 auto 10px;
    place-items: center;
    font-size: 18px;
    color: var(--accent-700);
    background: var(--accent-soft);
    border-radius: 50%;
}

.platform-billing-empty-row td > strong,
.platform-billing-empty-row td > small {
    display: block;
}

.platform-billing-empty-row td > small {
    margin-top: 4px;
}

.platform-billing-pay-card {
    padding: 22px;
    color: #fff;
    background:
        radial-gradient(circle at 100% 0, rgba(110, 231, 183, .15), transparent 38%),
        linear-gradient(150deg, #182439, #163b3a);
    border-color: rgba(52, 211, 153, .18);
    box-shadow: 0 18px 38px -28px rgba(15, 23, 42, .9);
}

.platform-billing-pay-card > header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.platform-billing-pay-card > header > span {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    font-size: 18px;
    color: #6ee7b7;
    background: rgba(16, 185, 129, .15);
    border: 1px solid rgba(110, 231, 183, .18);
    border-radius: 12px;
}

.platform-billing-pay-card header div > span {
    margin-bottom: 4px;
    color: #6ee7b7;
}

.platform-billing-pay-card h2 {
    color: #fff;
}

.platform-billing-pay-card > p {
    margin: 17px 0;
    font-size: 12px;
    line-height: 1.6;
    color: #cbd5e1;
}

.platform-billing-payment-amount {
    padding: 15px 16px;
    margin: 18px 0;
    background: rgba(8, 15, 29, .32);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
}

.platform-billing-payment-amount span {
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    color: #94a3b8;
    text-transform: uppercase;
}

.platform-billing-payment-amount strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 23px;
    line-height: 1.25;
    color: #fff;
}

.platform-billing-payment-form .form-group {
    margin-bottom: 15px;
}

.platform-billing-payment-form label {
    margin-bottom: 7px;
    font-size: 11px;
    color: #e2e8f0;
}

.platform-billing-phone-input {
    position: relative;
}

.platform-billing-phone-input > span {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 13px;
    color: #64748b;
    transform: translateY(-50%);
}

.platform-billing-phone-input .form-control {
    height: 44px;
    padding-left: 37px;
    color: #e5edf7 !important;
    background: rgba(8, 15, 29, .42) !important;
    border-color: rgba(255, 255, 255, .14) !important;
}

.platform-billing-phone-input .form-control::placeholder {
    color: #94a3b8;
}

.platform-billing-phone-input .form-control:focus {
    border-color: #34d399 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .15) !important;
}

.platform-billing-payment-form .form-group > small {
    display: block;
    margin-top: 7px;
    font-size: 10px;
    line-height: 1.45;
    color: #94a3b8 !important;
}

.platform-billing-pay-button {
    width: 100%;
    min-height: 43px;
    font-weight: 700;
    background: #10b981 !important;
    border-color: #10b981 !important;
    border-radius: 10px;
}

.platform-billing-pay-button:hover,
.platform-billing-pay-button:focus {
    background: #059669 !important;
    border-color: #059669 !important;
}

.platform-billing-secure-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding-top: 15px;
    margin-top: 16px;
    font-size: 10px;
    line-height: 1.5;
    color: #94a3b8;
    border-top: 1px solid rgba(255, 255, 255, .09);
}

.platform-billing-secure-note i {
    margin-top: 2px;
    color: #6ee7b7;
}

.platform-billing-pay-card.is-settled {
    text-align: center;
}

.platform-billing-pay-card.is-settled > header {
    justify-content: center;
    text-align: left;
}

.platform-billing-settled-mark {
    display: grid;
    width: 70px;
    height: 70px;
    margin: 20px auto 4px;
    place-items: center;
    font-size: 28px;
    color: #6ee7b7;
    background: rgba(16, 185, 129, .14);
    border: 1px solid rgba(110, 231, 183, .22);
    border-radius: 50%;
}

.platform-billing-paybill-card {
    padding: 22px;
}

.platform-billing-paybill-card dl {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.platform-billing-paybill-card dl > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 13px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.platform-billing-paybill-card dt {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .055em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.platform-billing-paybill-card dd {
    max-width: 62%;
    margin: 0;
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    font-weight: 750;
    color: var(--text);
    text-align: right;
}

.platform-billing-paybill-card > small {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 10px;
    line-height: 1.5;
    color: var(--text-muted) !important;
}

.platform-billing-paybill-card > small i {
    margin-top: 2px;
    color: var(--accent-600);
}

.platform-billing-unavailable {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 26px;
    margin-top: 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--amber);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.platform-billing-unavailable > span {
    display: grid;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    place-items: center;
    font-size: 20px;
    color: #b45309;
    background: rgba(245, 158, 11, .12);
    border-radius: 13px;
}

html.dark .platform-billing-unavailable > span {
    color: #fbbf24;
}

.platform-billing-unavailable > div {
    flex: 1 1 auto;
    min-width: 0;
}

.platform-billing-unavailable > div > span {
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .08em;
    color: #b45309;
    text-transform: uppercase;
}

html.dark .platform-billing-unavailable > div > span {
    color: #fbbf24;
}

.platform-billing-unavailable h2 {
    margin: 0;
    font-size: 18px;
    color: var(--text);
}

.platform-billing-unavailable p {
    margin: 7px 0 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
}

.platform-billing-unavailable .btn {
    flex: 0 0 auto;
}

@media (max-width: 1100px) {
    .platform-billing-layout {
        grid-template-columns: minmax(0, 1fr) 310px;
    }

    .platform-billing-metric {
        align-items: flex-start;
    }

    .platform-billing-metric small {
        white-space: normal;
    }
}

@media (max-width: 991px) {
    .platform-billing-hero {
        min-height: 0;
    }

    .platform-billing-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .platform-billing-metric:last-child {
        grid-column: 1 / -1;
    }

    .platform-billing-layout {
        grid-template-columns: 1fr;
    }

    .platform-billing-sidebar {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    body.admin-route-platform_billing .content-wrapper > .content {
        padding: 14px;
    }

    .platform-billing-hero {
        flex-direction: column;
        gap: 22px;
        padding: 23px;
    }

    .platform-billing-hero-status {
        flex: 1 1 auto;
        width: 100%;
    }

    .platform-billing-table-wrap {
        padding: 8px 14px 14px;
        overflow: visible;
    }

    .platform-billing-table {
        display: block;
        min-width: 0;
    }

    .platform-billing-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .platform-billing-table tbody,
    .platform-billing-table tr,
    .platform-billing-table td {
        display: block;
        width: 100%;
    }

    .platform-billing-table tbody {
        display: grid;
        gap: 10px;
    }

    .platform-billing-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow: hidden;
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: 12px;
    }

    .platform-billing-table td {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        min-width: 0;
        padding: 11px 13px;
        border-bottom: 1px solid var(--border);
    }

    .platform-billing-table td:nth-last-child(-n + 2) {
        border-bottom: 0;
    }

    .platform-billing-table td::before {
        content: attr(data-label);
        font-size: 9px;
        font-weight: 750;
        line-height: 1.25;
        letter-spacing: .065em;
        color: var(--text-muted);
        text-transform: uppercase;
    }

    .platform-billing-table tbody tr:hover td {
        background: transparent;
    }

    .platform-billing-empty-row {
        display: block !important;
    }

    .platform-billing-empty-row td {
        display: block;
        border: 0 !important;
    }

    .platform-billing-empty-row td::before {
        display: none;
    }

    .platform-billing-sidebar {
        grid-template-columns: 1fr;
    }

    .platform-billing-unavailable {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .platform-billing-unavailable .btn {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .platform-billing-hero-copy {
        flex-direction: column;
    }

    .platform-billing-metrics {
        grid-template-columns: 1fr;
    }

    .platform-billing-metric:last-child {
        grid-column: auto;
    }

    .platform-billing-card-header {
        padding: 18px;
    }

    .platform-billing-card-icon {
        display: none;
    }

    .platform-billing-document-brand {
        width: 92px;
        max-height: 46px;
        padding: 4px 6px;
    }

    .platform-billing-document-brand img {
        max-height: 34px;
    }

    .platform-billing-table tbody tr {
        grid-template-columns: 1fr;
    }

    .platform-billing-table td,
    .platform-billing-table td:nth-last-child(-n + 2) {
        border-bottom: 1px solid var(--border);
    }

    .platform-billing-table td:last-child {
        border-bottom: 0;
    }

    .platform-billing-pay-card,
    .platform-billing-paybill-card {
        padding: 18px;
    }
}

/* =====================================================================
   Modern application navigation
   Shared theme switch and sidebar icon hierarchy.
   ===================================================================== */
.theme-switch.topbar-action {
    width: 58px;
    cursor: pointer;
}

.theme-switch-track {
    position: relative;
    display: block;
    width: 40px;
    height: 23px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .08);
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.theme-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    display: grid;
    width: 17px;
    height: 17px;
    place-items: center;
    color: #475569;
    background: var(--surface);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .22);
    transition: color .2s ease, background-color .2s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
}

.theme-switch-icon {
    position: absolute;
    width: 11px;
    height: 11px;
    transition: opacity .16s ease, transform .2s ease;
}

.theme-switch-icon-moon {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.theme-switch-icon-moon path {
    fill: currentColor;
}

.theme-switch-icon-sun {
    opacity: 0;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
    transform: rotate(-35deg) scale(.75);
}

.theme-switch[aria-pressed="true"] .theme-switch-track {
    background: rgba(16, 185, 129, .16);
    border-color: rgba(52, 211, 153, .42);
}

.theme-switch[aria-pressed="true"] .theme-switch-thumb {
    color: #f59e0b;
    background: #fff;
    transform: translateX(17px);
}

.theme-switch[aria-pressed="true"] .theme-switch-icon-moon {
    opacity: 0;
    transform: rotate(30deg) scale(.75);
}

.theme-switch[aria-pressed="true"] .theme-switch-icon-sun {
    opacity: 1;
    transform: rotate(0) scale(1);
}

.theme-switch:hover .theme-switch-track,
.theme-switch:focus .theme-switch-track {
    border-color: var(--accent-600);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

html.dark .theme-switch-track {
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .28);
}

.modern-sidebar-navigation .sidebar {
    padding-top: 10px;
    padding-bottom: 18px;
}

.modern-sidebar-menu > li > a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 7px 10px !important;
    margin-top: 3px;
    margin-bottom: 3px;
    border: 1px solid transparent;
}

.modern-sidebar-menu > li > a > .fa,
.modern-sidebar-menu > li > a > .ion {
    display: inline-grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    font-size: 14px;
    line-height: 1;
    color: var(--sidebar-muted);
    background: rgba(255, 255, 255, .045);
    border: 1px solid rgba(255, 255, 255, .045);
    border-radius: 9px;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.modern-sidebar-menu > li > a > span:not(.pull-right-container) {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modern-sidebar-menu > li:hover > a > .fa,
.modern-sidebar-menu > li:hover > a > .ion,
.modern-sidebar-menu > li.menu-open > a > .fa,
.modern-sidebar-menu > li.menu-open > a > .ion {
    color: #e2e8f0;
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .08);
    transform: translateY(-1px);
}

.modern-sidebar-menu > li.active > a {
    border-color: rgba(52, 211, 153, .12);
    box-shadow: none;
}

.modern-sidebar-menu > li.active > a > .fa,
.modern-sidebar-menu > li.active > a > .ion {
    color: var(--sidebar-active-text);
    background: rgba(16, 185, 129, .18);
    border-color: rgba(52, 211, 153, .18);
    box-shadow: 0 5px 14px -9px rgba(16, 185, 129, .9);
}

.modern-sidebar-menu > li > a > .pull-right-container {
    position: static;
    display: grid;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin: 0 0 0 auto;
    place-items: center;
    color: var(--sidebar-muted);
}

.modern-sidebar-menu > li > a > .pull-right-container > .fa {
    position: static;
    width: auto;
    margin: 0;
    font-size: 12px;
    line-height: 1;
    transition: color .16s ease, transform .2s ease;
}

.modern-sidebar-menu > li.menu-open > a > .pull-right-container,
.modern-sidebar-menu > li.active > a > .pull-right-container {
    color: var(--sidebar-active-text);
}

.modern-sidebar-menu .treeview-menu {
    position: relative;
    padding: 3px 8px 7px 25px;
    margin: 0 10px 4px 25px;
    border-left: 1px solid rgba(148, 163, 184, .16);
}

.modern-sidebar-menu .treeview-menu > li > a {
    position: relative;
    min-height: 36px;
    padding: 9px 10px 9px 15px;
    line-height: 18px;
}

.modern-sidebar-menu .treeview-menu > li > a::before {
    position: absolute;
    top: 50%;
    left: -5px;
    width: 7px;
    height: 7px;
    content: "";
    background: var(--sidebar-bg);
    border: 1.5px solid #64748b;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.modern-sidebar-menu .treeview-menu > li > a:hover::before,
.modern-sidebar-menu .treeview-menu > li.active > a::before {
    background: var(--sidebar-active-text);
    border-color: var(--sidebar-active-text);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .12);
}

.main-header .sidebar-toggle::before {
    font-size: 17px;
}

@media (min-width: 768px) {
    .sidebar-mini.sidebar-collapse .modern-sidebar-menu > li > a {
        justify-content: center;
        padding-right: 4px !important;
        padding-left: 4px !important;
    }

    .sidebar-mini.sidebar-collapse .modern-sidebar-menu > li > a > .fa,
    .sidebar-mini.sidebar-collapse .modern-sidebar-menu > li > a > .ion {
        flex-basis: 32px;
        margin: 0;
    }
}

@media (max-width: 767px) {
    .theme-switch.topbar-action {
        width: 50px;
        padding-right: 5px;
        padding-left: 5px;
    }

    .modern-sidebar-navigation .sidebar {
        padding-top: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .theme-switch-track,
    .theme-switch-thumb,
    .theme-switch-icon,
    .modern-sidebar-menu > li > a > .fa,
    .modern-sidebar-menu > li > a > .ion {
        transition: none;
    }
}

@media (forced-colors: active) {
    .theme-switch-track,
    .theme-switch-thumb,
    .modern-sidebar-menu > li > a > .fa,
    .modern-sidebar-menu > li > a > .ion {
        border: 1px solid CanvasText;
    }
}

/* =====================================================================
   Administrator password workspace
   ===================================================================== */
body.admin-route-settings.admin-action-change-password .content-wrapper > .content-header {
    display: none;
}

body.admin-route-settings.admin-action-change-password .content-wrapper > .content {
    padding-top: 22px !important;
}

.admin-password-page {
    width: min(100%, 1180px);
    margin: 0 auto;
}

.admin-password-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    min-height: 164px;
    padding: 28px 30px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 88% 12%, rgba(96, 165, 250, .2), transparent 30%),
        linear-gradient(125deg, #182235 0%, #203451 58%, #164c46 130%);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 20px;
    box-shadow: 0 18px 36px -27px rgba(15, 23, 42, .9);
}

.admin-password-hero::after {
    position: absolute;
    right: -72px;
    bottom: -130px;
    width: 285px;
    height: 285px;
    content: "";
    border: 42px solid rgba(255, 255, 255, .035);
    border-radius: 50%;
    pointer-events: none;
}

.admin-password-hero-copy {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-start;
    gap: 17px;
    min-width: 0;
}

.admin-password-hero-icon {
    display: grid;
    flex: 0 0 54px;
    width: 54px;
    height: 54px;
    place-items: center;
    font-size: 23px;
    color: #6ee7b7;
    background: rgba(16, 185, 129, .15);
    border: 1px solid rgba(110, 231, 183, .2);
    border-radius: 16px;
}

.admin-password-hero-copy > div > span,
.admin-password-card-header > div > span,
.admin-password-guidance-card header div > span {
    display: block;
    margin-bottom: 6px;
    font-size: 10px;
    font-weight: 750;
    line-height: 1.3;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.admin-password-hero-copy > div > span {
    color: #6ee7b7;
}

.admin-password-hero h1 {
    margin: 0;
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 750;
    line-height: 1.14;
    letter-spacing: -.04em;
    color: #fff;
}

.admin-password-hero-copy p {
    max-width: 650px;
    margin: 11px 0 0;
    font-size: 13px;
    line-height: 1.7;
    color: #cbd5e1;
}

.admin-password-hero-status {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 0 0 250px;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    background: rgba(8, 15, 29, .3);
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 14px;
    backdrop-filter: blur(8px);
}

.admin-password-status-icon {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    color: #93c5fd;
    background: rgba(59, 130, 246, .13);
    border-radius: 11px;
}

.admin-password-hero-status > div {
    min-width: 0;
}

.admin-password-hero-status > div > span,
.admin-password-hero-status small {
    display: block;
    overflow: hidden;
    font-size: 10px;
    line-height: 1.4;
    color: #94a3b8 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-password-hero-status strong {
    display: block;
    margin: 2px 0;
    overflow: hidden;
    font-size: 13px;
    color: #fff;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-password-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 315px;
    gap: 18px;
    align-items: start;
    margin-top: 18px;
}

.admin-password-card,
.admin-password-guidance-card,
.admin-password-security-note {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

.admin-password-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 22px 24px;
    border-bottom: 1px solid var(--border);
}

.admin-password-card-header > div > span,
.admin-password-guidance-card header div > span {
    color: var(--accent-700);
}

.admin-password-card-header h2,
.admin-password-guidance-card h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 750;
    line-height: 1.3;
    letter-spacing: -.02em;
    color: var(--text);
}

.admin-password-card-header p {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-muted);
}

.admin-password-card-icon {
    display: grid;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    place-items: center;
    color: var(--accent-700);
    background: var(--accent-soft);
    border-radius: 11px;
}

.admin-password-form {
    padding: 24px;
}

.admin-password-field {
    max-width: 620px;
    margin-bottom: 21px;
}

.admin-password-field > label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.admin-password-input {
    position: relative;
}

.admin-password-input-icon {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 14px;
    display: grid;
    width: 18px;
    place-items: center;
    color: var(--text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.admin-password-input .form-control {
    height: 46px;
    padding-right: 48px;
    padding-left: 42px;
    font-size: 13px;
    border-radius: 10px !important;
}

.admin-password-input .form-control:focus + .admin-password-reveal {
    color: var(--accent-600);
}

.admin-password-reveal {
    position: absolute;
    z-index: 3;
    top: 50%;
    right: 5px;
    display: grid;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    transform: translateY(-50%);
}

.admin-password-reveal:hover,
.admin-password-reveal:focus {
    color: var(--accent-700);
    background: var(--accent-soft);
}

.admin-password-field > small,
.admin-password-match {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 8px;
    font-size: 10px;
    line-height: 1.5;
    color: var(--text-muted) !important;
}

.admin-password-field > small i,
.admin-password-match i {
    margin-top: 2px;
}

.admin-password-match.is-valid {
    color: #047857 !important;
}

.admin-password-match.is-invalid {
    color: #be123c !important;
}

html.dark .admin-password-match.is-valid {
    color: #6ee7b7 !important;
}

html.dark .admin-password-match.is-invalid {
    color: #fda4af !important;
}

.admin-password-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 620px;
    margin: 24px 0 21px;
    color: var(--text-muted);
}

.admin-password-divider::before,
.admin-password-divider::after {
    flex: 1 1 auto;
    height: 1px;
    content: "";
    background: var(--border);
}

.admin-password-divider span {
    flex: 0 0 auto;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.admin-password-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 9px;
}

.admin-password-strength-track {
    flex: 0 0 120px;
    height: 5px;
    overflow: hidden;
    background: var(--surface-3);
    border-radius: 999px;
}

.admin-password-strength-track span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--text-muted);
    border-radius: inherit;
    transition: width .2s ease, background-color .2s ease;
}

.admin-password-strength > span {
    font-size: 10px;
    color: var(--text-muted);
}

.admin-password-strength.is-weak .admin-password-strength-track span {
    width: 25%;
    background: var(--rose);
}

.admin-password-strength.is-fair .admin-password-strength-track span {
    width: 50%;
    background: var(--amber);
}

.admin-password-strength.is-good .admin-password-strength-track span {
    width: 75%;
    background: var(--blue);
}

.admin-password-strength.is-strong .admin-password-strength-track span {
    width: 100%;
    background: var(--accent);
}

.admin-password-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 20px;
    margin-top: 8px;
    border-top: 1px solid var(--border);
}

.admin-password-actions > div:first-child {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 360px;
    font-size: 10px;
    line-height: 1.5;
    color: var(--text-muted);
}

.admin-password-actions > div:first-child i {
    margin-top: 2px;
    color: var(--accent-600);
}

.admin-password-action-buttons {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.admin-password-action-buttons .btn {
    min-height: 40px;
    padding: 9px 16px;
    font-weight: 700;
    border-radius: 9px;
}

.admin-password-guidance {
    position: sticky;
    top: 74px;
    display: grid;
    gap: 14px;
}

.admin-password-guidance-card {
    padding: 20px;
}

.admin-password-guidance-card header {
    display: flex;
    align-items: center;
    gap: 11px;
}

.admin-password-guidance-card header > span {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    color: var(--accent-700);
    background: var(--accent-soft);
    border-radius: 11px;
}

.admin-password-guidance-card h2 {
    font-size: 15px;
}

.admin-password-guidance-card ul {
    display: grid;
    gap: 9px;
    padding: 0;
    margin: 18px 0 0;
    list-style: none;
}

.admin-password-guidance-card li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 11px;
    font-size: 11px;
    line-height: 1.45;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease;
}

.admin-password-guidance-card li i {
    margin-top: 2px;
}

.admin-password-guidance-card li.is-valid {
    color: #047857;
    background: rgba(16, 185, 129, .08);
    border-color: rgba(16, 185, 129, .18);
}

html.dark .admin-password-guidance-card li.is-valid {
    color: #6ee7b7;
}

.admin-password-security-note {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 17px;
    background: rgba(59, 130, 246, .07);
    border-color: rgba(59, 130, 246, .16);
}

.admin-password-security-note > span {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #2563eb;
    background: rgba(59, 130, 246, .11);
    border-radius: 10px;
}

html.dark .admin-password-security-note > span {
    color: #93c5fd;
}

.admin-password-security-note strong {
    display: block;
    font-size: 11px;
    color: var(--text);
}

.admin-password-security-note p {
    margin: 4px 0 0;
    font-size: 10px;
    line-height: 1.55;
    color: var(--text-muted);
}

@media (max-width: 900px) {
    .admin-password-layout {
        grid-template-columns: 1fr;
    }

    .admin-password-guidance {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    body.admin-route-settings.admin-action-change-password .content-wrapper > .content {
        padding: 14px !important;
    }

    .admin-password-hero {
        align-items: stretch;
        flex-direction: column;
        padding: 23px;
    }

    .admin-password-hero-status {
        flex-basis: auto;
        width: 100%;
    }

    .admin-password-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-password-action-buttons {
        justify-content: flex-end;
    }
}

@media (max-width: 520px) {
    .admin-password-hero-copy {
        flex-direction: column;
    }

    .admin-password-card-header,
    .admin-password-form {
        padding: 18px;
    }

    .admin-password-card-icon {
        display: none;
    }

    .admin-password-strength {
        align-items: stretch;
        flex-direction: column;
        gap: 7px;
    }

    .admin-password-strength-track {
        flex-basis: auto;
        width: 100%;
    }

    .admin-password-action-buttons {
        display: grid;
        grid-template-columns: 1fr;
    }

    .admin-password-action-buttons .btn {
        width: 100%;
    }

    .admin-password-guidance {
        grid-template-columns: 1fr;
    }
}

/* =====================================================================
   Service plan card actions
   One integrated footer for Hotspot, PPPoE and VPN plan cards.
   ===================================================================== */
.service-plan-card > .service-plan-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 60px;
    padding: 11px 14px;
    margin: 15px -16px -16px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 0 0 12px 12px;
}

.service-plan-card-footer .service-plan-id {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    line-height: 1.25;
}

.service-plan-card-footer .service-plan-id > span {
    font-family: var(--font);
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .08em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.service-plan-card-footer .service-plan-id > strong {
    font-size: 11px;
    font-weight: 750;
    color: var(--text);
}

.service-plan-card-footer .service-plan-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
}

.service-plan-card-footer .service-plan-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 64px;
    min-height: 35px;
    padding: 7px 8px;
    margin: 0;
    font-size: 10px;
    font-weight: 750;
    line-height: 1;
    border: 1px solid transparent !important;
    border-radius: 9px;
    box-shadow: none !important;
    transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.service-plan-card.is-portal-hidden {
    border-color: rgba(245, 158, 11, .42);
}

.service-plan-tags .is-portal-hidden {
    color: #92400e;
    background: rgba(245, 158, 11, .13);
    border-color: rgba(245, 158, 11, .24);
}

.service-plan-card-footer .service-plan-visibility-form {
    display: flex;
    margin: 0;
}

.service-plan-card-footer .service-plan-visibility.is-hide {
    color: #a16207 !important;
    background: rgba(245, 158, 11, .11) !important;
    border-color: rgba(245, 158, 11, .23) !important;
}

.service-plan-card-footer .service-plan-visibility.is-show {
    color: #0369a1 !important;
    background: rgba(14, 165, 233, .1) !important;
    border-color: rgba(14, 165, 233, .22) !important;
}

.service-plan-card-footer .service-plan-visibility:hover,
.service-plan-card-footer .service-plan-visibility:focus {
    color: #fff !important;
    background: #0284c7 !important;
    border-color: #0284c7 !important;
    transform: translateY(-1px);
}

.service-plan-card-footer .service-plan-edit {
    color: var(--accent-700) !important;
    background: var(--accent-soft) !important;
    border-color: rgba(16, 185, 129, .2) !important;
}

.service-plan-card-footer .service-plan-edit:hover,
.service-plan-card-footer .service-plan-edit:focus {
    color: #fff !important;
    background: var(--accent-600) !important;
    border-color: var(--accent-600) !important;
    transform: translateY(-1px);
}

.service-plan-card-footer .service-plan-delete {
    color: #be123c !important;
    background: rgba(244, 63, 94, .09) !important;
    border-color: rgba(244, 63, 94, .17) !important;
}

.service-plan-card-footer .service-plan-delete:hover,
.service-plan-card-footer .service-plan-delete:focus {
    color: #fff !important;
    background: #e11d48 !important;
    border-color: #e11d48 !important;
    transform: translateY(-1px);
}

html.dark .service-plan-tags .is-portal-hidden {
    color: #fcd34d;
    background: rgba(245, 158, 11, .14);
    border-color: rgba(251, 191, 36, .24);
}

html.dark .service-plan-card-footer .service-plan-visibility.is-hide {
    color: #fcd34d !important;
    background: rgba(245, 158, 11, .13) !important;
    border-color: rgba(251, 191, 36, .22) !important;
}

html.dark .service-plan-card-footer .service-plan-visibility.is-show {
    color: #7dd3fc !important;
    background: rgba(14, 165, 233, .13) !important;
    border-color: rgba(56, 189, 248, .22) !important;
}

html.dark .service-plan-card-footer .service-plan-edit {
    color: #6ee7b7 !important;
    background: rgba(16, 185, 129, .14) !important;
    border-color: rgba(52, 211, 153, .2) !important;
}

html.dark .service-plan-card-footer .service-plan-delete {
    color: #fda4af !important;
    background: rgba(244, 63, 94, .12) !important;
    border-color: rgba(251, 113, 133, .2) !important;
}

html.dark .service-plan-card-footer .service-plan-edit:hover,
html.dark .service-plan-card-footer .service-plan-edit:focus {
    color: #fff !important;
    background: #059669 !important;
    border-color: #059669 !important;
}

html.dark .service-plan-card-footer .service-plan-delete:hover,
html.dark .service-plan-card-footer .service-plan-delete:focus {
    color: #fff !important;
    background: #e11d48 !important;
    border-color: #e11d48 !important;
}

@media (max-width: 460px) {
    .service-plan-card > .service-plan-card-footer {
        align-items: stretch;
        flex-direction: column;
        gap: 9px;
    }

    .service-plan-card-footer .service-plan-id {
        align-items: baseline;
        flex-direction: row;
        gap: 5px;
    }

    .service-plan-card-footer .service-plan-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
    }

    .service-plan-card-footer .service-plan-visibility-form,
    .service-plan-card-footer .service-plan-visibility-form .btn {
        width: 100%;
    }

    .service-plan-card-footer .service-plan-actions .btn {
        width: 100%;
        min-width: 0;
    }
}

@media (hover: none) and (pointer: coarse) {
    .service-plan-card-footer .service-plan-actions .btn {
        min-height: 42px;
    }
}

/* =====================================================================
   Customer login wallpaper preset gallery
   ===================================================================== */
.login-wallpaper-setting > .control-label {
    padding-top: 5px;
}

.login-wallpaper-picker {
    min-width: 0;
    padding: 0;
    margin: 0;
    border: 0;
}

.login-wallpaper-picker > legend {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
    margin: 0 0 5px;
    color: var(--text);
    border: 0;
}

.login-wallpaper-picker > legend > span {
    font-size: 13px;
    font-weight: 750;
}

.login-wallpaper-picker > legend > small {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 9px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .045em;
    color: var(--accent-700) !important;
    text-transform: uppercase;
    background: var(--accent-soft);
    border-radius: 999px;
}

.login-wallpaper-intro {
    margin: 0 0 14px;
    font-size: 11px;
    line-height: 1.55;
    color: var(--text-muted);
}

.login-wallpaper-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.login-wallpaper-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 210px;
    flex-direction: column;
    padding: 7px;
    margin: 0;
    overflow: hidden;
    color: var(--text);
    cursor: pointer;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 13px;
    box-shadow: var(--shadow-sm);
    transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.login-wallpaper-card:hover,
.login-wallpaper-card:focus-within {
    border-color: rgba(16, 185, 129, .55);
    box-shadow: 0 10px 24px -20px rgba(15, 23, 42, .65);
    transform: translateY(-2px);
}

.login-wallpaper-card.is-selected {
    background: var(--accent-soft);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, .1);
}

.login-wallpaper-card > input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.login-wallpaper-card > input:focus-visible ~ .login-wallpaper-preview {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.login-wallpaper-preview {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0f172a;
    border-radius: 9px;
}

.login-wallpaper-preview::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(180deg, transparent 58%, rgba(2, 6, 23, .3));
    pointer-events: none;
}

.login-wallpaper-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.login-wallpaper-card:hover .login-wallpaper-preview img {
    transform: scale(1.025);
}

.login-wallpaper-current-badge {
    position: absolute;
    z-index: 2;
    bottom: 8px;
    left: 8px;
    display: inline-flex;
    padding: 4px 7px;
    font-size: 8px;
    font-weight: 750;
    letter-spacing: .06em;
    color: #fff;
    text-transform: uppercase;
    background: rgba(15, 23, 42, .7);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    backdrop-filter: blur(6px);
}

.login-wallpaper-card-copy {
    display: block;
    min-width: 0;
    padding: 10px 7px 7px;
}

.login-wallpaper-card-copy strong,
.login-wallpaper-card-copy small {
    display: block;
}

.login-wallpaper-card-copy strong {
    margin-bottom: 4px;
    overflow: hidden;
    font-size: 11px;
    font-weight: 750;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-wallpaper-card-copy small {
    display: -webkit-box;
    min-height: 29px;
    overflow: hidden;
    font-size: 9px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--text-muted) !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.login-wallpaper-check {
    position: absolute;
    z-index: 3;
    top: 14px;
    right: 14px;
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
    font-size: 10px;
    color: #fff;
    background: var(--accent-600);
    border: 2px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .28);
    opacity: 0;
    transform: scale(.7);
    transition: opacity .16s ease, transform .16s ease;
}

.login-wallpaper-card.is-selected .login-wallpaper-check {
    opacity: 1;
    transform: scale(1);
}

.login-wallpaper-upload {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(220px, 300px);
    align-items: center;
    gap: 12px;
    padding: 14px;
    margin-top: 14px;
    background: var(--surface-2);
    border: 1px dashed var(--border);
    border-radius: 12px;
}

.login-wallpaper-upload-icon {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    font-size: 15px;
    color: var(--accent-700);
    background: var(--accent-soft);
    border-radius: 10px;
}

.login-wallpaper-upload label,
.login-wallpaper-upload p {
    display: block;
    margin: 0;
}

.login-wallpaper-upload label {
    font-size: 11px;
    font-weight: 750;
    color: var(--text);
}

.login-wallpaper-upload p {
    margin-top: 3px;
    font-size: 9px;
    line-height: 1.45;
    color: var(--text-muted);
}

.login-wallpaper-upload .form-control {
    width: 100%;
    min-width: 0;
    height: auto;
    padding: 7px;
    font-size: 10px;
    background: var(--surface) !important;
}

.login-wallpaper-size-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 8px;
    font-size: 9px;
    line-height: 1.45;
    color: var(--text-muted) !important;
}

.login-wallpaper-size-note i {
    margin-top: 2px;
    color: var(--accent-600);
}

html.dark .login-wallpaper-card:hover,
html.dark .login-wallpaper-card:focus-within {
    box-shadow: 0 12px 26px -20px rgba(0, 0, 0, .9);
}

@media (max-width: 1100px) {
    .login-wallpaper-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .login-wallpaper-upload {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .login-wallpaper-upload .form-control {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .login-wallpaper-setting > .control-label {
        margin-bottom: 9px;
    }

    .login-wallpaper-picker > legend {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .login-wallpaper-gallery {
        grid-template-columns: 1fr;
    }

    .login-wallpaper-card {
        min-height: 0;
    }

    .login-wallpaper-upload {
        grid-template-columns: 1fr;
    }
}

/* Customer directory: compact, ordered phone layout. */
@media (max-width: 650px) {
    .customer-directory-filter-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 8px;
    }

    .customer-directory-filter-actions .customer-directory-filter-reset {
        grid-column: 1 / -1;
    }

    .customer-directory-card-heading {
        align-items: flex-start;
        padding: 15px;
    }

    .customer-directory-table-wrap {
        padding: 10px;
    }

    .customer-directory-table tr {
        margin-bottom: 12px;
        padding: 14px;
        overflow: hidden;
        border-radius: 15px;
        box-shadow: 0 8px 24px -24px rgba(15, 23, 42, .85);
    }

    .customer-directory-table tr:last-child {
        margin-bottom: 0;
    }

    .customer-directory-table td {
        display: flex;
        min-height: 38px;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 9px 0;
        text-align: right;
    }

    .customer-directory-table td::before {
        flex: 0 0 76px;
    }

    .customer-directory-table .customer-directory-person-cell {
        display: block;
        min-height: 52px;
        padding: 0 38px 13px 0;
        text-align: left;
    }

    .customer-directory-person-cell::before {
        display: none;
    }

    .customer-directory-person {
        justify-content: flex-start;
    }

    .customer-directory-person img {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .customer-directory-person strong {
        font-size: 13px;
    }

    .customer-directory-contact,
    .customer-directory-service,
    .customer-directory-network,
    .customer-directory-status-cell > span,
    .customer-directory-created-cell > span {
        min-width: 0;
        margin-left: auto;
    }

    .customer-directory-service,
    .customer-directory-network {
        text-align: right;
    }

    .customer-directory-live-plans {
        align-items: flex-end;
    }

    .customer-directory-contact {
        justify-content: flex-end;
    }

    .customer-directory-contact a {
        min-height: 34px;
        padding: 7px 9px;
    }

    .customer-directory-pagination {
        padding: 11px;
        overflow-x: auto;
    }

    .customer-directory-selection {
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        left: 12px;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        padding: 9px;
    }

    .customer-directory-selection > div {
        align-items: center;
        flex-direction: column;
        gap: 0;
        padding: 0 4px;
        line-height: 1.1;
    }

    .customer-directory-selection .btn {
        min-width: 0;
        justify-content: center;
        padding-right: 10px;
        padding-left: 10px;
        white-space: nowrap;
    }
}

@media (max-width: 460px) {
    .customer-directory-hero-actions {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-directory-hero-actions .btn {
        width: 100%;
    }

    .customer-directory-contact {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
    }

    .customer-directory-contact a {
        width: auto;
        max-width: 100%;
    }

    .customer-directory-contact a span {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .customer-directory-modal .modal-footer {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .customer-directory-modal .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

@media (max-width: 360px) {
    .customer-directory-hero-actions,
    .customer-directory-filter-actions,
    .customer-directory-actions {
        grid-template-columns: 1fr;
    }

    .customer-directory-filter-actions .customer-directory-filter-reset {
        grid-column: auto;
    }

    .customer-directory-selection {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .customer-directory-selection #clearCustomerSelection {
        grid-column: 1 / -1;
    }
}


/* =====================================================================
   Active customer subscriptions
   ===================================================================== */

.subscription-directory-page {
    max-width: 1440px;
    margin: 0 auto;
}

.subscription-directory-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 22px;
    margin-bottom: 16px;
    padding: clamp(23px, 3.5vw, 38px);
    overflow: hidden;
    border-radius: 20px;
    background:
        radial-gradient(circle at 90% 8%, rgba(125, 211, 252, .2), transparent 28%),
        linear-gradient(135deg, #111827, #1e3a8a 58%, #0369a1);
    color: #fff;
    box-shadow: 0 22px 48px -36px rgba(3, 105, 161, .9);
}

.subscription-directory-hero::after {
    position: absolute;
    right: -90px;
    bottom: -190px;
    width: 350px;
    height: 350px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    content: "";
}

.subscription-directory-hero > * {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.subscription-directory-hero-copy {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.subscription-directory-hero-icon {
    display: inline-flex;
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 14px;
    background: rgba(255, 255, 255, .1);
    color: #bae6fd;
    font-size: 20px;
}

.subscription-directory-hero-copy > div > span {
    display: block;
    margin-bottom: 5px;
    color: #7dd3fc;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.subscription-directory-hero h1,
.subscription-directory-hero p {
    margin: 0;
}

.subscription-directory-hero h1 {
    color: #fff;
    font-size: clamp(27px, 3.8vw, 40px);
    font-weight: 750;
    letter-spacing: -.035em;
    line-height: 1.12;
}

.subscription-directory-hero p {
    max-width: 650px;
    margin-top: 8px;
    color: rgba(255, 255, 255, .7);
    font-size: 13px;
    line-height: 1.6;
}

.subscription-directory-hero-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.subscription-directory-hero-actions .btn {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 10px;
    background: rgba(15, 23, 42, .28);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.subscription-directory-hero-actions .btn:hover,
.subscription-directory-hero-actions .btn:focus {
    border-color: rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .15);
    color: #fff;
}

.subscription-directory-hero-actions .btn-primary {
    border-color: #0284c7;
    background: #0284c7;
}

.subscription-directory-summary {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.subscription-directory-summary > div {
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 11px;
    background: rgba(15, 23, 42, .24);
}

.subscription-directory-summary span,
.subscription-directory-summary strong {
    display: block;
    overflow-wrap: anywhere;
}

.subscription-directory-summary span {
    margin-bottom: 3px;
    color: rgba(255, 255, 255, .55);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.subscription-directory-summary strong {
    color: #fff;
    font-size: 13px;
}

.subscription-directory-filter-card,
.subscription-directory-results {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.subscription-directory-filter-card {
    margin-bottom: 16px;
    padding: 14px;
}

.subscription-directory-filter-card form {
    display: grid;
    grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(135px, .75fr)) auto;
    align-items: end;
    gap: 10px;
}

.subscription-directory-filter-card label {
    display: block;
    min-width: 0;
    margin: 0;
}

.subscription-directory-filter-card label > span {
    display: block;
    margin: 0 0 5px 2px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.subscription-directory-search {
    position: relative;
    min-width: 0;
}

.subscription-directory-search > i {
    position: absolute;
    top: 50%;
    left: 13px;
    color: var(--text-muted);
    transform: translateY(-50%);
}

.subscription-directory-search input,
.subscription-directory-filter-card select {
    width: 100%;
    height: 41px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: 0;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 12px;
}

.subscription-directory-search input {
    padding: 8px 12px 8px 37px;
}

.subscription-directory-filter-card select {
    padding: 8px 10px;
}

.subscription-directory-search input:focus,
.subscription-directory-filter-card select:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.subscription-directory-filter-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.subscription-directory-filter-actions .btn {
    display: inline-flex;
    min-height: 41px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.subscription-directory-results {
    overflow: hidden;
}

.subscription-directory-results-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 17px 19px;
    border-bottom: 1px solid var(--border);
}

.subscription-directory-results-heading h2,
.subscription-directory-results-heading p {
    margin: 0;
}

.subscription-directory-results-heading h2 {
    color: var(--text);
    font-size: 16px;
    font-weight: 750;
}

.subscription-directory-results-heading p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

.subscription-directory-results-heading > span {
    padding: 6px 9px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.subscription-directory-table-wrap {
    min-width: 0;
    overflow-x: auto;
}

.subscription-directory-table {
    width: 100%;
    border-collapse: collapse;
}

.subscription-directory-table th,
.subscription-directory-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 11px;
    line-height: 1.45;
    text-align: left;
    vertical-align: middle;
}

.subscription-directory-table th {
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.subscription-directory-table tbody tr:last-child td {
    border-bottom: 0;
}

.subscription-directory-table tbody tr:hover td {
    background: var(--accent-soft);
}

.subscription-directory-row.is-expired td {
    background: rgba(239, 68, 68, .035);
}

.subscription-directory-customer {
    display: flex;
    min-width: 140px;
    align-items: center;
    gap: 9px;
}

.subscription-directory-avatar {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-700);
}

.subscription-directory-customer > span:last-child,
.subscription-directory-customer a,
.subscription-directory-customer small,
.subscription-directory-plan > a,
.subscription-directory-plan > strong,
.subscription-directory-plan > small {
    display: block;
}

.subscription-directory-customer a,
.subscription-directory-plan > a,
.subscription-directory-plan > strong {
    color: var(--text);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.subscription-directory-customer small {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 9px;
}

.subscription-directory-plan {
    min-width: 130px;
}

.subscription-directory-live:empty {
    display: none;
}

.subscription-directory-live:not(:empty) {
    display: inline-flex;
    margin-top: 5px;
}

.subscription-data-state {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 9px;
}

.subscription-data-state.is-exhausted {
    width: fit-content;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(239, 68, 68, .12);
    color: #b91c1c;
    font-weight: 700;
}

html.dark .subscription-data-state.is-exhausted {
    color: #fca5a5;
}

.subscription-type-badge,
.subscription-status-badge,
.subscription-directory-location {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.subscription-type-badge {
    padding: 5px 7px;
    border-radius: 7px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 750;
    text-transform: uppercase;
}

.subscription-status-badge {
    min-height: 27px;
    padding: 5px 9px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.subscription-status-badge i {
    font-size: 7px;
}

.subscription-status-badge.is-active {
    border-color: rgba(22, 163, 74, .3);
    background: rgba(34, 197, 94, .14);
    color: #166534;
}

.subscription-status-badge.is-expired {
    border-color: rgba(220, 38, 38, .26);
    background: rgba(239, 68, 68, .12);
    color: #b91c1c;
}

html.dark .subscription-status-badge.is-active {
    color: #86efac;
}

html.dark .subscription-status-badge.is-expired {
    color: #fca5a5;
}

.subscription-directory-date,
.subscription-directory-method,
.subscription-directory-location {
    color: var(--text-muted);
    font-size: 10px;
}

.subscription-directory-location {
    max-width: 150px;
    overflow-wrap: anywhere;
}

.subscription-directory-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.subscription-directory-actions .btn {
    display: inline-flex;
    min-width: 31px;
    min-height: 31px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 10px;
}

.subscription-directory-pagination {
    display: flow-root;
    padding: 11px 17px;
    border-top: 1px solid var(--border);
}

.subscription-directory-pagination .pagination {
    margin: 0;
}

.subscription-directory-empty {
    padding: 50px 20px;
    color: var(--text-muted);
    text-align: center;
}

.subscription-directory-empty > i {
    margin-bottom: 10px;
    color: var(--border-strong);
    font-size: 34px;
}

.subscription-directory-empty h3,
.subscription-directory-empty p {
    margin: 0;
}

.subscription-directory-empty h3 {
    color: var(--text);
    font-size: 16px;
}

.subscription-directory-empty p {
    margin: 6px 0 14px;
    font-size: 11px;
}

@media (max-width: 1180px) {
    .subscription-directory-filter-card form {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .subscription-directory-search {
        grid-column: span 2;
    }

    .subscription-directory-filter-actions {
        grid-column: span 2;
        justify-content: flex-end;
    }
}

@media (max-width: 900px) {
    .subscription-directory-hero {
        grid-template-columns: 1fr;
    }

    .subscription-directory-hero-actions {
        justify-content: flex-start;
    }

    .subscription-directory-table-wrap {
        overflow: visible;
        padding: 11px;
    }

    .subscription-directory-table,
    .subscription-directory-table tbody,
    .subscription-directory-table tr,
    .subscription-directory-table td {
        display: block;
        width: 100%;
    }

    .subscription-directory-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
    }

    .subscription-directory-table tr {
        margin-bottom: 11px;
        padding: 13px;
        overflow: hidden;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: var(--surface-2);
    }

    .subscription-directory-table tr:last-child {
        margin-bottom: 0;
    }

    .subscription-directory-table td {
        display: flex;
        min-height: 38px;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 9px 0;
        border: 0;
        border-bottom: 1px solid var(--border);
        background: transparent !important;
        text-align: right;
    }

    .subscription-directory-table td::before {
        flex: 0 0 78px;
        color: var(--text-muted);
        content: attr(data-label);
        font-size: 10px;
        font-weight: 700;
        text-align: left;
    }

    .subscription-directory-table .subscription-directory-customer-cell {
        display: block;
        min-height: 48px;
        padding: 0 0 12px;
        text-align: left;
    }

    .subscription-directory-customer-cell::before {
        display: none;
    }

    .subscription-directory-customer {
        min-width: 0;
    }

    .subscription-directory-avatar {
        width: 40px;
        height: 40px;
    }

    .subscription-directory-plan,
    .subscription-directory-location,
    .subscription-directory-date,
    .subscription-directory-method,
    .subscription-status-badge,
    .subscription-type-badge {
        min-width: 0;
        margin-left: auto;
    }

    .subscription-directory-plan {
        text-align: right;
    }

    .subscription-data-state.is-exhausted {
        margin-left: auto;
    }

    .subscription-directory-table .subscription-directory-actions-cell {
        display: block;
        padding-top: 12px;
        border-bottom: 0;
        text-align: left;
    }

    .subscription-directory-actions-cell::before {
        display: block;
        margin-bottom: 8px;
    }

    .subscription-directory-actions {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
        white-space: normal;
    }

    .subscription-directory-actions .btn {
        width: 100%;
        min-height: 42px;
        gap: 7px;
        font-size: 11px;
    }
}

@media (max-width: 650px) {
    .subscription-directory-hero {
        padding: 21px 18px;
        border-radius: 17px;
    }

    .subscription-directory-hero-copy {
        gap: 11px;
    }

    .subscription-directory-hero-icon {
        width: 46px;
        height: 46px;
    }

    .subscription-directory-hero-actions,
    .subscription-directory-filter-actions {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .subscription-directory-hero-actions .btn,
    .subscription-directory-filter-actions .btn {
        width: 100%;
    }

    .subscription-directory-summary,
    .subscription-directory-filter-card form {
        grid-template-columns: 1fr;
    }

    .subscription-directory-search,
    .subscription-directory-filter-actions {
        grid-column: auto;
    }

    .subscription-directory-results-heading {
        align-items: flex-start;
        padding: 15px;
    }

    .subscription-directory-pagination {
        padding: 11px;
        overflow-x: auto;
    }
}

@media (max-width: 390px) {
    .subscription-directory-hero-copy {
        display: block;
    }

    .subscription-directory-hero-icon {
        margin-bottom: 12px;
    }

    .subscription-directory-hero-actions {
        grid-template-columns: 1fr;
    }

    .subscription-directory-table-wrap {
        padding: 8px;
    }

    .subscription-directory-table tr {
        padding: 12px;
    }

    .subscription-directory-table td::before {
        flex-basis: 70px;
    }
}

/* =====================================================================
   Coupon directory
   ===================================================================== */

.coupon-directory-page,
.widget-manager-page {
    max-width: 1440px;
    margin: 0 auto;
}

.coupon-directory-hero,
.widget-manager-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 22px;
    margin-bottom: 16px;
    padding: clamp(23px, 3.5vw, 38px);
    overflow: hidden;
    border-radius: 20px;
    color: #fff;
    box-shadow: 0 22px 48px -36px rgba(67, 56, 202, .9);
}

.coupon-directory-hero {
    background:
        radial-gradient(circle at 90% 7%, rgba(216, 180, 254, .22), transparent 28%),
        linear-gradient(135deg, #111827, #4c1d95 58%, #7e22ce);
}

.widget-manager-hero {
    background:
        radial-gradient(circle at 90% 7%, rgba(153, 246, 228, .2), transparent 28%),
        linear-gradient(135deg, #111827, #134e4a 58%, #0f766e);
}

.coupon-directory-hero::after,
.widget-manager-hero::after {
    position: absolute;
    right: -90px;
    bottom: -190px;
    width: 350px;
    height: 350px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
    content: "";
}

.coupon-directory-hero > *,
.widget-manager-hero > * {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.coupon-directory-hero-copy,
.widget-manager-hero-copy {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.coupon-directory-hero-icon,
.widget-manager-hero-icon {
    display: inline-flex;
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 14px;
    background: rgba(255, 255, 255, .1);
    font-size: 20px;
}

.coupon-directory-hero-icon {
    color: #e9d5ff;
}

.widget-manager-hero-icon {
    color: #99f6e4;
}

.coupon-directory-hero-copy > div > span,
.widget-manager-hero-copy > div > span {
    display: block;
    margin-bottom: 5px;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.coupon-directory-hero-copy > div > span {
    color: #d8b4fe;
}

.widget-manager-hero-copy > div > span {
    color: #5eead4;
}

.coupon-directory-hero h1,
.coupon-directory-hero p,
.widget-manager-hero h1,
.widget-manager-hero p {
    margin: 0;
}

.coupon-directory-hero h1,
.widget-manager-hero h1 {
    color: #fff;
    font-size: clamp(27px, 3.8vw, 40px);
    font-weight: 750;
    letter-spacing: -.035em;
    line-height: 1.12;
}

.coupon-directory-hero p,
.widget-manager-hero p {
    max-width: 650px;
    margin-top: 8px;
    color: rgba(255, 255, 255, .7);
    font-size: 13px;
    line-height: 1.6;
}

.coupon-directory-hero-actions {
    display: flex;
    justify-content: flex-end;
}

.coupon-directory-hero-actions .btn {
    display: inline-flex;
    min-height: 41px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    border: 1px solid #a855f7;
    border-radius: 10px;
    background: #9333ea;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.coupon-directory-summary,
.widget-manager-summary {
    display: grid;
    grid-column: 1 / -1;
    gap: 8px;
}

.coupon-directory-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.widget-manager-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.coupon-directory-summary > div,
.widget-manager-summary > div {
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 11px;
    background: rgba(15, 23, 42, .24);
}

.coupon-directory-summary span,
.coupon-directory-summary strong,
.widget-manager-summary span,
.widget-manager-summary strong {
    display: block;
    overflow-wrap: anywhere;
}

.coupon-directory-summary span,
.widget-manager-summary span {
    margin-bottom: 3px;
    color: rgba(255, 255, 255, .55);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.coupon-directory-summary strong,
.widget-manager-summary strong {
    color: #fff;
    font-size: 13px;
}

.coupon-directory-filter-card,
.coupon-directory-results,
.widget-role-tabs,
.widget-structure-card,
.widget-area-card {
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.coupon-directory-filter-card {
    margin-bottom: 16px;
    padding: 14px;
}

.coupon-directory-filter-card form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    align-items: center;
    gap: 8px;
}

.coupon-directory-search {
    position: relative;
    min-width: 0;
}

.coupon-directory-search > i {
    position: absolute;
    top: 50%;
    left: 13px;
    color: var(--text-muted);
    transform: translateY(-50%);
}

.coupon-directory-search input {
    width: 100%;
    height: 41px;
    padding: 8px 12px 8px 37px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: 0;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 12px;
}

.coupon-directory-search input:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.coupon-directory-filter-card .btn {
    display: inline-flex;
    min-height: 41px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.coupon-directory-results {
    overflow: hidden;
}

.coupon-directory-results-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 17px 19px;
    border-bottom: 1px solid var(--border);
}

.coupon-directory-results-heading h2,
.coupon-directory-results-heading p {
    margin: 0;
}

.coupon-directory-results-heading h2 {
    color: var(--text);
    font-size: 16px;
    font-weight: 750;
}

.coupon-directory-results-heading p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 11px;
}

.coupon-select-all {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 6px 10px;
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.coupon-select-all input,
.coupon-card-select input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--accent);
}

.coupon-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 14px;
}

.coupon-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
}

.coupon-card.is-inactive {
    opacity: .82;
}

.coupon-card > header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 13px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.coupon-card-select {
    margin: 0;
}

.coupon-card-code span,
.coupon-card-code strong {
    display: block;
}

.coupon-card-code span {
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.coupon-card-code strong {
    margin-top: 2px;
    overflow-wrap: anywhere;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    letter-spacing: .025em;
}

.coupon-status-badge,
.coupon-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.coupon-status-badge {
    min-height: 26px;
    padding: 5px 8px;
    border: 1px solid;
}

.coupon-status-badge i {
    font-size: 7px;
}

.coupon-status-badge.is-active {
    border-color: rgba(22, 163, 74, .3);
    background: rgba(34, 197, 94, .14);
    color: #166534;
}

.coupon-status-badge.is-inactive {
    border-color: rgba(220, 38, 38, .26);
    background: rgba(239, 68, 68, .12);
    color: #b91c1c;
}

.coupon-status-badge.is-unknown {
    border-color: var(--border);
    background: var(--surface-3);
    color: var(--text-muted);
}

html.dark .coupon-status-badge.is-active {
    color: #86efac;
}

html.dark .coupon-status-badge.is-inactive {
    color: #fca5a5;
}

.coupon-card-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 0;
}

.coupon-card-value strong {
    color: var(--accent-700);
    font-size: 21px;
}

.coupon-type-badge {
    padding: 5px 8px;
    background: var(--accent-soft);
    color: var(--accent-700);
}

.coupon-card-description {
    min-height: 38px;
    margin: 10px 14px 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.coupon-card-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 13px 14px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--border);
}

.coupon-card-facts > div {
    min-width: 0;
    padding: 9px;
    background: var(--surface);
}

.coupon-card-facts dt,
.coupon-card-facts dd {
    margin: 0;
}

.coupon-card-facts dt {
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 750;
    text-transform: uppercase;
}

.coupon-card-facts dd {
    margin-top: 3px;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 10px;
    font-weight: 650;
}

.coupon-card > footer {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.coupon-card > footer .btn {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 700;
}

.coupon-directory-pagination {
    display: flow-root;
    padding: 11px 17px;
    border-top: 1px solid var(--border);
}

.coupon-directory-pagination .pagination {
    margin: 0;
}

.coupon-directory-empty,
.widget-area-empty {
    color: var(--text-muted);
    text-align: center;
}

.coupon-directory-empty {
    padding: 50px 20px;
}

.coupon-directory-empty > i {
    margin-bottom: 10px;
    color: var(--border-strong);
    font-size: 34px;
}

.coupon-directory-empty h3,
.coupon-directory-empty p {
    margin: 0;
}

.coupon-directory-empty h3 {
    color: var(--text);
    font-size: 16px;
}

.coupon-directory-empty p {
    margin: 6px 0 14px;
    font-size: 11px;
}

.coupon-selection-bar {
    position: fixed;
    right: 24px;
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 1040;
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.coupon-selection-bar[hidden] {
    display: none !important;
}

.coupon-selection-bar > div {
    display: flex;
    align-items: baseline;
    gap: 5px;
    padding: 0 8px;
    color: var(--text-muted);
    font-size: 10px;
}

.coupon-selection-bar > div strong {
    color: var(--text);
    font-size: 16px;
}

.coupon-selection-bar .btn {
    min-height: 38px;
    margin: 0;
    border-radius: 8px;
    font-size: 10px;
}

/* =====================================================================
   Dashboard widget manager
   ===================================================================== */

.widget-role-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 16px;
    padding: 6px;
}

.widget-role-tabs a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
}

.widget-role-tabs a:hover,
.widget-role-tabs a:focus {
    background: var(--surface-2);
    color: var(--text);
}

.widget-role-tabs a.is-active {
    background: var(--accent-soft);
    color: var(--accent-700);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, .18);
}

.widget-manager-layout {
    display: grid;
    grid-template-columns: minmax(270px, .36fr) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.widget-structure-card {
    position: sticky;
    top: 72px;
    overflow: hidden;
}

.widget-structure-card > header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.widget-structure-icon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--accent-soft);
    color: var(--accent-700);
}

.widget-structure-card h2,
.widget-structure-card p {
    margin: 0;
}

.widget-structure-card h2 {
    color: var(--text);
    font-size: 14px;
    font-weight: 750;
}

.widget-structure-card p {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.45;
}

.widget-layout-preview {
    display: grid;
    gap: 7px;
    padding: 15px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}

.widget-layout-preview-row {
    display: flex;
    gap: 6px;
    min-width: 0;
}

.widget-layout-slot {
    display: inline-flex;
    min-width: 0;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--border-strong);
    border-radius: 9px;
    background: var(--surface);
    color: var(--accent-700);
    font-size: 11px;
    font-weight: 800;
}

.widget-layout-slot:hover,
.widget-layout-slot:focus {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-700);
}

.widget-layout-span-1 { flex: 1 1 8.333%; }
.widget-layout-span-2 { flex: 2 1 16.666%; }
.widget-layout-span-3 { flex: 3 1 25%; }
.widget-layout-span-4 { flex: 4 1 33.333%; }
.widget-layout-span-5 { flex: 5 1 41.666%; }
.widget-layout-span-6 { flex: 6 1 50%; }
.widget-layout-span-7 { flex: 7 1 58.333%; }
.widget-layout-span-8 { flex: 8 1 66.666%; }
.widget-layout-span-9 { flex: 9 1 75%; }
.widget-layout-span-10 { flex: 10 1 83.333%; }
.widget-layout-span-11 { flex: 11 1 91.666%; }
.widget-layout-span-12 { flex: 12 1 100%; }

.widget-structure-form {
    padding: 15px;
}

.widget-structure-form > label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 750;
    text-transform: uppercase;
}

.widget-structure-form > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 7px;
}

.widget-structure-form .form-control {
    min-width: 0;
    height: 41px;
    border-color: var(--border);
    border-radius: 9px;
    background: var(--surface-2);
    color: var(--text);
}

.widget-structure-form > div .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    border-radius: 9px;
}

.widget-structure-form > .btn {
    display: inline-flex;
    width: 100%;
    min-height: 41px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 9px 0 0;
    border-radius: 9px;
}

.widget-area-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
}

.widget-area-form {
    min-width: 0;
}

.widget-area-card {
    overflow: hidden;
}

.widget-area-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 15px;
    border-bottom: 1px solid var(--border);
}

.widget-area-card > header span,
.widget-area-card > header h2 {
    display: block;
    margin: 0;
}

.widget-area-card > header span {
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 750;
    text-transform: uppercase;
}

.widget-area-card > header h2 {
    margin-top: 2px;
    color: var(--text);
    font-size: 14px;
    font-weight: 750;
}

.widget-area-card > header .btn {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    border-radius: 9px;
    font-size: 10px;
    white-space: nowrap;
}

.widget-area-items {
    display: grid;
    gap: 9px;
    padding: 12px;
    background: var(--surface-2);
}

.widget-manager-item {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
}

.widget-manager-item.is-disabled {
    opacity: .78;
}

.widget-manager-item-copy {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 11px;
    border-bottom: 1px solid var(--border);
}

.widget-manager-item-icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent-700);
}

.widget-manager-item-copy strong,
.widget-manager-item-copy small {
    display: block;
}

.widget-manager-item-copy strong {
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 11px;
}

.widget-manager-item-copy small {
    margin-top: 2px;
    overflow-wrap: anywhere;
    color: var(--text-muted);
    font-size: 9px;
}

.widget-manager-status {
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
    white-space: nowrap;
}

.widget-manager-status.is-enabled {
    background: rgba(34, 197, 94, .14);
    color: #166534;
}

.widget-manager-status.is-disabled {
    background: rgba(239, 68, 68, .12);
    color: #b91c1c;
}

html.dark .widget-manager-status.is-enabled {
    color: #86efac;
}

html.dark .widget-manager-status.is-disabled {
    color: #fca5a5;
}

.widget-manager-item-controls {
    display: grid;
    grid-template-columns: minmax(90px, .4fr) minmax(0, 1fr);
    align-items: end;
    gap: 9px;
    padding: 10px 11px;
}

.widget-manager-item-controls label {
    min-width: 0;
    margin: 0;
}

.widget-manager-item-controls label > span {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 8px;
    font-weight: 750;
    text-transform: uppercase;
}

.widget-manager-item-controls .form-control {
    width: 100%;
    height: 36px;
    min-height: 36px;
    border-color: var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    color: var(--text);
}

.widget-manager-item-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.widget-manager-item-actions .btn {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin: 0;
    border-radius: 8px;
    font-size: 9px;
}

.widget-area-card > footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
}

.widget-area-card > footer .btn {
    display: inline-flex;
    width: 100%;
    min-height: 39px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    border-radius: 9px;
    font-size: 10px;
}

.widget-area-empty {
    padding: 24px 12px;
    border: 1px dashed var(--border-strong);
    border-radius: 10px;
    background: var(--surface);
    font-size: 10px;
}

.widget-area-empty i,
.widget-area-empty span {
    display: block;
}

.widget-area-empty i {
    margin-bottom: 7px;
    color: var(--accent-700);
    font-size: 20px;
}

@media (max-width: 1100px) {
    .widget-manager-layout {
        grid-template-columns: 1fr;
    }

    .widget-structure-card {
        position: static;
    }
}

@media (max-width: 900px) {
    .coupon-card-grid,
    .widget-area-grid {
        grid-template-columns: 1fr;
    }

    .coupon-directory-hero,
    .widget-manager-hero {
        grid-template-columns: 1fr;
    }

    .coupon-directory-hero-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 650px) {
    .coupon-directory-hero,
    .widget-manager-hero {
        padding: 21px 18px;
        border-radius: 17px;
    }

    .coupon-directory-hero-copy,
    .widget-manager-hero-copy {
        gap: 11px;
    }

    .coupon-directory-hero-icon,
    .widget-manager-hero-icon {
        width: 46px;
        height: 46px;
    }

    .coupon-directory-hero-actions,
    .coupon-directory-hero-actions .btn {
        width: 100%;
    }

    .coupon-directory-filter-card form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .coupon-directory-search {
        grid-column: 1 / -1;
    }

    .coupon-directory-filter-card .btn {
        width: 100%;
    }

    .coupon-directory-summary,
    .widget-manager-summary {
        grid-template-columns: 1fr;
    }

    .coupon-directory-results-heading {
        align-items: flex-start;
        flex-direction: column;
        padding: 15px;
    }

    .coupon-select-all {
        width: 100%;
        justify-content: center;
    }

    .coupon-card-grid {
        padding: 10px;
    }

    .coupon-card-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .coupon-selection-bar {
        right: 12px;
        bottom: max(12px, env(safe-area-inset-bottom));
        left: 12px;
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .coupon-selection-bar .btn {
        min-width: 0;
        white-space: nowrap;
    }

    .widget-role-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .widget-area-card > header {
        align-items: stretch;
        flex-direction: column;
    }

    .widget-area-card > header .btn {
        width: 100%;
    }

    .widget-manager-item-controls {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 390px) {
    .coupon-directory-hero-copy,
    .widget-manager-hero-copy {
        display: block;
    }

    .coupon-directory-hero-icon,
    .widget-manager-hero-icon {
        margin-bottom: 12px;
    }

    .coupon-card > header {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .coupon-status-badge {
        grid-column: 1 / -1;
        justify-content: center;
    }

    .coupon-card > footer {
        grid-template-columns: 1fr;
    }

    .coupon-selection-bar {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .coupon-selection-bar #clearCouponSelection {
        grid-column: 1 / -1;
    }

    .widget-manager-item-copy {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .widget-manager-status {
        grid-column: 1 / -1;
        text-align: center;
    }
}

/* =====================================================================
   SweetAlert2 dark-mode support
   SweetAlert2 (bundled, fired from admin/customer templates on nearly every
   confirm/delete) ships its own hardcoded light-theme colours with no theme
   hook, so its dialogs render as an unstyled white box in dark mode. Style
   them with this theme's own custom properties, scoped to html.dark so
   light mode — which already looks correct out of the box — is untouched.
   ===================================================================== */
html.dark .swal2-popup {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}

html.dark .swal2-title {
    color: var(--text);
}

html.dark .swal2-html-container {
    color: var(--text);
}

html.dark .swal2-actions .swal2-styled.swal2-confirm {
    background: var(--accent) !important;
    color: var(--accent-contrast) !important;
}

html.dark .swal2-actions .swal2-styled.swal2-cancel {
    background: var(--surface-2) !important;
    color: var(--text) !important;
}

html.dark .swal2-actions .swal2-styled.swal2-deny {
    background: var(--rose) !important;
    color: #fff !important;
}

html.dark .swal2-input,
html.dark .swal2-select,
html.dark .swal2-textarea {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}

html.dark .swal2-validation-message {
    background: var(--surface-2);
    color: var(--text);
}

html.dark .swal2-icon {
    border-color: var(--border);
}

/* =====================================================================
   Select2 open-dropdown dark-mode support
   Select2 (theme: "bootstrap") appends its open dropdown as its own
   .select2-container near <body> rather than inside the field's own
   container, so it escapes every container-scoped .select2-selection rule
   above. Style the dropdown separately, scoped to html.dark.
   ===================================================================== */
html.dark .select2-container--bootstrap .select2-dropdown {
    background: var(--surface);
    border-color: var(--border);
}

html.dark .select2-container--bootstrap .select2-search--dropdown .select2-search__field {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
}

html.dark .select2-container--bootstrap .select2-results__option {
    color: var(--text);
}

html.dark .select2-container--bootstrap .select2-results__option[aria-selected="true"] {
    background: var(--surface-2);
    color: var(--text);
}

html.dark .select2-container--bootstrap .select2-results__option--highlighted[aria-selected] {
    background: var(--accent) !important;
    color: var(--accent-contrast) !important;
}

/* =====================================================================
   Customer Dashboard (Wave 1)
   - Shell: customer-dashboard-page / -hero / -layout / -row / -column / -widget
   - Shared widget chrome: customer-dashboard-card (header/body/footer/divider)
   - Per-widget internals: customer-account-card, customer-unpaid-card,
     customer-announcement-card, customer-voucher-card, customer-plan-*,
     customer-transfer-* / customer-recharge-friend-card
   - Reuses the existing .customer-info-list / .customer-credential-row /
     .customer-status-badge component rules defined above for the customer
     detail page -- not redefined here.
   - Breakpoints are 767px and 479px only (the customer shell's own two
     breakpoints); no new max-width values are introduced.
   - New inputs here all carry .form-control, so the existing mobile 16px
     rule (in the 767px query above) already covers them without needing
     another entry in that selector list.
   ===================================================================== */

.customer-dashboard-page {
    max-width: 1200px;
    margin: 0 auto;
}

.customer-dashboard-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
    padding: clamp(22px, 4vw, 34px);
    overflow: hidden;
    border-radius: 20px;
    background:
        radial-gradient(circle at 88% 12%, rgba(94, 234, 212, .2), transparent 28%),
        linear-gradient(135deg, #0f172a 0%, #064e3b 58%, #0f766e 100%);
    color: #fff;
    box-shadow: 0 20px 46px -32px rgba(4, 120, 87, .9);
}

.customer-dashboard-hero-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 16px;
}

.customer-dashboard-hero-icon {
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 16px;
    background: rgba(255, 255, 255, .1);
    color: #a7f3d0;
    font-size: 23px;
}

.customer-dashboard-hero-title > div > span {
    display: block;
    margin-bottom: 4px;
    color: #5eead4;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.customer-dashboard-hero h1 {
    margin: 0;
    overflow-wrap: anywhere;
    color: #fff;
    font-size: clamp(22px, 3.2vw, 32px);
    font-weight: 750;
    letter-spacing: -.03em;
    line-height: 1.18;
}

.customer-dashboard-hero p {
    max-width: 560px;
    margin: 6px 0 0;
    color: rgba(255, 255, 255, .7);
    font-size: 12.5px;
    line-height: 1.55;
}

.customer-dashboard-hero-balance {
    display: grid;
    flex: 0 0 auto;
    min-width: 150px;
    gap: 3px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
    background: rgba(15, 23, 42, .26);
    text-align: right;
    backdrop-filter: blur(7px);
}

.customer-dashboard-hero-balance span {
    color: rgba(255, 255, 255, .6);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.customer-dashboard-hero-balance strong {
    color: #fff;
    font-size: 17px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

.customer-dashboard-layout,
.customer-dashboard-row,
.customer-dashboard-column,
.customer-dashboard-widget {
    min-width: 0;
}

.customer-dashboard-row {
    margin-right: -7px;
    margin-left: -7px;
}

.customer-dashboard-column {
    padding-right: 7px;
    padding-left: 7px;
}

.customer-dashboard-widget:empty {
    display: none;
}

.customer-dashboard-widget > * + * {
    margin-top: 14px;
}

/* Shared card chrome every dashboard widget renders inside */
.customer-dashboard-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.customer-dashboard-card > header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
}

.customer-dashboard-card-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-700);
    font-size: 15px;
}

.customer-dashboard-card-icon.is-danger {
    background: rgba(239, 68, 68, .12);
    color: #dc2626;
}

.customer-dashboard-card-icon.is-info {
    background: rgba(59, 130, 246, .12);
    color: var(--blue);
}

html.dark .customer-dashboard-card-icon.is-danger { color: #fca5a5; }
html.dark .customer-dashboard-card-icon.is-info { color: #93c5fd; }

.customer-dashboard-card > header h2 {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.customer-dashboard-card-body {
    padding: 16px 18px;
    color: var(--text);
}

.customer-dashboard-card-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 18px;
    margin-top: -4px;
    color: var(--text-muted);
}

.customer-dashboard-card-divider::before,
.customer-dashboard-card-divider::after {
    flex: 1 1 auto;
    height: 1px;
    content: "";
    background: var(--border);
}

.customer-dashboard-card-divider span {
    flex: 0 0 auto;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.customer-dashboard-card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 18px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
}

.customer-dashboard-card-footer .btn {
    margin: 0;
}

/* Status-badge links (auto-renewal toggle, "Expired" link) shouldn't carry
   the browser's default link underline -- .customer-status-badge itself is
   defined on the customer detail page above and is reused as-is here. */
.customer-info-list .customer-status-badge {
    text-decoration: none;
}

/* Announcement: keep admin-authored HTML readable without fighting its own markup */
.customer-announcement-body {
    color: var(--text);
    line-height: 1.6;
}

.customer-announcement-body img {
    max-width: 100%;
    height: auto;
}

/* Voucher activation */
.customer-voucher-input {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}

.customer-voucher-scan {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    color: var(--text-muted);
    border-right: 1px solid var(--border);
}

.customer-voucher-scan:hover,
.customer-voucher-scan:focus {
    color: var(--accent-700);
    background: var(--surface-3);
}

.customer-voucher-input input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    color: var(--text);
}

.customer-voucher-input input:focus {
    outline: 0;
}

.customer-voucher-input .btn {
    flex: 0 0 auto;
    margin: 0;
    border-radius: 0;
}

.customer-voucher-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

/* Transfer / recharge-a-friend forms (share the same field/form pattern) */
.customer-transfer-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
}

.customer-transfer-field {
    flex: 1 1 160px;
    min-width: 0;
}

.customer-transfer-field-wide {
    flex: 1 1 220px;
}

.customer-transfer-form .btn {
    flex: 0 0 auto;
    margin: 0;
}

/* Active internet plan(s): one card per active/expired bill */
.customer-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.customer-plan-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.customer-plan-card.is-expired {
    border-top-color: var(--rose);
}

.customer-plan-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
}

.customer-plan-card-identity {
    display: flex;
    min-width: 0;
    gap: 10px;
}

.customer-plan-card-identity > div > span {
    display: block;
    margin-bottom: 2px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.customer-plan-card-identity h3 {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.customer-plan-type-badge {
    flex: 0 0 auto;
    padding: 4px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.customer-plan-card .customer-info-list {
    padding: 4px 18px;
}

.customer-plan-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding: 14px 18px;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
}

.customer-plan-card-actions .btn {
    margin: 0;
}

@media (max-width: 767px) {
    .customer-dashboard-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px 18px;
        border-radius: 16px;
    }

    .customer-dashboard-hero-balance {
        width: 100%;
        text-align: left;
    }

    .customer-dashboard-row {
        margin-right: 0;
        margin-left: 0;
    }

    .customer-dashboard-column {
        float: none;
        width: 100%;
        padding-right: 0;
        padding-left: 0;
    }

    .customer-dashboard-card > header,
    .customer-plan-card > header {
        padding: 13px 14px;
    }

    .customer-dashboard-card-body,
    .customer-dashboard-card-footer,
    .customer-plan-card-actions {
        padding: 13px 14px;
    }

    .customer-plan-grid {
        grid-template-columns: 1fr;
    }

    .customer-transfer-field,
    .customer-transfer-field-wide {
        flex: 1 1 100%;
    }

    .customer-transfer-form .btn {
        width: 100%;
    }
}

@media (max-width: 479px) {
    .customer-dashboard-hero-title {
        align-items: flex-start;
    }

    .customer-dashboard-hero-icon {
        width: 46px;
        height: 46px;
        border-radius: 13px;
        font-size: 18px;
    }

    .customer-dashboard-card-footer,
    .customer-plan-card-actions {
        flex-direction: column;
    }

    .customer-dashboard-card-footer .btn,
    .customer-plan-card-actions .btn {
        width: 100%;
    }

    .customer-voucher-input {
        flex-wrap: wrap;
    }

    .customer-voucher-scan {
        flex: 0 0 42px;
    }

    .customer-voucher-input input {
        flex: 1 1 auto;
    }

    .customer-voucher-input .btn {
        flex: 1 1 100%;
        border-radius: 0;
    }
}

/* =====================================================================
   Customer Auth (Wave 2)

   Two different page architectures are involved:

   A. login.tpl, login-noreg.tpl, register.tpl, register-otp.tpl,
      register-rotp.tpl, forgot.tpl still render inside the legacy
      customer/header-public.tpl + customer/footer-public.tpl shell
      (out of scope for this wave, not edited). That shell already loads
      Bootstrap 3, and the ".panel" / ".form-control" / ".input-group-addon"
      rules earlier in this file already reskin it. This section only adds
      the page-level wrapper (replacing the old "hidden-xs height:100px"
      spacer hack), a small brand strip, a secondary-links row, and the
      password-reveal toggle button used on those pages.

   B. login-custom-moon.tpl (served instead of login.tpl whenever
      config.login_Page_template = 'moon', see system/controllers/login.php)
      is a fully standalone page with its own <head> and used to carry an
      inline ~530-line <style> block under a hardcoded blue palette. That
      block has been moved here, unchanged in class names/DOM contract, and
      re-themed onto the shared --accent/--surface/--text variables so it
      matches the rest of the modern theme instead of introducing a second
      one. Its "login-fg" class prefix is kept (already established in that
      template) rather than switched to "customer-auth-" for a smaller diff.

   Only the two sanctioned breakpoints (767px / 479px) are used below; the
   moon template previously had five (1200/992/768/480/320) which are
   consolidated into these two (see comments at each media query).
   ===================================================================== */

/* ---------- A. header-public.tpl-wrapped pages ---------- */

.customer-auth-page {
    padding: 100px 0 60px;
}

.customer-auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 26px;
    text-align: center;
}

.customer-auth-brand-icon {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    place-items: center;
    font-size: 16px;
    color: var(--accent-700);
    background: var(--accent-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.customer-auth-brand-name {
    max-width: 70vw;
    overflow: hidden;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-auth-page .panel-heading i {
    margin-right: 7px;
    color: var(--accent-700);
}

.customer-auth-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 14px;
    margin-top: 6px;
    font-size: 12.5px;
    text-align: center;
}

.customer-auth-links a {
    color: var(--link);
}

.customer-auth-links a:hover,
.customer-auth-links a:focus {
    color: var(--link-hover);
}

.customer-auth-links-sep {
    color: var(--text-muted);
}

.customer-auth-password-toggle.btn.btn-default {
    color: var(--text-muted);
    background: var(--surface-2) !important;
    border: 1px solid var(--border) !important;
}

.customer-auth-password-toggle.btn.btn-default:hover,
.customer-auth-password-toggle.btn.btn-default:focus-visible {
    color: var(--accent-700);
    background: var(--accent-soft) !important;
}

.customer-auth-password-toggle.btn.btn-default:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

@media (max-width: 767px) {
    .customer-auth-page {
        padding: 26px 0 40px;
    }

    .customer-auth-brand {
        margin-bottom: 18px;
    }

    .customer-auth-links {
        gap: 8px 12px;
    }
}

/* ---------- B. login-custom-moon.tpl ("login-fg") ---------- */

.login-fg-skip {
    position: fixed;
    z-index: 100;
    top: 12px;
    left: 12px;
    padding: 10px 14px;
    color: #fff;
    background: var(--accent-700);
    border-radius: 8px;
    opacity: 0;
    transform: translateY(-150%);
    transition: opacity .16s ease, transform .16s ease;
}

.login-fg-skip:focus {
    color: #fff;
    opacity: 1;
    outline: 3px solid rgba(255, 255, 255, .75);
    transform: translateY(0);
}

.login-fg .form-container {
    position: relative;
}

.login-fg .login {
    position: relative;
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    background: var(--surface);
}

.login-fg .login-section {
    width: 100%;
    max-width: 370px;
    margin: 0 auto;
    text-align: center;
}

.login-fg .form-fg {
    position: relative;
    float: left;
    width: 100%;
    text-align: center;
}

.login-fg .form-container .form-group {
    margin-bottom: 22px;
}

.login-fg .form-container img {
    height: 40px;
    margin-bottom: 5px;
}

.login-fg .form-container .form-fg input {
    float: left;
    width: 100%;
    padding: 13px 46px 13px 22px;
    font-size: 16px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.login-fg .form-container .form-fg input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.login-fg .form-container .form-fg i {
    position: absolute;
    top: 14px;
    right: 20px;
    font-size: 17px;
    color: var(--text-muted);
}

.login-fg-password-toggle {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    padding: 0;
    color: var(--text-muted);
    cursor: pointer;
    background: transparent;
    border: 0;
    border-radius: 50%;
}

.login-fg-password-toggle:hover,
.login-fg-password-toggle:focus-visible {
    color: var(--accent-700);
    background: var(--accent-soft);
}

.login-fg-password-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.login-fg .form-container label {
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.login-fg-title {
    margin: 18px 0 24px;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text);
}

.login-fg .form-container .forgot {
    line-height: 45px;
    color: var(--text-muted);
    float: right;
}

.login-fg .bg {
    position: relative;
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(0, 0, 0, .04) repeat;
    background-size: cover;
}

.login-fg-bg-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(4, 12, 10, .66), rgba(4, 12, 10, .32) 55%, rgba(4, 12, 10, .72));
}

.login-fg .info {
    position: relative;
    text-align: center;
}

.login-fg .info h1 {
    margin-bottom: 15px;
    font-size: clamp(28px, 5vw, 60px);
    font-weight: 700;
    color: #fff;
    text-shadow: 0 8px 24px rgba(0, 0, 0, .45);
    text-transform: uppercase;
}

.login-fg .info p {
    margin-bottom: 0;
    color: rgba(255, 255, 255, .88);
    line-height: 28px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

.login-fg .form-container .btn-md {
    height: 45px;
    padding: 10px 30px 9px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .5px;
    color: #d6d6d6;
    cursor: pointer;
    border-radius: 50px;
}

.login-fg .form-container p {
    margin: 0;
    color: var(--text-muted);
}

.login-fg .form-container p a {
    color: var(--link);
}

.login-fg .form-container button:focus {
    outline: none;
}

.login-fg .form-container .btn-fg.focus,
.login-fg .btn-fg:focus {
    box-shadow: none;
}

.login-fg .form-container .btn-fg {
    color: #fff;
    background: var(--accent-600);
    border: none;
    box-shadow: var(--shadow-sm);
}

.login-fg .form-container .btn-fg:hover {
    background: var(--accent-700);
}

.login-fg .logo a {
    font-size: 39px;
    font-weight: 700;
    color: var(--text);
}

.login-fg .form-container .checkbox {
    margin-bottom: 22px;
    font-size: 14px;
}

.login-fg .form-container .form-check {
    float: left;
    margin-bottom: 0;
}

.login-fg .form-container .form-check a {
    float: right;
    color: #d6d6d6;
}

.login-fg .form-container .form-check-input {
    position: absolute;
    margin-left: 0;
}

.login-fg .form-container .form-check label::before {
    position: absolute;
    top: 2px;
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: -25px;
    content: "";
    background: var(--surface);
    border: none;
    border-radius: 3px;
    box-shadow: var(--shadow-sm);
}

.login-fg .form-container .form-check-label {
    padding-left: 25px;
    margin-bottom: 0;
    font-size: 14px;
    color: var(--text-muted);
}

.login-fg .form-container .checkbox-fg input[type="checkbox"]:checked+label::before {
    color: #fff;
    background: var(--accent);
}

.login-fg .form-container input[type="checkbox"]:checked+label:before {
    font-size: 14px;
    font-weight: 300;
    line-height: 17px;
    color: #f3f3f3;
    content: "\2713";
}

.login-fg .form-container input[type="checkbox"],
.login-fg input[type="radio"] {
    margin-top: 4px;
}

.login-fg .form-container .checkbox a {
    float: right;
    margin-left: 3px;
    font-size: 14px;
    color: var(--text-muted);
}

.login-fg .login-section ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

.login-fg .login-section .social li {
    display: inline-block;
    margin-bottom: 5px;
}

.login-fg .login-section .social li a {
    display: inline-block;
    width: 120px;
    height: 35px;
    margin: 2px 0 3px;
    font-size: 12px;
    font-weight: 600;
    line-height: 35px;
    text-align: center;
    text-decoration: none;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.login-fg .login-section .social li a i {
    float: left;
    width: 35px;
    height: 35px;
    color: #fff;
    line-height: 35px;
    border-radius: 20px;
}

.login-fg .login-section .social li a span {
    margin-right: 7px;
}

.login-fg .login-section .or-login {
    position: relative;
    float: left;
    width: 100%;
    margin: 20px 0 25px;
    text-align: center;
}

.login-fg .login-section .or-login::before {
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    height: 1px;
    content: "";
    background: var(--border);
}

.login-fg .login-section .or-login>span {
    position: relative;
    z-index: 1;
    display: inline-block;
    float: none;
    width: auto;
    padding: 1px 20px;
    font-size: 13px;
    text-transform: capitalize;
    background: var(--surface);
}

.login-fg .facebook-i { color: #fff; background: #4867aa; }
.login-fg .twitter-i { color: #fff; background: #3cf; }
.login-fg .google-i { color: #fff; background: #db4437; }
.login-fg .facebook { color: #4867aa; }
.login-fg .twitter { color: #3cf; }
.login-fg .google { color: #db4437; }

.login-fg-footer {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 10px;
    font-size: 14px;
    color: #4a4a4a;
    text-align: center;
    background-color: #f8f8f8;
}

/* Accessible footer link colour (>=4.5:1 on #f8f8f8) + underline so links
   aren't distinguished by colour alone — carried over from the original. */
.login-fg-footer a {
    color: #0b5cab;
    text-decoration: underline;
}

.login-fg .submit-btn {
    box-sizing: border-box;
    width: 100%;
    padding: 15px;
    font-size: 16px;
    color: #fff;
    cursor: pointer;
    background-color: var(--accent-600);
    border: none;
    border-radius: 50px;
    transition: background-color .2s ease, transform .05s ease;
}

.login-fg .submit-btn:hover {
    background-color: var(--accent-700);
}

.login-fg .submit-btn:focus-visible {
    outline: 3px solid var(--accent-soft);
    outline-offset: 2px;
}

.login-fg .submit-btn:active {
    transform: scale(.98);
}

.login-fg .logo img {
    max-width: 100%;
    height: auto;
}

/* The old base rule tried to set "inputmode" as a CSS property, which is not
   a CSS property and did nothing; the real fix is the inputmode="tel" /
   inputmode="email" HTML attribute now set directly on the markup. */

/* This media query previously sat at three separate widths (1200px, 992px
   and 768px) in the original inline <style> block; consolidated into the
   theme's one sanctioned phone/tablet breakpoint. The .bg photo panel now
   hides at 767px instead of 992px — a deliberate, small behaviour change so
   this page stops introducing a third breakpoint family. */
@media (max-width: 767px) {
    .login-fg .bg {
        display: none;
    }

    .login-fg .login {
        padding: 20px 15px;
    }

    .login-fg .login-section {
        max-width: 100%;
        padding: 15px;
    }

    .login-fg .logo img {
        max-width: 200px;
    }

    .login-fg-title {
        margin: 14px 0 20px;
        font-size: 18px;
    }

    .login-fg .form-container .social li a {
        width: 100%;
        margin: 5px 0;
    }

    .login-fg .form-container .checkbox a {
        display: block;
        margin-top: 10px;
        text-align: right;
    }

    .login-fg-footer {
        position: fixed;
        padding: 8px;
        font-size: 12px;
    }
}

/* Was 480px and 320px in the original; both fold into the theme's one
   sanctioned narrow-phone breakpoint. Font sizes stay at 16px (never lower)
   so iOS Safari does not zoom the page on focus — the original dropped as
   low as 12px here, which is the exact bug this rule exists to prevent. */
@media (max-width: 479px) {
    .login-fg .login {
        padding: 15px;
    }

    .login-fg-title {
        font-size: 16px;
    }

    .login-fg-footer {
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-fg .submit-btn {
        transition-duration: .01ms !important;
    }
}

@media (forced-colors: active) {
    .login-fg .form-container .form-fg input,
    .login-fg .submit-btn,
    .login-fg-password-toggle {
        border: 1px solid ButtonText;
    }

    .login-fg-bg-overlay {
        background: rgba(0, 0, 0, .7);
    }
}

/* =====================================================================
   Public Shell (Wave 3)

   ui/themes/modern/customer/header-public.tpl + footer-public.tpl is the
   shell every logged-out customer page renders inside: the six pages
   from "Customer Auth (Wave 2)" above still {include} it unchanged, plus
   the shared invoice link (invoice-customer.tpl, which now gets Font
   Awesome and the dark-mode boot script from the shell itself instead of
   its own stopgap copy) and the plain 404 page. It previously had no
   modern override at all -- no Font Awesome, no dark-mode boot script, no
   themed colours -- which is what this section fixes. It does not edit
   the Wave 2 section above; the "customer-auth-page" / "login-fg" rules
   there keep styling the page content that renders *inside* this shell
   unchanged, they just gain a couple of new, additive selectors below
   (autofill + color-scheme) that happen to share the "login-fg" prefix.

   Also covers reg-login-custom-moon.tpl, the register counterpart to
   login-custom-moon.tpl (system/controllers/register.php renders it
   whenever login_Page_template = 'moon', the same way login.php swaps in
   login-custom-moon.tpl for the login side). It reuses the "login-fg"
   prefix Wave 2 already established for that page family rather than
   inventing a second one, matching Wave 2's own reasoning for keeping it.

   Only the two sanctioned breakpoints (767px / 479px) are used below.
   ===================================================================== */

/* ---------- header-public.tpl / footer-public.tpl shell ---------- */

.customer-public-shell {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
}

.customer-public-shell-topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding-top: 4px;
}

.customer-public-shell-brand {
    max-width: 100%;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The banner's own <hr> used a hardcoded Bootstrap grey; that reads as an
   almost-invisible sliver on the dark surface, so give it the shared
   border token instead (colour only, layout/markup untouched). */
.form-head hr {
    border-color: var(--border);
}

.customer-public-shell-footer {
    padding: 20px 0;
    margin-top: 40px;
    color: var(--text-muted);
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.customer-public-shell-footer a {
    color: var(--link);
}

.customer-public-shell-footer a:hover,
.customer-public-shell-footer a:focus {
    color: var(--link-hover);
}

@media (max-width: 767px) {
    .customer-public-shell-topbar {
        justify-content: center;
        text-align: center;
    }

    .customer-public-shell-brand {
        white-space: normal;
    }
}

/* ---------- reg-login-custom-moon.tpl ("login-fg", shared with login-custom-moon.tpl) ---------- */

.login-fg {
    color-scheme: light;
}

html.dark .login-fg {
    color-scheme: dark;
}

.login-fg .form-container .form-fg input:-webkit-autofill,
.login-fg .form-container .form-fg input:-webkit-autofill:hover,
.login-fg .form-container .form-fg input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text);
    box-shadow: 0 0 0 1000px var(--surface) inset;
    transition: background-color 9999s ease-out;
}

/* =====================================================================
   Customer Orders (Wave 4)

   Covers the rest of the purchase journey that customer/order-plan-card.tpl
   / order-plan-group.tpl / orderPlan.tpl (already modernised) started:
   order.tpl, selectGateway.tpl, orderView.tpl, orderHistory.tpl,
   orderBalance.tpl and sendPlan.tpl. These six pages are one continuous
   flow (browse -> pick a gateway -> pay -> view the receipt -> see it in
   history), so - mirroring how orderPlan.tpl's three files already share
   the "package-catalog-*" / "package-plan-*" prefixes - they share one
   "order-flow-*" prefix for the page shell/hero/card/status chrome common
   to all six, plus a small page-local prefix for what's unique to each
   page (order-gateway-*, order-view-*, order-history-*, order-balance-*,
   order-voucher-*, send-plan-*). Facts rows reuse the existing
   ".customer-info-list" component (dashboard, Wave 1) instead of a new
   list class. Only the two sanctioned breakpoints (767px / 479px) are
   used below.
   ===================================================================== */

.order-flow-page {
    max-width: 880px;
    margin: 0 auto;
}

.order-flow-page.order-flow-page-wide {
    max-width: 1200px;
}

/* ---------- shared hero ---------- */

.order-flow-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
    padding: clamp(22px, 4vw, 34px);
    overflow: hidden;
    border-radius: 22px;
    background:
        radial-gradient(circle at 88% 15%, rgba(255, 255, 255, .16), transparent 28%),
        radial-gradient(circle at 72% 115%, rgba(45, 212, 191, .35), transparent 34%),
        linear-gradient(135deg, #0f172a 0%, #064e3b 58%, #0f766e 100%);
    color: #fff;
    box-shadow: 0 22px 50px -32px rgba(4, 120, 87, .9);
}

.order-flow-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 620px;
}

.order-flow-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: #5eead4;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.order-flow-hero h1 {
    margin: 0 0 9px;
    overflow-wrap: anywhere;
    color: #fff;
    font-size: clamp(22px, 3.2vw, 32px);
    font-weight: 750;
    letter-spacing: -.03em;
    line-height: 1.12;
}

.order-flow-hero-copy > p {
    margin: 0;
    color: rgba(255, 255, 255, .74);
    font-size: 13px;
    line-height: 1.6;
}

.order-flow-hero-mark {
    position: relative;
    z-index: 1;
    display: grid;
    width: 84px;
    height: 84px;
    flex: 0 0 auto;
    place-items: center;
}

.order-flow-hero-mark > span {
    display: grid;
    width: 84px;
    height: 84px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 50%;
    background: rgba(255, 255, 255, .09);
    color: #5eead4;
    font-size: 32px;
    backdrop-filter: blur(9px);
}

/* ---------- shared card ---------- */

.order-flow-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.order-flow-card + .order-flow-card {
    margin-top: 16px;
}

.order-flow-card > header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 18px;
    border-bottom: 1px solid var(--border);
}

.order-flow-card > header h2 {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 15px;
    font-weight: 700;
}

.order-flow-card-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-700);
    font-size: 15px;
}

.order-flow-card-body {
    padding: 18px;
    color: var(--text);
}

.order-flow-card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
}

.order-flow-section-title {
    margin: 0 0 10px;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.order-flow-card-body > .customer-info-list {
    margin-bottom: 18px;
}

.order-flow-card-body > .customer-info-list:last-child {
    margin-bottom: 0;
}

.order-flow-price-old {
    margin-right: 6px;
    color: var(--rose);
    text-decoration: line-through;
}

.order-flow-field {
    margin-bottom: 14px;
}

.order-flow-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
}

.order-flow-field:last-child {
    margin-bottom: 0;
}

/* ---------- shared status badge ---------- */

.order-flow-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 25px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 750;
    line-height: 1;
    letter-spacing: .035em;
    color: var(--text-muted);
    text-transform: uppercase;
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 999px;
    white-space: nowrap;
}

.order-flow-status.is-success {
    color: #047857;
    background: rgba(16, 185, 129, .12);
    border-color: rgba(16, 185, 129, .2);
}

.order-flow-status.is-warning {
    color: #b45309;
    background: rgba(245, 158, 11, .12);
    border-color: rgba(245, 158, 11, .22);
}

.order-flow-status.is-danger {
    color: #be123c;
    background: rgba(244, 63, 94, .11);
    border-color: rgba(244, 63, 94, .2);
}

html.dark .order-flow-status.is-success { color: #6ee7b7; }
html.dark .order-flow-status.is-warning { color: #fbbf24; }
html.dark .order-flow-status.is-danger { color: #fda4af; }

/* Inside the dark hero the neutral/unstyled badge needs to read on the
   gradient too, unlike the light-surface default. */
.order-flow-hero-copy .order-flow-status {
    color: rgba(255, 255, 255, .82);
    background: rgba(15, 23, 42, .28);
    border-color: rgba(255, 255, 255, .18);
}

.order-flow-hero-copy .order-flow-status.is-success,
.order-flow-hero-copy .order-flow-status.is-warning,
.order-flow-hero-copy .order-flow-status.is-danger {
    background: rgba(15, 23, 42, .28);
}

/* ---------- selectGateway.tpl ("order-gateway-*") ---------- */

.order-gateway-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    gap: 16px;
    align-items: start;
}

.order-gateway-grid.order-gateway-grid-solo {
    grid-template-columns: minmax(0, 1fr);
    max-width: 620px;
    margin: 0 auto;
}

.order-gateway-coupon-form {
    padding: 14px;
    margin: 6px 0 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.order-gateway-coupon-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
}

.order-gateway-coupon-input {
    display: flex;
    gap: 8px;
}

.order-gateway-coupon-input .form-control {
    flex: 1 1 auto;
}

.order-gateway-total {
    font-size: 16px;
    font-weight: 750;
}

.order-gateway-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

/* ---------- orderView.tpl ("order-view-*") ---------- */

.order-view-router-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.order-view-router-card h2 {
    margin: 0 0 3px;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.order-view-router-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
}

.order-view-price {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 15px;
    font-weight: 750;
}

/* ---------- orderHistory.tpl ("order-history-*") ---------- */

.order-history-table-wrap {
    overflow-x: auto;
}

.order-history-table {
    width: 100%;
    border-collapse: collapse;
}

.order-history-table th {
    padding: 10px 12px;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .05em;
    text-align: left;
    text-transform: uppercase;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.order-history-table td {
    padding: 11px 12px;
    color: var(--text);
    font-size: 12.5px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.order-history-table tbody tr:last-child td {
    border-bottom: 0;
}

.order-history-table tbody tr:hover td {
    background: var(--surface-2);
}

.order-history-empty-row td {
    padding: 36px 20px !important;
    text-align: center;
    white-space: normal;
}

.order-history-empty-row td > span {
    display: grid;
    width: 42px;
    height: 42px;
    margin: 0 auto 10px;
    place-items: center;
    font-size: 18px;
    color: var(--accent-700);
    background: var(--accent-soft);
    border-radius: 50%;
}

.order-history-empty-row td > strong,
.order-history-empty-row td > small {
    display: block;
}

.order-history-empty-row td > small {
    margin-top: 4px;
    color: var(--text-muted);
}

/* ---------- orderBalance.tpl ("order-balance-*") ---------- */

.order-balance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}

.order-balance-card {
    display: flex;
    flex-direction: column;
}

.order-balance-card .order-flow-card-body {
    flex: 1 1 auto;
}

.order-balance-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 20px;
    font-weight: 750;
    color: var(--text);
}

.order-balance-price del {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}

.order-balance-custom-card form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.order-balance-custom-card .order-flow-card-body {
    flex: 1 1 auto;
}

/* ---------- order.tpl ("order-voucher-*") ---------- */

.order-voucher-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 34px 24px;
    text-align: center;
}

.order-voucher-card-body h1 {
    margin: 6px 0 0;
    color: var(--text);
    font-size: 18px;
}

.order-voucher-card-body p {
    max-width: 420px;
    margin: 0 0 8px;
    color: var(--text-muted);
    font-size: 12.5px;
}

/* ---------- sendPlan.tpl ("send-plan-*") ---------- */

.send-plan-price {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 15px;
    font-weight: 750;
}

.send-plan-footer {
    display: block;
}

.send-plan-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
}

.send-plan-field {
    flex: 1 1 220px;
    margin-bottom: 0;
}

.send-plan-submit {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    font-size: 16px;
}

.send-plan-help {
    flex: 1 1 100%;
    margin: 0;
    color: var(--text-muted);
    font-size: 11.5px;
    text-align: center;
}

/* ---------- responsive: 767px (phones/small tablets) ---------- */

@media (max-width: 767px) {
    .order-flow-hero {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .order-flow-hero-mark {
        width: 56px;
        height: 56px;
    }

    .order-flow-hero-mark > span {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .order-gateway-grid,
    .order-gateway-grid.order-gateway-grid-solo {
        grid-template-columns: 1fr;
        max-width: none;
    }

    .order-gateway-coupon-input {
        flex-direction: column;
    }

    .order-flow-card-body {
        padding: 14px;
    }

    .order-flow-card > header,
    .order-flow-card-footer {
        padding: 13px 14px;
    }

    /* Data-label row-to-card stacking (pattern A from the pattern guide). */
    .order-history-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .order-history-table tbody,
    .order-history-table tr,
    .order-history-table td {
        display: block;
        width: 100%;
    }

    .order-history-table tbody {
        display: grid;
        gap: 10px;
    }

    .order-history-table tbody tr {
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: 12px;
    }

    .order-history-table td {
        display: flex;
        flex-direction: column;
        gap: 5px;
        padding: 11px 13px;
        white-space: normal;
        border-bottom: 1px solid var(--border);
    }

    .order-history-table td:last-child {
        border-bottom: 0;
    }

    .order-history-table td::before {
        content: attr(data-label);
        font-size: 9px;
        font-weight: 750;
        letter-spacing: .065em;
        text-transform: uppercase;
        color: var(--text-muted);
    }

    .order-history-table tbody tr:hover td {
        background: transparent;
    }

    .order-history-empty-row {
        display: block !important;
    }

    .order-history-empty-row td {
        display: block;
        border: 0 !important;
    }

    .order-history-empty-row td::before {
        display: none;
    }

    .order-balance-grid {
        grid-template-columns: 1fr;
    }

    .send-plan-field {
        flex: 1 1 100%;
    }

    .send-plan-submit {
        width: 100%;
        height: 44px;
    }
}

/* ---------- responsive: 479px (narrow phones only) ---------- */

@media (max-width: 479px) {
    .order-flow-hero {
        padding: 20px;
    }

    .order-flow-hero h1 {
        font-size: 21px;
    }

    .order-gateway-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .order-gateway-actions .btn {
        width: 100%;
    }

    .order-flow-card-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .order-flow-card-footer .btn {
        width: 100%;
    }
}

/* =====================================================================
   Customer Account (Wave 5)

   Covers the remaining customer account pages: profile.tpl,
   change-password.tpl, email-update.tpl, phone-update.tpl,
   activation.tpl (Order Voucher + Voucher Activation), activation-list.tpl
   (Activation History), inbox.tpl and pages.tpl (admin-authored static
   page wrapper). Each page keeps its own kebab-case prefix per the
   pattern guide's "one prefix per page/feature" rule
   (customer-profile-*, customer-account-password-*,
   customer-email-update-*, customer-phone-update-*,
   customer-voucher-activation-*, customer-activation-history-*,
   customer-inbox-*, customer-pages-*), but the hero chrome all eight
   share is written once as a grouped selector list rather than repeating
   eight near-identical blocks (the same shell design already used by
   customer-dashboard-hero / order-flow-hero / admin-password-hero
   elsewhere in this file).

   change-password.tpl mirrors admin/change-password.tpl's accessible
   password-reveal / strength-meter / match-indicator idiom (aria-pressed,
   data-label-show/hide, aria-describedby, aria-live) under a
   "customer-account-password-" prefix, chosen specifically to avoid
   colliding with the existing admin-scoped ".customer-password-control"
   class used by admin/customers/customer-form.tpl.

   activation-list.tpl uses the "data-label" row-to-card table pattern
   (Pattern A - 7 directly-comparable columns, mirrors order-history-table).
   inbox.tpl uses the card/list pattern (Pattern B - a handful of facts,
   one action per row) since a message list isn't a dense comparison
   table.

   Only the two sanctioned breakpoints (767px / 479px) are used below. All
   new inputs keep the plain .form-control class, so the existing shared
   mobile-16px selector list (pattern guide section 9) already covers them
   without needing another entry.
   ===================================================================== */

/* ---------- shared page width + hero (all eight pages) ---------- */

.customer-profile-page,
.customer-account-password-page,
.customer-email-update-page,
.customer-phone-update-page,
.customer-voucher-activation-page,
.customer-activation-history-page,
.customer-inbox-page,
.customer-pages-page {
    max-width: 760px;
    margin: 0 auto;
}

.customer-voucher-activation-page,
.customer-activation-history-page {
    max-width: 1000px;
}

.customer-profile-hero,
.customer-account-password-hero,
.customer-email-update-hero,
.customer-phone-update-hero,
.customer-voucher-activation-hero,
.customer-activation-history-hero,
.customer-inbox-hero,
.customer-pages-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
    padding: clamp(22px, 4vw, 34px);
    overflow: hidden;
    border-radius: 20px;
    background:
        radial-gradient(circle at 88% 12%, rgba(94, 234, 212, .2), transparent 28%),
        linear-gradient(135deg, #0f172a 0%, #064e3b 58%, #0f766e 100%);
    color: #fff;
    box-shadow: 0 20px 46px -32px rgba(4, 120, 87, .9);
}

.customer-profile-hero-copy,
.customer-account-password-hero-copy,
.customer-email-update-hero-copy,
.customer-phone-update-hero-copy,
.customer-voucher-activation-hero-copy,
.customer-activation-history-hero-copy,
.customer-inbox-hero-copy,
.customer-pages-hero-copy {
    position: relative;
    z-index: 1;
    max-width: 620px;
}

.customer-profile-eyebrow,
.customer-account-password-eyebrow,
.customer-email-update-eyebrow,
.customer-phone-update-eyebrow,
.customer-voucher-activation-eyebrow,
.customer-activation-history-eyebrow,
.customer-inbox-eyebrow,
.customer-pages-eyebrow {
    display: block;
    margin-bottom: 8px;
    color: #5eead4;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.customer-profile-hero h1,
.customer-account-password-hero h1,
.customer-email-update-hero h1,
.customer-phone-update-hero h1,
.customer-voucher-activation-hero h1,
.customer-activation-history-hero h1,
.customer-inbox-hero h1,
.customer-pages-hero h1 {
    margin: 0 0 8px;
    font-size: clamp(23px, 3vw, 34px);
    font-weight: 750;
    letter-spacing: -.01em;
}

.customer-profile-hero p,
.customer-account-password-hero p,
.customer-email-update-hero p,
.customer-phone-update-hero p,
.customer-voucher-activation-hero p,
.customer-activation-history-hero p,
.customer-inbox-hero p {
    margin: 0;
    max-width: 560px;
    color: rgba(255, 255, 255, .78);
    font-size: 12.5px;
    line-height: 1.55;
}

.customer-profile-hero-mark,
.customer-account-password-hero-mark,
.customer-email-update-hero-mark,
.customer-phone-update-hero-mark,
.customer-voucher-activation-hero-mark,
.customer-activation-history-hero-mark,
.customer-inbox-hero-mark,
.customer-pages-hero-mark {
    position: relative;
    z-index: 1;
    display: grid;
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 16px;
    background: rgba(255, 255, 255, .1);
    font-size: 22px;
}

/* ---------- shared card chrome ---------- */

.customer-profile-card,
.customer-account-password-card,
.customer-email-update-card,
.customer-phone-update-card,
.customer-activation-history-card,
.customer-inbox-card,
.customer-pages-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.customer-profile-form,
.customer-account-password-form {
    display: grid;
    gap: 15px;
    padding: clamp(16px, 3vw, 24px);
}

/* ---------- profile.tpl ("customer-profile-*") ---------- */

.customer-profile-photo {
    display: flex;
    justify-content: center;
    margin-bottom: 6px;
}

.customer-profile-photo img {
    border: 4px solid var(--surface-3);
    border-radius: 50%;
    box-shadow: var(--shadow);
    cursor: pointer;
}

.customer-profile-field {
    display: grid;
    gap: 6px;
}

.customer-profile-field > label {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 680;
}

.customer-profile-field textarea {
    min-height: 76px;
    resize: vertical;
}

.customer-profile-input {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.customer-profile-input > span:first-child {
    position: absolute;
    left: 12px;
    display: grid;
    place-items: center;
    color: var(--text-muted);
    pointer-events: none;
}

.customer-profile-input input {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 34px;
}

.customer-profile-input .btn {
    flex: 0 0 auto;
}

.customer-profile-checkbox {
    margin: -2px 0 4px;
    color: var(--text-muted);
    font-size: 11.5px;
}

.customer-profile-checkbox label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-weight: 600;
}

.customer-profile-checkbox input {
    margin: 0;
    accent-color: var(--accent-600);
}

.customer-profile-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.customer-profile-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
}

/* ---------- change-password.tpl ("customer-account-password-*") ---------- */

.customer-account-password-field {
    display: grid;
    gap: 6px;
}

.customer-account-password-field > label {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 680;
}

.customer-account-password-input {
    position: relative;
    display: flex;
    align-items: center;
}

.customer-account-password-input > span:first-child {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.customer-account-password-input input {
    flex: 1 1 auto;
    padding-right: 42px;
    padding-left: 34px;
}

.customer-account-password-reveal {
    position: absolute;
    right: 4px;
    display: grid;
    width: 34px;
    height: 33px;
    padding: 0;
    place-items: center;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
}

.customer-account-password-reveal:hover,
.customer-account-password-reveal:focus {
    color: var(--accent-700);
    background: var(--surface-3);
}

.customer-account-password-field > small {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0;
    color: var(--text-muted);
    font-size: 10.5px;
    line-height: 1.5;
}

.customer-account-password-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
}

.customer-account-password-strength-track {
    flex: 0 0 120px;
    height: 5px;
    overflow: hidden;
    background: var(--surface-3);
    border-radius: 999px;
}

.customer-account-password-strength-track span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--text-muted);
    border-radius: inherit;
    transition: width .2s ease, background-color .2s ease;
}

.customer-account-password-strength > span {
    font-size: 10px;
    color: var(--text-muted);
}

.customer-account-password-strength.is-weak .customer-account-password-strength-track span {
    width: 25%;
    background: var(--rose);
}

.customer-account-password-strength.is-fair .customer-account-password-strength-track span {
    width: 50%;
    background: var(--amber);
}

.customer-account-password-strength.is-good .customer-account-password-strength-track span {
    width: 75%;
    background: var(--blue);
}

.customer-account-password-strength.is-strong .customer-account-password-strength-track span {
    width: 100%;
    background: var(--accent);
}

.customer-account-password-match {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 0;
    color: var(--text-muted);
    font-size: 10.5px;
    line-height: 1.5;
}

.customer-account-password-match.is-valid {
    color: #047857;
}

.customer-account-password-match.is-invalid {
    color: #be123c;
}

html.dark .customer-account-password-match.is-valid {
    color: #6ee7b7;
}

html.dark .customer-account-password-match.is-invalid {
    color: #fda4af;
}

.customer-account-password-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 4px;
}

/* ---------- email-update.tpl / phone-update.tpl (shared "step" layout) ---------- */

.customer-email-update-current,
.customer-phone-update-current {
    display: grid;
    gap: 6px;
    padding: clamp(16px, 3vw, 24px);
    border-bottom: 1px solid var(--border);
}

.customer-email-update-current > span,
.customer-phone-update-current > span {
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 680;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.customer-email-update-step,
.customer-phone-update-step {
    position: relative;
    display: flex;
    gap: 14px;
    padding: clamp(16px, 3vw, 24px);
}

.customer-email-update-step + .customer-email-update-step,
.customer-phone-update-step + .customer-phone-update-step {
    border-top: 1px solid var(--border);
}

.customer-email-update-step-badge,
.customer-phone-update-step-badge {
    display: grid;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-700);
    font-size: 12px;
    font-weight: 750;
}

.customer-email-update-form,
.customer-phone-update-form {
    flex: 1 1 auto;
    min-width: 0;
}

.customer-email-update-field,
.customer-phone-update-field {
    display: grid;
    gap: 6px;
}

.customer-email-update-field > label,
.customer-phone-update-field > label {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 680;
}

.customer-email-update-input,
.customer-phone-update-input {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.customer-email-update-input > span:first-child,
.customer-phone-update-input > span:first-child {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.customer-email-update-input input,
.customer-phone-update-input input {
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 34px;
}

.customer-email-update-input .btn,
.customer-phone-update-input .btn {
    flex: 0 0 auto;
}

.customer-email-update-actions,
.customer-phone-update-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding: 0 clamp(16px, 3vw, 24px) clamp(16px, 3vw, 24px);
}

/* ---------- activation.tpl ("customer-voucher-activation-*") ---------- */

.customer-voucher-activation-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    align-items: start;
    gap: 16px;
}

.customer-voucher-activation-card {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.customer-voucher-activation-card > header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.customer-voucher-activation-card > header h2 {
    margin: 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 750;
}

.customer-voucher-activation-card-icon {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 9px;
    background: var(--accent-soft);
    color: var(--accent-700);
    font-size: 13px;
}

.customer-voucher-activation-card-body {
    padding: 18px;
}

.customer-voucher-activation-input {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.customer-voucher-activation-scan {
    display: grid;
    width: 42px;
    flex: 0 0 42px;
    place-items: center;
    color: var(--link);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.customer-voucher-activation-scan:hover,
.customer-voucher-activation-scan:focus {
    color: var(--accent-700);
    background: var(--accent-soft);
}

.customer-voucher-activation-input input {
    flex: 1 1 auto;
    min-width: 0;
}

.customer-voucher-activation-input .btn {
    flex: 0 0 auto;
}

.customer-voucher-activation-actions {
    margin-top: 12px;
}

/* ---------- activation-list.tpl ("customer-activation-history-*", Pattern A) ---------- */

.customer-activation-history-table-wrap {
    padding: 6px;
    overflow-x: auto;
}

.customer-activation-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.customer-activation-history-table th {
    padding: 10px 14px;
    color: var(--text-muted);
    font-weight: 750;
    font-size: 10px;
    letter-spacing: .06em;
    text-align: left;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

.customer-activation-history-table td {
    padding: 12px 14px;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

.customer-activation-history-row {
    cursor: pointer;
}

.customer-activation-history-row:hover td {
    background: var(--surface-2);
}

.customer-activation-history-table td a {
    color: var(--link);
    font-weight: 650;
}

.customer-activation-history-table td a:hover,
.customer-activation-history-table td a:focus {
    color: var(--link-hover);
}

.customer-activation-history-empty-row td {
    padding: 40px 20px;
    color: var(--text-muted);
    text-align: center;
}

.customer-activation-history-empty-row span {
    display: grid;
    width: 46px;
    height: 46px;
    margin: 0 auto 10px;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-700);
    font-size: 18px;
}

.customer-activation-history-empty-row strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 13px;
}

.customer-activation-history-empty-row small {
    color: var(--text-muted);
    font-size: 11px;
}

/* ---------- inbox.tpl ("customer-inbox-*", Pattern B) ---------- */

.customer-inbox-toolbar {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
}

.customer-inbox-search {
    display: flex;
    gap: 8px;
}

.customer-inbox-search input {
    flex: 1 1 auto;
}

.customer-inbox-search .btn {
    flex: 0 0 auto;
}

.customer-inbox-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 18px;
}

.customer-inbox-controls-footer {
    border-top: 1px solid var(--border);
}

.customer-inbox-pager {
    display: flex;
    gap: 6px;
}

.customer-inbox-list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--border);
}

.customer-inbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 18px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

.customer-inbox-item:hover,
.customer-inbox-item:focus {
    background: var(--surface-2);
}

.customer-inbox-item-icon {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 15px;
}

.customer-inbox-item.is-unread .customer-inbox-item-icon {
    color: var(--accent-700);
}

.customer-inbox-item-body {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.customer-inbox-item-body strong {
    overflow: hidden;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-inbox-item.is-unread .customer-inbox-item-body strong {
    font-weight: 750;
}

.customer-inbox-item-body small {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.customer-inbox-item-date {
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 10.5px;
    white-space: nowrap;
}

.customer-inbox-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 50px 20px;
    text-align: center;
}

.customer-inbox-empty span {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    color: var(--accent-700);
    background: var(--accent-soft);
    border-radius: 50%;
    font-size: 19px;
}

.customer-inbox-empty h3 {
    margin: 4px 0 0;
    color: var(--text);
    font-size: 14px;
}

.customer-inbox-empty p {
    margin: 0;
    color: var(--text-muted);
    font-size: 11.5px;
}

.customer-inbox-read-card {
    padding: clamp(16px, 3vw, 24px);
}

.customer-inbox-message {
    color: var(--text);
    font-size: 13px;
    line-height: 1.7;
}

.customer-inbox-read-time {
    margin-left: 8px;
    color: var(--text-muted);
    font-size: 11px;
    cursor: help;
}

.customer-inbox-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.customer-inbox-actions-nav,
.customer-inbox-actions-main {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---------- pages.tpl ("customer-pages-*") ---------- */

.customer-pages-card-body {
    padding: clamp(16px, 3vw, 24px);
    color: var(--text);
    font-size: 13px;
    line-height: 1.7;
}

/* ---------- responsive: 767px (phones/tablets, sidebar goes off-canvas) ---------- */

@media (max-width: 767px) {
    .customer-profile-hero,
    .customer-account-password-hero,
    .customer-email-update-hero,
    .customer-phone-update-hero,
    .customer-voucher-activation-hero,
    .customer-activation-history-hero,
    .customer-inbox-hero,
    .customer-pages-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .customer-voucher-activation-layout {
        grid-template-columns: 1fr;
    }

    .customer-profile-actions,
    .customer-account-password-actions,
    .customer-email-update-actions,
    .customer-phone-update-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .customer-profile-actions .btn,
    .customer-account-password-actions .btn,
    .customer-email-update-actions .btn,
    .customer-phone-update-actions .btn {
        width: 100%;
    }

    .customer-email-update-input,
    .customer-phone-update-input,
    .customer-voucher-activation-input {
        flex-wrap: wrap;
    }

    .customer-email-update-input input,
    .customer-phone-update-input input,
    .customer-voucher-activation-input input {
        flex: 1 1 100%;
    }

    .customer-email-update-input .btn,
    .customer-phone-update-input .btn,
    .customer-voucher-activation-input .btn {
        flex: 1 1 100%;
    }

    .customer-email-update-step,
    .customer-phone-update-step {
        flex-direction: column;
    }

    .customer-activation-history-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        white-space: nowrap;
        clip: rect(0, 0, 0, 0);
        border: 0;
    }

    .customer-activation-history-table tbody,
    .customer-activation-history-table tr,
    .customer-activation-history-table td {
        display: block;
        width: 100%;
    }

    .customer-activation-history-table tbody {
        display: grid;
        gap: 10px;
    }

    .customer-activation-history-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: 12px;
    }

    .customer-activation-history-table td {
        display: flex;
        flex-direction: column;
        gap: 5px;
        padding: 11px 13px;
        border-bottom: 1px solid var(--border);
    }

    .customer-activation-history-table td::before {
        content: attr(data-label);
        color: var(--text-muted);
        font-weight: 750;
        font-size: 9px;
        letter-spacing: .065em;
        text-transform: uppercase;
    }

    .customer-activation-history-empty-row {
        display: block !important;
    }

    .customer-activation-history-empty-row td {
        display: block;
        border: 0 !important;
    }

    .customer-activation-history-empty-row td::before {
        display: none;
    }

    .customer-inbox-controls {
        flex-wrap: wrap;
    }

    .customer-inbox-item {
        flex-wrap: wrap;
    }

    .customer-inbox-item-date {
        flex: 1 1 100%;
        padding-left: 27px;
    }
}

/* ---------- responsive: 479px (narrow phones only) ---------- */

@media (max-width: 479px) {
    .customer-profile-hero h1,
    .customer-account-password-hero h1,
    .customer-email-update-hero h1,
    .customer-phone-update-hero h1,
    .customer-voucher-activation-hero h1,
    .customer-activation-history-hero h1,
    .customer-inbox-hero h1,
    .customer-pages-hero h1 {
        font-size: 21px;
    }

    .customer-profile-hero-mark,
    .customer-account-password-hero-mark,
    .customer-email-update-hero-mark,
    .customer-phone-update-hero-mark,
    .customer-voucher-activation-hero-mark,
    .customer-activation-history-hero-mark,
    .customer-inbox-hero-mark,
    .customer-pages-hero-mark {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
        font-size: 18px;
    }

    .customer-voucher-activation-scan {
        width: 100%;
    }
}
