/* Production parity layer for the approved localhost:5173 console. */
:root,
html[data-theme="light"] {
  --navy: #0b1045;
  --ink: #17182f;
  --muted: #697086;
  --paper: #f3f4f9;
  --surface: #fff;
  --line: #e1e3ec;
  --violet: #6f61d9;
  --violet-soft: #ece9ff;
  --blue: #3d76d7;
  --blue-soft: #e7f0ff;
  --green: #16835a;
  --green-soft: #e5f5ee;
  --amber: #9b6507;
  --amber-soft: #fff1d4;
  --red: #b63c50;
  --red-soft: #fde9ed;
  --canvas: var(--paper);
  --panel: var(--surface);
  --soft: var(--paper);
}
html[data-theme="dark"] {
  --navy: #0c111c;
  --ink: #edf2f7;
  --muted: #9aa7b6;
  --paper: #090d14;
  --surface: #131a24;
  --line: #293342;
  --violet: #9b8cff;
  --violet-soft: #292641;
  --blue: #78aef8;
  --blue-soft: #182a40;
  --green: #48cc90;
  --green-soft: #17352b;
  --amber: #e7b35f;
  --amber-soft: #3b2e19;
  --red: #f07c89;
  --red-soft: #3c2229;
  --canvas: var(--paper);
  --panel: var(--surface);
  --soft: #0e151e;
}
html, body { min-width: 320px; background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(111,97,217,.28); outline-offset: 2px; }

/* Exact dashboard shell. */
.app-shell { min-height: 100vh; padding: 18px 18px 18px 264px; background: var(--paper); }
.sidebar { inset: 18px auto 18px 18px; width: 228px; padding: 18px 14px 14px; color: #f8f8ff; background: var(--navy); border: 0; border-radius: 20px; box-shadow: 0 22px 60px rgba(11,16,69,.22); }
.brand-row { display: flex; align-items: center; gap: 10px; padding: 2px 4px 18px; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; overflow: hidden; background: #20265d; border-radius: 11px; }
.brand-mark img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; }
.brand-row > div:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.brand-row strong { font-size: 17px; letter-spacing: -.03em; }
.brand-row span { color: #aeb4dd; font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.close-nav { display: none; margin-left: auto; padding: 6px; color: #d7daf1; background: transparent; border: 0; border-radius: 7px; }
.account-dock { display: grid; grid-template-columns: minmax(0,1fr) 38px; align-items: stretch; gap: 5px; padding: 5px; background: #191f58; border: 1px solid #30366e; border-radius: 12px; }
.operator-card { width: 100%; min-width: 0; min-height: 48px; display: flex; align-items: center; gap: 9px; margin: 0; padding: 5px 6px; color: #f8f9ff; text-align: left; background: transparent; border: 0; border-radius: 8px; }
.operator-card:hover { background: rgba(255,255,255,.06); }
.operator-card > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.operator-card strong { font-size: 12px; }
.operator-card small { color: #9da5d3; font-size: 10px; }
.account-dock .logout-button { width: 38px; min-height: 38px; display: grid; place-items: center; align-self: center; padding: 0; color: #bfc5e8; background: transparent; border: 0; border-left: 1px solid #343b75; border-radius: 0 8px 8px 0; }
.account-dock .logout-button:hover { color: #fff; background: rgba(255,255,255,.07); }
.admin-avatar { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; color: #fff; background: rgba(147,134,255,.24); border-radius: 10px; font-size: 10px; font-weight: 850; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav button, .sidebar-foot > button { position: relative; display: flex; align-items: center; grid-template-columns: none; gap: 11px; width: 100%; min-height: 42px; padding: 0 11px; color: #b9bfdf; background: transparent; border: 0; border-radius: 9px; text-align: left; }
.sidebar nav button:hover, .sidebar-foot > button:hover { color: #fff; background: #171d55; }
.sidebar nav button.active { color: #fff; background: #242a63; }
.sidebar nav button.active::before { position: absolute; inset: auto auto auto -6px; width: 3px; height: 22px; background: #9d92ff; border-radius: 9px; content: ""; }
.sidebar nav button > i { width: 19px; color: inherit; font-size: 19px; text-align: center; }
.sidebar nav button > span, .sidebar-foot > button > span { flex: 1; font-size: 13px; font-weight: 650; }
.sidebar nav button small { min-width: 24px; padding: 2px 6px; color: #cad0ee; background: #343a73; border-radius: 999px; font-size: 10px; text-align: center; }
.sidebar nav button small:empty { visibility: hidden; }
.sidebar-foot { display: grid; gap: 9px; margin-top: auto; }
.sidebar-health { display: grid; gap: 3px; padding: 11px; background: #151b50; border-radius: 10px; }
.sidebar-health span { display: flex; align-items: center; color: #c9f3df; font-size: 11px; font-weight: 700; }
.sidebar-health small { padding-left: 0; color: #8f97c5; font-size: 10px; }
.sidebar-foot > button { color: #aab1d6; }
.main-canvas { min-height: calc(100vh - 36px); overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 16px 46px rgba(29,32,67,.08); }
.topbar { position: static; min-height: 66px; height: auto; padding: 0 28px; color: var(--ink); background: var(--surface); border: 0; border-bottom: 1px solid var(--line); }
.breadcrumb { gap: 8px; font-size: 12px; }
.breadcrumb span { color: var(--muted); }
.breadcrumb span::after { margin-left: 8px; color: #b4b8c7; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.freshness { display: flex; align-items: center; gap: 8px; margin-right: 4px; color: var(--muted); font-size: 11px; font-weight: 650; }
.freshness i { margin-right: 0; }
.icon-action, .avatar { display: grid; place-items: center; width: 36px; height: 36px; color: #525870; background: #f7f7fa; border: 1px solid var(--line); border-radius: 9px; }
.avatar { color: #fff; background: var(--violet); border-color: var(--violet); font-size: 11px; font-weight: 800; }
.content { max-width: 1460px; padding: 32px 34px 50px; margin: 0 auto; }

/* Exact overview hierarchy. */
.page-header { align-items: flex-end; gap: 28px; margin-bottom: 24px; }
.eyebrow, .panel-kicker { margin: 0 0 5px; color: var(--violet); font: 800 10px/1.4 ui-monospace,"SFMono-Regular",Consolas,monospace; letter-spacing: .12em; text-transform: uppercase; }
.page-header h1 { font-size: clamp(31px,3.1vw,43px); line-height: 1.05; letter-spacing: -.055em; }
.page-header > div:first-child > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.page-actions { align-items: center; gap: 10px; }
.button { min-height: 40px; padding: 0 15px; border: 0; border-radius: 9px; font-size: 12px; font-weight: 750; }
.button-light { display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: #fff; background: var(--violet); }
.summary-banner { position: relative; grid-template-columns: minmax(0,1fr) 390px; min-height: 270px; margin-bottom: 18px; overflow: hidden; color: #fff; background: linear-gradient(130deg,#0b1045 0%,#151b58 100%); border: 0; border-radius: 17px; box-shadow: none; }
.summary-copy { padding: 32px 35px; }
.summary-copy h2 { margin: 17px 0 9px; font-size: clamp(27px,3vw,39px); line-height: 1.05; letter-spacing: -.05em; }
.summary-copy p { max-width: 580px; margin: 0; color: #c7cbea; font-size: 13px; }
.summary-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.summary-links button { display: inline-flex; align-items: center; gap: 7px; min-height: 35px; padding: 0 11px; color: #eef0ff; background: #242a63; border: 1px solid #394078; border-radius: 8px; font-size: 11px; font-weight: 750; }
.banner-orbit { position: relative; width: auto; min-height: 270px; margin: 0; overflow: hidden; animation: none; }
.banner-orbit img { position: absolute; z-index: 2; inset: auto 22px -66px auto; width: 330px; height: 330px; object-fit: contain; image-rendering: pixelated; transform: none; filter: drop-shadow(0 18px 25px rgba(0,0,20,.35)); }
.banner-orbit canvas { position: absolute; z-index: 1; inset: auto 0 -45px auto; width: 360px; height: 360px; transform: none; }
.banner-orbit canvas.front { z-index: 3; }
.metric-grid { gap: 12px; margin-bottom: 18px; }
.metric-card { min-height: 104px; display: flex; align-items: center; flex-direction: row; justify-content: flex-start; gap: 13px; padding: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 13px; }
.metric-icon { width: 39px; height: 39px; border-radius: 10px; font-size: 23px; }
.metric-violet { color: var(--violet); background: var(--violet-soft); }
.metric-blue { color: var(--blue); background: var(--blue-soft); }
.metric-green { color: var(--green); background: var(--green-soft); }
.metric-amber { color: var(--amber); background: var(--amber-soft); }
.metric-copy { display: flex; flex-direction: column; min-width: 0; }
.metric-copy > span { color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .03em; text-transform: uppercase; }
.metric-copy strong { margin-top: 1px; color: var(--ink); font-size: 24px; line-height: 1.2; letter-spacing: -.04em; }
.metric-copy small { color: var(--muted); font-size: 10px; }
.dashboard-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.fleet-snapshot, .attention-panel { padding: 20px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.panel-heading h2 { margin: 0; color: var(--ink); font-size: 18px; letter-spacing: -.035em; }
.text-link { color: var(--violet); background: transparent; border: 0; font-size: 11px; font-weight: 800; }
.node-compact-list { display: grid; gap: 8px; }
.node-compact { padding: 11px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.node-title { display: flex; align-items: center; gap: 10px; }
.instance-icon { display: grid; place-items: center; flex: 0 0 auto; width: 38px; height: 38px; background: #252c64; border-radius: 10px; }
.instance-icon img { width: 21px; height: 21px; }
.node-title > div:nth-child(2) { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.node-title strong { font-size: 12px; }
.node-title span { color: var(--muted); font-size: 10px; }
.node-capacity { margin: 10px 0 5px; color: var(--muted); font-size: 10px; }
.progress, .usage-mini { height: 5px; overflow: hidden; background: var(--line); border-radius: 99px; }
.progress span, .usage-mini span { display: block; height: 100%; background: var(--violet); border-radius: inherit; }
progress.progress { display: block; width: 100%; appearance: none; border: 0; }
progress.progress::-webkit-progress-bar { background: var(--line); }
progress.progress::-webkit-progress-value { background: var(--violet); border-radius: 99px; }
progress.progress::-moz-progress-bar { background: var(--violet); border-radius: 99px; }
.activity-row { min-height: 64px; padding: 0; border-top: 1px solid var(--line); border-bottom: 0; }
.activity-row:first-child { border-top: 0; }
.activity-row > div { display: flex; flex-direction: column; }
.activity-row strong { font-size: 11px; }
.activity-row span, .activity-row time { color: var(--muted); font-size: 10px; }
.activity-icon { width: 31px; height: 31px; color: var(--violet); background: var(--violet-soft); border-radius: 9px; }
.badge { min-height: 23px; padding: 0 8px; gap: 5px; border-radius: 999px; font-size: 9px; font-weight: 800; text-transform: capitalize; white-space: nowrap; }
.badge-dot { width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.badge-green { color: var(--green); background: var(--green-soft); }
.badge-amber { color: var(--amber); background: var(--amber-soft); }
.badge-red { color: var(--red); background: var(--red-soft); }
.badge-blue { color: var(--blue); background: var(--blue-soft); }
.badge-violet { color: var(--violet); background: var(--violet-soft); }
.badge-neutral { color: var(--muted); background: var(--paper); }
.server-icon { overflow: hidden; background: #252c64; }
.server-icon img { width: 20px; height: 20px; }

/* Exact localhost login composition. */
.login-shell { position: relative; isolation: isolate; display: flex; align-items: center; min-height: 100vh; padding: 56px 24px; overflow: hidden; background: #080d16; }
.login-shell .cosmic-backdrop { position: fixed; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; background: linear-gradient(145deg,#070b14 0%,#0e1728 56%,#1b1527 100%); }
.starfield { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-shell .planet-scene { position: absolute; left: calc(50% + clamp(220px,18vw,270px)); right: auto; top: 50%; bottom: auto; width: min(50vw,720px); aspect-ratio: 1; margin: 0; translate: -50% -50%; opacity: .96; filter: drop-shadow(0 34px 62px rgba(0,0,12,.56)); animation: none; }
.planet-scene img, .planet-scene canvas { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%,-50%); }
.login-shell .background-earth { z-index: 1; width: 72%; height: 72%; object-fit: contain; image-rendering: pixelated; }
.planet-scene canvas { width: 100%; height: 100%; }
.planet-scene .mesh-back { z-index: 0; }
.planet-scene .mesh-front { z-index: 2; }
.login-theme { position: fixed; z-index: 3; top: 24px; right: 24px; display: grid; place-items: center; width: 42px; height: 42px; color: #e9edf6; background: rgba(18,26,39,.88); border: 1px solid rgba(255,255,255,.12); border-radius: 11px; box-shadow: 0 10px 30px rgba(0,0,0,.26); }
.login-layout { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(380px,480px) minmax(360px,1fr); align-items: center; gap: 70px; width: min(1180px,calc(100% - 32px)); min-height: 0; margin: 0 auto; }
.login-art-space { min-width: 0; min-height: 560px; }
.login-card { --ink:#17182f; --muted:#697086; --paper:#f3f4f9; --surface:#fff; --line:#dfe2eb; --violet:#6f61d9; --red:#b63c50; position: relative; z-index: 2; display: block; width: 100%; min-height: 0; padding: 36px; color: var(--ink); background: rgba(255,255,255,.97); border: 1px solid rgba(255,255,255,.72); border-radius: 18px; box-shadow: 0 28px 80px rgba(0,0,0,.32); color-scheme: light; }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 32px; }
.login-brand-mark { display: grid; place-items: center; width: 42px; height: 42px; overflow: hidden; background: #171f36; border-radius: 12px; }
.login-brand-mark img { width: 47px; height: 47px; image-rendering: pixelated; }
.login-brand > span:last-child { display: flex; flex-direction: column; min-width: 96px; overflow: visible; }
.login-brand strong { font-size: 16px; letter-spacing: -.02em; }
.login-brand small { display: block; margin-top: 2px; overflow: visible; color: var(--muted); font-size: 10px; text-overflow: clip; white-space: nowrap; }
.login-intro h1 { margin: 0; color: var(--ink); font-size: 35px; line-height: 1; letter-spacing: -.055em; }
.login-intro > p:not(.eyebrow) { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.login-form { display: grid; gap: 16px; margin-top: 27px; }
.login-form > label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.login-form input { width: 100%; min-height: 44px; padding: 0 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 9px; font-size: 12px; outline: none; }
.login-form input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px color-mix(in srgb,var(--violet) 18%,transparent); }
.password-field { position: relative; display: block; }
.password-field input { min-height: 44px; padding-right: 45px; }
.password-field button { position: absolute; right: 5px; top: 5px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; color: var(--muted); background: transparent; border: 0; border-radius: 7px; font-size: 18px; }
.password-field button:hover { color: var(--ink); background: var(--surface); }
.login-submit { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 45px; margin-top: 3px; color: #fff; background: #6f61d9; border: 0; border-radius: 9px; font-size: 12px; font-weight: 800; }
.login-submit:hover { background: #6356cb; }
.login-error { margin: -4px 0 0; color: var(--red); font-size: 11px; }
.prototype-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 22px 0 0; color: var(--muted); font-size: 10px; }
html[data-theme="dark"] .login-card { --ink:#f1f4fa; --muted:#9da9bb; --paper:#0c131e; --surface:#182231; --line:#2a3748; --violet:#9b8cff; --red:#f07c89; background: rgba(16,23,34,.97); border-color: #2a3545; box-shadow: 0 28px 86px rgba(0,0,0,.48); color-scheme: dark; }
html[data-theme="dark"] .login-brand-mark { background: #1a2636; }
html[data-theme="dark"] .login-submit { background: #7869e7; }
html[data-theme="dark"] .sidebar { background: #0d1420; box-shadow: 0 22px 60px rgba(0,0,0,.3); }
html[data-theme="dark"] .brand-mark { background: #192333; }
html[data-theme="dark"] .account-dock { background: #151e2b; border-color: #273344; }
html[data-theme="dark"] .operator-card { color: #f4f7fa; }
html[data-theme="dark"] .account-dock .logout-button { border-left-color: #2d3a4c; }
html[data-theme="dark"] .sidebar-health { background: #131d29; }
html[data-theme="dark"] .main-canvas, html[data-theme="dark"] .topbar { background: #101720; border-color: #26313f; }
html[data-theme="dark"] .summary-banner { background: linear-gradient(130deg,#111a28 0%,#1c2940 100%); }
html[data-theme="dark"] .node-compact { background: #0e151e; }
html[data-theme="dark"] .icon-action { color: var(--muted); background: #151e29; }

@media (max-width: 1100px) {
  .app-shell { padding-left: 230px; }
  .sidebar { width: 194px; }
  .summary-banner { grid-template-columns: 1fr 315px; }
  .banner-orbit img { right: -5px; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .login-layout { grid-template-columns: minmax(0,470px); grid-template-rows: none; justify-content: center; }
  .login-art-space { display: none; }
  .login-shell .planet-scene { left: auto; right: -190px; top: 68%; width: 520px; translate: 0 -50%; opacity: .16; }
}
@media (max-width: 820px) {
  .app-shell { padding: 0; }
  .main-canvas { min-height: 100vh; border: 0; border-radius: 0; }
  .sidebar { width: 228px; transform: translateX(calc(-100% - 30px)); transition: transform .2s ease; }
  .sidebar.open { transform: none; }
  .close-nav { display: block; }
  .mobile-menu { position: fixed; z-index: 12; top: 16px; left: 16px; display: grid; place-items: center; width: 36px; height: 36px; color: #4e5369; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
  .topbar { padding-left: 65px; }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .login-shell { padding: 68px 16px 30px; }
  .login-layout { width: 100%; }
  .login-card { padding: 27px 22px; }
  .login-theme { top: 16px; right: 16px; }
  .login-shell .planet-scene { right: -265px; top: 72%; width: 520px; opacity: .13; }
  .content { padding: 26px 16px 40px; }
  .topbar { padding-right: 16px; }
  .freshness, .breadcrumb span { display: none; }
  .page-header { align-items: flex-start; flex-direction: column; gap: 14px; }
  .page-actions, .page-actions .button { width: 100%; }
  .summary-banner { grid-template-columns: 1fr; }
  .summary-copy { padding: 25px 22px; }
  .banner-orbit { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
}
