:root {
  --ink: #f4f8f6;
  --muted: #a1afab;
  --dim: #71807c;
  --bg: #070a0a;
  --surface: #101715;
  --surface-2: #151e1b;
  --line: rgba(181, 216, 204, .15);
  --mint: #72efbc;
  --blue: #72bcff;
  --amber: #ffc16b;
  --violet: #b6a2ff;
  --danger: #ff7373;
  --radius: 22px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: radial-gradient(circle at 76% -12%, rgba(68, 175, 134, .2), transparent 34%), radial-gradient(circle at -10% 45%, rgba(65, 111, 151, .09), transparent 28%), linear-gradient(150deg, #0a0f0e 0%, #060909 100%); font: 15px/1.55 Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.noise { position: fixed; inset: 0; pointer-events: none; opacity: .15; z-index: 20; background-image: repeating-radial-gradient(circle at 12px 9px, rgba(255,255,255,.07) 0 1px, transparent 1px 5px); background-size: 7px 7px; mix-blend-mode: soft-light; }
.eyebrow { margin: 0 0 10px; color: var(--mint); font: 750 12px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .18em; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { position: relative; width: min(540px, 100%); padding: 58px; border: 1px solid rgba(181, 216, 204, .19); border-radius: 30px; background: linear-gradient(145deg, rgba(21, 32, 29, .97), rgba(10, 16, 14, .98)); box-shadow: 0 36px 110px rgba(0, 0, 0, .52), inset 0 1px rgba(255,255,255,.04); overflow: hidden; }
.login-card::before { content: ""; position: absolute; width: 240px; height: 240px; right: -100px; top: -120px; border-radius: 50%; background: rgba(121, 242, 192, .08); filter: blur(8px); }
.login-card h1 { margin: 0; font-size: clamp(34px, 6vw, 48px); font-weight: 650; letter-spacing: -.045em; }
.login-copy { margin: 16px 0 38px; color: var(--muted); font-size: 16px; line-height: 1.75; }
.signal-mark { position: relative; width: 62px; height: 62px; display: grid; place-items: center; margin-bottom: 40px; border: 1px solid rgba(121, 242, 192, .26); border-radius: 50%; box-shadow: 0 0 36px rgba(121, 242, 192, .07); }
.signal-mark span { position: absolute; inset: 8px; border: 1px solid rgba(121, 242, 192, .24); border-radius: 50%; }
.signal-mark span:nth-child(2) { inset: 16px; }
.signal-mark i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 20px var(--mint); }
.login-card label { display: block; margin-bottom: 10px; color: #c1cbc8; font-size: 15px; }
.password-row { display: flex; gap: 11px; }
.password-row input { width: 100%; min-width: 0; padding: 16px 17px; color: var(--ink); border: 1px solid rgba(181, 216, 204, .2); border-radius: 13px; outline: none; background: #090e0d; font-size: 16px; transition: border-color .2s, box-shadow .2s; }
.password-row input:focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(121, 242, 192, .1); }
.password-row button { flex: 0 0 auto; padding: 0 27px; border: 0; border-radius: 13px; color: #07110d; background: var(--mint); font-size: 16px; font-weight: 750; box-shadow: 0 8px 26px rgba(114, 239, 188, .14); }
.password-row button:hover { filter: brightness(1.07); }
.password-row button:disabled { opacity: .55; cursor: wait; }
.form-error { min-height: 22px; margin: 11px 0 0; color: #ff9696; font-size: 13px; }
.login-meta { display: flex; align-items: center; gap: 9px; margin-top: 30px; color: var(--dim); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px rgba(121, 242, 192, .8); }

.dashboard { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 10; height: 78px; padding: 0 max(28px, calc((100vw - 1480px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(8, 12, 12, .84); box-shadow: 0 10px 35px rgba(0,0,0,.14); backdrop-filter: blur(20px); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand-mark { position: relative; width: 34px; height: 34px; border: 1px solid rgba(121, 242, 192, .62); border-radius: 50%; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; border-radius: 50%; }
.brand-mark::before { inset: 7px; border: 1px solid rgba(121, 242, 192, .38); }
.brand-mark::after { width: 6px; height: 6px; inset: 13px; background: var(--mint); box-shadow: 0 0 14px var(--mint); }
.brand b, .brand small { display: block; }
.brand b { font-size: 15px; letter-spacing: .14em; }
.brand small { margin-top: 4px; color: var(--dim); font: 650 11px/1 ui-monospace, monospace; letter-spacing: .12em; }
.top-actions { display: flex; align-items: center; gap: 18px; }
.connection-pill { display: flex; align-items: center; gap: 8px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 100px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 13px; }
.connection-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--amber); }
.connection-pill.live i { background: var(--mint); box-shadow: 0 0 10px var(--mint); animation: pulse 1.8s ease-in-out infinite; }
.connection-pill.offline i { background: var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }
.clock { color: var(--muted); font: 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ghost-button { padding: 9px 14px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.018); font-size: 13px; }
.ghost-button:hover { color: var(--ink); border-color: rgba(181, 216, 204, .28); }

.content { width: min(1480px, 100%); margin: 0 auto; padding: 56px 28px 32px; }
.overview { display: flex; align-items: flex-end; justify-content: space-between; gap: 34px; margin-bottom: 38px; }
.overview h1 { margin: 0; font-size: clamp(40px, 4.7vw, 64px); font-weight: 650; letter-spacing: -.055em; line-height: 1.08; }
.server-identity { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 17px 0 0; color: var(--muted); font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.identity-item { display: inline-flex; align-items: center; min-height: 30px; padding: 5px 10px; border: 1px solid rgba(181,216,204,.11); border-radius: 8px; background: rgba(255,255,255,.025); }
.identity-host { color: #c8d4d0; }
.identity-host i { width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 10px rgba(114,239,188,.7); }
.health-badge { min-width: 220px; display: flex; align-items: center; gap: 17px; padding: 19px 22px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(20, 31, 28, .84), rgba(13, 20, 18, .82)); box-shadow: 0 14px 45px rgba(0,0,0,.16), inset 0 1px rgba(255,255,255,.025); }
.health-orbit { position: relative; flex: 0 0 42px; width: 42px; height: 42px; border: 1px solid var(--dim); border-radius: 50%; }
.health-orbit::after { content: ""; position: absolute; inset: 6px; border: 1px solid var(--dim); border-radius: 50%; }
.health-orbit i { position: absolute; width: 8px; height: 8px; left: 16px; top: 16px; z-index: 1; border-radius: 50%; background: var(--muted); }
.health-badge small, .health-badge strong { display: block; }
.health-badge small { margin-bottom: 4px; color: var(--dim); font-size: 12px; letter-spacing: .06em; }
.health-badge strong { font-size: 20px; font-weight: 650; }
.health-badge[data-state="healthy"] { border-color: rgba(121, 242, 192, .22); }
.health-badge[data-state="healthy"] .health-orbit, .health-badge[data-state="healthy"] .health-orbit::after { border-color: rgba(121, 242, 192, .4); }
.health-badge[data-state="healthy"] .health-orbit i { background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.health-badge[data-state="warning"] .health-orbit i { background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.health-badge[data-state="critical"] .health-orbit i { background: var(--danger); box-shadow: 0 0 12px var(--danger); }

.metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.metric-card, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(19, 29, 26, .96), rgba(10, 16, 14, .96)); box-shadow: 0 18px 55px rgba(0,0,0,.14), inset 0 1px rgba(255,255,255,.025); transition: border-color .2s ease, transform .2s ease, background .2s ease; }
.metric-card:hover, .panel:hover { border-color: rgba(181, 216, 204, .22); }
.metric-card { --accent: var(--mint); position: relative; min-height: 224px; padding: 27px; overflow: hidden; }
.metric-card::before { content: ""; position: absolute; left: 26px; right: 26px; top: 0; height: 2px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: .75; }
.metric-card::after { content: ""; position: absolute; width: 160px; height: 160px; right: -78px; bottom: -90px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 12%, transparent); filter: blur(14px); }
.metric-card[data-accent="blue"] { --accent: var(--blue); }
.metric-card[data-accent="amber"] { --accent: var(--amber); }
.metric-card[data-accent="violet"] { --accent: var(--violet); }
.metric-head { display: flex; justify-content: space-between; gap: 12px; color: #c4cecb; font-size: 14px; }
.metric-name { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; }
.metric-name i { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 55%, transparent); }
.metric-meta { color: var(--dim); font: 12px/1.4 ui-monospace, monospace; }
.metric-value { margin: 30px 0 23px; display: flex; align-items: baseline; gap: 7px; }
.metric-value strong { font: 520 54px/.85 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: -.08em; }
.metric-value small { color: var(--accent); font: 750 16px/1 ui-monospace, monospace; }
.meter { height: 5px; border-radius: 5px; background: rgba(255,255,255,.075); overflow: hidden; }
.meter i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 55%, transparent); transition: width .7s cubic-bezier(.2,.8,.2,1); }
.metric-card > p { margin: 15px 0 0; color: var(--dim); font: 12px/1.5 ui-monospace, monospace; }
.network-values { display: flex; align-items: baseline; gap: 18px; margin: 32px 0 25px; color: var(--violet); font: 14px/1 ui-monospace, monospace; }
.network-values strong { color: var(--ink); font-size: 21px; }
.spark-bars { height: 22px; display: flex; align-items: flex-end; gap: 5px; }
.spark-bars i { flex: 1; height: 30%; border-radius: 2px; background: rgba(173, 150, 255, .38); animation: bars 2.7s ease-in-out infinite alternate; }
.spark-bars i:nth-child(2), .spark-bars i:nth-child(7) { height: 70%; animation-delay: -.8s; }
.spark-bars i:nth-child(3), .spark-bars i:nth-child(6) { height: 45%; animation-delay: -1.6s; }
.spark-bars i:nth-child(4) { height: 90%; animation-delay: -.3s; }
.spark-bars i:nth-child(5) { height: 60%; animation-delay: -2s; }
@keyframes bars { to { height: 95%; opacity: .9; } }

.main-grid { display: grid; grid-template-columns: minmax(0, 2.05fr) minmax(310px, .95fr); gap: 14px; margin-bottom: 14px; }
.panel { padding: 29px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-head h2 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -.025em; }
.panel-head.compact { align-items: center; }
.range-tabs { display: flex; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: rgba(0,0,0,.2); }
.range-tabs button { min-width: 54px; padding: 8px 11px; color: var(--dim); border: 0; border-radius: 8px; background: transparent; font-size: 12px; }
.range-tabs button:hover { color: var(--muted); }
.range-tabs button.active { color: var(--ink); background: rgba(181, 216, 204, .12); box-shadow: inset 0 0 0 1px rgba(181,216,204,.05); }
.chart-legend { display: flex; gap: 23px; margin: 30px 0 8px; color: var(--muted); font: 12px/1 ui-monospace, monospace; }
.chart-legend span::before { content: ""; display: inline-block; width: 16px; height: 2px; margin: 0 7px 3px 0; background: var(--mint); }
.chart-legend .memory::before { background: var(--blue); }
.chart-legend .disk::before { background: var(--amber); }
.chart-wrap { position: relative; height: 278px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 14px; }
.chart-axis { display: flex; justify-content: space-between; color: var(--dim); font: 12px/1 ui-monospace, monospace; }
.updated-at { color: var(--dim); font: 12px/1 ui-monospace, monospace; }
.system-facts { margin: 28px 0; }
.system-facts > div { padding: 16px 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(181, 216, 204, .08); }
.system-facts dt { color: var(--muted); font-size: 14px; }
.system-facts dd { margin: 0; color: #dce3e1; font: 14px/1 ui-monospace, monospace; }
.availability { margin-top: 27px; }
.availability > div:first-child { display: flex; justify-content: space-between; margin-bottom: 12px; color: var(--muted); font-size: 14px; }
.availability strong { color: var(--mint); font: 14px/1 ui-monospace, monospace; }
.availability-bar { height: 7px; border-radius: 6px; background: rgba(255,255,255,.07); overflow: hidden; }
.availability-bar i { display: block; width: 0; height: 100%; background: var(--mint); transition: width .7s; }

.lower-grid { display: grid; grid-template-columns: .9fr 1.6fr; gap: 14px; margin-bottom: 14px; }
.count-badge, .record-count { padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.02); font: 12px/1 ui-monospace, monospace; }
.status-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 26px; }
.status-item { padding: 17px; display: flex; align-items: center; justify-content: space-between; border: 1px solid rgba(181, 216, 204, .09); border-radius: 13px; background: rgba(0,0,0,.15); }
.status-item span:first-child { color: #d1dad7; font-size: 14px; font-weight: 550; }
.state { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 12px/1 ui-monospace, monospace; text-transform: uppercase; }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.state.online::before { background: var(--mint); box-shadow: 0 0 8px rgba(121,242,192,.6); }
.app-list { margin-top: 26px; }
.app-row { display: grid; grid-template-columns: minmax(140px, 1.7fr) .7fr .9fr .8fr; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid rgba(181, 216, 204, .08); font-size: 13px; }
.app-row:last-child { border: 0; }
.app-name { display: flex; align-items: center; gap: 10px; color: #dce4e1; font-size: 14px; min-width: 0; }
.app-name b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.app-meta { color: var(--muted); font: 12px/1 ui-monospace, monospace; }
.app-empty { padding: 38px 0 18px; color: var(--dim); text-align: center; font-size: 14px; }

.log-panel { margin-bottom: 14px; }
.table-wrap { margin-top: 24px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th { padding: 12px 14px; color: var(--dim); border-bottom: 1px solid var(--line); font: 12px/1 ui-monospace, monospace; text-align: left; text-transform: uppercase; letter-spacing: .06em; }
td { padding: 15px 14px; color: #bec9c6; border-bottom: 1px solid rgba(181, 216, 204, .07); font: 12px/1.35 ui-monospace, monospace; }
tbody tr { transition: background .18s; }
tbody tr:hover { background: rgba(255,255,255,.018); }
tbody tr:last-child td { border: 0; }
.log-state { display: inline-flex; align-items: center; gap: 6px; }
.log-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); }
.log-state.warning::before { background: var(--amber); }
.log-state.critical::before { background: var(--danger); }
.empty-row { padding: 42px; color: var(--dim); text-align: center; }
footer { display: flex; justify-content: space-between; padding: 20px 4px 0; color: #5f6d69; font: 11px/1.5 ui-monospace, monospace; letter-spacing: .08em; }

@media (max-width: 1050px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .main-grid, .lower-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .login-card { padding: 40px 26px; }
  .password-row { flex-direction: column; }
  .password-row button { height: 50px; }
  .topbar { height: 68px; padding: 0 16px; }
  .clock { display: none; }
  .connection-pill span { display: none; }
  .content { padding: 36px 15px 24px; }
  .overview { align-items: flex-start; flex-direction: column; margin-bottom: 24px; }
  .health-badge { width: 100%; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 208px; padding: 24px; }
  .panel { padding: 22px; }
  .trend-panel .panel-head { flex-direction: column; }
  .range-tabs { width: 100%; }
  .range-tabs button { flex: 1; }
  .chart-wrap { height: 244px; }
  .status-list { grid-template-columns: 1fr; }
  .app-row { grid-template-columns: minmax(120px, 1.6fr) .8fr .8fr; }
  .app-row .app-restarts { display: none; }
  footer { gap: 12px; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
