:root {
  --bg: #061019;
  --bg-deep: #040b12;
  --panel: rgba(10, 24, 37, .86);
  --panel-solid: #0b1926;
  --panel-2: #0f2131;
  --line: rgba(128, 178, 215, .14);
  --line-strong: rgba(128, 205, 255, .25);
  --text: #edf8ff;
  --text-2: #c8d9e7;
  --muted: #7793a9;
  --cyan: #61defa;
  --cyan-soft: rgba(97, 222, 250, .12);
  --green: #48e19b;
  --green-soft: rgba(72, 225, 155, .12);
  --amber: #ffc864;
  --amber-soft: rgba(255, 200, 100, .12);
  --red: #ff6d7d;
  --red-soft: rgba(255, 109, 125, .12);
  --violet: #9d8cff;
  --blue: #6aa9ff;
  --sidebar: 236px;
  --radius: 20px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg-deep); }
body { margin: 0; min-height: 100vh; color: var(--text); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }

.app-body, .login-body {
  background:
    linear-gradient(rgba(80, 145, 190, .024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 145, 190, .024) 1px, transparent 1px),
    radial-gradient(circle at 18% -10%, rgba(52, 156, 211, .16), transparent 34%),
    radial-gradient(circle at 92% 88%, rgba(92, 78, 197, .10), transparent 32%),
    var(--bg);
  background-size: 48px 48px, 48px 48px, auto, auto, auto;
}

.ambient { position: fixed; width: 420px; height: 420px; border-radius: 50%; filter: blur(110px); opacity: .08; pointer-events: none; z-index: 0; }
.ambient-a { background: var(--cyan); left: -180px; top: 6%; }
.ambient-b { background: var(--violet); right: -220px; bottom: -50px; }

/* Login */
.login-body { display: grid; place-items: center; padding: 28px; overflow-x: hidden; }
.login-shell { position: relative; z-index: 1; width: min(1050px, 100%); display: grid; grid-template-columns: 1.2fr .8fr; gap: 70px; align-items: center; }
.login-brand h1 { margin: 15px 0 18px; font-size: clamp(46px, 6vw, 82px); letter-spacing: -.055em; line-height: .95; }
.login-brand p { max-width: 580px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.7; }
.kicker, .eyebrow { color: var(--cyan); font-size: 10px; font-weight: 800; letter-spacing: .19em; }
.brand-mark { width: 50px; height: 50px; display: grid; grid-auto-flow: column; place-content: center; align-items: center; gap: 2px; border: 1px solid rgba(97, 222, 250, .27); border-radius: 14px; color: var(--text); background: linear-gradient(145deg, rgba(97,222,250,.10), rgba(115,101,220,.08)); font-weight: 900; letter-spacing: -.08em; box-shadow: inset 0 0 22px rgba(97,222,250,.05), 0 0 30px rgba(97,222,250,.05); }
.brand-mark-large { width: 72px; height: 72px; border-radius: 21px; font-size: 21px; margin-bottom: 34px; }
.brand-slash { color: var(--cyan); opacity: .8; font-weight: 500; }
.login-flags { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.flag { display: inline-flex; gap: 7px; align-items: center; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; background: rgba(5,14,22,.45); }
.flag i { width: 5px; height: 5px; border-radius: 50%; background: var(--blue); }
.flag-green { color: var(--green); border-color: rgba(72,225,155,.22); }
.flag-green i { background: var(--green); box-shadow: 0 0 12px var(--green); }
.login-card { padding: 30px; border: 1px solid var(--line-strong); border-radius: 26px; background: linear-gradient(160deg, rgba(14,32,47,.95), rgba(8,20,31,.96)); box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.025); }
.login-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 30px; }
.login-card h2 { margin: 6px 0 0; font-size: 26px; letter-spacing: -.035em; }
.lock-orbit { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid rgba(97,222,250,.25); border-radius: 50%; color: var(--cyan); box-shadow: inset 0 0 18px rgba(97,222,250,.06); }
.field-label { display: block; color: var(--muted); font-size: 11px; font-weight: 700; margin: 16px 0 7px; }
input { width: 100%; min-width: 0; border: 1px solid var(--line); background: rgba(3,12,20,.7); color: var(--text); border-radius: 13px; padding: 13px 14px; outline: none; transition: .18s ease; }
input:focus { border-color: rgba(97,222,250,.55); box-shadow: 0 0 0 3px rgba(97,222,250,.08); }
.primary { border: 0; background: linear-gradient(135deg, #64def7, #79b8ff); color: #04111a; font-weight: 850; border-radius: 13px; padding: 13px 16px; box-shadow: 0 10px 30px rgba(91,203,242,.12); }
.wide { width: 100%; margin-top: 23px; }
.form-status { min-height: 18px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.form-status.error { color: var(--red); }
.form-status.success { color: var(--green); }
.login-foot { margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); color: #5f7e95; font-size: 10px; line-height: 1.55; }

/* App shell */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: var(--sidebar); padding: 22px 16px 18px; display: flex; flex-direction: column; background: rgba(5, 14, 22, .88); border-right: 1px solid var(--line); backdrop-filter: blur(22px); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 6px 25px; }
.brand-name { font-weight: 900; letter-spacing: .16em; font-size: 13px; }
.brand-sub { margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .23em; }
.nav-list { display: grid; gap: 5px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; padding: 11px 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: #7e9bb0; text-align: left; font-size: 12px; font-weight: 700; transition: .16s ease; }
.nav-item:hover { color: var(--text-2); background: rgba(97,222,250,.045); }
.nav-item.active { color: var(--text); border-color: rgba(97,222,250,.16); background: linear-gradient(90deg, rgba(97,222,250,.11), rgba(97,222,250,.025)); box-shadow: inset 3px 0 var(--cyan); }
.nav-icon { width: 19px; color: var(--cyan); font-size: 16px; text-align: center; }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; }
.guard-card { display: flex; align-items: center; gap: 10px; border: 1px solid rgba(72,225,155,.14); border-radius: 13px; padding: 11px; background: rgba(72,225,155,.045); }
.guard-card strong { display: block; color: #b9f5d7; font-size: 10px; }
.guard-card span { display: block; color: #5d8973; font-size: 9px; margin-top: 2px; }
.guard-led { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 16px rgba(72,225,155,.55); }
.logout { color: #6c8395; }
.workspace { min-height: 100vh; margin-left: var(--sidebar); position: relative; z-index: 1; display: flex; flex-direction: column; }
.topbar { height: 82px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 30px; background: rgba(6,16,25,.76); border-bottom: 1px solid var(--line); backdrop-filter: blur(20px); }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar h1 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.03em; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.environment-pill, .readonly-pill { display: inline-flex; align-items: center; gap: 7px; height: 29px; padding: 0 10px; border-radius: 999px; font-size: 9px; font-weight: 850; letter-spacing: .09em; }
.environment-pill { color: #bdd4e5; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.readonly-pill { color: var(--green); border: 1px solid rgba(72,225,155,.18); background: rgba(72,225,155,.055); }
.pulse-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px rgba(97,222,250,.65); animation: pulse 2.2s infinite; }
.icon-button, .mobile-menu { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); color: var(--text-2); }
.icon-button:hover { border-color: rgba(97,222,250,.3); color: var(--cyan); }
.icon-button.spinning { animation: spin .8s linear infinite; }
.mobile-menu { display: none; }
.content { flex: 1; width: min(1480px, 100%); margin: 0 auto; padding: 26px 30px 36px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: enter .22s ease both; }

/* Hero */
.hero-card { min-height: 230px; position: relative; overflow: hidden; display: flex; justify-content: space-between; gap: 40px; padding: 34px 38px; border: 1px solid var(--line-strong); border-radius: 25px; background: linear-gradient(112deg, rgba(15,39,56,.92), rgba(8,22,34,.9) 55%, rgba(19,20,46,.84)); box-shadow: var(--shadow); }
.hero-card::after { content: ''; position: absolute; width: 420px; height: 420px; right: -80px; top: -210px; border: 1px solid rgba(97,222,250,.08); border-radius: 50%; box-shadow: 0 0 0 50px rgba(97,222,250,.018), 0 0 0 100px rgba(97,222,250,.012); }
.hero-copy { position: relative; z-index: 1; max-width: 700px; }
.hero-overline { display: flex; gap: 8px; align-items: center; color: #8caabd; font-size: 9px; font-weight: 850; letter-spacing: .12em; }
.hero-led { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(72,225,155,.6); }
.hero-copy h2 { margin: 18px 0 14px; font-size: clamp(29px, 4vw, 48px); line-height: 1.02; letter-spacing: -.052em; }
.hero-copy h2 span { color: #8caec3; font-weight: 500; }
.hero-copy p { max-width: 660px; margin: 0; color: #7894a9; font-size: 13px; line-height: 1.65; }
.hero-meta { position: relative; z-index: 2; min-width: 210px; align-self: flex-end; text-align: right; }
.hero-clock { font-size: 35px; font-weight: 350; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.hero-date { margin-top: 4px; color: var(--muted); font-size: 11px; }
.sync-line { display: flex; justify-content: flex-end; align-items: center; gap: 7px; margin-top: 18px; color: #64859a; font-size: 9px; }
.sync-line > span:first-child { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); }

/* Metrics */
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.metric-card { position: relative; overflow: hidden; min-height: 122px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(160deg, rgba(13,29,43,.92), rgba(8,20,31,.92)); }
.metric-card::after { content: ''; position: absolute; right: -28px; bottom: -30px; width: 85px; height: 85px; border-radius: 50%; background: var(--metric-glow); filter: blur(30px); opacity: .16; }
.metric-top { display: flex; align-items: center; gap: 8px; }
.metric-icon { color: var(--metric-color); font-size: 15px; }
.metric-label { color: #829db1; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.metric-value { margin-top: 19px; font-size: 24px; font-weight: 800; letter-spacing: -.045em; }
.metric-detail { margin-top: 4px; color: #5d788d; font-size: 9px; }
.tone-cyan { --metric-color: var(--cyan); --metric-glow: var(--cyan); }
.tone-green { --metric-color: var(--green); --metric-glow: var(--green); }
.tone-amber { --metric-color: var(--amber); --metric-glow: var(--amber); }
.tone-violet { --metric-color: var(--violet); --metric-glow: var(--violet); }
.tone-blue { --metric-color: var(--blue); --metric-glow: var(--blue); }

.dashboard-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 12px; margin-top: 12px; }
.panel { border: 1px solid var(--line); border-radius: 18px; padding: 18px; background: rgba(9,22,34,.72); backdrop-filter: blur(12px); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 14px; }
.panel-head h3 { margin: 4px 0 0; font-size: 15px; letter-spacing: -.02em; }
.counter { min-width: 28px; height: 28px; display: grid; place-items: center; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; }
.text-button { padding: 0; border: 0; background: transparent; color: #7898ad; font-size: 10px; }
.text-button:hover { color: var(--cyan); }
.attention-list { display: grid; gap: 5px; }
.attention-row { display: grid; grid-template-columns: 5px 1fr; gap: 11px; padding: 10px; border: 1px solid rgba(128,178,215,.08); border-radius: 12px; background: rgba(255,255,255,.014); }
.attention-led { width: 4px; min-height: 34px; border-radius: 99px; background: var(--blue); }
.severity-critical .attention-led { background: var(--red); box-shadow: 0 0 14px rgba(255,109,125,.25); }
.severity-warning .attention-led { background: var(--amber); }
.attention-title { font-size: 11px; font-weight: 750; }
.attention-detail { margin-top: 3px; color: #7690a4; font-size: 9px; line-height: 1.45; overflow-wrap: anywhere; }
.attention-meta { margin-top: 4px; color: #496578; font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.mini-node-list { display: grid; gap: 2px; }
.mini-node { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 39px; padding: 7px 9px; border-bottom: 1px solid rgba(128,178,215,.07); }
.mini-node:last-child { border-bottom: 0; }
.mini-node-id, .mini-node-stats { display: flex; align-items: center; gap: 8px; }
.mini-node-id { min-width: 0; color: #b9cfdd; font-size: 10px; font-weight: 750; }
.mini-node-id > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-node-stats { color: #648196; font-size: 9px; white-space: nowrap; }
.node-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #607888; }
.node-dot.good { background: var(--green); box-shadow: 0 0 10px rgba(72,225,155,.4); }
.node-dot.warn { background: var(--amber); }
.node-dot.bad { background: var(--red); }

/* Generic sections */
.section-intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 6px 0 23px; }
.section-intro h2 { margin: 5px 0 5px; font-size: 30px; letter-spacing: -.045em; }
.section-intro p { margin: 0; color: var(--muted); font-size: 11px; }
.search-box { width: min(520px, 48vw); display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 4px; padding-left: 8px; border: 1px solid var(--line); border-radius: 14px; background: rgba(6,17,27,.65); }
.search-box > span { color: #55798f; text-align: center; }
.search-box input { border: 0; background: transparent; box-shadow: none; padding: 11px 7px; }
.search-box input:focus { box-shadow: none; }
.search-box button { align-self: stretch; margin: 4px; padding: 0 14px; border: 1px solid rgba(97,222,250,.16); border-radius: 10px; background: rgba(97,222,250,.08); color: #aeeeff; font-size: 10px; font-weight: 800; }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.node-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.data-card { padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: linear-gradient(155deg, rgba(13,29,43,.85), rgba(7,19,29,.88)); box-shadow: 0 11px 35px rgba(0,0,0,.09); }
.data-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.data-title { color: #e4f2fb; font-size: 12px; font-weight: 800; overflow-wrap: anywhere; }
.data-subtitle { margin-top: 4px; color: #58778d; font-size: 9px; overflow-wrap: anywhere; }
.state-pill { display: inline-flex; flex: none; align-items: center; min-height: 20px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; color: #7894a8; font-size: 8px; font-weight: 800; letter-spacing: .025em; text-transform: uppercase; }
.state-pill.good { color: var(--green); border-color: rgba(72,225,155,.19); background: rgba(72,225,155,.05); }
.state-pill.warn { color: var(--amber); border-color: rgba(255,200,100,.19); background: rgba(255,200,100,.05); }
.state-pill.bad { color: var(--red); border-color: rgba(255,109,125,.2); background: rgba(255,109,125,.05); }
.fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 14px; border: 1px solid rgba(128,178,215,.08); border-radius: 11px; overflow: hidden; background: rgba(128,178,215,.05); }
.fact { min-width: 0; display: grid; gap: 3px; padding: 9px 10px; background: rgba(5,15,24,.82); }
.fact-key { color: #557287; font-size: 8px; text-transform: uppercase; letter-spacing: .05em; }
.fact-value { color: #abc2d2; font-size: 9px; overflow-wrap: anywhere; }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 999px; color: #7894a8; font-size: 8px; }
.chip i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.chip.good { color: var(--green); border-color: rgba(72,225,155,.16); }
.chip.warn { color: var(--amber); border-color: rgba(255,200,100,.16); }
.chip.bad { color: var(--red); border-color: rgba(255,109,125,.16); }
.inline-alert { display: grid; gap: 3px; margin-top: 10px; padding: 9px 10px; border-radius: 9px; font-size: 9px; overflow-wrap: anywhere; }
.inline-alert strong { font-size: 9px; }
.inline-alert.warn { color: #d8ae63; background: rgba(255,200,100,.065); border: 1px solid rgba(255,200,100,.11); }
.inline-alert.bad { color: #d47c87; background: rgba(255,109,125,.065); border: 1px solid rgba(255,109,125,.11); }
.muted-line, .card-foot { margin-top: 10px; color: #4e6d82; font-size: 8px; overflow-wrap: anywhere; }

/* Nodes */
.traffic-block { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 14px; }
.traffic-stat { padding: 10px; border: 1px solid rgba(128,178,215,.08); border-radius: 10px; background: rgba(3,13,21,.45); }
.traffic-stat strong { display: block; margin-top: 5px; font-size: 13px; font-weight: 700; }
.traffic-label { color: #567489; font-size: 8px; }
.session-bar { margin-top: 11px; }
.session-meta { display: flex; justify-content: space-between; color: #5e7a8f; font-size: 8px; }
.session-meta strong { color: #9cb5c6; }
.bar-track { height: 4px; margin-top: 6px; border-radius: 99px; background: rgba(112,157,187,.10); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--blue)); box-shadow: 0 0 8px rgba(97,222,250,.25); }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 13px; }
.service-cell { min-height: 45px; display: grid; align-content: center; gap: 4px; padding: 7px; border: 1px solid rgba(128,178,215,.07); border-radius: 9px; background: rgba(5,15,24,.48); }
.service-name { color: #536f84; font-size: 7px; text-transform: uppercase; }
.service-cell strong { color: #9eb7c8; font-size: 9px; }
.service-cell .state-pill { width: fit-content; }

/* Network */
.path-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.path-card { padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: rgba(9,22,34,.78); }
.path-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.path-domain { font-size: 13px; font-weight: 800; }
.path-flow, .tunnel-state { display: flex; align-items: stretch; gap: 7px; margin-top: 17px; }
.flow-node { flex: 1; min-width: 0; padding: 10px; border: 1px solid rgba(128,178,215,.10); border-radius: 10px; background: rgba(3,13,22,.55); }
.flow-node strong { display: block; margin-top: 5px; color: #b9cfde; font-size: 9px; overflow-wrap: anywhere; }
.flow-label { color: #516e82; font-size: 7px; font-weight: 800; letter-spacing: .08em; }
.flow-node.relay { border-color: rgba(157,140,255,.16); box-shadow: inset 0 0 20px rgba(157,140,255,.025); }
.flow-node.target, .flow-node.good { border-color: rgba(72,225,155,.15); }
.flow-node.warn { border-color: rgba(255,200,100,.18); }
.flow-node.bad { border-color: rgba(255,109,125,.18); }
.flow-arrow { align-self: center; color: #3f6075; font-size: 12px; }
.path-details { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 12px; }
.path-detail { min-width: 0; display: grid; gap: 4px; padding: 7px; border-radius: 8px; background: rgba(255,255,255,.018); }
.path-detail span { color: #4d6b80; font-size: 7px; text-transform: uppercase; }
.path-detail strong { color: #8ba5b8; font-size: 8px; overflow-wrap: anywhere; }
.section-divider { display: flex; align-items: center; gap: 13px; margin: 27px 0 11px; color: #648298; font-size: 9px; text-transform: uppercase; letter-spacing: .11em; }
.section-divider::before, .section-divider::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.ops-list { display: grid; gap: 5px; }
.op-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid rgba(128,178,215,.08); border-radius: 10px; background: rgba(7,18,28,.62); }
.op-main, .op-side { display: flex; align-items: center; gap: 8px; }
.op-main strong { color: #a9c1d1; font-size: 9px; }
.op-id { color: #507086; font-size: 8px; font-variant-numeric: tabular-nums; }
.op-target { color: #6e8da1; font-size: 8px; }
.op-time { color: #506c80; font-size: 8px; }
.tiny-flag { padding: 3px 5px; border-radius: 5px; color: var(--violet); background: rgba(157,140,255,.07); font-size: 7px; font-weight: 800; }
.op-error { flex-basis: 100%; color: #b66e78; font-size: 8px; overflow-wrap: anywhere; }

/* Routers / diagnostics */
.tunnel-state { margin-top: 14px; }
.timeline { display: grid; gap: 0; max-width: 950px; }
.timeline-row { display: grid; grid-template-columns: 26px 1fr; }
.timeline-rail { position: relative; display: flex; justify-content: center; }
.timeline-rail::after { content: ''; position: absolute; top: 18px; bottom: -2px; width: 1px; background: var(--line); }
.timeline-row:last-child .timeline-rail::after { display: none; }
.timeline-dot { position: relative; z-index: 1; width: 9px; height: 9px; margin-top: 16px; border: 2px solid var(--bg); border-radius: 50%; background: #587286; box-shadow: 0 0 0 1px #587286; }
.timeline-dot.good { background: var(--green); box-shadow: 0 0 0 1px var(--green), 0 0 12px rgba(72,225,155,.25); }
.timeline-dot.warn { background: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.timeline-dot.bad { background: var(--red); box-shadow: 0 0 0 1px var(--red); }
.timeline-card { margin-bottom: 8px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(8,21,32,.75); }
.diagnostic-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; margin-top: 11px; }
.diagnostic-stat { padding: 7px 8px; border-radius: 8px; background: rgba(255,255,255,.018); }
.diagnostic-stat span { display: block; color: #506c80; font-size: 7px; text-transform: uppercase; }
.diagnostic-stat strong { display: block; margin-top: 4px; color: #9fb7c7; font-size: 9px; }
.diagnostic-meta { margin-top: 9px; color: #4e697c; font-size: 8px; }

.empty-state { grid-column: 1 / -1; min-height: 210px; display: grid; place-items: center; align-content: center; gap: 7px; border: 1px dashed rgba(128,178,215,.15); border-radius: 17px; color: #658298; text-align: center; }
.empty-state strong { color: #a2bac9; font-size: 12px; }
.empty-state span { font-size: 9px; }
.empty-orbit { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 4px; border: 1px solid rgba(97,222,250,.17); border-radius: 50%; color: var(--cyan); background: rgba(97,222,250,.035); }
.compact-empty { min-height: 150px; }
.statusbar { min-height: 37px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 30px; border-top: 1px solid var(--line); color: #415f73; font-size: 8px; }
#statusLine { display: flex; align-items: center; gap: 7px; }
.status-led { width: 5px; height: 5px; border-radius: 50%; background: #5b778a; }
.status-led.good { background: var(--green); box-shadow: 0 0 10px rgba(72,225,155,.45); }
.status-led.warn, .status-led.busy { background: var(--amber); }
.status-led.bad { background: var(--red); }
.mobile-backdrop { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes enter { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .node-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 850px) {
  :root { --sidebar: 230px; }
  .sidebar { transform: translateX(-105%); transition: transform .22s ease; box-shadow: 25px 0 60px rgba(0,0,0,.25); }
  .sidebar.open { transform: translateX(0); }
  .workspace { margin-left: 0; }
  .mobile-menu { display: grid; }
  .mobile-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(0,0,0,.46); backdrop-filter: blur(3px); }
  .mobile-backdrop.show { display: block; }
  .topbar { height: 72px; padding: 11px 16px; }
  .content { padding: 16px 14px 28px; }
  .hero-card { min-height: auto; padding: 25px 22px; }
  .hero-meta { min-width: 150px; }
  .hero-clock { font-size: 28px; }
  .dashboard-grid, .path-grid { grid-template-columns: 1fr; }
  .card-grid, .node-grid { grid-template-columns: 1fr; }
  .section-intro { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .statusbar { padding: 8px 14px; }
  .statusbar > div:last-child { display: none; }
  .login-shell { grid-template-columns: 1fr; gap: 30px; width: min(560px, 100%); }
  .login-brand { text-align: center; }
  .brand-mark-large { margin-left: auto; margin-right: auto; }
  .login-brand p { margin-left: auto; margin-right: auto; }
  .login-flags { justify-content: center; }
}

@media (max-width: 580px) {
  .login-body { padding: 18px 14px; place-items: start center; }
  .login-shell { padding-top: 8vh; }
  .login-brand h1 { font-size: 47px; }
  .login-brand p { font-size: 13px; }
  .login-card { padding: 22px; border-radius: 21px; }
  .topbar-right .readonly-pill { display: none; }
  .environment-pill { padding: 0 8px; }
  .hero-card { display: block; }
  .hero-copy h2 { font-size: 31px; }
  .hero-meta { margin-top: 27px; text-align: left; }
  .sync-line { justify-content: flex-start; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { min-height: 112px; }
  .metric-value { font-size: 21px; }
  .mini-node { align-items: flex-start; }
  .mini-node-stats { display: grid; justify-items: end; gap: 3px; }
  .path-flow, .tunnel-state { gap: 4px; }
  .flow-node { padding: 8px 7px; }
  .flow-arrow { font-size: 9px; }
  .path-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact-grid { grid-template-columns: 1fr 1fr; }
  .service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .diagnostic-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .op-row { align-items: flex-start; }
  .op-side { width: 100%; justify-content: flex-start; }
}
