:root {
  color-scheme: dark;
  --bg: #080b12;
  --bg-soft: #0d111b;
  --panel: rgba(18, 23, 36, .82);
  --panel-solid: #121724;
  --panel-hover: #171d2c;
  --line: rgba(153, 170, 205, .14);
  --line-strong: rgba(153, 170, 205, .24);
  --text: #f4f7fc;
  --text-soft: #b8c1d4;
  --muted: #7f8aa2;
  --blue: #069bdb;
  --blue-bright: #26b7f2;
  --red: #ff242e;
  --green: #3ed598;
  --amber: #f8b84e;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
a { color: inherit; }
code { border: 1px solid var(--line); border-radius: 7px; background: #090d15; padding: 3px 7px; color: #c9d9ef; font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; display: flex; width: 252px; flex-direction: column; border-right: 1px solid var(--line); background: rgba(8, 11, 18, .92); padding: 26px 18px 20px; backdrop-filter: blur(22px); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; overflow: hidden; border: 1px solid rgba(255,255,255,.11); border-radius: 13px; background: #060910; box-shadow: 0 10px 30px rgba(0,0,0,.32); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-mark.large { width: 64px; height: 64px; flex-basis: 64px; border-radius: 18px; }
.brand strong { display: block; font-size: 18px; font-weight: 800; letter-spacing: .055em; }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; letter-spacing: .025em; }
.side-nav { display: grid; gap: 6px; margin-top: 42px; }
.nav-item { display: flex; align-items: center; gap: 13px; min-height: 46px; border: 1px solid transparent; border-radius: 12px; padding: 0 13px; color: var(--muted); text-decoration: none; font-weight: 600; transition: .18s ease; }
.nav-item svg, .mobile-nav svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:hover { background: rgba(255,255,255,.035); color: var(--text-soft); }
.nav-item.active { border-color: rgba(6,155,219,.22); background: linear-gradient(90deg, rgba(6,155,219,.15), rgba(6,155,219,.04)); color: #dff6ff; box-shadow: inset 3px 0 0 var(--blue); }
.sidebar-footer { display: grid; gap: 13px; margin-top: auto; }
.connection-card { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.025); padding: 11px 12px; }
.connection-card strong, .connection-card small { display: block; }
.connection-card strong { font-size: 12px; }
.connection-card small { color: var(--muted); font-size: 10px; }
.status-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #647087; box-shadow: 0 0 0 4px rgba(100,112,135,.1); }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 4px rgba(62,213,152,.12), 0 0 14px rgba(62,213,152,.4); }
.logout-button { width: 100%; border: 0; background: transparent; padding: 8px; color: var(--muted); cursor: pointer; font-size: 12px; }
.logout-button:hover { color: var(--text); }

.main-area { min-height: 100vh; margin-left: 252px; background: radial-gradient(circle at 93% 0, rgba(6,155,219,.08), transparent 28%), radial-gradient(circle at 12% 100%, rgba(255,36,46,.045), transparent 25%), var(--bg); }
.content-wrap { width: min(100%, 1360px); margin: 0 auto; padding: 44px 44px 70px; }
.page-header { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.page-header h1 { margin: 1px 0 5px; font-size: clamp(26px, 3vw, 36px); line-height: 1.12; letter-spacing: -.035em; }
.eyebrow, .section-kicker { margin: 0; color: var(--blue-bright); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.page-description { margin: 0; color: var(--muted); font-size: 14px; }
.page-actions { flex: 0 0 auto; }
.mobile-header, .mobile-nav { display: none; }

.flash-stack { display: grid; gap: 10px; margin-bottom: 20px; }
.flash { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); padding: 12px 15px; color: var(--text-soft); box-shadow: var(--shadow); }
.flash.success { border-color: rgba(62,213,152,.3); background: rgba(20,64,50,.62); color: #c8f6e3; }
.flash.error { border-color: rgba(255,36,46,.3); background: rgba(80,21,29,.65); color: #ffd7da; }

.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(20,26,40,.92), rgba(13,17,27,.9)); box-shadow: var(--shadow); }
.panel h2 { margin: 2px 0 5px; font-size: 18px; letter-spacing: -.02em; }
.panel p { margin: 0; color: var(--muted); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 22px 24px; border-bottom: 1px solid var(--line); }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { display: flex; align-items: center; gap: 14px; min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: rgba(17,22,34,.78); padding: 17px 18px; }
.stat-card > div:last-child { min-width: 0; }
.stat-icon { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border-radius: 11px; font-weight: 800; }
.stat-icon.blue { background: rgba(6,155,219,.12); color: var(--blue-bright); }
.stat-icon.red { background: rgba(255,36,46,.11); color: #ff6670; }
.stat-icon.green { background: rgba(62,213,152,.1); color: var(--green); font-size: 12px; }
.stat-card span, .stat-card small, .stat-card strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-card span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .075em; text-transform: uppercase; }
.stat-card strong { margin: 2px 0; font-size: 16px; }
.stat-card strong i { color: var(--muted); font-size: 12px; font-style: normal; font-weight: 600; }
.stat-card small { color: #66728a; font-size: 10px; }

.create-panel { display: grid; grid-template-columns: 1fr minmax(380px, 1.05fr); align-items: end; gap: 28px; margin-bottom: 18px; padding: 24px; }
.create-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; }
label > span { display: block; margin-bottom: 7px; color: var(--text-soft); font-size: 11px; font-weight: 700; }
input, textarea { width: 100%; outline: 0; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(5,8,14,.72); color: var(--text); transition: border .18s, box-shadow .18s; }
input { height: 42px; padding: 0 12px; }
textarea { min-height: 144px; resize: vertical; padding: 11px 12px; font: 12px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
input:focus, textarea:focus { border-color: rgba(38,183,242,.64); box-shadow: 0 0 0 3px rgba(6,155,219,.1); }
input::placeholder, textarea::placeholder { color: #4f5a70; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 10px; padding: 0 17px; text-decoration: none; font-weight: 750; cursor: pointer; transition: transform .16s, filter .16s, background .16s; }
.button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.button.primary { background: linear-gradient(135deg, #0aa7e6, #087dbd); color: white; box-shadow: 0 10px 24px rgba(6,155,219,.2); }
.button.secondary { border-color: var(--line-strong); background: rgba(255,255,255,.035); color: var(--text-soft); }
.button.full { width: 100%; }

.count-badge, .engine-badge { display: inline-flex; min-height: 28px; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.03); padding: 0 10px; color: var(--muted); font-size: 10px; font-weight: 700; }
.responsive-table { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 11px 15px; border-bottom: 1px solid var(--line); color: #657087; font-size: 9px; font-weight: 800; letter-spacing: .09em; text-align: left; text-transform: uppercase; }
td { padding: 15px; border-bottom: 1px solid rgba(153,170,205,.09); color: var(--text-soft); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .16s; }
tbody tr:hover { background: rgba(255,255,255,.018); }
.client-name { display: flex; align-items: center; gap: 11px; min-width: 150px; }
.client-name strong, .client-name small { display: block; }
.client-name strong { color: var(--text); font-size: 13px; }
.client-name small { max-width: 220px; overflow: hidden; margin-top: 2px; color: #66728a; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border: 1px solid rgba(6,155,219,.22); border-radius: 10px; background: linear-gradient(145deg, rgba(6,155,219,.16), rgba(6,155,219,.05)); color: #a9e6ff; font-size: 10px; font-weight: 800; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 8px; font-size: 9px; font-weight: 700; }
.status-chip i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-chip.online { background: rgba(62,213,152,.09); color: var(--green); }
.status-chip.offline { background: rgba(127,138,162,.08); color: #7f8aa2; }
.cell-subtitle { display: block; margin-top: 5px; color: #59647a; font-size: 9px; }
.traffic { display: grid; gap: 2px; font-size: 10px; }
.limit-summary { color: #9ba8bf; font-size: 10px; white-space: nowrap; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.row-actions form { margin: 0; }
.icon-button { min-height: 30px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.025); padding: 6px 9px; color: var(--text-soft); text-decoration: none; font-size: 9px; font-weight: 750; cursor: pointer; }
.icon-button.download:hover { border-color: rgba(6,155,219,.35); color: #bcecff; }
.icon-button.danger { color: #ff8c93; }
.icon-button.danger:hover { border-color: rgba(255,36,46,.35); background: rgba(255,36,46,.07); }
.empty-state { padding: 52px 20px; text-align: center; }
.empty-state > span { display: grid; width: 44px; height: 44px; margin: 0 auto 12px; place-items: center; border: 1px dashed var(--line-strong); border-radius: 13px; color: var(--blue-bright); font-size: 22px; }
.empty-state h3 { margin: 0 0 5px; }

.info-strip { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; border: 1px solid rgba(6,155,219,.22); border-radius: 14px; background: rgba(6,155,219,.055); padding: 14px 16px; color: var(--text-soft); }
.info-strip p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.info-icon { display: grid; width: 24px; height: 24px; flex: 0 0 24px; place-items: center; border-radius: 50%; background: rgba(6,155,219,.18); color: var(--blue-bright); font-weight: 800; }
.bandwidth-list { display: grid; }
.bandwidth-row { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(180px, .55fr) minmax(180px, .55fr); align-items: center; gap: 24px; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.mini-dot { display: inline-block; width: 5px; height: 5px; margin-right: 5px; border-radius: 50%; background: #68738a; }
.mini-dot.online { background: var(--green); }
.rate-field > span { color: var(--muted); }
.rate-field > span b { color: var(--blue-bright); }
.rate-field:last-child > span b { color: #ff6972; }
.rate-field > div { position: relative; }
.rate-field input { padding-right: 70px; }
.rate-field em { position: absolute; top: 50%; right: 11px; color: #647087; font-size: 9px; font-style: normal; transform: translateY(-50%); }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 24px; }
.form-footer p { font-size: 10px; }

.default-route-panel { display: grid; grid-template-columns: 1fr minmax(390px, .9fr); align-items: center; gap: 28px; margin-bottom: 18px; padding: 24px; }
.route-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.route-option { cursor: pointer; }
.route-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.route-option > span { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 9px; align-items: center; min-height: 70px; border: 1px solid var(--line); border-radius: 12px; background: rgba(5,8,14,.5); padding: 13px; transition: .18s; }
.route-option input:checked + span { border-color: rgba(6,155,219,.45); background: rgba(6,155,219,.08); box-shadow: 0 0 0 3px rgba(6,155,219,.06); }
.route-option b { font-size: 12px; }
.route-option small { grid-column: 2; color: var(--muted); font-size: 9px; }
.route-dot { width: 8px; height: 8px; grid-row: 1 / 3; border-radius: 50%; }
.route-dot.blue { background: var(--blue-bright); box-shadow: 0 0 12px rgba(38,183,242,.5); }
.route-dot.red { background: var(--red); box-shadow: 0 0 12px rgba(255,36,46,.45); }
.managed-routes-panel { margin-bottom: 18px; overflow: hidden; }
.managed-routes-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); padding: 22px 24px; }
.managed-source-title { display: flex; align-items: flex-start; gap: 14px; }
.source-mark { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border: 1px solid rgba(6,155,219,.3); border-radius: 12px; background: linear-gradient(145deg, rgba(6,155,219,.2), rgba(6,155,219,.06)); color: #b9ebff; font-size: 12px; font-weight: 850; letter-spacing: .06em; }
.managed-source-title h2 { margin-top: 2px; }
.managed-source-title p:last-child { max-width: 680px; font-size: 11px; }
.source-status { display: inline-flex; min-height: 29px; flex: 0 0 auto; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 0 11px; color: var(--muted); font-size: 9px; font-weight: 750; }
.source-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.source-status.ready { border-color: rgba(62,213,152,.22); background: rgba(62,213,152,.07); color: var(--green); }
.source-status.error { border-color: rgba(255,36,46,.25); background: rgba(255,36,46,.07); color: #ff7d85; }
.managed-routes-body { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(360px, .85fr); gap: 28px; padding: 24px; }
.managed-settings { display: grid; gap: 19px; }
.switch-control { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 11px; cursor: pointer; }
.switch-control input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-control > span:last-child { min-width: 0; }
.switch-control b, .switch-control small { display: block; }
.switch-control b { color: var(--text-soft); font-size: 11px; }
.switch-control small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.switch-track { position: relative; width: 38px; height: 22px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(5,8,14,.8); transition: .18s; }
.switch-track i { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #69758b; transition: .18s; }
.switch-control input:checked + .switch-track { border-color: rgba(6,155,219,.55); background: rgba(6,155,219,.18); }
.switch-control input:checked + .switch-track i { left: 19px; background: var(--blue-bright); box-shadow: 0 0 10px rgba(38,183,242,.5); }
.managed-direction > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.route-toggle.compact { max-width: 430px; }
.route-toggle.compact .route-option > span { min-height: 60px; padding: 10px 12px; }
.auto-control { border-top: 1px solid var(--line); padding-top: 18px; }
.managed-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.managed-facts > div { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: rgba(5,8,14,.45); padding: 13px 14px; }
.managed-facts > div:nth-child(3) { grid-column: 1 / -1; }
.managed-facts span, .managed-facts strong, .managed-facts small { display: block; }
.managed-facts span { color: #66728a; font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.managed-facts strong { overflow: hidden; margin: 5px 0 3px; color: var(--text-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.managed-facts small { color: var(--muted); font-size: 8px; }
.managed-facts .button { grid-column: 1 / -1; }
.button:disabled { cursor: not-allowed; filter: grayscale(.7); opacity: .48; transform: none; }
.route-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.route-card { padding: 24px; }
.route-card.vpn { border-top: 2px solid rgba(255,36,46,.8); }
.route-card.direct { border-top: 2px solid rgba(6,155,219,.8); }
.route-card-title { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.route-symbol { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; font-weight: 800; }
.route-card.vpn .route-symbol { background: rgba(255,36,46,.1); color: #ff6670; }
.route-card.direct .route-symbol { background: rgba(6,155,219,.11); color: var(--blue-bright); }
.route-card label { display: block; margin-top: 15px; }
.sticky-actions { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(14,18,29,.9); padding: 14px 16px; box-shadow: var(--shadow); }
.sticky-actions p { margin: 0; color: var(--muted); font-size: 10px; }

.log-grid { display: grid; gap: 18px; }
.log-panel pre { max-height: 430px; min-height: 220px; overflow: auto; margin: 0; background: #070a10; padding: 17px 19px; color: #9facbf; font: 10px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; word-break: break-word; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.live-badge i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(62,213,152,.6); }
.legend { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 9px; }
.legend i { width: 6px; height: 6px; border-radius: 50%; }
.legend i.blue { background: var(--blue); }
.legend i.red { margin-left: 6px; background: var(--red); }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.security-panel { overflow: hidden; }
.security-panel .panel-heading p:last-child { font-size: 11px; }
.security-badge { display: inline-flex; min-height: 29px; flex: 0 0 auto; align-items: center; gap: 7px; border: 1px solid rgba(62,213,152,.22); border-radius: 999px; background: rgba(62,213,152,.07); padding: 0 11px; color: var(--green); font-size: 9px; font-weight: 750; }
.security-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px rgba(62,213,152,.5); }
.password-form { display: grid; gap: 18px; padding: 24px; }
.password-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.security-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); margin-top: 2px; padding-top: 20px; }
.password-hint { display: flex; align-items: center; gap: 11px; }
.password-hint > span { display: grid; width: 37px; height: 37px; flex: 0 0 37px; place-items: center; border: 1px solid rgba(6,155,219,.25); border-radius: 11px; background: rgba(6,155,219,.08); color: var(--blue-bright); font-size: 11px; font-weight: 850; }
.password-hint strong, .password-hint small { display: block; }
.password-hint strong { color: var(--text-soft); font-size: 10px; }
.password-hint small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.session-panel { padding: 24px; }
.session-icon { display: grid; width: 42px; height: 42px; margin-bottom: 18px; place-items: center; border: 1px solid rgba(62,213,152,.24); border-radius: 13px; background: rgba(62,213,152,.08); color: var(--green); font-weight: 850; }
.session-panel > p:not(.section-kicker) { margin: 10px 0 20px; font-size: 11px; line-height: 1.7; }
.session-panel ul { display: grid; gap: 10px; margin: 0; padding: 17px 0 0; border-top: 1px solid var(--line); list-style: none; }
.session-panel li { display: flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: 10px; }
.session-panel li i { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }

.login-body { overflow-x: hidden; background: #070a10; }
.login-glow { position: fixed; width: 520px; height: 520px; border-radius: 50%; filter: blur(120px); opacity: .12; pointer-events: none; }
.glow-blue { top: -220px; right: -150px; background: var(--blue); }
.glow-red { bottom: -280px; left: -180px; background: var(--red); }
.login-layout { position: relative; z-index: 1; display: grid; min-height: 100vh; grid-template-columns: 1.1fr .9fr; }
.login-brand-panel { display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; border-right: 1px solid var(--line); padding: clamp(32px, 5vw, 72px); background: radial-gradient(circle at 25% 65%, rgba(6,155,219,.08), transparent 34%); }
.login-brand { display: flex; align-items: center; gap: 16px; }
.login-brand strong { display: block; font-size: 24px; letter-spacing: .08em; }
.login-brand small { display: block; color: var(--muted); font-size: 12px; }
.login-copy { max-width: 620px; }
.login-copy h1 { max-width: 560px; margin: 9px 0 17px; font-size: clamp(44px, 6.2vw, 82px); line-height: .98; letter-spacing: -.065em; }
.login-copy > p:last-child { max-width: 500px; margin: 0; color: var(--text-soft); font-size: clamp(15px, 1.5vw, 19px); }
.login-feature-list { display: flex; gap: 9px; flex-wrap: wrap; }
.login-feature-list span { border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.025); padding: 7px 11px; color: var(--muted); font-size: 10px; }
.login-card-wrap { display: grid; place-items: center; padding: 30px; }
.login-card { width: min(100%, 410px); border: 1px solid var(--line); border-radius: 22px; background: rgba(17,22,34,.84); padding: clamp(24px, 4vw, 38px); box-shadow: 0 30px 90px rgba(0,0,0,.45); backdrop-filter: blur(22px); }
.login-card h2 { margin: 4px 0 4px; font-size: 27px; letter-spacing: -.04em; }
.muted { color: var(--muted); }
.login-card > .muted { margin: 0 0 24px; }
.login-form { display: grid; gap: 16px; }
.login-form label { color: var(--text-soft); font-size: 11px; font-weight: 650; }
.login-form label input { margin-top: 7px; }
.login-form .button { margin-top: 5px; }
.login-security { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; color: #68738a; font-size: 9px; }
.login-mobile-brand { display: none; }

@media (max-width: 1100px) {
  .content-wrap { padding-inline: 28px; }
  .create-panel, .default-route-panel { grid-template-columns: 1fr; align-items: stretch; }
  .bandwidth-row { grid-template-columns: 1fr 180px 180px; gap: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .managed-routes-body { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .stat-card:last-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .main-area { margin-left: 0; }
  .content-wrap { padding: 22px 15px 36px; }
  .mobile-header { position: sticky; top: 0; z-index: 15; display: flex; height: 66px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(8,11,18,.88); padding: 0 15px; backdrop-filter: blur(18px); }
  .brand.compact .brand-mark { width: 36px; height: 36px; flex-basis: 36px; border-radius: 10px; }
  .brand.compact strong { font-size: 15px; }
  .brand.compact small { font-size: 9px; }
  .mobile-status { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 9px; color: var(--muted); font-size: 10px; }
  .mobile-nav { position: fixed; z-index: 30; inset: auto 0 0; display: grid; grid-template-columns: repeat(5,1fr); min-height: calc(66px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(8,11,18,.94); padding: 7px 7px env(safe-area-inset-bottom); backdrop-filter: blur(22px); }
  .mobile-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 10px; color: #69758c; text-decoration: none; font-size: 8px; font-weight: 700; }
  .mobile-nav a.active { background: rgba(6,155,219,.08); color: var(--blue-bright); }
  .mobile-nav svg { width: 19px; height: 19px; }
  .page-header { align-items: flex-start; margin-bottom: 19px; }
  .page-header h1 { font-size: 27px; }
  .page-description { max-width: 280px; font-size: 12px; }
  .eyebrow { font-size: 9px; }
  .page-actions .button { min-height: 36px; padding-inline: 12px; font-size: 10px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { align-items: flex-start; gap: 10px; padding: 13px; }
  .stat-card:last-child { grid-column: 1 / -1; }
  .stat-icon { width: 30px; height: 30px; flex-basis: 30px; border-radius: 9px; }
  .stat-card strong { font-size: 12px; }
  .stat-card span, .stat-card small { font-size: 8px; }
  .create-panel { gap: 19px; padding: 19px; }
  .create-form { grid-template-columns: 1fr; }
  .create-form .button { width: 100%; }
  .panel-heading { padding: 18px; }
  .responsive-table { overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody { padding: 0 15px 15px; }
  tbody tr { position: relative; margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(7,10,16,.5); padding: 15px; }
  td { display: flex; min-height: 34px; align-items: center; justify-content: space-between; gap: 15px; border: 0; padding: 6px 0; text-align: right; }
  td::before { content: attr(data-label); color: #59647a; font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
  td:first-child { display: block; border-bottom: 1px solid var(--line); padding: 0 0 13px; text-align: left; }
  td:first-child::before, td.row-actions::before { display: none; }
  .client-name small { max-width: 190px; }
  .cell-subtitle { text-align: right; }
  .row-actions { justify-content: stretch; border-top: 1px solid var(--line); margin-top: 7px; padding-top: 13px; }
  .row-actions a, .row-actions form, .row-actions button { width: 100%; }
  .icon-button { display: inline-flex; justify-content: center; min-height: 36px; align-items: center; }
  .bandwidth-row { grid-template-columns: 1fr 1fr; gap: 14px; padding: 17px; }
  .bandwidth-row .client-name { grid-column: 1 / -1; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
  .rate-field input { padding-right: 56px; }
  .form-footer { align-items: stretch; flex-direction: column; padding: 17px; }
  .form-footer .button { width: 100%; }
  .default-route-panel { padding: 19px; }
  .managed-routes-head { align-items: stretch; flex-direction: column; padding: 19px; }
  .source-status { align-self: flex-start; }
  .managed-routes-body { grid-template-columns: 1fr; gap: 22px; padding: 19px; }
  .managed-source-title { gap: 11px; }
  .source-mark { width: 36px; height: 36px; flex-basis: 36px; }
  .managed-facts { grid-template-columns: 1fr; }
  .managed-facts > div:nth-child(3), .managed-facts .button { grid-column: auto; }
  .route-toggle, .route-grid { grid-template-columns: 1fr; }
  .route-card { padding: 19px; }
  .sticky-actions { position: sticky; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 9; align-items: stretch; flex-direction: column; }
  .sticky-actions .button { width: 100%; }
  .log-panel pre { max-height: 58vh; min-height: 280px; font-size: 9px; }
  .security-panel .panel-heading { align-items: flex-start; flex-direction: column; }
  .password-pair { grid-template-columns: 1fr; }
  .security-form-footer { align-items: stretch; flex-direction: column; }
  .security-form-footer .button { width: 100%; }
  .login-layout { display: block; min-height: 100vh; }
  .login-brand-panel { display: none; }
  .login-card-wrap { min-height: 100vh; align-items: center; padding: 18px 15px; }
  .login-card { border-radius: 20px; padding: 24px 20px; }
  .login-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 34px; }
  .login-mobile-brand .brand-mark { width: 42px; height: 42px; flex-basis: 42px; }
  .login-mobile-brand strong { font-size: 18px; letter-spacing: .07em; }
  .login-mobile-brand small { border-left: 1px solid var(--line); margin-left: 2px; padding-left: 10px; color: var(--muted); font-size: 11px; }
}

@media (max-width: 390px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card:last-child { grid-column: auto; }
  .bandwidth-row { grid-template-columns: 1fr; }
  .bandwidth-row .client-name { grid-column: auto; }
}
