:root {
  --bg: #071014;
  --surface: rgba(14, 28, 34, 0.86);
  --surface-strong: #102129;
  --line: rgba(167, 202, 207, 0.14);
  --text: #edf7f5;
  --muted: #8ca6a8;
  --teal: #52dbc7;
  --teal-soft: rgba(82, 219, 199, 0.12);
  --coral: #ff896f;
  --amber: #f8c66a;
  --blue: #75aef6;
  --danger: #ff6f76;
  --radius: 18px;
  --shadow: 0 20px 80px rgba(0, 0, 0, 0.28);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 70% -10%, #12333a 0, transparent 35%), var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
[hidden] { display: none !important; }

.ambient { position: fixed; z-index: -1; border-radius: 999px; filter: blur(100px); opacity: .18; pointer-events: none; }
.ambient-one { width: 440px; height: 440px; right: 5vw; top: 12vh; background: #1cb7a9; }
.ambient-two { width: 320px; height: 320px; left: 14vw; bottom: -80px; background: #db694f; opacity: .09; }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-card { width: min(600px, 100%); padding: 54px; border: 1px solid var(--line); border-radius: 28px; background: linear-gradient(150deg, rgba(18, 38, 45, .96), rgba(8, 19, 24, .94)); box-shadow: var(--shadow); }
.login-card h1 { margin: 12px 0 16px; max-width: 520px; font-size: clamp(34px, 6vw, 58px); line-height: 1.05; letter-spacing: -.045em; }
.login-copy { max-width: 500px; color: var(--muted); line-height: 1.8; }
.login-form { margin-top: 34px; }
.login-form label, .modal label { display: block; margin: 16px 0 8px; color: #b9cccd; font-size: 13px; font-weight: 650; }
.token-row { display: flex; gap: 10px; }
input, select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; color: var(--text); background: rgba(4, 14, 18, .8); }
input::placeholder { color: #587276; }
.login-footnote { margin: 20px 0 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.signal-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 16px var(--teal); }
.form-error, .global-error { min-height: 18px; color: #ff989d; font-size: 13px; }

.brand-mark { display: flex; align-items: end; gap: 3px; width: 30px; height: 30px; padding: 6px; border-radius: 9px; background: var(--teal); box-shadow: 0 0 28px rgba(82, 219, 199, .22); }
.brand-mark span { display: block; width: 4px; border-radius: 4px; background: #071a1c; }
.brand-mark span:nth-child(1) { height: 9px; }.brand-mark span:nth-child(2) { height: 17px; }.brand-mark span:nth-child(3) { height: 13px; }
.brand-mark.large { width: 44px; height: 44px; padding: 9px; border-radius: 13px; }
.brand-mark.large span { width: 6px; }.brand-mark.large span:nth-child(1) { height: 14px; }.brand-mark.large span:nth-child(2) { height: 25px; }.brand-mark.large span:nth-child(3) { height: 19px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 242px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 20px; border-right: 1px solid var(--line); background: rgba(6, 16, 20, .82); backdrop-filter: blur(22px); }
.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 0 8px 30px; }
.brand-lockup strong { display: block; font-size: 17px; letter-spacing: -.02em; }.brand-lockup small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .13em; }
.main-nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 13px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; cursor: pointer; text-align: left; }
.nav-item span { font-size: 10px; letter-spacing: .12em; color: #527177; }.nav-item:hover { color: var(--text); background: rgba(255,255,255,.03); }.nav-item.active { color: #dffbf5; background: var(--teal-soft); }.nav-item.active span { color: var(--teal); }
.sidebar-foot { margin-top: auto; padding: 20px 8px 0; border-top: 1px solid var(--line); }
.controller-state { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }.controller-state small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .16em; }.controller-state strong { font-size: 12px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 5px rgba(82,219,199,.08), 0 0 18px rgba(82,219,199,.45); }

.main-content { min-width: 0; padding: 30px clamp(24px, 4vw, 56px) 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.topbar h1 { margin: 5px 0 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
.eyebrow { margin: 0; color: var(--teal); font-size: 10px; font-weight: 750; letter-spacing: .17em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }.utc-clock { min-width: 92px; padding-right: 12px; text-align: right; }.utc-clock small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .14em; }.utc-clock time { font-variant-numeric: tabular-nums; font-size: 14px; }
.primary-button, .secondary-button, .icon-button { border: 0; border-radius: 11px; cursor: pointer; font-weight: 700; }
.primary-button { padding: 13px 18px; color: #06201e; background: var(--teal); box-shadow: 0 8px 28px rgba(82,219,199,.14); }.primary-button:hover { background: #70ead7; }.primary-button.compact { padding: 10px 14px; font-size: 13px; }
.secondary-button { padding: 11px 16px; background: rgba(255,255,255,.06); }.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); color: var(--muted); background: var(--surface); font-size: 20px; }.icon-button:hover { color: var(--teal); }
.text-button { padding: 0; border: 0; color: var(--muted); background: none; cursor: pointer; font-size: 12px; }.text-button:hover { color: var(--teal); }

.view-section { display: none; animation: rise .26s ease both; }.view-section.active { display: block; } @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(18,38,45,.86), rgba(9,22,27,.82)); box-shadow: 0 18px 50px rgba(0,0,0,.12); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }.panel-heading h2, .section-intro h2 { margin: 7px 0 0; font-size: 19px; letter-spacing: -.025em; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .8fr); gap: 16px; }
.flow-card, .attention-card { padding: 24px; }
.flow-map { display: grid; grid-template-columns: 1fr 98px 1fr 98px 1fr; align-items: center; gap: 8px; margin: 31px 0 24px; }
.flow-node { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(4,14,18,.48); }.flow-node small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; letter-spacing: .12em; }.flow-node strong { font-size: 15px; }.flow-node p { margin: 4px 0 0; color: var(--muted); font-size: 10px; white-space: nowrap; }.node-index { flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--teal); background: var(--teal-soft); font: 700 11px ui-monospace, monospace; }
.flow-node.storage .node-index { color: var(--coral); background: rgba(255,137,111,.12); }.flow-node.controller { border-color: rgba(82,219,199,.32); }
.flow-link { position: relative; color: var(--muted); text-align: center; font-size: 8px; }.flow-link i { display: block; position: relative; height: 1px; margin-top: 8px; background: linear-gradient(90deg, var(--teal), rgba(82,219,199,.15)); }.flow-link i::after { content: ""; position: absolute; right: -1px; top: -3px; border-left: 5px solid var(--teal); border-top: 3px solid transparent; border-bottom: 3px solid transparent; }.flow-link.accent i { background: linear-gradient(90deg, var(--coral), rgba(255,137,111,.15)); }.flow-link.accent i::after { border-left-color: var(--coral); }
.flow-note { display: flex; gap: 12px; padding: 13px 15px; border-radius: 12px; background: rgba(82,219,199,.06); }.flow-note > span { color: var(--teal); }.flow-note p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }.flow-note strong { color: #cce4e1; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 9px; font-weight: 750; letter-spacing: .06em; }.status-pill.online, .status-pill.ready { color: #77ead6; background: rgba(82,219,199,.1); }.status-pill.warning { color: var(--amber); background: rgba(248,198,106,.1); }.status-pill.danger { color: #ff969b; background: rgba(255,111,118,.1); }.status-pill.info { color: #9bc7ff; background: rgba(117,174,246,.1); }.status-pill.neutral { color: var(--muted); background: rgba(255,255,255,.05); }
.counter { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 10px; color: var(--coral); background: rgba(255,137,111,.1); font-weight: 800; }
.attention-list { display: grid; gap: 9px; margin-top: 22px; }.attention-item { display: grid; grid-template-columns: 8px 1fr; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); }.attention-item:last-child { border-bottom: 0; }.attention-item i { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--amber); }.attention-item.danger i { background: var(--danger); }.attention-item strong { display: block; font-size: 12px; }.attention-item p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.empty-state { margin: 18px 0; color: var(--muted); font-size: 12px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }.metric-card { position: relative; overflow: hidden; min-height: 126px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: rgba(12,27,33,.7); }.metric-card::after { content: ""; position: absolute; width: 84px; height: 84px; right: -26px; bottom: -35px; border: 1px solid rgba(82,219,199,.16); border-radius: 50%; }.metric-card.coral::after { border-color: rgba(255,137,111,.2); }.metric-card p { margin: 0 0 14px; color: var(--muted); font-size: 11px; }.metric-card strong { display: block; font-size: 30px; letter-spacing: -.04em; }.metric-card span { color: var(--muted); font-size: 10px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(270px, .75fr); gap: 16px; }.jobs-panel, .node-snapshot-panel { padding: 22px; }
.table-wrap { overflow-x: auto; margin-top: 18px; }.table-wrap.wide { margin-top: 0; } table { width: 100%; border-collapse: collapse; } th { padding: 11px 12px; color: #5f7b7e; font-size: 9px; text-align: left; text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; } td { padding: 14px 12px; border-top: 1px solid var(--line); color: #c8d9d8; font-size: 11px; vertical-align: middle; } tbody tr { transition: background .16s; } tbody tr:hover { background: rgba(255,255,255,.018); }.cell-main { display: block; color: var(--text); font-size: 12px; font-weight: 680; }.cell-sub { display: block; max-width: 260px; margin-top: 3px; overflow: hidden; color: var(--muted); font: 9px ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }.row-action { border: 0; color: var(--teal); background: none; cursor: pointer; font-size: 16px; }
.snapshot-list { display: grid; gap: 17px; margin-top: 22px; }.snapshot-item header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }.snapshot-item strong { font-size: 11px; }.snapshot-item small { color: var(--muted); font-size: 9px; }.bar { height: 5px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.06); }.bar span { display: block; height: 100%; border-radius: inherit; background: var(--teal); }.bar.warning span { background: var(--amber); }.bar.danger span { background: var(--danger); }

.section-intro { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 8px 0 22px; }.section-intro h2 { font-size: 25px; }.section-intro p:not(.eyebrow) { max-width: 650px; margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }.section-intro select { width: 190px; }
.nodes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px; }.node-card { padding: 21px; }.node-card-header { display: flex; justify-content: space-between; gap: 14px; }.node-card h3 { margin: 7px 0 0; font-size: 16px; }.node-card .roles { display: flex; flex-wrap: wrap; gap: 6px; margin: 15px 0 20px; }.role-chip { padding: 5px 8px; border-radius: 6px; color: #8fc8c1; background: rgba(82,219,199,.07); font: 9px ui-monospace, monospace; }.resource-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }.resource-stat p { display: flex; justify-content: space-between; margin: 0; color: var(--muted); font-size: 9px; }.resource-stat p strong { color: #cfe1df; }.node-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 21px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; }.danger-button { border: 0; color: #ff969b; background: none; cursor: pointer; font-size: 10px; }.enable-button { color: var(--teal); }
.rooms-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }.room-card { padding: 21px; }.room-card header { display: flex; align-items: flex-start; justify-content: space-between; }.room-card h3 { margin: 5px 0 0; font-size: 17px; }.room-card dl { display: grid; grid-template-columns: 90px 1fr; gap: 10px; margin: 22px 0; font-size: 10px; }.room-card dt { color: var(--muted); }.room-card dd { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.room-card footer { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 14px; }

.modal { width: min(500px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 20px; color: var(--text); background: #0d2026; box-shadow: var(--shadow); }.modal::backdrop { background: rgba(1,8,11,.72); backdrop-filter: blur(8px); }.modal form { padding: 25px; }.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; }.modal-heading h2 { margin: 7px 0 0; }.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }.close-button { width: 34px; height: 34px; border: 0; border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.05); cursor: pointer; }.modal-actions .close-button { width: auto; height: auto; }
.drawer { position: fixed; z-index: 20; inset: 0; pointer-events: none; visibility: hidden; }.drawer.open { pointer-events: auto; visibility: visible; }.drawer-backdrop { position: absolute; inset: 0; background: rgba(1,8,11,.66); opacity: 0; transition: opacity .25s; }.drawer.open .drawer-backdrop { opacity: 1; }.drawer-panel { position: absolute; top: 0; right: 0; width: min(620px, 94vw); height: 100%; padding: 26px; overflow-y: auto; border-left: 1px solid var(--line); background: #0b1b21; transform: translateX(100%); transition: transform .28s ease; box-shadow: -30px 0 80px rgba(0,0,0,.28); }.drawer.open .drawer-panel { transform: translateX(0); }.drawer-panel > header { display: flex; align-items: flex-start; justify-content: space-between; padding-bottom: 20px; border-bottom: 1px solid var(--line); }.drawer-panel h2 { margin: 7px 0 0; font-size: 20px; }.drawer-content { padding: 20px 0; }.detail-hero { padding: 18px; border-radius: 14px; background: rgba(82,219,199,.06); }.detail-hero h3 { margin: 8px 0; font: 700 13px ui-monospace, monospace; word-break: break-all; }.detail-hero p { margin: 0; color: var(--muted); font-size: 10px; }.detail-section { margin-top: 25px; }.detail-section h3 { margin: 0 0 12px; color: #b8cdcb; font-size: 12px; }.detail-list { display: grid; gap: 8px; }.detail-item { padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,255,255,.02); }.detail-item header { display: flex; justify-content: space-between; gap: 10px; }.detail-item strong { font-size: 11px; }.detail-item p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; word-break: break-word; }.clip-card { padding: 14px; border-left: 2px solid var(--coral); border-radius: 0 10px 10px 0; background: rgba(255,137,111,.05); }.clip-card h4 { margin: 0 0 7px; font-size: 12px; }.clip-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.toast { position: fixed; z-index: 40; right: 26px; bottom: 26px; max-width: 360px; padding: 12px 16px; border: 1px solid rgba(82,219,199,.26); border-radius: 11px; color: #d9f7f2; background: #102a2e; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; font-size: 11px; }.toast.show { opacity: 1; transform: translateY(0); }
.global-error { margin: -12px 0 18px; padding: 10px 13px; border: 1px solid rgba(255,111,118,.18); border-radius: 10px; background: rgba(255,111,118,.06); }

@media (max-width: 1100px) { .hero-grid, .content-grid { grid-template-columns: 1fr; }.metric-grid { grid-template-columns: repeat(2, 1fr); }.flow-map { grid-template-columns: 1fr 65px 1fr 65px 1fr; }.flow-node { padding: 12px; }.flow-node p { display: none; } }
@media (max-width: 760px) { .app-shell { grid-template-columns: 1fr; }.sidebar { position: fixed; z-index: 10; top: auto; bottom: 0; width: 100%; height: auto; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line); }.brand-lockup, .sidebar-foot { display: none; }.main-nav { grid-template-columns: repeat(4, 1fr); gap: 4px; }.nav-item { justify-content: center; padding: 9px 5px; font-size: 10px; }.nav-item span { display: none; }.main-content { padding: 22px 16px 92px; }.topbar { align-items: flex-start; }.utc-clock, #add-room-button { display: none; }.flow-map { grid-template-columns: 1fr; gap: 8px; }.flow-link { height: 25px; }.flow-link i { width: 1px; height: 20px; margin: 4px auto; background: var(--teal); }.flow-link i::after { top: auto; right: -3px; bottom: -1px; transform: rotate(90deg); }.metric-grid { grid-template-columns: repeat(2, 1fr); }.metric-card { min-height: 112px; padding: 16px; }.section-intro { align-items: flex-start; flex-direction: column; }.section-intro select { width: 100%; }.token-row { flex-direction: column; }.login-card { padding: 32px 24px; }.login-card h1 { font-size: 38px; } }
@media (max-width: 430px) { .metric-grid { grid-template-columns: 1fr; }.topbar h1 { font-size: 29px; }.panel, .flow-card, .attention-card, .jobs-panel, .node-snapshot-panel { border-radius: 14px; }.resource-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
