:root {
    --ink: #0f172a;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --line: #e5eaf0;
    --surface: #ffffff;
    --canvas: #f5f7fa;
    --sidebar: #0b1220;
    --sidebar-soft: #121c2f;
    --green: #17a66a;
    --green-soft: #e9f8f1;
    --red: #dc3e4c;
    --red-soft: #fcecef;
    --orange: #e6872b;
    --orange-soft: #fff4e8;
    --yellow: #d8a519;
    --yellow-soft: #fff8dc;
    --blue: #3468dd;
    --blue-soft: #ecf2ff;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .025);
    --shadow-lg: 0 24px 70px rgba(15, 23, 42, .16);
    --radius: 14px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--canvas); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.mobile-only { display: none !important; }

.boot-screen {
    min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 18px;
    background: var(--sidebar); color: #aab5c7;
}
.boot-screen p { margin: 0; font-size: 13px; letter-spacing: .02em; }

.brand-mark { width: 35px; height: 35px; border-radius: 10px; background: #1c2b43; display: flex; align-items: center; justify-content: center; gap: 2px; }
.brand-mark span { display: block; width: 3px; border-radius: 5px; background: #55dda0; }
.brand-mark span:nth-child(1) { height: 8px; }
.brand-mark span:nth-child(2) { height: 18px; }
.brand-mark span:nth-child(3) { height: 12px; }
.brand-mark--large { width: 50px; height: 50px; border-radius: 14px; }
.brand-mark--large span { width: 4px; }

.auth-view { min-height: 100vh; display: grid; grid-template-columns: minmax(400px, 45%) 1fr; background: #fff; }
.auth-panel { background: var(--sidebar); color: #fff; padding: 46px clamp(38px, 6vw, 88px); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-panel::after { content: ""; position: absolute; width: 560px; height: 560px; border: 1px solid rgba(94,224,160,.1); border-radius: 50%; bottom: -330px; right: -240px; box-shadow: 0 0 0 80px rgba(94,224,160,.025), 0 0 0 160px rgba(94,224,160,.018); }
.auth-brand { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 750; letter-spacing: -.01em; }
.auth-copy { max-width: 520px; margin: auto 0 30px; position: relative; z-index: 1; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.auth-copy h1 { font-size: clamp(36px, 4vw, 58px); line-height: 1.06; letter-spacing: -.048em; margin: 18px 0 24px; max-width: 500px; }
.auth-copy p { color: #9fadc1; font-size: 17px; line-height: 1.7; max-width: 490px; }
.auth-foot { color: #66748a; font-size: 12px; margin: auto 0 0; }
.auth-signal { height: 78px; display: flex; align-items: center; gap: 10px; opacity: .5; position: relative; z-index: 1; }
.auth-signal span { flex: 1; height: 1px; background: #2b3b53; position: relative; }
.auth-signal span:nth-child(3)::after, .auth-signal span:nth-child(6)::after { content: ""; position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #55dda0; right: 0; top: -3px; box-shadow: 0 0 0 5px rgba(85,221,160,.12); }
.auth-form-wrap { display: grid; place-items: center; padding: 36px; }
.auth-form { width: min(100%, 410px); display: flex; flex-direction: column; }
.auth-form h2 { font-size: 32px; letter-spacing: -.035em; margin: 12px 0 8px; }
.auth-form > p { color: var(--muted); margin: 0 0 32px; }
.auth-form label, .field { display: grid; gap: 7px; color: #334155; font-size: 13px; font-weight: 700; margin-bottom: 18px; }
.auth-form input, .field input, .field select, .field textarea, .toolbar input, .toolbar select {
    width: 100%; border: 1px solid #d9e0e8; border-radius: 9px; padding: 11px 12px; color: var(--ink); background: #fff; outline: none; transition: border .15s, box-shadow .15s;
}
.auth-form input { padding: 13px 14px; }
input:focus, select:focus, textarea:focus { border-color: #6e91e5 !important; box-shadow: 0 0 0 3px rgba(52,104,221,.1); }
textarea { min-height: 105px; resize: vertical; }
.mobile-brand { display: none; }
.form-error, .form-message { border-radius: 8px; padding: 10px 12px; margin: -5px 0 15px; color: #a52232; background: var(--red-soft); font-size: 13px; }
.form-message.success { color: #087248; background: var(--green-soft); }
.link-button, .back-button { border: 0; padding: 12px 0; color: var(--blue); background: none; align-self: center; }
.back-button { align-self: flex-start; color: var(--muted); padding: 0; margin-bottom: 34px; }

.button { border: 0; border-radius: 9px; min-height: 40px; padding: 9px 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 750; transition: transform .12s, background .15s, box-shadow .15s; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button svg { width: 16px; height: 16px; }
.button--primary { background: var(--blue); color: #fff; box-shadow: 0 5px 14px rgba(52,104,221,.17); }
.button--primary:hover { background: #2859c3; }
.button--soft { background: #eef2f6; color: #27364b; }
.button--soft:hover { background: #e5eaf0; }
.button--danger { background: var(--red-soft); color: #b82d3c; }
.button--success { background: var(--green-soft); color: #08764a; }
.button--wide { width: 100%; min-height: 47px; }
.button--small { padding: 7px 10px; min-height: 34px; }
.icon-button { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #475569; }
.icon-button svg { width: 19px; height: 19px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 236px 1fr; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 236px; z-index: 30; display: flex; flex-direction: column; background: var(--sidebar); color: #a8b4c6; padding: 27px 16px 18px; }
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 26px; color: #fff; }
.sidebar-brand > div:last-child { display: flex; flex-direction: column; line-height: 1.12; }
.sidebar-brand strong { font-size: 16px; letter-spacing: -.01em; }
.sidebar-brand small { font-size: 10px; color: #728097; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.main-nav { display: grid; gap: 4px; }
.main-nav a, .sidebar-bottom > a { min-height: 43px; padding: 10px 11px; border-radius: 8px; display: flex; align-items: center; gap: 11px; color: #95a3b8; font-size: 13px; font-weight: 650; }
.main-nav a:hover, .sidebar-bottom > a:hover { background: rgba(255,255,255,.045); color: #fff; }
.main-nav a.active { color: #fff; background: var(--sidebar-soft); box-shadow: inset 3px 0 #55dda0; }
.nav-icon { width: 18px; height: 18px; display: inline-grid; place-items: center; flex: 0 0 auto; }
.nav-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.nav-count { min-width: 20px; height: 20px; display: grid; place-items: center; margin-left: auto; border-radius: 10px; padding: 0 6px; color: #fff; background: var(--red); font-size: 10px; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 12px; }
.node-mini { margin: 4px 8px; padding: 12px 0; border-top: 1px solid #1c2940; border-bottom: 1px solid #1c2940; display: flex; align-items: center; gap: 10px; }
.node-mini div { display: flex; flex-direction: column; }
.node-mini strong { color: #cbd5e1; font-size: 11px; }
.node-mini small { color: #64748b; font-size: 10px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); flex: 0 0 auto; }
.status-dot--online { background: #40d692; box-shadow: 0 0 0 4px rgba(64,214,146,.1); }
.user-menu { border: 0; border-radius: 9px; background: transparent; padding: 8px; color: #fff; display: grid; grid-template-columns: 32px 1fr auto; gap: 9px; align-items: center; text-align: left; }
.user-menu:hover { background: #121c2f; }
.user-menu > span:nth-child(2) { display: flex; flex-direction: column; overflow: hidden; }
.user-menu strong { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu small { font-size: 9px; color: #708098; }
.user-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #b8f3d5; background: #17362f; font-size: 10px; font-weight: 800; }
.logout-icon { color: #536278; font-size: 14px; }
.app-content { min-width: 0; grid-column: 2; }
.topbar { height: 76px; position: sticky; top: 0; z-index: 20; padding: 0 clamp(22px, 3vw, 42px); background: rgba(255,255,255,.94); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.topbar-title { display: flex; flex-direction: column; line-height: 1.25; }
.topbar-title span { color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; font-weight: 750; }
.topbar-title strong { font-size: 17px; letter-spacing: -.015em; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.page { padding: 30px clamp(22px, 3vw, 42px) 60px; max-width: 1660px; margin: 0 auto; }

.page-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.035em; margin: 0 0 7px; }
.page-head p { color: var(--muted); margin: 0; }
.page-head-actions { display: flex; align-items: center; gap: 8px; }
.health-banner { border: 1px solid #cfeade; background: linear-gradient(100deg,#f4fcf8 0%,#fff 70%); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 18px; display: flex; align-items: center; gap: 17px; box-shadow: var(--shadow-sm); }
.health-banner--danger { border-color: #f2cbd1; background: linear-gradient(100deg,#fff4f5 0%,#fff 70%); }
.health-icon { width: 44px; height: 44px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: var(--green); background: var(--green-soft); }
.health-banner--danger .health-icon { color: var(--red); background: var(--red-soft); }
.health-icon svg { width: 22px; height: 22px; }
.health-banner h2 { font-size: 16px; margin: 0 0 3px; }
.health-banner p { color: var(--muted); margin: 0; font-size: 12px; }
.health-banner .last-refresh { margin-left: auto; color: var(--muted-2); font-size: 11px; }

.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; margin-bottom: 22px; }
.stat-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.stat-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { color: var(--muted); font-size: 11px; font-weight: 700; }
.stat-icon { width: 29px; height: 29px; border-radius: 8px; display: grid; place-items: center; color: #66758b; background: #f2f5f8; }
.stat-icon svg { width: 15px; height: 15px; }
.stat-value { display: block; font-size: 27px; letter-spacing: -.04em; line-height: 1.15; margin: 12px 0 3px; }
.stat-meta { color: var(--muted-2); font-size: 10px; }
.stat-meta .positive { color: var(--green); font-weight: 750; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(280px,.75fr); gap: 18px; }
.stack { display: grid; gap: 18px; align-content: start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-head { min-height: 62px; padding: 16px 19px; border-bottom: 1px solid #eef1f5; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.panel-head h2 { font-size: 14px; margin: 0 0 2px; }
.panel-head p { color: var(--muted-2); font-size: 10px; margin: 0; }
.panel-link { border: 0; background: none; color: var(--blue); font-size: 11px; font-weight: 700; }
.panel-body { padding: 19px; }

.attention-list { display: grid; }
.attention-item { display: grid; grid-template-columns: 9px minmax(150px,1.1fr) minmax(130px,.9fr) 85px 90px 22px; gap: 13px; align-items: center; min-height: 62px; padding: 10px 19px; border-bottom: 1px solid #f0f3f6; transition: background .15s; }
.attention-item:last-child { border-bottom: 0; }
.attention-item:hover { background: #fafbfd; }
.attention-item strong { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attention-item small { display: block; color: var(--muted-2); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attention-item .reason { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-latency { font-weight: 700; font-size: 11px; text-align: right; }
.row-arrow { color: #b2bdcb; font-size: 16px; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-2); }
.pulse-dot.online { background: var(--green); }
.pulse-dot.down { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.pulse-dot.verifying { background: var(--yellow); box-shadow: 0 0 0 4px var(--yellow-soft); }
.pulse-dot.degraded { background: var(--orange); }
.pulse-dot.paused, .pulse-dot.pending { background: #94a3b8; }

.customer-list { display: grid; }
.customer-row { min-height: 60px; padding: 10px 19px; display: grid; grid-template-columns: minmax(140px,1fr) 90px 120px 22px; align-items: center; gap: 14px; border-bottom: 1px solid #f0f3f6; }
.customer-row:last-child { border: 0; }
.customer-row:hover { background: #fafbfd; }
.customer-row strong { font-size: 12px; }
.customer-row small { color: var(--muted-2); display: block; font-size: 10px; }
.status-cluster { display: flex; align-items: center; gap: 4px; }
.status-cluster span { width: 6px; height: 18px; border-radius: 3px; background: #e8edf2; }
.status-cluster .ok { background: #63d7a0; }
.status-cluster .bad { background: #ef7781; }
.uptime-value { font-size: 11px; font-weight: 750; }

.incident-list { display: grid; }
.incident-mini { display: grid; grid-template-columns: 9px 1fr auto; gap: 11px; align-items: start; padding: 13px 0; border-bottom: 1px solid #f0f3f6; }
.incident-mini:last-child { border: 0; padding-bottom: 0; }
.incident-mini:first-child { padding-top: 0; }
.incident-mini strong { font-size: 11px; }
.incident-mini p { margin: 2px 0 0; color: var(--muted); font-size: 10px; }
.incident-mini time { color: var(--muted-2); font-size: 9px; white-space: nowrap; }

.status-badge { display: inline-flex; align-items: center; gap: 6px; width: max-content; border-radius: 20px; padding: 5px 8px; font-size: 9px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.online { color: #0a8553; background: var(--green-soft); }
.status-badge.down { color: #c72e3e; background: var(--red-soft); }
.status-badge.verifying { color: #9a7110; background: var(--yellow-soft); }
.status-badge.degraded { color: #b86417; background: var(--orange-soft); }
.status-badge.paused, .status-badge.pending { color: #68778b; background: #eef2f6; }
.status-badge.unstable { color: #8b5ab9; background: #f5edfc; }

.toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; flex-wrap: wrap; }
.toolbar .search { min-width: 250px; flex: 1; max-width: 420px; position: relative; }
.toolbar .search input { padding-left: 36px; }
.toolbar .search svg { position: absolute; left: 12px; top: 11px; width: 16px; height: 16px; color: var(--muted-2); }
.toolbar select { width: auto; min-width: 135px; padding: 9px 32px 9px 11px; font-size: 12px; }
.result-count { color: var(--muted-2); font-size: 11px; margin-left: auto; }

.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 11px 15px; text-align: left; color: #8290a3; background: #fafbfd; border-bottom: 1px solid var(--line); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
.data-table td { padding: 13px 15px; border-bottom: 1px solid #eef1f5; font-size: 11px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #fbfcfd; }
.data-table .target-cell { max-width: 300px; }
.data-table strong { display: block; font-size: 12px; }
.data-table small { color: var(--muted-2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 270px; }
.type-chip { display: inline-flex; padding: 4px 7px; border-radius: 6px; color: #536278; background: #f0f3f7; font-size: 9px; font-weight: 750; text-transform: uppercase; }

.empty-state { min-height: 290px; padding: 45px 25px; display: grid; place-items: center; align-content: center; text-align: center; }
.empty-icon { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); margin-bottom: 16px; }
.empty-icon svg { width: 25px; height: 25px; }
.empty-state h3 { margin: 0 0 6px; font-size: 16px; }
.empty-state p { margin: 0 0 18px; max-width: 390px; color: var(--muted); font-size: 12px; }

.detail-hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; border: 1px solid var(--line); background: #fff; border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.detail-title { display: flex; align-items: center; gap: 15px; min-width: 0; }
.detail-status-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--green); background: var(--green-soft); flex: 0 0 auto; }
.detail-status-icon.down { color: var(--red); background: var(--red-soft); }
.detail-status-icon.verifying { color: var(--yellow); background: var(--yellow-soft); }
.detail-status-icon.degraded { color: var(--orange); background: var(--orange-soft); }
.detail-status-icon.paused,.detail-status-icon.pending { color: var(--muted); background: #eef2f6; }
.detail-status-icon svg { width: 22px; height: 22px; }
.detail-title h1 { font-size: 22px; margin: 0 0 2px; letter-spacing: -.025em; }
.detail-title p { color: var(--muted); margin: 0; max-width: 670px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.detail-actions { display: flex; gap: 8px; }
.metric-strip { display: grid; grid-template-columns: repeat(5,1fr); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.metric-cell { padding: 17px 20px; border-right: 1px solid var(--line); }
.metric-cell:last-child { border: 0; }
.metric-cell small { color: var(--muted-2); display: block; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.metric-cell strong { display: block; font-size: 18px; margin-top: 6px; letter-spacing: -.025em; }
.metric-cell span { color: var(--muted); font-size: 9px; }
.detail-grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(260px,.6fr); gap: 16px; }
.chart-wrap { height: 280px; padding: 15px 10px 5px; position: relative; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.segmented { display: flex; padding: 3px; border-radius: 8px; background: #f0f3f6; }
.segmented button { border: 0; border-radius: 6px; padding: 5px 8px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 700; }
.segmented button.active { color: var(--ink); background: #fff; box-shadow: 0 1px 4px rgba(15,23,42,.09); }
.definition-list { margin: 0; display: grid; }
.definition-list > div { display: grid; grid-template-columns: 1fr auto; gap: 15px; padding: 11px 0; border-bottom: 1px solid #f0f3f6; }
.definition-list > div:last-child { border: 0; }
.definition-list dt { color: var(--muted); font-size: 10px; }
.definition-list dd { margin: 0; font-size: 10px; font-weight: 700; text-align: right; max-width: 180px; overflow-wrap: anywhere; }
.daily-bars { display: grid; grid-template-columns: repeat(14,1fr); gap: 5px; align-items: end; height: 75px; padding-top: 12px; }
.daily-bar { min-width: 5px; height: 100%; border-radius: 3px; background: var(--green); position: relative; opacity: .82; }
.daily-bar.warn { background: var(--orange); }
.daily-bar.bad { background: var(--red); }

.cards-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.customer-card { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 18px; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s; cursor: pointer; }
.customer-card:hover { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(15,23,42,.07); }
.customer-card-head { display: flex; justify-content: space-between; gap: 12px; }
.customer-card h3 { margin: 0 0 3px; font-size: 14px; }
.customer-card p { margin: 0; color: var(--muted-2); font-size: 10px; }
.customer-card-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 20px; padding-top: 15px; border-top: 1px solid #eef1f5; }
.customer-card-stats strong { display: block; font-size: 15px; }
.customer-card-stats small { color: var(--muted-2); font-size: 9px; }

.node-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 22px; box-shadow: var(--shadow-sm); }
.node-card-head { display: flex; align-items: center; gap: 14px; }
.node-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 11px; color: var(--green); background: var(--green-soft); }
.node-icon.offline { color: var(--red); background: var(--red-soft); }
.node-icon svg { width: 22px; height: 22px; }
.node-card h3 { margin: 0 0 2px; font-size: 14px; }
.node-card p { margin: 0; color: var(--muted); font-size: 10px; }
.node-metrics { margin-top: 20px; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.node-metrics > div { padding: 12px; border-radius: 9px; background: #f7f9fb; }
.node-metrics small { display: block; color: var(--muted-2); font-size: 9px; }
.node-metrics strong { display: block; font-size: 13px; margin-top: 4px; }

.settings-grid { display: grid; grid-template-columns: 210px minmax(0,1fr); gap: 18px; }
.settings-nav { padding: 8px; align-self: start; }
.settings-nav button { width: 100%; border: 0; border-radius: 7px; background: transparent; padding: 10px; text-align: left; color: var(--muted); font-size: 11px; font-weight: 700; }
.settings-nav button.active { color: var(--ink); background: #eef2f6; }
.settings-section { padding: 22px; }
.settings-section h2 { margin: 0 0 4px; font-size: 16px; }
.settings-section > p { color: var(--muted); font-size: 11px; margin: 0 0 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 15px; }
.field--full { grid-column: 1/-1; }
.field small { font-weight: 400; color: var(--muted-2); }
.field-label { display: inline-flex; align-items: center; gap: 6px; width: max-content; max-width: 100%; }
.info-tip {
    position: relative; z-index: 4; width: 17px; height: 17px; flex: 0 0 17px; display: inline-grid; place-items: center;
    padding: 0; border: 1px solid #aeb9c7; border-radius: 50%; color: #6f7f93; background: #fff; cursor: help;
    font-family: Georgia, serif; font-size: 11px; font-weight: 700; line-height: 1; outline: none;
}
.info-tip:hover, .info-tip:focus { color: var(--blue); border-color: #7898df; background: var(--blue-soft); }
.info-tip:focus { box-shadow: 0 0 0 3px rgba(52,104,221,.12); }
.info-tip::before, .info-tip::after { position: absolute; left: 50%; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .12s, transform .12s; }
.info-tip::before {
    content: ""; top: calc(100% + 4px); transform: translate(-50%, -3px); border: 5px solid transparent; border-bottom-color: #172033;
}
.info-tip::after {
    content: attr(data-tooltip); top: calc(100% + 13px); width: max-content; max-width: min(270px, calc(100vw - 44px));
    padding: 9px 11px; border-radius: 8px; color: #fff; background: #172033; box-shadow: 0 8px 24px rgba(15,23,42,.2);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 11px; font-weight: 500; line-height: 1.45;
    text-align: left; white-space: normal; transform: translate(-50%, -3px); pointer-events: auto;
}
.info-tip:hover::before, .info-tip:hover::after, .info-tip:focus::before, .info-tip:focus::after { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.field-check { display: flex; align-items: center; gap: 9px; margin: 3px 0 20px; font-size: 12px; font-weight: 650; }
.field-check input { width: 16px; height: 16px; accent-color: var(--blue); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 7px; }
.user-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.user-row { display: grid; grid-template-columns: 36px 1fr 100px 100px; align-items: center; gap: 11px; padding: 12px; border-bottom: 1px solid var(--line); }
.user-row:last-child { border: 0; }
.user-row .user-avatar { color: #315fbf; background: var(--blue-soft); }
.user-row strong { font-size: 11px; display: block; }
.user-row small { color: var(--muted-2); font-size: 9px; display: block; }

.modal-backdrop { position: fixed; inset: 0; z-index: 80; background: rgba(6,12,23,.55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 24px; animation: fade-in .15s ease-out; }
.modal { width: min(100%, 660px); max-height: min(90vh,850px); overflow: auto; border-radius: 16px; background: #fff; box-shadow: var(--shadow-lg); animation: modal-in .18s ease-out; }
.modal--wide { width: min(100%,850px); }
.modal-head { padding: 20px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: start; justify-content: space-between; gap: 15px; position: sticky; top: 0; z-index: 2; background: #fff; }
.modal-head h2 { font-size: 17px; margin: 0 0 3px; }
.modal-head p { color: var(--muted); margin: 0; font-size: 10px; }
.modal-close { border: 0; width: 32px; height: 32px; border-radius: 8px; background: #f0f3f6; color: #526176; font-size: 19px; }
.modal-body { padding: 22px; }
.modal-footer { padding: 15px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; position: sticky; bottom: 0; background: #fff; }
.discovery-box { border: 1px solid #ccebdc; background: #f4fcf8; border-radius: 10px; padding: 14px; margin: 0 0 18px; display: grid; grid-template-columns: 32px 1fr; gap: 11px; }
.discovery-box .discovery-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--green); background: #dff5ea; }
.discovery-box strong { display: block; font-size: 11px; }
.discovery-box small { color: var(--muted); font-size: 9px; word-break: break-all; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px 0 20px; }
.tabs button { border: 0; padding: 10px 12px; color: var(--muted); background: transparent; border-bottom: 2px solid transparent; font-size: 11px; font-weight: 700; }
.tabs button.active { color: var(--blue); border-color: var(--blue); }

.toast-root { position: fixed; z-index: 120; right: 20px; bottom: 20px; display: grid; gap: 9px; }
.toast { width: min(360px,calc(100vw - 40px)); padding: 13px 15px; color: #fff; background: #172033; border-radius: 10px; box-shadow: 0 12px 35px rgba(15,23,42,.25); display: flex; align-items: center; gap: 10px; animation: toast-in .2s ease-out; }
.toast.success { border-left: 4px solid #55dda0; }
.toast.error { border-left: 4px solid #ef6370; }
.toast strong { display: block; font-size: 11px; }
.toast span { display: block; color: #b5c0d1; font-size: 10px; }
.spinner { width: 17px; height: 17px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.skeleton { background: linear-gradient(90deg,#edf1f5 25%,#f7f9fb 50%,#edf1f5 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 7px; }
.loading-panel { height: 420px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 20px; display: grid; gap: 12px; }
.loading-panel span { height: 42px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.99); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1120px) {
    .stats-grid { grid-template-columns: repeat(2,1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .cards-grid { grid-template-columns: repeat(2,1fr); }
    .metric-strip { grid-template-columns: repeat(3,1fr); }
    .metric-cell:nth-child(3) { border-right: 0; }
    .metric-cell:nth-child(n+4) { border-top: 1px solid var(--line); }
    .attention-item { grid-template-columns: 9px minmax(150px,1fr) minmax(120px,.8fr) 80px 22px; }
    .attention-item .mini-latency { display: none; }
}

@media (max-width: 820px) {
    .mobile-only { display: grid !important; }
    .desktop-only { display: none !important; }
    .auth-view { grid-template-columns: 1fr; }
    .auth-panel { display: none; }
    .auth-form-wrap { min-height: 100vh; padding: 28px 22px; }
    .mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 60px; font-weight: 750; }
    .app-shell { display: block; }
    .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .sidebar.open { transform: translateX(0); }
    .sidebar-scrim { display: none; position: fixed; inset: 0; z-index: 25; border: 0; background: rgba(5,10,19,.52); }
    .sidebar.open + * + .sidebar-scrim, .sidebar-scrim.open { display: block; }
    .app-content { min-width: 0; }
    .topbar { height: 67px; padding: 0 16px; gap: 11px; }
    .topbar-title { margin-right: auto; }
    .topbar-actions .button { padding-inline: 11px; }
    .topbar-actions .button span:not([data-icon]) { display: none; }
    .page { padding: 22px 16px 45px; }
    .detail-grid, .settings-grid { grid-template-columns: 1fr; }
    .settings-nav { display: flex; overflow-x: auto; }
    .settings-nav button { white-space: nowrap; width: auto; }
    .detail-hero { grid-template-columns: 1fr; }
    .detail-actions { flex-wrap: wrap; }
}

@media (max-width: 600px) {
    .stats-grid, .cards-grid { grid-template-columns: 1fr; }
    .stat-card { display: grid; grid-template-columns: 1fr auto; align-items: center; }
    .stat-card-top { grid-column: 1/-1; }
    .stat-value { margin-bottom: 0; }
    .stat-meta { align-self: end; padding-bottom: 3px; }
    .health-banner { align-items: flex-start; padding: 17px; }
    .health-banner .last-refresh { display: none; }
    .page-head { align-items: flex-start; }
    .page-head h1 { font-size: 23px; }
    .page-head-actions { flex-wrap: wrap; justify-content: flex-end; }
    .attention-item { grid-template-columns: 9px 1fr auto; padding: 12px 15px; }
    .attention-item .reason, .attention-item .status-badge { display: none; }
    .customer-row { grid-template-columns: 1fr 80px 22px; padding: 12px 15px; }
    .customer-row .status-cluster { display: none; }
    .metric-strip { grid-template-columns: repeat(2,1fr); }
    .metric-cell, .metric-cell:nth-child(3) { border-right: 1px solid var(--line); border-top: 1px solid var(--line); }
    .metric-cell:nth-child(1), .metric-cell:nth-child(2) { border-top: 0; }
    .metric-cell:nth-child(2n) { border-right: 0; }
    .metric-cell:last-child { grid-column: 1/-1; }
    .form-grid { grid-template-columns: 1fr; }
    .field--full { grid-column: auto; }
    .info-tip::before { display: none; }
    .info-tip::after {
        position: fixed; inset: auto 17px 17px; width: auto; max-width: none;
        transform: translateY(4px); font-size: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.3);
    }
    .info-tip:hover::after, .info-tip:focus::after { transform: translateY(0); }
    .modal-backdrop { padding: 0; place-items: end center; }
    .modal { border-radius: 16px 16px 0 0; max-height: 94vh; }
    .modal-head { padding: 17px; }
    .modal-body { padding: 17px; }
    .modal-footer { padding: 13px 17px; }
    .toolbar { align-items: stretch; }
    .toolbar .search { min-width: 100%; max-width: none; }
    .toolbar select { flex: 1; min-width: 0; }
    .result-count { width: 100%; margin: 0; }
    .user-row { grid-template-columns: 36px 1fr auto; }
    .user-row > :last-child { display: none; }
}
