:root {
    color-scheme: dark;
    --navy-1000: #030a13;
    --navy-950: #06111e;
    --navy-900: #091726;
    --navy-850: #0c1b2c;
    --navy-800: #102236;
    --navy-700: #1a3047;
    --surface: rgba(9, 23, 38, .92);
    --surface-raised: #0d1d2f;
    --line: rgba(122, 155, 188, .2);
    --line-strong: rgba(122, 155, 188, .34);
    --text: #f4f8fc;
    --muted: #8ea1b4;
    --muted-2: #667b90;
    --blue: #2876ff;
    --blue-soft: rgba(40, 118, 255, .14);
    --emerald: #16c98d;
    --emerald-soft: rgba(22, 201, 141, .13);
    --violet: #8d68ff;
    --danger: #ff6379;
    --danger-soft: rgba(255, 99, 121, .12);
    --shadow: 0 24px 70px rgba(0, 0, 0, .28);
    --sidebar: 274px;
    --radius-lg: 18px;
    --radius-md: 13px;
    --radius-sm: 9px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: Tahoma, "Segoe UI", Arial, sans-serif; color: var(--text); background: var(--navy-950); font-size: 13px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.admin-page { min-height: 100vh; background: radial-gradient(circle at 6% 0%, rgba(32, 105, 185, .1), transparent 29%), var(--navy-950); }
.sidebar { position: fixed; inset: 0 0 0 auto; z-index: 30; width: var(--sidebar); display: flex; flex-direction: column; overflow: hidden; border-left: 1px solid var(--line); background: #061321; box-shadow: -14px 0 45px rgba(0, 0, 0, .12); }
.sidebar-texture { position: absolute; inset: 0; pointer-events: none; opacity: .42; background: linear-gradient(180deg, rgba(4, 13, 24, .04), rgba(4, 13, 24, .88)), url("admin-orbit-texture.png") center/cover; }
.sidebar > *:not(.sidebar-texture) { position: relative; z-index: 1; }
.sidebar-brand { min-height: 108px; display: flex; align-items: center; gap: 13px; padding: 24px 25px; border-bottom: 1px solid var(--line); }
.brand-mark { width: 50px; height: 50px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(22, 201, 141, .34); border-radius: 15px; color: var(--emerald); background: rgba(6, 28, 35, .8); box-shadow: inset 0 0 24px rgba(22, 201, 141, .08), 0 10px 28px rgba(0,0,0,.18); }
.brand-mark svg { width: 34px; height: 34px; }
.brand-mark svg path:first-child { fill: rgba(22, 201, 141, .08); }
.brand-copy { display: grid; gap: 4px; }
.brand-copy b { direction: ltr; font-size: 22px; letter-spacing: -.8px; }
.brand-copy b span { color: var(--emerald); }
.brand-copy small { color: var(--muted); font-size: 10px; }
.sidebar-nav { display: grid; gap: 7px; padding: 25px 15px; }
.nav-link { position: relative; min-height: 50px; display: flex; align-items: center; gap: 13px; padding: 0 15px; color: #9aabbc; border: 1px solid transparent; border-radius: 11px; font-size: 12px; font-weight: 700; transition: .18s ease; }
.nav-link::before { content: ""; position: absolute; inset: 10px auto 10px -16px; width: 3px; border-radius: 4px; background: transparent; }
.nav-link svg { width: 21px; height: 21px; }
.nav-link:hover { color: #dce9f4; background: rgba(255,255,255,.035); }
.nav-link.active { color: white; border-color: rgba(40,118,255,.34); background: linear-gradient(90deg, rgba(40,118,255,.25), rgba(40,118,255,.1)); box-shadow: inset 0 1px rgba(255,255,255,.04); }
.nav-link.active::before { background: var(--blue); box-shadow: 0 0 15px rgba(40,118,255,.85); }
.nav-link.active svg { color: #7fb0ff; }
.sidebar-status { margin: auto 17px 20px; display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(3, 14, 25, .55); }
.status-orbit { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid rgba(22,201,141,.27); border-radius: 50%; }
.status-orbit::before { content: ""; width: 17px; height: 17px; border: 1px solid rgba(22,201,141,.45); border-radius: 50%; }
.status-orbit i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 12px var(--emerald); transform: translate(12px,-7px); }
.sidebar-status span:last-child { min-width: 0; display: grid; gap: 4px; }
.sidebar-status b { font-size: 10px; }
.sidebar-status small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.sidebar-footer { min-height: 78px; display: flex; align-items: center; gap: 10px; padding: 14px 17px; border-top: 1px solid var(--line); background: rgba(3, 12, 22, .62); }
.admin-avatar, .compact-user img, .user-cell img, .dialog-user img { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; object-fit: cover; color: white; background: linear-gradient(145deg, var(--blue), #184795); font-weight: 800; }
.admin-avatar { border: 2px solid rgba(255,255,255,.12); }
.admin-identity { min-width: 0; display: grid; gap: 3px; flex: 1; }
.admin-identity b, .admin-identity small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.admin-identity b { font-size: 10px; }
.admin-identity small { direction: ltr; color: var(--muted); font-size: 8px; text-align: right; }
.logout-button, .mobile-menu, .dialog-close, [data-alert-close] { display: grid; place-items: center; border: 0; color: var(--muted); background: transparent; cursor: pointer; }
.logout-button { width: 34px; height: 34px; border-radius: 9px; }
.logout-button:hover { color: var(--danger); background: var(--danger-soft); }
.logout-button svg { width: 19px; height: 19px; }

.app-shell { min-height: 100vh; margin-right: var(--sidebar); }
.topbar { min-height: 92px; display: flex; align-items: center; gap: 18px; padding: 18px clamp(24px, 3vw, 46px); border-bottom: 1px solid var(--line); background: rgba(5, 15, 26, .88); backdrop-filter: blur(16px); }
.mobile-menu { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; }
.mobile-menu svg { width: 22px; height: 22px; }
.page-heading { min-width: 0; display: grid; gap: 6px; }
.page-heading h1 { margin: 0; font-size: clamp(20px, 2vw, 27px); letter-spacing: -.7px; }
.page-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.topbar-meta { margin-right: auto; display: flex; align-items: center; gap: 16px; color: var(--muted); font-size: 11px; direction: ltr; }
.live-state { display: flex; align-items: center; gap: 7px; direction: rtl; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.025); }
.live-state i, .live-dot { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 12px rgba(22,201,141,.75); }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 30px clamp(22px, 3vw, 44px) 48px; }

.alert { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; padding: 13px 15px; border-radius: 11px; font-size: 11px; }
.alert svg { width: 19px; height: 19px; flex: 0 0 auto; }
.alert span { flex: 1; }
.alert-success { color: #9af3d1; border: 1px solid rgba(22,201,141,.32); background: var(--emerald-soft); }
.alert-error { color: #ffabb7; border: 1px solid rgba(255,99,121,.32); background: var(--danger-soft); }
[data-alert-close] { font-size: 18px; color: currentColor; }
.surface { border: 1px solid var(--line); border-radius: var(--radius-lg); background: linear-gradient(180deg, rgba(13,29,47,.94), rgba(7,20,34,.96)); box-shadow: 0 16px 55px rgba(0,0,0,.13), inset 0 1px rgba(255,255,255,.025); }
.surface-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.surface-heading h2 { margin: 0 0 7px; font-size: 15px; }
.surface-heading p { margin: 0; color: var(--muted); font-size: 9px; }
.text-link { display: flex; gap: 8px; color: #7eabff; font-size: 10px; font-weight: 700; }
.count-label { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 9px; }

.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); overflow: hidden; margin-bottom: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(8,22,37,.8); }
.metric-item { min-height: 112px; display: flex; align-items: center; gap: 15px; padding: 20px; border-left: 1px solid var(--line); }
.metric-item:last-child { border-left: 0; }
.metric-icon { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 14px; font-size: 20px; font-weight: 900; }
.metric-icon svg { width: 24px; height: 24px; }
.metric-icon.blue { color: #75a8ff; background: var(--blue-soft); }
.metric-icon.green { color: #63e3b7; background: var(--emerald-soft); }
.metric-icon.violet { color: #b19aff; background: rgba(141,104,255,.13); }
.metric-icon.google { color: white; background: conic-gradient(from 20deg, #4285f4, #34a853, #fbbc05, #ea4335, #4285f4); text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.metric-item > span:last-child { display: grid; gap: 4px; }
.metric-item small { color: var(--muted); font-size: 9px; }
.metric-item strong { font-size: 24px; line-height: 1; }
.metric-item em { color: var(--muted-2); font-size: 8px; font-style: normal; }
.compact-metrics .metric-item { min-height: 92px; padding: 16px 19px; }
.compact-metrics .metric-icon { width: 40px; height: 40px; }
.compact-metrics .metric-item strong { font-size: 21px; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(280px, .65fr); gap: 22px; }
.recent-users, .network-panel { padding: 21px; }
.compact-user-list { margin-top: 17px; border-top: 1px solid var(--line); }
.compact-user { min-height: 67px; display: grid; grid-template-columns: 38px minmax(160px,1.4fr) auto auto minmax(120px,.8fr); align-items: center; gap: 13px; border-bottom: 1px solid rgba(122,155,188,.12); }
.compact-user:last-child { border-bottom: 0; }
.user-main, .last-seen, .date-cell { min-width: 0; display: grid; gap: 4px; }
.user-main b, .user-main small, .last-seen b, .last-seen small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.user-main b, .last-seen b, .date-cell b { font-size: 10px; }
.user-main small, .last-seen small, .date-cell small, .cell-note { color: var(--muted); font-size: 8px; }
.last-seen { color: #bed0df; }
.account-type, .subscription-state, .protocol-name { display: inline-flex; align-items: center; width: fit-content; gap: 6px; padding: 6px 9px; border-radius: 7px; font-size: 9px; white-space: nowrap; }
.account-type.google-type { color: #a9c7ff; background: var(--blue-soft); }
.account-type.guest { color: #c0aaff; background: rgba(141,104,255,.12); }
.subscription-state.active { color: #5ce4b4; background: var(--emerald-soft); }
.subscription-state.inactive { color: #ff92a2; background: var(--danger-soft); }
.subscription-state i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.network-panel { position: relative; overflow: hidden; }
.network-panel::after { content: ""; position: absolute; width: 210px; height: 210px; left: -90px; bottom: -95px; border: 1px solid rgba(40,118,255,.12); border-radius: 50%; box-shadow: 0 0 0 35px rgba(40,118,255,.025), 0 0 0 70px rgba(22,201,141,.018); }
.network-score { position: relative; z-index: 1; display: grid; justify-items: center; gap: 7px; padding: 25px 0 20px; }
.network-score strong { font-size: 42px; line-height: 1; }
.network-score strong small { color: var(--emerald); font-size: 16px; }
.network-score span { color: var(--muted); font-size: 9px; }
.network-list { position: relative; z-index: 1; display: grid; margin: 0 0 17px; }
.network-list div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(122,155,188,.12); }
.network-list dt { color: var(--muted); font-size: 9px; }
.network-list dd { margin: 0; font-weight: 800; }
.success-text { color: var(--emerald) !important; }
.blue-text { color: #6da4ff !important; }
.danger-text { color: var(--danger) !important; }
.quick-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin-top: 22px; }
.quick-actions a { min-height: 76px; display: flex; align-items: center; gap: 13px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 13px; background: rgba(8,22,37,.58); transition: .18s ease; }
.quick-actions a:hover { transform: translateY(-2px); border-color: rgba(40,118,255,.45); background: rgba(12,31,51,.86); }
.quick-actions svg { width: 23px; height: 23px; color: #77aaff; }
.quick-actions span { display: grid; gap: 5px; flex: 1; }
.quick-actions b { font-size: 10px; }
.quick-actions small { color: var(--muted); font-size: 8px; }
.quick-actions i { color: var(--muted); font-style: normal; }

.data-surface { overflow: hidden; }
.table-toolbar { min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.search-field { width: min(470px, 100%); height: 43px; display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 10px; background: rgba(3,12,22,.5); transition: .18s ease; }
.search-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(40,118,255,.1); }
.search-field svg { width: 18px; height: 18px; margin: 0 13px; color: var(--muted); }
.search-field input { min-width: 0; flex: 1; height: 100%; border: 0; outline: 0; color: white; background: transparent; font-size: 10px; }
.search-field input::placeholder { color: #60758a; }
.search-field button { align-self: stretch; padding: 0 16px; border: 0; border-right: 1px solid var(--line); color: #a9c7ff; background: var(--blue-soft); cursor: pointer; font-size: 9px; }
.filter-group { display: flex; align-items: center; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: rgba(3,12,22,.35); }
.filter-button { padding: 8px 12px; border-radius: 7px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.filter-button:hover { color: white; }
.filter-button.selected { color: white; background: var(--blue); box-shadow: 0 8px 18px rgba(40,118,255,.2); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; table-layout: auto; }
.data-table th { height: 48px; padding: 0 15px; border-bottom: 1px solid var(--line); color: #9eb0c0; background: rgba(3,12,22,.26); font-size: 9px; font-weight: 700; text-align: right; white-space: nowrap; }
.data-table td { height: 71px; padding: 10px 15px; border-bottom: 1px solid rgba(122,155,188,.13); color: #d7e2ec; font-size: 9px; vertical-align: middle; }
.data-table tbody tr { transition: .15s ease; }
.data-table tbody tr:hover { background: linear-gradient(90deg, rgba(40,118,255,.08), rgba(22,201,141,.025)); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td > b { display: block; font-size: 10px; }
.user-cell, .country-cell, .device-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.user-cell > span:last-child, .country-cell > span:last-child, .device-cell > span:last-child { min-width: 0; display: grid; gap: 4px; }
.user-cell b, .user-cell small, .country-cell b, .country-cell small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.user-cell b, .country-cell b, .device-cell b { font-size: 10px; }
.user-cell small, .country-cell small, .device-cell small { color: var(--muted); font-size: 8px; }
.device-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: #47596a; }
.device-dot.online { background: var(--emerald); box-shadow: 0 0 10px rgba(22,201,141,.6); }
.row-action { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; color: #b9c9d7; background: rgba(255,255,255,.025); cursor: pointer; font-size: 8px; white-space: nowrap; }
.row-action:hover { color: white; border-color: #4a85e8; background: var(--blue-soft); }
.row-action:disabled { opacity: .4; cursor: not-allowed; }
.row-action svg { width: 14px; height: 14px; }
.history-code { display: inline-flex; align-items: center; gap: 7px; direction: ltr; }
.history-code code { color: #fff; font: 700 11px Consolas, monospace; letter-spacing: 1.2px; }
.history-code button { min-height: 26px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 7px; color: #8fb8ff; background: var(--blue-soft); cursor: pointer; font-size: 8px; }
.history-code button:hover { color: #fff; border-color: #4a85e8; }
.primary-action { color: #b7d0ff; border-color: rgba(40,118,255,.35); background: var(--blue-soft); }
.pagination-bar, .table-foot { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 17px; border-top: 1px solid var(--line); color: var(--muted); font-size: 8px; }
.pagination-bar > div { display: flex; align-items: center; gap: 8px; direction: rtl; }
.pagination-bar a, .pagination-bar strong, .page-disabled { min-width: 42px; height: 31px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; }
.pagination-bar a:hover { color: white; border-color: var(--blue); }
.pagination-bar strong { color: white; background: var(--blue); border-color: var(--blue); }
.page-disabled { opacity: .4; }

.region-toolbar .button { margin-right: auto; }
.country-flag { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.035); font-size: 18px; }
.country-flag.large { width: 48px; height: 48px; font-size: 24px; }
.protocol-switch { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 8px; }
.protocol-switch i { position: relative; width: 34px; height: 19px; border-radius: 20px; background: #27384a; box-shadow: inset 0 0 0 1px rgba(255,255,255,.05); }
.protocol-switch i::after { content: ""; position: absolute; top: 3px; right: 3px; width: 13px; height: 13px; border-radius: 50%; background: #7d8b98; transition: .18s ease; }
.protocol-switch.on { color: #59dfaf; }
.protocol-switch.on i { background: rgba(22,201,141,.8); box-shadow: 0 0 14px rgba(22,201,141,.2); }
.protocol-switch.on i::after { right: 18px; background: white; }
.protocol-switch.on.blue { color: #7cacff; }
.protocol-switch.on.blue i { background: rgba(40,118,255,.8); box-shadow: 0 0 14px rgba(40,118,255,.2); }
.protocol-name { color: #b8c9da; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.table-foot span { display: flex; align-items: center; gap: 8px; }

.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 17px; border: 1px solid transparent; border-radius: 9px; font-weight: 800; font-size: 9px; cursor: pointer; transition: .17s ease; }
.button svg { width: 17px; height: 17px; }
.button:hover { transform: translateY(-1px); }
.button-primary { color: white; border-color: #377ff8; background: linear-gradient(135deg, #2b7cff, #145be0); box-shadow: 0 9px 24px rgba(40,118,255,.2); }
.button-secondary { color: #b9d1ff; border-color: rgba(40,118,255,.34); background: var(--blue-soft); }
.button-ghost { color: #adbdcb; border-color: var(--line); background: rgba(255,255,255,.025); }
.button-danger { color: #ff9eac; border-color: rgba(255,99,121,.32); background: var(--danger-soft); }
.button-block { width: 100%; }

.detail-dialog { width: min(460px, 94vw); max-width: none; height: 100dvh; max-height: none; margin: 0 0 0 auto; padding: 0; border: 0; color: var(--text); background: transparent; }
.detail-dialog::backdrop { background: rgba(1,7,13,.72); backdrop-filter: blur(4px); }
.dialog-shell { min-height: 100%; display: flex; flex-direction: column; overflow: auto; border-right: 1px solid var(--line-strong); background: linear-gradient(180deg,#091828,#06111e); box-shadow: 28px 0 75px rgba(0,0,0,.4); animation: drawer-in .2s ease-out; }
@keyframes drawer-in { from { transform: translateX(-35px); opacity: .5; } to { transform: translateX(0); opacity: 1; } }
.dialog-shell > header { min-height: 95px; display: flex; align-items: center; gap: 14px; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.dialog-user, .dialog-title { min-width: 0; display: flex; align-items: center; gap: 13px; flex: 1; }
.dialog-user > span:last-child, .dialog-title > span:last-child { min-width: 0; display: grid; gap: 4px; }
.dialog-user small, .dialog-title small { color: #6e9eea; font-size: 8px; }
.dialog-user h2, .dialog-title h2 { margin: 0; font-size: 16px; }
.dialog-user p, .dialog-title p { margin: 0; color: var(--muted); font-size: 9px; }
.dialog-close { width: 38px; height: 38px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 10px; font-size: 22px; }
.dialog-close:hover { color: white; border-color: var(--line-strong); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.detail-grid div { min-height: 82px; display: grid; align-content: center; gap: 8px; padding: 14px; background: var(--navy-900); }
.detail-grid dt { color: var(--muted); font-size: 8px; }
.detail-grid dd { margin: 0; font-size: 10px; font-weight: 800; }
.privacy-note { display: flex; align-items: flex-start; gap: 9px; margin: auto 22px 22px; padding: 12px; border: 1px solid rgba(22,201,141,.2); border-radius: 10px; color: #8fb7a9; background: rgba(22,201,141,.055); font-size: 8px; line-height: 1.9; }
.privacy-note svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--emerald); }
.drawer-form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; padding: 22px; }
.field { min-width: 0; display: grid; align-content: start; gap: 8px; }
.field > span:first-child { color: #acbbc8; font-size: 9px; font-weight: 700; }
.field input, .field select { width: 100%; height: 43px; padding: 0 12px; border: 1px solid var(--line-strong); outline: 0; border-radius: 9px; color: white; background: rgba(3,12,22,.52); font-size: 10px; transition: .17s ease; }
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(40,118,255,.1); }
.field select { appearance: auto; }
.file-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-control { min-height: 43px; display: flex; align-items: center; padding: 0 12px; border: 1px dashed #38516b; border-radius: 9px; color: #7f9ab1; background: rgba(3,12,22,.35); cursor: pointer; font-size: 9px; }
.form-divider { grid-column: 1/-1; display: flex; align-items: center; gap: 10px; color: #6f86a0; font-size: 8px; font-weight: 800; }
.form-divider::before, .form-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.dialog-actions { grid-column: 1/-1; display: flex; justify-content: flex-end; gap: 9px; padding-top: 8px; }
.danger-zone { display: flex; align-items: center; gap: 12px; margin: auto 22px 22px; padding: 14px; border: 1px solid rgba(255,99,121,.23); border-radius: 11px; background: var(--danger-soft); }
.danger-zone > span { display: grid; gap: 4px; flex: 1; }
.danger-zone b { color: #ff9eac; font-size: 9px; }
.danger-zone small { color: #aa7480; font-size: 8px; }

.credential-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.credential-card { overflow: hidden; }
.credential-visual { min-height: 92px; display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: linear-gradient(105deg, rgba(40,118,255,.15), transparent 58%); }
.credential-visual.cisco { background: linear-gradient(105deg, rgba(22,201,141,.13), transparent 58%); }
.credential-visual > span { width: 47px; height: 47px; display: grid; place-items: center; border: 1px solid rgba(40,118,255,.32); border-radius: 14px; color: #7cafff; background: rgba(40,118,255,.1); }
.credential-visual.cisco > span { border-color: rgba(22,201,141,.3); color: #59dfaf; background: rgba(22,201,141,.09); }
.credential-visual svg { width: 25px; height: 25px; }
.credential-visual > div { display: grid; gap: 4px; }
.credential-visual small { color: var(--muted); font-size: 8px; }
.credential-visual strong { font-size: 16px; direction: ltr; }
.credential-visual time { margin-right: auto; color: var(--muted); font-size: 8px; }
.credential-copy { padding: 20px 22px 2px; }
.credential-copy h2 { margin: 0 0 7px; font-size: 15px; }
.credential-copy p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.8; }
.form-stack { display: grid; gap: 15px; padding: 21px 22px; }
.password-field { position: relative; display: block; }
.password-field input { padding-left: 45px; }
.password-field button { position: absolute; inset: 4px auto 4px 5px; width: 35px; display: grid; place-items: center; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.password-field button:hover { color: white; background: rgba(255,255,255,.04); }
.password-field button svg { width: 18px; height: 18px; }

.credential-pool-card { margin-bottom: 22px; padding: 21px; }
.credential-pool-heading { padding: 0 0 17px; border-bottom: 1px solid var(--line); }
.credential-add-form { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr .7fr auto; align-items: end; gap: 12px; padding-top: 18px; }
.credential-add-form .button { min-height: 43px; }
.credential-pool-card .privacy-note { margin: 17px 0 0; }
.credential-pool-list > .surface-heading { min-height: 76px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.live-capacity { display: inline-flex; align-items: center; gap: 7px; color: #9cb6ca; font-size: 9px; font-weight: 800; white-space: nowrap; }
.credential-pool-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; padding: 18px; }
.credential-pool-grid > .empty-state { grid-column: 1/-1; }
.credential-pool-item { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(145deg,rgba(17,42,65,.68),rgba(5,18,31,.7)); }
.credential-pool-status { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 11px; }
.credential-pool-status > span:nth-child(2) { min-width: 0; display: grid; gap: 4px; }
.credential-pool-status b { overflow: hidden; color: #e8f2fa; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.credential-pool-status small { color: var(--muted); font-size: 8px; }
.credential-pool-status strong { color: #77e1bc; font: 800 15px Consolas,monospace; direction: ltr; }
.capacity-meter { height: 6px; margin: 14px 0 17px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.055); }
.capacity-meter i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg,var(--emerald),#44a7ff); box-shadow: 0 0 12px rgba(22,201,141,.35); }
.credential-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.credential-edit-grid .button { min-height: 43px; align-self: end; }

.grant-composer { margin-bottom: 22px; padding: 21px; }
.composer-copy { display: flex; align-items: center; gap: 14px; }
.composer-copy h2 { margin: 0 0 6px; font-size: 15px; }
.composer-copy p { margin: 0; color: var(--muted); font-size: 9px; }
.grant-form { display: grid; grid-template-columns: 1.2fr .7fr 1fr auto; align-items: end; gap: 13px; margin-top: 20px; padding-top: 19px; border-top: 1px solid var(--line); }
.activation-reveal { display: flex; align-items: center; gap: 15px; margin-top: 18px; padding: 14px; border: 1px solid rgba(22,201,141,.28); border-radius: 11px; background: var(--emerald-soft); }
.activation-reveal > span { display: grid; gap: 7px; flex: 1; }
.activation-reveal small { color: #82baa6; font-size: 8px; }
.activation-reveal code { direction: ltr; color: white; font: 700 15px Consolas, monospace; letter-spacing: 1px; }
.plan-action-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 11px; margin-top: 19px; padding-top: 19px; border-top: 1px solid var(--line); }
.plan-action-grid form { min-width: 0; }
.plan-action { width: 100%; min-height: 78px; display: grid; place-items: center; align-content: center; gap: 6px; padding: 12px; border: 1px solid rgba(40,118,255,.26); border-radius: 12px; color: white; background: linear-gradient(145deg,rgba(40,118,255,.17),rgba(8,25,42,.55)); cursor: pointer; transition: transform .17s ease,border-color .17s ease,box-shadow .17s ease; }
.plan-action:hover { transform: translateY(-2px); border-color: rgba(80,151,255,.7); box-shadow: 0 10px 26px rgba(0,0,0,.2); }
.plan-action b { font-size: 11px; }
.plan-action small { color: #91a8bb; font-size: 8px; }
.plan-action.trial { border-color: rgba(22,201,141,.31); background: linear-gradient(145deg,rgba(22,201,141,.15),rgba(8,25,42,.55)); }
.plan-action.year { border-color: rgba(170,115,255,.32); background: linear-gradient(145deg,rgba(132,75,220,.18),rgba(8,25,42,.55)); }
.history-actions { display: flex; align-items: center; gap: 9px; }
.history-actions form { margin: 0; }
.grants-surface .surface-heading { min-height: 74px; padding: 15px 18px; border-bottom: 1px solid var(--line); }

.empty-state { display: grid; justify-items: center; gap: 7px; padding: 29px; color: var(--muted); text-align: center; }
.empty-state > span { font-size: 29px; color: #426080; }
.empty-state b { color: #c1cfdb; font-size: 11px; }
.empty-state p { margin: 0; font-size: 8px; }

.login-page { min-height: 100vh; background: radial-gradient(circle at 30% 0%, #123952 0, var(--navy-950) 52%); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-card { width: min(420px,100%); padding: 38px; border: 1px solid var(--line); border-radius: 19px; background: rgba(9,23,38,.97); box-shadow: var(--shadow); text-align: center; }
.login-card .brand-mark { margin: 0 auto 20px; }
.login-card .eyebrow { color: #6c9de9; font-size: 8px; letter-spacing: 2px; }
.login-card h1 { margin: 8px 0; font-size: 23px; }
.login-card .muted { margin: 0 0 24px; color: var(--muted); font-size: 10px; }
.login-footnote { margin: 20px 0 0; color: var(--muted-2); font-size: 8px; }
.sidebar-scrim { display: none; }

@media (max-width: 1180px) {
    :root { --sidebar: 244px; }
    .overview-grid { grid-template-columns: 1fr; }
    .network-panel { display: grid; grid-template-columns: auto 1fr; column-gap: 25px; }
    .network-panel .surface-heading { grid-column: 1/-1; }
    .network-panel .button { grid-column: 1/-1; }
    .table-toolbar { align-items: stretch; flex-direction: column; }
    .search-field { width: 100%; }
    .filter-group { overflow-x: auto; }
    .credential-layout { grid-template-columns: 1fr; }
    .grant-form { grid-template-columns: 1fr 1fr; }
    .credential-add-form { grid-template-columns: 1fr 1fr 1fr; }
    .plan-action-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 820px) {
    :root { --sidebar: min(286px, 86vw); }
    body.sidebar-open { overflow: hidden; }
    .sidebar { transform: translateX(100%); transition: transform .2s ease; }
    .sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(1,7,13,.7); backdrop-filter: blur(3px); }
    .sidebar-open .sidebar-scrim { display: block; }
    .app-shell { margin-right: 0; }
    .topbar { min-height: 78px; padding: 13px 16px; }
    .mobile-menu { display: grid; }
    .page-heading h1 { font-size: 18px; }
    .page-heading p { max-width: 56vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
    .topbar-meta time { display: none; }
    .live-state { padding: 7px 9px; }
    .content { padding: 18px 13px 36px; }
    .metric-strip { grid-template-columns: 1fr 1fr; }
    .metric-item { min-height: 92px; border-bottom: 1px solid var(--line); }
    .metric-item:nth-child(2) { border-left: 0; }
    .metric-item:nth-last-child(-n+2) { border-bottom: 0; }
    .quick-actions { grid-template-columns: 1fr; }
    .compact-user { grid-template-columns: 38px minmax(0,1fr) auto; padding: 10px 0; }
    .compact-user .last-seen { grid-column: 2/-1; }
    .compact-user .subscription-state { grid-column: 3; grid-row: 1; }
    .compact-user .account-type { display: none; }
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
    .data-table tr { padding: 13px 15px; border-bottom: 1px solid var(--line); }
    .data-table td { min-height: 38px; height: auto; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 7px 0; border: 0; text-align: left; }
    .data-table td::before { content: attr(data-label); color: var(--muted); font-size: 8px; text-align: right; }
    .data-table td:first-child { padding-bottom: 12px; }
    .data-table td:first-child::before, .data-table td:last-child::before { display: none; }
    .data-table td:last-child { justify-content: flex-end; }
    .user-cell, .country-cell { width: 100%; }
    .pagination-bar, .table-foot { align-items: flex-start; flex-direction: column; }
    .detail-dialog { width: min(460px,100vw); }
    .drawer-form { grid-template-columns: 1fr; }
    .form-divider, .dialog-actions { grid-column: auto; }
    .grant-form { grid-template-columns: 1fr; }
    .credential-pool-grid { grid-template-columns: 1fr; }
    .credential-add-form { grid-template-columns: 1fr 1fr; }
    .plan-action-grid { grid-template-columns: 1fr 1fr; }
}

.settings-grid { display: grid; grid-template-columns: minmax(260px,.75fr) minmax(420px,1.25fr); gap: 22px; align-items: start; }
.settings-card { overflow: hidden; }
.settings-card-heading { display: flex; align-items: center; gap: 13px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.settings-card-heading > div { display: grid; gap: 6px; }
.settings-card-heading h2 { margin: 0; font-size: 15px; }
.settings-card-heading p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.8; }
.metric-icon.red { color: #ff9eac; background: var(--danger-soft); }
.reset-preserved { padding: 20px 22px; }
.reset-preserved b { font-size: 10px; }
.reset-preserved ul { display: grid; gap: 11px; margin: 16px 0 0; padding: 0; list-style: none; color: #a9bac9; font-size: 9px; }
.reset-preserved li::before { content: "✓"; margin-left: 8px; color: var(--emerald); }
.danger-settings-card { border-color: rgba(255,99,121,.26); }
.reset-count-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.reset-count-grid div { min-height: 82px; display: grid; place-content: center; gap: 5px; text-align: center; background: rgba(7,20,34,.97); }
.reset-count-grid strong { color: #ff9eac; font-size: 20px; }
.reset-count-grid span { color: var(--muted); font-size: 8px; }
.system-reset-form { display: grid; gap: 16px; padding: 22px; }
.reset-warning { display: grid; gap: 6px; padding: 13px; border: 1px solid rgba(255,99,121,.26); border-radius: 10px; color: #c89aa2; background: var(--danger-soft); font-size: 8px; line-height: 1.8; }
.reset-warning b { color: #ff9eac; font-size: 9px; }
.system-reset-form .field code { width: max-content; padding: 5px 8px; border-radius: 6px; color: #ffabb7; background: rgba(255,99,121,.1); font: 700 10px Consolas,monospace; direction: ltr; }
.reset-acknowledge { display: flex; align-items: flex-start; gap: 9px; color: #aab9c7; font-size: 9px; line-height: 1.8; cursor: pointer; }
.reset-acknowledge input { margin-top: 4px; accent-color: var(--danger); }
@media (max-width: 900px) {
    .settings-grid { grid-template-columns: 1fr; }
}

.reset-submit { justify-self: start; }
.reset-submit:disabled { opacity: .35; cursor: not-allowed; }
@media (max-width: 520px) {
    .topbar-meta { display: none; }
    .metric-strip { grid-template-columns: 1fr; }
    .metric-item, .metric-item:nth-child(2), .metric-item:nth-last-child(-n+2) { min-height: 78px; border-left: 0; border-bottom: 1px solid var(--line); }
    .metric-item:last-child { border-bottom: 0; }
    .metric-item strong { font-size: 19px; }
    .metric-icon { width: 39px; height: 39px; border-radius: 11px; }
    .recent-users, .network-panel, .grant-composer { padding: 16px; }
    .network-panel { display: block; }
    .filter-group { justify-content: flex-start; }
    .pagination-bar > span { display: none; }
    .pagination-bar { align-items: center; }
    .credential-copy, .form-stack { padding-right: 16px; padding-left: 16px; }
    .detail-grid { grid-template-columns: 1fr; }
    .dialog-shell > header, .drawer-form { padding-right: 16px; padding-left: 16px; }
    .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .danger-zone { align-items: stretch; flex-direction: column; }
    .activation-reveal { align-items: stretch; flex-direction: column; }
    .activation-reveal code { font-size: 12px; }
    .credential-pool-card { padding: 16px; }
    .reset-count-grid { grid-template-columns: 1fr 1fr; }
    .reset-submit { width: 100%; }
    .credential-add-form, .credential-edit-grid { grid-template-columns: 1fr; }
    .credential-pool-grid { padding: 12px; }
    .credential-pool-list > .surface-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
    .history-actions { width: 100%; align-items: stretch; flex-direction: column; }
    .history-actions .button { width: 100%; }
    .plan-action-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Country orchestration */
.region-metric-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.region-metric-card { min-height: 112px; display: flex; align-items: center; gap: 14px; padding: 18px; }
.region-metric-card > span:last-child { min-width: 0; display: grid; gap: 5px; }
.region-metric-card small { color: var(--muted); font-size: 8px; }
.region-metric-card strong { color: #f6fbff; font-size: 24px; line-height: 1; }
.region-metric-card strong b { margin-right: 3px; color: #6f8496; font-size: 12px; }
.region-metric-card em { overflow: hidden; color: #71889b; font-size: 7px; font-style: normal; white-space: nowrap; text-overflow: ellipsis; }
.metric-icon.violet { color: #c0a7ff; background: rgba(151,105,255,.1); }
.region-network-surface { overflow: hidden; }
.region-command-bar { min-height: 116px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 20px 22px; border-bottom: 1px solid var(--line); background: rgba(3,12,22,.18); }
.region-command-copy { max-width: 540px; }
.region-command-copy .eyebrow { display: block; margin-bottom: 7px; color: #5f91e5; font: 700 7px/1.4 Consolas,monospace; letter-spacing: 1.7px; }
.region-command-copy h2 { margin: 0 0 7px; font-size: 16px; }
.region-command-copy p { margin: 0; color: var(--muted); font-size: 8px; line-height: 1.9; }
.region-command-actions { min-width: min(520px,50%); display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.region-command-actions .search-field { flex: 1; }
.country-stack-list { display: grid; gap: 12px; padding: 16px; background: rgba(2,10,18,.24); }
.country-stack { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: rgba(8,22,37,.72); transition: border-color .18s ease, box-shadow .18s ease; }
.country-stack:hover, .country-stack.is-expanded { border-color: rgba(92,137,183,.33); }
.country-stack.is-expanded { box-shadow: 0 12px 34px rgba(0,0,0,.14); }
.country-stack-header { min-height: 92px; display: grid; grid-template-columns: minmax(220px,1.35fr) minmax(150px,.75fr) minmax(200px,.9fr) auto; align-items: center; gap: 17px; padding: 15px 17px; background: rgba(10,27,45,.76); }
.country-heading { min-width: 0; display: flex; align-items: center; gap: 13px; }
.country-heading > span:last-child { min-width: 0; display: grid; gap: 3px; }
.country-heading small { color: #6793c4; font: 700 7px Consolas,monospace; letter-spacing: 1.4px; }
.country-heading strong { overflow: hidden; font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.country-heading em { color: var(--muted); font-size: 8px; font-style: normal; }
.country-flag-xl { width: 48px; height: 48px; border-radius: 13px; background: #10273d; font-size: 25px; box-shadow: inset 0 1px rgba(255,255,255,.04); }
.country-flag svg { width: 100%; height: 100%; display: block; overflow: hidden; border-radius: inherit; }
.country-health { display: grid; gap: 7px; }
.health-badge, .node-count-badge { width: max-content; display: inline-flex; align-items: center; gap: 7px; color: #90a5b7; font-size: 8px; white-space: nowrap; }
.health-badge i { width: 7px; height: 7px; border-radius: 50%; background: #667b8d; }
.health-badge.healthy { color: #7be8bf; }
.health-badge.healthy i { background: var(--emerald); box-shadow: 0 0 10px rgba(22,201,141,.5); }
.health-badge.attention { color: #f0c780; }
.health-badge.attention i { background: #e6a840; box-shadow: 0 0 10px rgba(230,168,64,.4); }
.node-count-badge b { color: #edf6ff; font-size: 11px; }
.country-protocols { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.country-protocols small { width: 100%; color: #758da1; font-size: 7px; }
.protocol-chip { min-height: 25px; display: inline-flex; align-items: center; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; color: #5f7181; background: rgba(255,255,255,.018); font: 700 7px Consolas,monospace; }
.protocol-chip.is-on { color: #77a9ff; border-color: rgba(40,118,255,.3); background: rgba(40,118,255,.09); }
.protocol-chip.cisco.is-on { color: #6fe4bb; border-color: rgba(22,201,141,.29); background: rgba(22,201,141,.08); }
.country-stack-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.country-expand { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line-strong); border-radius: 9px; color: #8ca1b3; background: rgba(255,255,255,.025); cursor: pointer; }
.country-expand svg { width: 16px; height: 16px; transition: transform .18s ease; }
.country-expand[aria-expanded="true"] svg { transform: rotate(180deg); }
.country-node-panel { border-top: 1px solid var(--line); }
.country-node-panel[hidden] { display: none; }
.node-table-head, .node-table-row { display: grid; grid-template-columns: 70px minmax(150px,1.25fr) 145px minmax(150px,1fr) 96px 95px 112px; align-items: center; gap: 10px; padding: 0 17px; }
.node-table-head { min-height: 43px; color: #71889c; background: rgba(2,11,20,.34); font-size: 7px; font-weight: 700; }
.node-table-row { min-height: 67px; border-top: 1px solid rgba(122,155,188,.11); color: #d5e2ed; font-size: 8px; transition: background .15s ease; }
.node-table-row:hover { background: rgba(40,118,255,.045); }
.node-table-row > span { min-width: 0; }
.node-table-row > span:nth-child(2), .node-table-row > span:nth-child(5) { display: grid; gap: 4px; }
.node-table-row b { font-size: 9px; }
.node-table-row small { overflow: hidden; color: var(--muted); font-size: 7px; white-space: nowrap; text-overflow: ellipsis; }
.priority-badge { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid rgba(40,118,255,.3); border-radius: 8px; color: #8db4fb; background: var(--blue-soft); }
.node-protocol-list { display: flex; gap: 5px; }
.mini-protocol { padding: 5px 7px; border: 1px solid var(--line); border-radius: 6px; color: #516678; background: rgba(255,255,255,.018); font: 700 6px Consolas,monospace; font-style: normal; }
.mini-protocol.on { color: #75a8ff; border-color: rgba(40,118,255,.25); background: rgba(40,118,255,.08); }
.mini-protocol.cisco.on { color: #62dcae; border-color: rgba(22,201,141,.24); background: rgba(22,201,141,.07); }
.domain-value { direction: ltr; text-align: left; }
.region-empty { min-height: 280px; place-content: center; }

/* Centered region modals intentionally override the generic account side drawer. */
.region-modal { position: fixed; inset: 0; width: min(820px,calc(100vw - 34px)); height: fit-content; max-height: calc(100dvh - 34px); margin: auto; overflow: visible; border-radius: 17px; }
.region-modal::backdrop { background: rgba(1,7,13,.79); backdrop-filter: blur(7px); }
.region-modal .dialog-shell { min-height: 0; max-height: calc(100dvh - 34px); overflow-y: auto; border: 1px solid rgba(111,153,194,.32); border-radius: 17px; background: #071624; box-shadow: 0 34px 100px rgba(0,0,0,.58), 0 0 0 1px rgba(255,255,255,.02); animation: region-modal-in .2s ease-out; }
@keyframes region-modal-in { from { transform: translateY(12px) scale(.985); opacity: .3; } to { transform: translateY(0) scale(1); opacity: 1; } }
.region-modal .dialog-shell > header { position: sticky; top: 0; z-index: 3; min-height: 90px; padding: 17px 20px; background: rgba(7,22,36,.97); backdrop-filter: blur(12px); }
.region-modal .dialog-close { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: #91a5b7; background: rgba(255,255,255,.025); font-size: 18px; }
.region-form { display: grid; gap: 14px; padding: 17px 20px 20px; }
.region-form-section { padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: rgba(12,29,47,.72); }
.region-form-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.region-form-heading > span:last-child { display: grid; gap: 4px; }
.region-form-heading b { font-size: 10px; }
.region-form-heading small { color: var(--muted); font-size: 7px; line-height: 1.7; }
.form-step { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(22,201,141,.25); border-radius: 9px; color: #66dfb3; background: rgba(22,201,141,.07); font: 700 7px Consolas,monospace; }
.form-step.blue { color: #77a8ff; border-color: rgba(40,118,255,.28); background: rgba(40,118,255,.08); }
.form-step.violet { color: #bca6ff; border-color: rgba(151,105,255,.25); background: rgba(151,105,255,.07); }
.form-step.green { color: #66dfb3; }
.region-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.region-form-grid.single { grid-template-columns: 1fr; }
.region-protocol-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.protocol-section { min-width: 0; }
.compact-section { display: grid; grid-template-columns: minmax(0,1fr) 240px; align-items: center; gap: 18px; }
.compact-section .region-form-heading { margin: 0; }
.region-form .dialog-actions { position: sticky; bottom: -20px; z-index: 2; margin: 0 -20px -20px; padding: 15px 20px; border-top: 1px solid var(--line); background: rgba(7,22,36,.97); backdrop-filter: blur(12px); }
.country-edit-modal { width: min(620px,calc(100vw - 34px)); }
.country-edit-modal .dialog-shell { min-height: 0; }
.country-form { padding-top: 20px; }
.field-hint { color: #668097; font-size: 7px; line-height: 1.7; }
.modal-notice { display: flex; align-items: flex-start; gap: 10px; padding: 13px; border: 1px solid rgba(22,201,141,.2); border-radius: 11px; color: #91c8b5; background: rgba(22,201,141,.05); }
.modal-notice svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--emerald); }
.modal-notice span { display: grid; gap: 4px; }
.modal-notice b { font-size: 9px; }
.modal-notice small { color: #78a594; font-size: 7px; line-height: 1.8; }

@media (max-width: 1240px) {
    .region-metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .country-stack-header { grid-template-columns: minmax(220px,1.3fr) minmax(180px,1fr) auto; }
    .country-health { display: none; }
    .node-table-head, .node-table-row { grid-template-columns: 60px minmax(140px,1.1fr) 135px minmax(130px,1fr) 85px 90px 105px; }
}
@media (max-width: 960px) {
    .region-command-bar, .region-command-actions { align-items: stretch; flex-direction: column; }
    .region-command-actions { min-width: 0; width: 100%; }
    .country-stack-header { grid-template-columns: 1fr auto; }
    .country-protocols { grid-column: 1; }
    .country-stack-actions { grid-column: 2; grid-row: 1/3; flex-direction: column; align-items: stretch; }
    .node-table-head { display: none; }
    .node-table-row { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 18px; padding: 15px 17px; }
    .node-table-row > span { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; }
    .node-table-row > span::before { content: attr(data-label); color: var(--muted); font-size: 7px; }
    .node-table-row > span:nth-child(2) { align-items: flex-start; flex-direction: column; }
    .node-table-row > span:nth-child(2)::before { display: none; }
}
@media (max-width: 680px) {
    .region-metric-grid { grid-template-columns: 1fr; }
    .region-metric-card { min-height: 92px; }
    .region-command-actions .button { width: 100%; }
    .country-stack-list { padding: 10px; }
    .country-stack-header { display: flex; align-items: stretch; flex-direction: column; }
    .country-stack-actions { flex-direction: row; justify-content: flex-start; flex-wrap: wrap; }
    .country-expand { margin-right: auto; }
    .node-table-row { grid-template-columns: 1fr; }
    .region-modal, .country-edit-modal { width: 100vw; max-height: 100dvh; border-radius: 0; }
    .region-modal .dialog-shell { max-height: 100dvh; border-width: 0; border-radius: 0; }
    .region-form-grid, .region-protocol-grid { grid-template-columns: 1fr; }
    .compact-section { grid-template-columns: 1fr; }
    .region-form .dialog-actions { grid-template-columns: 1fr 1fr; }
}
