:root {
    color-scheme: light;
    --ink: #172338;
    --muted: #778397;
    --muted-dark: #59677b;
    --line: #e5eaf1;
    --paper: #fff;
    --canvas: #f5f7fb;
    --navy: #14213a;
    --navy-light: #1c2b48;
    --blue: #4169e1;
    --blue-dark: #3154c6;
    --blue-soft: #edf2ff;
    --green: #16845b;
    --green-soft: #e8f7ef;
    --amber: #a96f17;
    --red: #b54646;
    --shadow: 0 8px 24px #2038560a, 0 1px 3px #20385608;
    font-family: "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; background: var(--canvas); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-layout { min-height: 100vh; }
.sidebar { position: fixed; z-index: 10; inset: 0 auto 0 0; display: flex; width: 252px; flex-direction: column; padding: 25px 16px 18px; background: var(--navy); color: #d8e1f0; }
.mobile-nav-toggle { display: none; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sidebar > .brand { padding: 0 10px 29px; }
.brand-mark { display: block; width: 46px; height: 46px; flex: 0 0 auto; border: 1px solid #ffffff24; border-radius: 10px; object-fit: cover; box-shadow: 0 6px 16px #00000030; }
.brand-name { display: flex; flex-direction: column; color: white; font-size: 20px; font-weight: 750; letter-spacing: -.6px; line-height: 1.1; }
.brand-word { white-space: nowrap; }
.brand-name small { margin-top: 6px; color: #8d9bb3; font-size: 8px; font-weight: 700; letter-spacing: 1px; }
.sidebar-caption { padding: 4px 12px 11px; color: #7e8ca5; font-size: 10px; font-weight: 700; letter-spacing: 1.45px; }
.sidebar-nav { display: grid; gap: 5px; }
.sidebar-nav a { position: relative; display: flex; min-height: 44px; align-items: center; gap: 12px; padding: 0 12px; border: 1px solid transparent; border-radius: 9px; color: #aab7ca; font-size: 13px; font-weight: 550; transition: color .16s ease, background .16s ease, border-color .16s ease; }
.sidebar-nav a:hover { background: #ffffff0d; color: #fff; }
.sidebar-nav a.active { border-color: #ffffff12; background: linear-gradient(100deg, #4169e133, #4169e119); color: #fff; box-shadow: inset 3px 0 #7290ff; }
.nav-icon { width: 19px; height: 19px; flex: 0 0 auto; opacity: .9; }
.sidebar-nav a.active .nav-icon { color: #93aaff; }
.nav-live-dot { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: #43d69c; box-shadow: 0 0 0 4px #43d69c1c; }
.sidebar-bottom { margin-top: auto; }
.sidebar-secure { display: flex; align-items: center; gap: 11px; padding: 13px 12px; border: 1px solid #ffffff12; border-radius: 10px; background: #ffffff08; }
.secure-icon { display: grid; width: 29px; height: 29px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: #3ed39820; color: #57dfa8; font-size: 15px; font-weight: 700; }
.sidebar-secure strong, .sidebar-secure small { display: block; }
.sidebar-secure strong { color: #e8eef9; font-size: 11px; font-weight: 650; }
.sidebar-secure small { margin-top: 4px; color: #8b9ab2; font-size: 10px; }
.sidebar-version { display: flex; justify-content: space-between; padding: 17px 5px 0; color: #718099; font-size: 9px; font-weight: 700; letter-spacing: 1.1px; }
.sidebar-version span { color: #8795aa; font-weight: 500; letter-spacing: 0; }

.app-main { min-height: 100vh; margin-left: 252px; }
.topbar { position: sticky; z-index: 5; top: 0; display: flex; min-height: 74px; align-items: center; justify-content: space-between; gap: 20px; padding: 0 36px; border-bottom: 1px solid var(--line); background: #ffffffed; backdrop-filter: blur(12px); }
.topbar-context, .topbar-account { display: flex; align-items: center; }
.topbar-context { gap: 12px; min-width: 0; }
.topbar-eyebrow { color: #8290a3; font-size: 10px; font-weight: 700; letter-spacing: 1.15px; white-space: nowrap; }
.topbar-separator { color: #c0c9d5; }
.topbar-title { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.topbar-account { gap: 10px; flex: 0 0 auto; }
.account-avatar { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #dbe4ff; border-radius: 50%; background: var(--blue-soft); color: var(--blue-dark); font-size: 10px; font-weight: 750; }
.account-copy strong, .account-copy small { display: block; }
.account-copy strong { color: #344258; font-size: 11px; font-weight: 650; }
.account-copy small { margin-top: 3px; color: #8994a4; font-size: 10px; }
.account-divider { width: 1px; height: 28px; margin: 0 3px 0 9px; background: var(--line); }
.logout-form { margin: 0; }
.logout-button { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.logout-button svg { width: 17px; height: 17px; }
.password-change-button { min-height: 34px; padding: 7px 9px; white-space: nowrap; }

.container { width: min(1450px, 100%); min-height: calc(100vh - 135px); margin: 0 auto; padding: 32px 36px 56px; }
.hotspot-tabs { display: flex; gap: 5px; overflow-x: auto; margin: -5px 0 25px; padding: 6px; border: 1px solid #cbd5e4; border-radius: 11px; background: #edf1f7; box-shadow: 0 1px 3px #20385612; scrollbar-width: thin; }
.hotspot-tabs a { display: inline-flex; min-height: 40px; flex: 0 0 auto; align-items: center; justify-content: center; padding: 0 17px; border: 1px solid #d4dce8; border-radius: 7px; background: #fff; color: #46556b; font-size: 13px; font-weight: 650; white-space: nowrap; transition: color .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.hotspot-tabs a:hover { border-color: #8aa5ed; background: #f3f6ff; color: #2449b5; }
.hotspot-tabs a.active { border-color: #3154c6; background: #4169e1; color: #fff; box-shadow: 0 2px 5px #3154c63b; }
.hotspot-tabs a:focus-visible { outline: 2px solid var(--blue); outline-offset: -3px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 24px; }
h1, h2, h3 { margin: 0; color: var(--ink); font-family: "Segoe UI", Arial, sans-serif; }
h1 { font-size: clamp(24px, 2.5vw, 31px); font-weight: 720; letter-spacing: -.8px; line-height: 1.2; }
h2 { font-size: 15px; font-weight: 680; letter-spacing: -.1px; }
h3 { font-size: 14px; font-weight: 650; }
.subtitle { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.grid { display: grid; gap: 17px; }
.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 22px 0; }
.dashboard-live-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 22px 0 14px; }
.dashboard-live-stat { min-height: 124px; }
.dashboard-live-stat .stat-label { padding-right: 34px; line-height: 1.35; }
.dashboard-stat-text { overflow-wrap: anywhere; font-size: clamp(16px, 1.5vw, 22px); line-height: 1.2; white-space: pre-line; }
.dashboard-interface-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.dashboard-interface-card { padding: 17px 20px; }
.dashboard-interface-card .card-heading { margin-bottom: 12px; }
.live-indicator { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #20b77a; box-shadow: 0 0 0 4px #20b77a1c; }
.dashboard-interface-card[data-state="unavailable"] .live-indicator { background: #a7b0bd; box-shadow: 0 0 0 4px #a7b0bd1c; }
.interface-traffic-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid #eef1f5; }
.interface-traffic-row span { color: var(--muted); font-size: 11px; font-weight: 700; }
.interface-traffic-row strong { color: var(--ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.stat, .card { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); box-shadow: var(--shadow); }
.stat { position: relative; overflow: hidden; min-height: 119px; padding: 20px; }
.stat::after { position: absolute; top: 17px; right: 18px; width: 30px; height: 30px; border-radius: 9px; background: var(--blue-soft); content: ""; }
.stat-label { color: var(--muted-dark); font-size: 12px; font-weight: 550; }
.stat-value { margin-top: 14px; color: var(--ink); font-size: 27px; font-weight: 720; letter-spacing: -.7px; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-detail { margin-top: 9px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.stats .stat:last-child .stat-detail { max-width: 260px; margin-top: 16px; }
.two-column { grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr); }
.card { padding: 20px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.host-card-heading { flex-wrap: wrap; }
.host-search { width: min(260px, 100%); min-height: 34px; margin-left: auto; }
.queue-mobile-sort { display: none; }
.live-controls { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.live-status { color: var(--green); font-size: 11px; font-weight: 650; white-space: nowrap; }
.live-status[data-state="error"] { color: var(--red); }
.queue-rate { white-space: nowrap; }
.queue-table tbody tr[data-queue-id].queue-usage-low > td { background-color: #eaf7ef; }
.queue-table tbody tr[data-queue-id].queue-usage-medium > td { background-color: #fff7df; }
.queue-table tbody tr[data-queue-id].queue-usage-high > td { background-color: #ffebea; }
.queue-table tbody tr[data-queue-id].queue-usage-low > td:first-child { background-color: #eaf7ef; }
.queue-table tbody tr[data-queue-id].queue-usage-medium > td:first-child { background-color: #fff7df; }
.queue-table tbody tr[data-queue-id].queue-usage-high > td:first-child { background-color: #ffebea; }
.button:disabled { opacity: .6; cursor: wait; }
.host-traffic-rate { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sort-button { display: inline-flex; align-items: center; gap: 5px; border: 0; padding: 2px 0; background: transparent; color: inherit; font-size: inherit; font-weight: inherit; letter-spacing: inherit; text-transform: inherit; white-space: nowrap; cursor: pointer; }
.sort-button:hover, th[aria-sort] .sort-button { color: var(--blue-dark); }
.sort-button span { color: var(--blue); font-size: 13px; }
.table-wrap { overflow-x: auto; border: 1px solid #e9edf3; border-radius: 9px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 12px 12px; border-bottom: 1px solid var(--line); background: #f8f9fc; color: #758196; font-size: 10px; font-weight: 700; letter-spacing: .055em; text-align: left; text-transform: uppercase; white-space: nowrap; }
th:first-child { border-top-left-radius: 8px; }
th:last-child { border-top-right-radius: 8px; }
td { padding: 12px; border-bottom: 1px solid #edf0f5; color: #3b485b; vertical-align: middle; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #f8faff; }
tbody tr:last-child td { border-bottom: 0; }
th[aria-sort="ascending"] .sort-button span, th[aria-sort="descending"] .sort-button span { color: var(--blue-dark); }

.button { display: inline-flex; min-height: 36px; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 8px; padding: 8px 13px; background: var(--blue); box-shadow: 0 2px 4px #4169e11c; color: white; font-size: 12px; font-weight: 650; cursor: pointer; transition: background .15s ease, border-color .15s ease, box-shadow .15s ease; }
.button:hover { background: var(--blue-dark); box-shadow: 0 4px 10px #4169e12e; }
.button-quiet { border-color: #e3e8ef; background: #fff; box-shadow: none; color: #5a687c; }
.button-quiet:hover { border-color: #cfd8e5; background: #f8faff; box-shadow: none; color: var(--ink); }
.button-danger { border-color: #f6d9d8; background: #fff3f2; box-shadow: none; color: var(--red); }
.button-danger:hover { border-color: #efc4c2; background: #ffe9e7; box-shadow: none; }
.button-small { min-height: 30px; padding: 6px 9px; font-size: 11px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.password-input-wrap { position: relative; }
.password-input-wrap input { padding-right: 42px; }
.password-visibility { position: absolute; top: 50%; right: 5px; display: grid; width: 32px; height: 32px; place-items: center; transform: translateY(-50%); border: 0; border-radius: 6px; background: transparent; color: #738197; cursor: pointer; }
.password-visibility:hover { background: #f1f4fa; color: var(--blue-dark); }
.password-visibility svg { width: 18px; height: 18px; }
.password-eye-slash { display: none; }
.password-visibility[aria-pressed="true"] .password-eye-slash { display: block; }
label { color: #4d5b70; font-size: 11px; font-weight: 650; }
input, select, textarea { width: 100%; min-height: 38px; border: 1px solid #dce3ec; border-radius: 8px; outline: none; background: #fff; color: var(--ink); padding: 9px 11px; font-size: 12px; transition: border-color .15s ease, box-shadow .15s ease; }
input::placeholder, textarea::placeholder { color: #a2acba; }
input:focus, select:focus, textarea:focus { border-color: #7893ee; box-shadow: 0 0 0 3px #4169e117; }
input[type="checkbox"] { min-height: 0; accent-color: var(--blue); }
.form-actions { display: flex; align-items: center; gap: 9px; margin-top: 17px; }
.inline-form { display: inline-flex; align-items: center; gap: 7px; }
.stack { display: grid; gap: 16px; }
.notice { margin: 0 0 18px; padding: 12px 15px; border: 1px solid transparent; border-radius: 9px; font-size: 12px; line-height: 1.5; }
.success { border-color: #d2eddf; background: #effaf4; color: #176345; }
.error { border-color: #f2d8d7; background: #fff4f3; color: #963e3c; }
.badge { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #d7eee2; border-radius: 99px; background: var(--green-soft); color: #17724f; padding: 4px 9px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.badge.off { border-color: #e7eaf0; background: #f2f4f7; color: #68768a; }
.muted { color: var(--muted); }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 11px; }
.empty { padding: 27px; color: var(--muted); text-align: center; }
.router-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.router-summary div { padding: 11px 0; border-bottom: 1px solid var(--line); }
.router-summary dt { margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.router-summary dd { overflow-wrap: anywhere; margin: 0; color: #334158; font-size: 12px; font-weight: 620; }
.voucher-print { white-space: pre-wrap; }
.fingerprint { font-size: 11px; overflow-wrap: anywhere; }
.small-check { width: auto; }
.section-spaced { margin-top: 16px; }
.section-spaced-small { margin-top: 15px; }
.binding-dialog { width: min(520px, calc(100vw - 32px)); max-width: none; padding: 0; border: 1px solid #d9e0e9; border-radius: 14px; color: var(--ink); box-shadow: 0 22px 70px #14213a38; }
.password-dialog { overflow: hidden; }
.password-dialog .binding-titlebar h2 { margin-top: 4px; color: #fff; font-size: 17px; }
.queue-dialog { width: min(700px, calc(100vw - 32px)); }
.user-dialog { width: min(700px, calc(100vw - 32px)); }
.user-dialog .form-grid { padding: 22px; }
.customer-dialog { width: min(680px, calc(100vw - 32px)); overflow: hidden; }
.customer-dialog form { display: grid; }
.bandwidth-dialog { width: min(680px, calc(100vw - 32px)); overflow: hidden; }
.bandwidth-dialog .binding-titlebar h2 { margin-top: 4px; color: #fff; font-size: 17px; }
.bandwidth-dialog-body { padding: 22px 24px 8px; }
.bandwidth-dialog-body > .subtitle { margin: 0 0 16px; color: #344258; font-size: 13px; font-weight: 650; }
.last-seen-panel { display: grid; gap: 7px; margin-bottom: 14px; padding: 13px 15px; border: 1px solid #dce7f8; border-radius: 10px; background: linear-gradient(110deg, #f3f7ff, #fbfcff); }
.last-seen-panel > span { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.last-seen-panel > strong { color: #294b9c; font-size: 14px; font-weight: 720; }
.last-seen-panel > small { color: var(--muted); font-size: 10px; }
.bandwidth-period-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bandwidth-period { display: grid; min-height: 112px; align-content: start; gap: 9px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcff; }
.bandwidth-period-primary { border-color: #d9e3ff; background: linear-gradient(140deg, #f4f7ff, #fbfcff); }
.bandwidth-period > span { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; }
.bandwidth-period > strong { color: var(--ink); font-size: 21px; font-weight: 730; letter-spacing: -.45px; font-variant-numeric: tabular-nums; }
.bandwidth-period > small { color: var(--muted); font-size: 10px; line-height: 1.4; }
.bandwidth-note { min-height: 31px; margin: 15px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.bandwidth-note[data-state="error"] { color: var(--red); }
.bandwidth-dialog .binding-actions { justify-content: flex-end; padding: 12px 24px 18px; }
.customer-name-link { display: inline; width: auto; min-height: 0; border: 0; padding: 0; background: transparent; color: var(--ink); font-size: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.customer-name-link:hover { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 3px; }
.customer-name-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
.customer-dialog .binding-titlebar { padding: 19px 24px; }
.customer-dialog .binding-titlebar h2 { margin-top: 4px; font-size: 17px; }
.customer-form-body { padding: 23px 24px 8px; }
.customer-form-body .form-grid { margin: 15px 0 24px; }
.customer-form-body .form-grid:last-of-type { margin-bottom: 12px; }
.form-section-label { display: flex; align-items: center; gap: 9px; color: #344258; font-size: 12px; font-weight: 700; }
.form-section-label span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; background: var(--blue-soft); color: var(--blue-dark); font-size: 10px; }
.dialog-eyebrow { color: #a9b8d7; font-size: 9px; font-weight: 750; letter-spacing: 1.4px; }
.customer-dialog-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.customer-dialog .binding-actions { padding: 15px 24px; }
.binding-dialog::backdrop { background: #14213a70; backdrop-filter: blur(3px); }
.binding-form { display: grid; gap: 0; }
.binding-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-radius: 13px 13px 0 0; background: linear-gradient(115deg, var(--navy), #24385f); color: #fff; }
.binding-titlebar h2 { color: #fff; font-size: 14px; }
.dialog-x { width: 30px; height: 30px; padding: 0; border: 1px solid #ffffff24; border-radius: 8px; background: #ffffff10; color: #fff; font-size: 21px; cursor: pointer; }
.binding-fields { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 12px; padding: 22px; }
.binding-fields > label, .binding-fields > span { color: #45554c; font-size: 12px; font-weight: 600; }
.binding-fields input, .binding-fields select { min-width: 0; }
.queue-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; padding: 22px; }
.queue-enabled { display: flex; align-items: center; gap: 8px; align-self: center; }
.queue-enabled input { width: auto; }
.binding-enabled { display: flex; align-items: center; gap: 8px; font-weight: 400 !important; }
.binding-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); }
.customer-heading { align-items: center; }
.eyebrow { display: block; margin-bottom: 8px; color: #6f83b0; font-size: 9px; font-weight: 750; letter-spacing: 1.55px; }
.customer-heading h1 { letter-spacing: -1px; }
.customer-stats { margin-top: 0; }
.customer-stat { min-height: 112px; padding: 18px 19px; }
.customer-stat::after { background: linear-gradient(145deg, #eff3ff, #e3eaff); }
.customer-stat .stat-value { font-size: 29px; }
.customer-stat-warning::after { background: #fff2dc; }
.customer-stat-warning .stat-value { color: var(--amber); }
.customer-stat-danger::after { background: #ffeded; }
.customer-stat-danger .stat-value { color: var(--red); }
.payment-policy-notice { border-color: #dce6ff; background: linear-gradient(110deg, #f1f5ff, #f9fbff); color: #445676; }
.payment-policy-notice strong { color: #2b4272; }
.payment-table { min-width: 820px; }
.payment-history-table { min-width: 600px; }
.payment-table tbody td, .payment-history-table tbody td { vertical-align: middle; }
.billing-status { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 10px; font-weight: 700; white-space: nowrap; }
.billing-status-ok { background: var(--green-soft); color: var(--green); }
.billing-status-warning { background: #fff4df; color: var(--amber); }
.billing-status-danger { background: #fff0ef; color: var(--red); }
.billing-status-muted { background: #f0f2f5; color: #68768a; }
.payment-sync-warning { display: block; margin: 4px 0 0; }
.payment-table form { margin: 0; }
.customer-list-card { padding: 21px; }
.customer-list-heading { align-items: center; margin-bottom: 17px; }
.customer-list-heading .subtitle { margin-top: 5px; font-size: 11px; }
.customer-search { width: min(280px, 100%); min-height: 36px; }
.customer-table { min-width: 850px; }
.lease-table { min-width: 800px; }
.lease-table th { white-space: nowrap; }
.lease-table td:first-child { width: 95px; color: var(--muted-dark); font-variant-numeric: tabular-nums; }
.lease-table td:nth-child(3), .lease-table td:nth-child(4) { white-space: nowrap; }
.customer-table tbody td { vertical-align: middle; }
.customer-name-cell { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.customer-avatar { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: linear-gradient(145deg, #e9efff, #f2f5ff); color: #4261bb; font-size: 12px; font-weight: 750; }
.customer-name-cell strong, .customer-name-cell small, .customer-secondary, .due-label { display: block; }
.customer-name-cell strong { color: #26354b; font-size: 12px; }
.customer-name-cell small, .customer-secondary { margin-top: 4px; color: var(--muted); font-size: 10px; }
.customer-name-cell .customer-comment { max-width: 220px; color: #61718a; overflow-wrap: anywhere; }
.optional-label { color: var(--muted); font-size: 10px; font-weight: 500; }
.field-hint { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.speed-chip { display: inline-grid; gap: 4px; border: 1px solid #e2e9fa; border-radius: 8px; padding: 6px 8px; background: #f7f9ff; color: #435780; font-size: 10px; font-weight: 650; white-space: nowrap; }
.due-label { margin-top: 5px; font-size: 10px; font-weight: 650; }
.due-label.due-ok { color: var(--green); }
.due-label.due-soon { color: var(--amber); }
.due-label.overdue { color: var(--red); }
.sync-warning { display: inline-block; margin: 6px 0 0 44px; color: var(--red); font-size: 9px; font-weight: 700; }
.customer-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.customer-actions form { margin: 0; }
.customer-footnote { margin: 14px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
[data-customer-row][hidden], [data-customer-empty-search][hidden] { display: none !important; }
.footer { display: flex; justify-content: space-between; gap: 15px; padding: 0 36px 18px; color: #8b96a6; font-size: 10px; }

.guest { min-height: 100vh; background: radial-gradient(ellipse at 50% 4%, #e8efff 0, transparent 43%), var(--canvas); }
.guest-layout { min-height: 100vh; }
.guest-topbar { display: flex; min-height: 76px; align-items: center; justify-content: space-between; padding: 0 max(5vw, calc((100vw - 1180px) / 2)); border-bottom: 1px solid #e4eaf3; background: #ffffffd9; }
.guest-brand .brand-mark { width: 42px; height: 42px; }
.guest-brand .brand-name { color: var(--navy); font-size: 18px; }
.guest-brand .brand-name small { color: #8290a3; }
.guest-secure { display: flex; align-items: center; gap: 7px; color: #728096; font-size: 11px; }
.guest-secure span { color: var(--green); font-weight: 800; }
.guest-container { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 130px); padding-top: 30px; padding-bottom: 36px; }
.login-wrap { width: min(440px, 100%); margin: 0 auto; }
.login-wrap .card { padding: 30px; border-color: #e6ebf3; border-radius: 15px; box-shadow: 0 18px 55px #1b376014, 0 2px 8px #1b37600a; }
.login-wrap h1 { font-size: 25px; }
.login-wrap .form-grid { grid-template-columns: 1fr; }
.login-wrap .subtitle { margin-top: 8px; }
.guest-footer { padding: 0 18px 20px; color: #98a3b2; font-size: 9px; font-weight: 700; letter-spacing: 1.2px; text-align: center; }
.guest-footer span { padding: 0 4px; color: #b4bdc9; }

@media (max-width: 1100px) {
    .sidebar { width: 218px; }
    .app-main { margin-left: 218px; }
    .topbar { padding-right: 24px; padding-left: 24px; }
    .container { padding-right: 24px; padding-left: 24px; }
    .stats { gap: 12px; }
    .stat { padding: 17px; }
    .dashboard-live-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dashboard-interface-grid { gap: 12px; }
}
@media (max-width: 760px) {
    .sidebar { position: sticky; inset: 0 0 auto; width: 100%; padding: 12px 16px 10px; }
    .sidebar > .brand { padding: 0 4px 12px; }
    .mobile-nav-toggle { position: absolute; top: 12px; right: 20px; display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; margin: 0; border: 1px solid #ffffff24; border-radius: 9px; background: #ffffff0b; color: #d8e1f0; cursor: pointer; }
    .mobile-nav-toggle:hover, .mobile-nav-toggle[aria-expanded="true"] { border-color: #829cff80; background: #4169e133; color: #fff; }
    .mobile-nav-toggle svg { width: 19px; height: 19px; }
    .brand-mark { width: 40px; height: 40px; border-radius: 9px; }
    .brand-name { font-size: 17px; }
    .brand-name small { margin-top: 4px; font-size: 8px; }
    .sidebar-caption, .sidebar-bottom { display: none; }
    .sidebar-nav { display: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; overflow: visible; padding: 1px 0 2px; }
    .sidebar.mobile-nav-open .sidebar-nav { display: grid; }
    .sidebar-nav a { min-width: 0; min-height: 38px; gap: 8px; padding: 0 10px; font-size: 11px; }
    .sidebar-nav a > span:not(.nav-live-dot) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .nav-icon { width: 16px; height: 16px; }
    .sidebar-nav a.active { box-shadow: inset 0 -2px #829cff; }
    .app-main { margin-left: 0; }
    .topbar { position: static; min-height: 59px; padding: 0 18px; }
    .topbar-eyebrow, .topbar-separator { display: none; }
    .topbar-title { font-size: 12px; }
    .account-copy, .account-divider { display: none; }
    .account-avatar { width: 30px; height: 30px; }
    .container { min-height: calc(100vh - 160px); padding: 25px 18px 40px; }
    .footer { padding: 0 18px 15px; }
}
@media (max-width: 560px) {
    body { overflow-x: hidden; }
    .container { padding-top: 21px; }
    .stats.host-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 14px 0; }
    .host-stats .stat { min-width: 0; min-height: 76px; padding: 10px 8px; }
    .host-stats .stat::after { top: 8px; right: 8px; width: 16px; height: 16px; border-radius: 5px; }
    .host-stats .stat-label { padding-right: 12px; font-size: 9px; line-height: 1.25; }
    .host-stats .stat-value { margin-top: 9px; font-size: 20px; }
    .host-stats .stat-detail { display: none; }
    .hotspot-tabs { margin-top: -2px; margin-bottom: 20px; }
    .hotspot-tabs a { min-height: 43px; padding: 0 14px; font-size: 12px; }
    .stats, .form-grid, .router-summary { grid-template-columns: 1fr 1fr; }
    .dashboard-live-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
    .dashboard-live-stat { min-height: 104px; padding: 14px; }
    .dashboard-live-stat .stat-value { margin-top: 10px; }
    .dashboard-interface-grid { grid-template-columns: 1fr; gap: 9px; }
    .dashboard-interface-card { padding: 14px 16px; }
    .stats .stat { min-height: 108px; padding: 15px; }
    .stat-value { font-size: 24px; }
    .stat-detail { font-size: 10px; }
    .stats .stat:last-child .stat-detail { margin-top: 10px; }
    .field.full { grid-column: 1 / -1; }
    .page-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
    .customer-heading { align-items: stretch; }
    .customer-heading > .button { width: 100%; }
    .customer-list-heading { display: grid; }
    .customer-search { width: 100%; }
    .customer-list-card { padding: 15px; }
    .customer-table { min-width: 0; }
    .payment-table, .payment-history-table { min-width: 0; }
    .payment-table { min-width: 0; }
    .lease-table { min-width: 0; }
    .customer-dialog .binding-titlebar { padding: 16px 18px; }
    .bandwidth-dialog-body { padding: 18px 18px 6px; }
    .bandwidth-dialog .binding-actions { padding: 10px 18px 15px; }
    .last-seen-panel { padding: 11px 12px; }
    .bandwidth-period-grid { gap: 8px; }
    .bandwidth-period { min-height: 104px; padding: 12px; }
    .bandwidth-period > strong { font-size: 18px; }
    .customer-form-body { padding: 18px 18px 6px; }
    .customer-form-body .form-grid { grid-template-columns: 1fr; gap: 12px; margin: 12px 0 20px; }
    .customer-dialog .binding-actions { padding: 12px 18px; }
    .live-controls { width: 100%; justify-content: space-between; }
    .card { padding: 15px; }
    .card-heading { align-items: flex-start; }
    .host-card-heading h2 { flex: 1 1 auto; }
    .host-card-heading .host-search { order: 3; width: 100%; margin-left: 0; }
    .host-card-heading > a { font-size: 11px; }
    .queue-card-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
    .queue-card-heading h2 { grid-column: 1; }
    .queue-card-heading > .live-status { grid-column: 1 / -1; grid-row: 2; }
    .queue-mobile-sort { display: flex; grid-column: 2; grid-row: 1; align-items: center; gap: 6px; color: var(--muted-dark); font-size: 10px; white-space: nowrap; }
    .queue-mobile-sort select { width: auto; min-height: 32px; padding: 5px 7px; font-size: 11px; }
    .queue-table-wrap { overflow: visible; border: 0; }
    .queue-table, .queue-table tbody { display: block; width: 100%; }
    .queue-table thead { display: none; }
    .queue-table tbody { display: grid; gap: 10px; }
    .queue-table tbody tr[data-queue-id] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; overflow: hidden; border: 1px solid #dfe6f0; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px #2038560a; }
    .queue-table tbody tr[data-queue-id]:hover { background: #fff; }
    .queue-table tbody tr[data-queue-id] td { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; padding: 10px 11px; border-bottom: 1px solid #edf0f5; font-size: 11px; overflow-wrap: anywhere; }
    .queue-table tbody tr[data-queue-id] td::before { color: var(--muted); content: attr(data-label); font-family: "Segoe UI", Arial, sans-serif; font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
    .queue-table tbody tr[data-queue-id] td:first-child { grid-column: 1 / -1; background: #f8f9fc; }
    .queue-table tbody tr[data-queue-id] td:nth-last-child(-n+2) { border-bottom: 0; }
    .queue-table tbody tr[data-queue-id] td:nth-last-child(2) { align-items: flex-start; }
    .queue-table tbody tr[data-queue-id] td:last-child { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid #edf0f5; }
    .queue-table tbody tr[data-queue-id] td:last-child .inline-form { width: 100%; }
    .queue-table tbody tr[data-queue-id] td:last-child .inline-form > * { flex: 1; }
    .queue-table tbody tr[data-queue-id] td:last-child .inline-form button { width: 100%; }
    .queue-table tbody tr[data-queue-empty] { display: block; }
    .queue-table tbody tr[data-queue-empty] td { display: block; padding: 20px 12px; font-size: 11px; }
    .binding-fields { grid-template-columns: 1fr; gap: 6px; padding: 18px; }
    .queue-fields { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
    .user-dialog .form-grid { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
    .binding-fields > :not(label):not(span) { margin-bottom: 8px; }
    .binding-fields > label, .binding-fields > span { margin-top: 4px; }
    .binding-actions { padding: 12px 18px; }
    .guest-topbar { min-height: 66px; padding: 0 18px; }
    .guest-secure { font-size: 0; }
    .guest-secure span { font-size: 15px; }
    .login-wrap .card { padding: 23px; }
    .table-wrap:not(.queue-table-wrap) { overflow: visible; border: 0; }
    .table-wrap:not(.queue-table-wrap) table { display: block; width: 100%; }
    .table-wrap:not(.queue-table-wrap) thead { display: none; }
    .table-wrap:not(.queue-table-wrap) tbody { display: grid; gap: 10px; width: 100%; }
    .table-wrap:not(.queue-table-wrap) tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; overflow: hidden; border: 1px solid #dfe6f0; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px #2038560a; }
    .table-wrap:not(.queue-table-wrap) tbody tr:hover { background: #fff; }
    .table-wrap:not(.queue-table-wrap) tbody td { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; justify-content: center; gap: 5px; padding: 10px; border-bottom: 1px solid #edf0f5; font-size: 11px; overflow-wrap: anywhere; }
    .table-wrap:not(.queue-table-wrap) tbody td::before { color: var(--muted); content: attr(data-label); font-family: "Segoe UI", Arial, sans-serif; font-size: 9px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
    .table-wrap:not(.queue-table-wrap) tbody td[colspan] { display: block; grid-column: 1 / -1; border: 0; text-align: center; }
    .table-wrap:not(.queue-table-wrap) tbody tr > td:last-child { border-bottom: 0; }
    .table-wrap:not(.queue-table-wrap) tbody tr > td:only-child { grid-column: 1 / -1; }
    .table-wrap:not(.queue-table-wrap) tbody td .inline-form { display: flex; max-width: 100%; flex-wrap: wrap; align-items: stretch; }
    .table-wrap:not(.queue-table-wrap) tbody td .inline-form > * { min-width: 0; max-width: 100%; }
    .table-wrap:not(.queue-table-wrap) tbody td .inline-form select,
    .table-wrap:not(.queue-table-wrap) tbody td .inline-form input { min-width: 0; width: 100%; }
    .table-wrap:not(.queue-table-wrap) tbody td form:not(.inline-form) { max-width: 100%; }
}
@media (max-width: 380px) {
    .sidebar { padding-right: 11px; padding-left: 11px; }
    .sidebar-nav a { padding: 0 8px; }
    .sidebar-nav a span:not(.nav-live-dot) { font-size: 10px; }
    .topbar { padding: 0 12px; }
    .container { padding-right: 12px; padding-left: 12px; }
    .stats .stat { padding: 12px; }
}
@media print {
    body { background: white; }
    .sidebar, .topbar, .footer, .no-print, .page-heading, .notice { display: none !important; }
    .app-main { margin: 0; }
    .container { width: 100%; margin: 0; padding: 0; }
    .card, .stat { box-shadow: none; }
}
