:root {
  --navy-950: #071526;
  --navy-900: #0c1d33;
  --navy-800: #102a49;
  --blue-700: #1556b1;
  --blue-600: #1c67d2;
  --blue-100: #eaf2ff;
  --cyan-500: #21b8c7;
  --ink-900: #172033;
  --ink-700: #3f4c62;
  --ink-500: #6b778b;
  --ink-400: #8c96a8;
  --surface: #ffffff;
  --canvas: #f3f6fa;
  --line: #dfe5ee;
  --line-soft: #e9edf3;
  --green: #1b8a5a;
  --green-soft: #e7f6ef;
  --orange: #b76511;
  --orange-soft: #fff2df;
  --red: #c43c4e;
  --red-soft: #fdebed;
  --shadow: 0 12px 36px rgba(21, 38, 65, 0.09);
  --radius: 12px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink-900);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--canvas); font-size: 14px; line-height: 1.5; }
body.sidebar-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.login-view { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr); background: var(--surface); }
.login-brand-panel { position: relative; min-height: 100vh; overflow: hidden; display: flex; flex-direction: column; padding: 42px 7vw; color: #fff; background: var(--navy-900); }
.login-brand-panel::before, .login-brand-panel::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; }
.login-brand-panel::before { width: 540px; height: 540px; right: -260px; top: -180px; }
.login-brand-panel::after { width: 360px; height: 360px; left: -210px; bottom: -160px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup > span:last-child { display: grid; }
.brand-lockup strong { font-size: 17px; letter-spacing: .04em; }
.brand-lockup small { margin-top: -2px; font-size: 9px; letter-spacing: .2em; color: var(--ink-500); }
.brand-lockup-light small { color: rgba(255,255,255,.48); }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--blue-600); font-weight: 800; letter-spacing: -.04em; box-shadow: 0 8px 20px rgba(22,103,210,.3); }
.login-story { position: relative; z-index: 1; margin: auto 0 42px; max-width: 680px; }
.eyebrow { margin: 0 0 12px; color: var(--blue-600); font-size: 12px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow-light { color: #64d6e1; }
.login-story h1 { margin: 0; font-size: clamp(38px, 4vw, 64px); line-height: 1.15; letter-spacing: -.04em; }
.login-story > p:last-child { max-width: 520px; margin: 24px 0 0; color: rgba(255,255,255,.65); font-size: 17px; }
.route-visual { position: relative; z-index: 1; display: grid; grid-template-columns: auto 1fr auto 1fr auto; align-items: center; max-width: 670px; padding: 20px 0; border-top: 1px solid rgba(255,255,255,.1); border-bottom: 1px solid rgba(255,255,255,.1); }
.route-visual i { display: block; height: 1px; margin: 0 16px; background: rgba(255,255,255,.18); }
.route-point { display: grid; justify-items: center; gap: 7px; }
.route-point span { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; color: rgba(255,255,255,.9); font-size: 11px; font-weight: 800; }
.route-point b { color: rgba(255,255,255,.55); font-size: 11px; font-weight: 500; white-space: nowrap; }
.route-point-accent span { border-color: #45d0dd; background: rgba(33,184,199,.17); color: #86edf3; }
.login-security-note { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; margin: 26px 0 0; color: rgba(255,255,255,.5); font-size: 12px; }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: #46d69a; box-shadow: 0 0 0 5px rgba(70,214,154,.12); }
.login-form-panel { display: grid; place-items: center; padding: 48px; background: #fbfcfe; }
.login-card { width: min(420px, 100%); }
.login-card h2 { margin: 0 0 6px; font-size: 34px; letter-spacing: -.03em; }
.muted { color: var(--ink-500); }
.login-card > .muted { margin: 0 0 34px; }
.mobile-brand { display: none; margin-bottom: 44px; }
.field { display: grid; gap: 8px; margin: 18px 0; color: var(--ink-700); font-size: 13px; font-weight: 650; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink-900); outline: none; transition: border-color .15s, box-shadow .15s; }
.field input, .field select { height: 44px; padding: 0 13px; }
.field textarea { min-height: 92px; padding: 11px 13px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(28,103,210,.1); }
.field small { color: var(--ink-400); font-weight: 450; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 58px; }
.password-wrap .password-toggle { position: absolute; top: 5px; right: 5px; height: 34px; width: 48px; color: var(--ink-500); font-size: 12px; }
.form-error { min-height: 21px; margin: 2px 0 8px; color: var(--red); font-size: 13px; }
.login-footnote { margin: 24px 0 0; text-align: center; color: var(--ink-400); font-size: 11px; }

.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; background: #fff; color: var(--ink-700); font-weight: 650; transition: background .15s, border-color .15s, transform .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.button-primary { background: var(--blue-600); color: #fff; box-shadow: 0 7px 16px rgba(28,103,210,.2); }
.button-primary:hover { background: var(--blue-700); }
.button-secondary { border-color: var(--line); background: #fff; }
.button-secondary:hover { border-color: #bfc9d8; background: #f8fafc; }
.button-danger { border-color: #f1c9ce; background: #fff7f8; color: var(--red); }
.button-ghost { background: transparent; color: var(--ink-500); }
.button-block { width: 100%; min-height: 46px; justify-content: space-between; padding-inline: 18px; }
.button-small { min-height: 31px; padding-inline: 10px; font-size: 12px; }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: inherit; }
.icon-button:hover { background: rgba(89,105,130,.09); }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 244px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: 244px; display: flex; flex-direction: column; padding: 26px 18px 18px; background: var(--navy-900); color: #fff; }
.sidebar-brand { padding: 0 10px 25px; border-bottom: 1px solid rgba(255,255,255,.08); }
.main-nav { display: grid; gap: 5px; margin: 23px 0; }
.nav-item { width: 100%; height: 43px; display: flex; align-items: center; gap: 12px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: rgba(255,255,255,.6); text-align: left; font-weight: 600; }
.nav-item span { width: 22px; color: rgba(255,255,255,.38); font-size: 17px; text-align: center; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-item.active { color: #fff; background: var(--blue-600); box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.nav-item.active span { color: #fff; }
.sidebar-status { display: flex; align-items: center; gap: 11px; margin-top: auto; padding: 15px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 9px; background: rgba(255,255,255,.035); }
.sidebar-status .status-light { width: 8px; height: 8px; border-radius: 50%; background: #45d295; box-shadow: 0 0 0 4px rgba(69,210,149,.1); }
.sidebar-status div { display: grid; }
.sidebar-status strong { font-size: 12px; }
.sidebar-status small { color: rgba(255,255,255,.4); font-size: 10px; }
.sidebar-version { margin: 14px 12px 0; color: rgba(255,255,255,.25); font-size: 10px; letter-spacing: .08em; }
.workspace { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-title h1 { margin: 0; font-size: 19px; letter-spacing: -.02em; }
.topbar-title p { margin: 1px 0 0; color: var(--ink-500); font-size: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.refresh-button { border: 1px solid var(--line); }
.account-chip { min-width: 146px; display: flex; align-items: center; gap: 9px; padding: 5px 10px; border-left: 1px solid var(--line); }
.account-chip > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-100); color: var(--blue-700); font-weight: 800; }
.account-chip div { display: grid; }
.account-chip strong { max-width: 110px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.account-chip small { color: var(--ink-500); font-size: 10px; }
.mobile-menu-button, .sidebar-scrim { display: none; }
.page-content { max-width: 1500px; margin: 0 auto; padding: 30px 34px 48px; outline: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.page-head h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.025em; }
.page-head p { margin: 0; color: var(--ink-500); }
.page-actions { display: flex; align-items: center; gap: 9px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.kpi-card { min-height: 132px; padding: 20px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 12px rgba(21,38,65,.04); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-label { color: var(--ink-500); font-size: 12px; font-weight: 650; }
.kpi-icon { width: 33px; height: 33px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-100); color: var(--blue-700); font-weight: 800; }
.kpi-value { margin: 18px 0 3px; font-size: 30px; font-weight: 780; letter-spacing: -.04em; }
.kpi-note { color: var(--ink-400); font-size: 11px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); gap: 18px; }
.stack { display: grid; gap: 18px; align-content: start; }
.panel { border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 12px rgba(21,38,65,.035); overflow: hidden; }
.panel-header { min-height: 61px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 19px; border-bottom: 1px solid var(--line-soft); }
.panel-header h3 { margin: 0; font-size: 14px; }
.panel-header p { margin: 2px 0 0; color: var(--ink-400); font-size: 10px; }
.panel-body { padding: 18px 19px; }
.panel-link { border: 0; background: none; color: var(--blue-600); font-size: 11px; font-weight: 650; }
.topology-list { display: grid; gap: 10px; }
.topology-row { display: grid; grid-template-columns: minmax(140px, .8fr) 1fr auto; align-items: center; gap: 18px; padding: 13px 14px; border: 1px solid var(--line-soft); border-radius: 9px; background: #fbfcfe; }
.topology-name { display: grid; }
.topology-name strong { font-size: 12px; }
.topology-name small { color: var(--ink-400); font-family: ui-monospace, monospace; font-size: 10px; }
.topology-path { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.topology-node { min-width: 0; }
.topology-node b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.topology-node small { display: block; color: var(--ink-400); font-size: 10px; }
.topology-arrow { color: var(--blue-600); }
.agent-list { display: grid; gap: 11px; }
.agent-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; }
.agent-role { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--blue-700); font-size: 10px; font-weight: 800; }
.agent-row > div { min-width: 0; display: grid; }
.agent-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.agent-row small { color: var(--ink-400); font-size: 10px; }
.metric-pair { display: flex; gap: 5px; }
.metric-pair span { padding: 3px 6px; border-radius: 5px; background: #f2f5f9; color: var(--ink-700); font-family: ui-monospace, monospace; font-size: 9px; }
.audit-mini-list { display: grid; }
.audit-mini { display: grid; grid-template-columns: auto 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); }
.audit-mini:last-child { border-bottom: 0; }
.audit-dot { width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--blue-600); }
.audit-mini div { display: grid; }
.audit-mini strong { font-size: 11px; }
.audit-mini small { color: var(--ink-400); font-size: 10px; }

.toolbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 15px; border-bottom: 1px solid var(--line-soft); }
.search-box { position: relative; width: min(340px, 100%); }
.search-box input { width: 100%; height: 38px; padding: 0 13px 0 34px; border: 1px solid var(--line); border-radius: 8px; outline: 0; }
.search-box input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(28,103,210,.08); }
.search-box::before { content: "⌕"; position: absolute; left: 12px; top: 8px; color: var(--ink-400); }
.filters { display: flex; gap: 7px; }
.filter-button { height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink-500); font-size: 11px; }
.filter-button.active { border-color: #b8cff3; background: var(--blue-100); color: var(--blue-700); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { height: 42px; padding: 0 15px; border-bottom: 1px solid var(--line-soft); background: #fafbfd; color: var(--ink-500); font-size: 10px; font-weight: 750; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.data-table td { min-height: 58px; padding: 12px 15px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-size: 12px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfcfe; }
.primary-cell { display: grid; }
.primary-cell strong { font-size: 12px; }
.primary-cell small { max-width: 230px; overflow: hidden; text-overflow: ellipsis; color: var(--ink-400); font-size: 10px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.text-button { min-height: 29px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--blue-600); font-size: 11px; font-weight: 650; }
.text-button:hover { background: var(--blue-100); }
.text-button.danger { color: var(--red); }
.text-button.danger:hover { background: var(--red-soft); }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 23px; padding: 0 8px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-orange { background: var(--orange-soft); color: var(--orange); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-gray { background: #eef1f5; color: var(--ink-500); }
.badge-blue { background: var(--blue-100); color: var(--blue-700); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(280px, 1fr)); gap: 15px; }
.node-card { padding: 19px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 12px rgba(21,38,65,.035); }
.node-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.node-title { display: flex; gap: 11px; }
.node-title > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 9px; background: var(--blue-100); color: var(--blue-700); font-size: 10px; font-weight: 800; }
.node-title h3 { margin: 0; font-size: 14px; }
.node-title p { margin: 2px 0 0; color: var(--ink-400); font-size: 10px; }
.node-details { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 19px 0; padding: 15px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.detail-item { display: grid; min-width: 0; }
.detail-item span { color: var(--ink-400); font-size: 9px; text-transform: uppercase; }
.detail-item strong { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
.sync-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sync-line > div { display: grid; }
.sync-line strong { font-size: 11px; }
.sync-line small { color: var(--ink-400); font-size: 9px; }
.latency-strip { display: flex; gap: 7px; margin-top: 13px; }
.latency-strip span { flex: 1; display: grid; padding: 8px 9px; border-radius: 7px; background: #f5f7fa; }
.latency-strip small { color: var(--ink-400); font-size: 8px; text-transform: uppercase; }
.latency-strip b { margin-top: 2px; font-size: 11px; }
.node-card-actions { display: flex; gap: 7px; margin-top: 15px; }
.empty-state { display: grid; justify-items: center; padding: 54px 20px; text-align: center; }
.empty-state-mark { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 12px; background: var(--blue-100); color: var(--blue-700); font-size: 22px; }
.empty-state h3 { margin: 15px 0 5px; font-size: 14px; }
.empty-state p { max-width: 380px; margin: 0 0 17px; color: var(--ink-500); font-size: 11px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 22px; background: rgba(5,16,31,.58); backdrop-filter: blur(2px); }
.modal { width: min(620px, 100%); max-height: min(850px, calc(100vh - 44px)); display: flex; flex-direction: column; border-radius: 13px; background: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.25); overflow: hidden; }
.modal-wide { width: min(790px, 100%); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line-soft); }
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-header p { margin: 3px 0 0; color: var(--ink-500); font-size: 11px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line-soft); background: #fbfcfd; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .field { margin: 9px 0; }
.field-full { grid-column: 1 / -1; }
.section-label { grid-column: 1 / -1; margin: 18px 0 2px; padding-top: 16px; border-top: 1px solid var(--line-soft); color: var(--ink-500); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.inline-input { display: flex; gap: 7px; }
.inline-input input { min-width: 0; }
.inline-input .button { flex: 0 0 auto; }
.notice { padding: 12px 14px; border: 1px solid #cbdcf6; border-radius: 8px; background: #f4f8ff; color: #31527f; font-size: 11px; }
.notice-warning { border-color: #f1d2a9; background: #fff8ed; color: #7a511d; }
.secret-box { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin: 16px 0; }
.secret-box code { min-width: 0; padding: 12px; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 8px; background: #f6f8fb; color: var(--ink-900); font-size: 11px; }
.agent-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.agent-summary > div { display: grid; padding: 11px; border-radius: 8px; background: #f5f7fa; }
.agent-summary span { color: var(--ink-400); font-size: 8px; text-transform: uppercase; }
.agent-summary strong { margin-top: 3px; font-size: 11px; }
.probe-table { width: 100%; border-collapse: collapse; margin: 12px 0; }
.probe-table th, .probe-table td { padding: 8px 7px; border-bottom: 1px solid var(--line-soft); text-align: left; font-size: 10px; }
.probe-table th { color: var(--ink-400); }
.loading-state { display: grid; place-items: center; min-height: 220px; color: var(--ink-500); }
.spinner { width: 25px; height: 25px; margin-bottom: 10px; border: 2px solid #d9e2ed; border-top-color: var(--blue-600); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-stack { position: fixed; z-index: 100; right: 24px; bottom: 24px; display: grid; gap: 9px; }
.toast { width: min(370px, calc(100vw - 48px)); display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px; border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 9px; background: #fff; box-shadow: var(--shadow); animation: toast-in .18s ease-out; }
.toast.error { border-left-color: var(--red); }
.toast strong { display: block; font-size: 12px; }
.toast p { margin: 1px 0 0; color: var(--ink-500); font-size: 10px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Admin application components */
.page-toolbar { min-height: 58px; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.page-toolbar-end { justify-content: space-between; }
.page-toolbar-end p { margin: 2px 0 0; font-size: 11px; }
.page-toolbar select { height: 40px; padding: 0 34px 0 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink-700); }
.toolbar-search { position: relative; flex: 1; max-width: 370px; }
.toolbar-search span { position: absolute; left: 12px; top: 8px; color: var(--ink-400); font-size: 18px; }
.toolbar-search input { width: 100%; height: 40px; padding: 0 12px 0 37px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: 0; }
.toolbar-search input:focus { border-color: var(--blue-600); box-shadow: 0 0 0 3px rgba(28,103,210,.08); }
.panel-head { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 19px; border-bottom: 1px solid var(--line-soft); }
.panel-head h2 { margin: 0; font-size: 14px; }
.panel-head p { margin: 2px 0 0; color: var(--ink-400); font-size: 10px; }
.panel-span-7 { grid-column: span 7; }
.panel-span-5 { grid-column: span 5; }
.panel-span-12 { grid-column: span 12; }
.dashboard-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.kpi-card { display: flex; align-items: flex-start; gap: 15px; }
.kpi-card > div { display: grid; }
.kpi-card p { margin: 0; color: var(--ink-500); font-size: 11px; font-weight: 650; }
.kpi-card strong { margin: 10px 0 2px; font-size: 28px; letter-spacing: -.04em; }
.kpi-card small { color: var(--ink-400); font-size: 10px; }
.kpi-icon { flex: 0 0 auto; }
.kpi-icon::before { content: ""; width: 9px; height: 9px; border: 3px solid currentColor; border-radius: 50%; }
.kpi-icon.teal { background: #e6f8f7; color: #13857e; }
.kpi-icon.violet { background: #f1ebff; color: #714ac4; }
.kpi-icon.orange { background: var(--orange-soft); color: var(--orange); }
.route-list, .activity-list { display: grid; padding: 7px 18px 14px; }
.route-row { display: grid; grid-template-columns: minmax(130px,.6fr) minmax(280px,1fr) auto; align-items: center; gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.route-row:last-child { border-bottom: 0; }
.route-row > div:first-child { display: grid; }
.route-row strong { font-size: 12px; }
.route-row small { color: var(--ink-400); font-size: 9px; }
.route-path { display: grid; grid-template-columns: 1fr minmax(30px,1fr) 1fr; align-items: center; gap: 8px; color: var(--ink-700); font-size: 10px; }
.route-path i { height: 1px; background: linear-gradient(90deg,var(--blue-600),var(--cyan-500)); }
.activity-item { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.activity-item:last-child { border-bottom: 0; }
.activity-item > span { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--blue-600); }
.activity-item div { display: grid; }
.activity-item strong { font-size: 11px; }
.activity-item p, .activity-item time { margin: 0; color: var(--ink-400); font-size: 9px; }
.table-wrap table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.table-wrap th { height: 42px; padding: 0 15px; border-bottom: 1px solid var(--line-soft); background: #fafbfd; color: var(--ink-500); font-size: 10px; font-weight: 750; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
.table-wrap td { padding: 12px 15px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; font-size: 11px; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap tbody tr:hover { background: #fbfcfe; }
.table-wrap td > small, .table-primary small, .table-user small { display: block; color: var(--ink-400); font-size: 9px; }
.table-primary { display: grid; }
.table-user { display: flex; align-items: center; gap: 9px; }
.table-user > span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 8px; background: var(--blue-100); color: var(--blue-700); font-weight: 750; }
.table-user > div { display: grid; }
.table-actions { display: flex; gap: 2px; }
.table-empty { height: 100px; color: var(--ink-400); text-align: center; }
.details-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
code { padding: 2px 5px; border-radius: 4px; background: #f2f5f9; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.route-arrow { color: var(--blue-600); font-size: 18px; }
.badge-success { background: var(--green-soft); color: var(--green); }
.badge-warning { background: var(--orange-soft); color: var(--orange); }
.badge-danger { background: var(--red-soft); color: var(--red); }
.badge-info { background: var(--blue-100); color: var(--blue-700); }
.badge-violet { background: #f1ebff; color: #714ac4; }
.badge-neutral { background: #eef1f5; color: var(--ink-500); }
.node-grid { display: grid; grid-template-columns: repeat(3,minmax(280px,1fr)); gap: 15px; }
.node-card header { display: flex; align-items: flex-start; gap: 11px; }
.node-card header > div:nth-child(2) { min-width: 0; flex: 1; }
.node-card header h3 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.node-card header p { margin: 2px 0 0; color: var(--ink-400); font-size: 10px; }
.node-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 9px; background: var(--blue-100); color: var(--blue-700); font-weight: 800; }
.node-icon.exit { background: #f1ebff; color: #714ac4; }
.node-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 18px 0; padding: 15px 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.node-facts div { min-width: 0; display: grid; }
.node-facts dt { color: var(--ink-400); font-size: 9px; }
.node-facts dd { margin: 3px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 650; }
.node-facts .node-id-fact { grid-column: 1 / -1; }
.node-id-fact dd { display: flex; align-items: center; gap: 7px; }
.node-id-fact code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-id-fact .text-button { flex: 0 0 auto; }
.probe-strip { display: flex; gap: 7px; }
.probe-strip span { flex: 1; display: grid; padding: 8px 9px; border-radius: 7px; background: #f5f7fa; }
.probe-strip small { color: var(--ink-400); font-size: 8px; }
.probe-strip strong { font-size: 11px; }
.node-card footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 15px; }
.node-card footer > small { color: var(--ink-400); font-size: 9px; }
.empty-inline { min-height: 120px; display: grid; place-items: center; align-content: center; gap: 5px; color: var(--ink-400); text-align: center; }
.empty-inline span { color: var(--blue-600); font-size: 21px; }
.empty-inline p { margin: 0; font-size: 11px; }
.loader { width: 25px; height: 25px; margin-bottom: 10px; border: 2px solid #d9e2ed; border-top-color: var(--blue-600); border-radius: 50%; animation: spin .75s linear infinite; }
.loading-state { align-content: center; gap: 6px; }
.loading-state p { margin: 0; font-size: 11px; }
.one-column { grid-template-columns: 1fr; }
.full-field { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 15px; border-top: 1px solid var(--line-soft); }
.form-note { grid-column: 1 / -1; margin: 3px 0; padding: 10px 12px; border-radius: 8px; background: var(--blue-100); color: #31527f; font-size: 10px; }
.check-field { display: flex; align-items: center; gap: 10px; margin: 9px 0; }
.check-field input { width: 17px; height: 17px; }
.check-field span { display: grid; }
.check-field small { color: var(--ink-400); font-size: 9px; }
.input-action { position: relative; }
.input-action input { padding-right: 70px; }
.input-action button { position: absolute; right: 5px; top: 7px; }
.confirm-content p { margin: 0 0 18px; }
.agent-modal-loading, .inline-loading { min-height: 100px; display: grid; place-items: center; align-content: center; gap: 7px; color: var(--ink-500); }
.node-id-box { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; margin-bottom: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--blue-100); }
.node-id-box > div { min-width: 0; display: grid; gap: 5px; }
.node-id-box small { color: var(--blue-700); font-size: 9px; }
.node-id-box code { overflow-wrap: anywhere; white-space: normal; background: rgba(255,255,255,.7); }
.agent-summary small { color: var(--ink-400); font-size: 8px; }
.alert { margin: 13px 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; font-size: 10px; }
.alert p { margin: 3px 0 0; }
.alert-danger { border-color: #f1c9ce; background: var(--red-soft); color: #8f2938; }
.agent-action-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px 0; border-top: 1px solid var(--line-soft); }
.agent-action-row p { margin: 2px 0 0; font-size: 10px; }
.secret-box > div { min-width: 0; display: grid; gap: 5px; }
.secret-box small { color: var(--orange); font-size: 9px; }
.secret-box code { overflow-wrap: anywhere; white-space: normal; }
.probe-table h3 { margin: 18px 0 8px; font-size: 12px; }
.section-divider { margin: 22px -22px; border: 0; border-top: 1px solid var(--line-soft); }
.section-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.section-title h3 { margin: 0; font-size: 14px; }
.section-title p { margin: 3px 0 0; color: var(--ink-400); font-size: 10px; }
.toast { align-items: center; }
.toast > span { width: 23px; height: 23px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 800; }
.toast > p { margin: 0; color: var(--ink-700); font-size: 11px; }
.toast-error { border-left-color: var(--red); }
.toast-error > span { background: var(--red-soft); color: var(--red); }
.toast-info { border-left-color: var(--blue-600); }
.toast-info > span { background: var(--blue-100); color: var(--blue-700); }

@media (max-width: 1150px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, minmax(280px, 1fr)); }
  .panel-span-7, .panel-span-5, .panel-span-12 { grid-column: auto; }
  .node-grid { grid-template-columns: repeat(2,minmax(280px,1fr)); }
}

@media (max-width: 820px) {
  .login-view { grid-template-columns: 1fr; }
  .login-brand-panel { display: none; }
  .login-form-panel { min-height: 100vh; padding: 28px; }
  .mobile-brand { display: flex; }
  .app-shell { display: block; }
  .workspace { width: 100%; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 25; display: block; visibility: hidden; opacity: 0; border: 0; background: rgba(5,16,31,.45); transition: opacity .2s; }
  .sidebar-scrim.open { visibility: visible; opacity: 1; }
  .mobile-menu-button { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
  .topbar { height: 68px; padding: 0 18px; }
  .topbar-title p, .account-chip div, .logout-button { display: none; }
  .account-chip { min-width: auto; padding: 0; border: 0; }
  .page-content { padding: 22px 18px 38px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .card-grid { grid-template-columns: 1fr; }
  .node-grid { grid-template-columns: 1fr; }
  .page-toolbar { align-items: stretch; flex-wrap: wrap; }
  .toolbar-search { max-width: none; flex-basis: 100%; }
  .route-row { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  .login-form-panel { padding: 22px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { min-height: 112px; padding: 15px; }
  .kpi-value { margin-top: 12px; font-size: 25px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .filters { overflow-x: auto; }
  .topology-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field-full, .full-field, .section-label { grid-column: auto; }
  .agent-summary { grid-template-columns: 1fr 1fr; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { width: 100%; max-height: 92vh; border-radius: 14px 14px 0 0; }
  .modal-footer .button { flex: 1; }
  .page-toolbar-end { align-items: flex-start; flex-direction: column; }
  .page-toolbar-end .button { width: 100%; }
  .agent-action-row { align-items: stretch; flex-direction: column; }
  .node-id-box { grid-template-columns: 1fr; }
  .node-id-box .button { width: 100%; }
}

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