:root {
  --bg: #090c10;
  --panel: #11171e;
  --panel-2: #18212c;
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.18);
  --text: #f4f6f8;
  --muted: #83909e;
  --red: #d11a1c;
  --red-soft: rgba(209,26,28,.12);
  --green: #57ca8b;
  --amber: #e0a84f;
  --blue: #63a8e8;
  --sidebar: 228px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 7px; color: var(--red); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.muted { color: var(--muted); line-height: 1.55; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--red); color: #fff; background: var(--red); font: 800 20px Georgia, serif; }
.brand strong, .brand small { display: block; }
.brand strong { font: 700 19px/1 Georgia, serif; letter-spacing: .08em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 7px; letter-spacing: .16em; }
.login-screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; overflow: hidden; }
.login-backdrop { position: absolute; inset: 0; background: radial-gradient(circle at 72% 18%, rgba(209,26,28,.14), transparent 31%), linear-gradient(125deg, #07090c 0 48%, #101720 48% 100%); }
.login-backdrop::before { content: "FYDNE"; position: absolute; right: -4vw; bottom: -5vw; color: rgba(255,255,255,.025); font: 900 22vw/1 Georgia, serif; letter-spacing: -.06em; }
.login-card { position: relative; width: 100%; min-width: 0; max-width: 470px; padding: 44px; border: 1px solid var(--line-strong); background: rgba(17,23,30,.96); box-shadow: 0 35px 90px rgba(0,0,0,.55); }
.brand-login { margin-bottom: 54px; }
.login-card h1 { max-width: 360px; margin: 0; font: 600 34px/1.06 Georgia, serif; }
.login-card > .muted { margin: 16px 0 28px; }
.field, .action-form label { display: grid; gap: 7px; color: #aeb7c1; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
input, select { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 2px; outline: 0; background: #0b1016; color: #fff; }
input:focus, select:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(209,26,28,.1); }
.login-card .button { width: 100%; margin-top: 12px; }
.security-note { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.security-note span { margin-right: 6px; color: var(--green); }
.form-error { min-height: 18px; margin: 12px 0 0; color: #f17878; font-size: 11px; }
.app { min-height: 100vh; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; width: var(--sidebar); flex-direction: column; padding: 24px 18px; border-right: 1px solid var(--line); background: #0c1117; }
.sidebar .brand { padding: 0 8px 24px; border-bottom: 1px solid var(--line); }
.sidebar nav { display: grid; gap: 4px; margin-top: 22px; }
.nav-item { display: grid; min-height: 42px; align-items: center; grid-template-columns: 26px 1fr; padding: 8px 12px; border: 1px solid transparent; border-left: 2px solid transparent; color: #8c98a6; background: transparent; font-size: 11px; text-align: left; cursor: pointer; }
.nav-item span { color: #667382; font: 700 15px Georgia, serif; }
.nav-item:hover, .nav-item.active { border-color: var(--line); border-left-color: var(--red); color: #fff; background: rgba(255,255,255,.035); }
.nav-item.active span { color: var(--red); }
.sidebar-foot { display: grid; gap: 8px; margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line); }
.sidebar-foot a, .sidebar-foot button { padding: 7px 9px; border: 0; color: var(--muted); background: transparent; font-size: 10px; text-align: left; text-decoration: none; cursor: pointer; }
.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; z-index: 10; top: 0; display: flex; min-height: 82px; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 28px; border-bottom: 1px solid var(--line); background: rgba(9,12,16,.94); backdrop-filter: blur(18px); }
.topbar h1 { margin: 0; font: 600 20px Georgia, serif; }
.topbar-meta { display: flex; align-items: center; gap: 18px; }
.live-pill { display: flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgba(87,202,139,.25); color: var(--green); background: rgba(87,202,139,.06); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.update-time { color: var(--muted); font-size: 9px; }
.identity { padding-left: 18px; border-left: 1px solid var(--line); }
.identity strong, .identity small { display: block; }
.identity strong { font-size: 11px; }
.identity small { margin-top: 3px; color: var(--red); font-size: 8px; text-transform: uppercase; }
.mobile-menu { display: none; border: 0; color: #fff; background: transparent; font-size: 22px; }
main { width: min(1480px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 54px; }
.view { display: none; }
.view.active { display: block; animation: reveal .22s ease; }
@keyframes reveal { from { opacity: .2; transform: translateY(4px); } }
.hero-status { display: flex; min-height: 190px; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 14px; padding: 34px 38px; border: 1px solid var(--line); background: radial-gradient(circle at 75% 50%, rgba(209,26,28,.12), transparent 28%), var(--panel); }
.hero-status h2 { margin: 0; font: 600 clamp(28px,4vw,50px)/1 Georgia, serif; }
.hero-status .muted { margin-bottom: 0; }
.hero-clock { display: grid; min-width: 170px; padding: 24px; place-items: center; border-left: 1px solid var(--line); }
.hero-clock strong { font: 600 58px/1 Georgia, serif; }
.hero-clock span { margin-top: 9px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.metric-grid { display: grid; margin-bottom: 26px; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.metric-card { min-height: 118px; padding: 19px; border: 1px solid var(--line); background: var(--panel); }
.metric-card span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .09em; }
.metric-card strong { display: block; margin: 18px 0 5px; font: 600 24px/1 Georgia, serif; }
.metric-card small { color: #65717f; font-size: 9px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 28px 0 13px; }
.section-head h2, .panel h2 { margin: 0; font: 600 21px/1.1 Georgia, serif; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; padding: 9px 15px; border: 1px solid transparent; border-radius: 2px; color: #fff; background: transparent; font-size: 10px; font-weight: 700; text-decoration: none; cursor: pointer; }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-primary { border-color: var(--red); background: var(--red); }
.button-primary:hover { background: #e32629; }
.button-ghost { border-color: var(--line-strong); color: #b8c0ca; }
.button-ghost:hover { border-color: var(--red); color: #fff; }
.button-warning { border-color: rgba(224,168,79,.5); color: var(--amber); background: rgba(224,168,79,.08); }
.button-danger { border-color: rgba(209,26,28,.58); color: #f07878; background: var(--red-soft); }
.service-strip { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
.service-chip { min-width: 0; padding: 14px; border: 1px solid var(--line); background: var(--panel); }
.service-chip b, .service-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-chip b { font-size: 10px; text-transform: uppercase; }
.service-chip small { margin-top: 6px; color: var(--muted); font-size: 8px; }
.dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #66717e; }
.dot.ok { background: var(--green); box-shadow: 0 0 7px rgba(87,202,139,.6); }
.dot.bad { background: var(--red); box-shadow: 0 0 7px rgba(209,26,28,.6); }
.split-grid { display: grid; margin-top: 14px; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.panel { min-width: 0; padding: 22px; border: 1px solid var(--line); background: var(--panel); }
.panel header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.panel-code { color: rgba(255,255,255,.12); font: 700 28px Georgia, serif; }
.status-row { display: grid; align-items: center; grid-template-columns: 1fr auto; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.status-row:last-child { border-bottom: 0; }
.status-row strong, .status-row small { display: block; }
.status-row strong { font-size: 11px; }
.status-row small { margin-top: 5px; color: var(--muted); font-size: 9px; }
.status-value { color: var(--green); font: 600 15px Georgia, serif; }
.server-grid, .host-grid, .system-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.server-card { position: relative; min-height: 200px; overflow: hidden; padding: 25px; border: 1px solid var(--line); background: linear-gradient(145deg, var(--panel-2), var(--panel)); }
.server-card::after { content: attr(data-code); position: absolute; right: -8px; bottom: -25px; color: rgba(255,255,255,.025); font: 800 110px Georgia, serif; }
.server-card h3 { position: relative; z-index: 1; margin: 15px 0 6px; font: 600 28px Georgia, serif; }
.server-card .server-stats { position: relative; z-index: 1; display: flex; gap: 25px; margin-top: 25px; }
.server-stats span, .host-card span { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.server-stats strong, .host-card strong { display: block; margin-top: 6px; font-size: 17px; }
.action-panel { margin-top: 14px; }
.action-form { display: grid; margin: 18px 0; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); background: var(--panel); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); font-size: 10px; text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; color: #788592; background: #0e141b; font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
td { color: #c7ced6; }
td code { color: #8c98a5; font-size: 8px; }
.privacy-badge { padding: 7px 9px; border: 1px solid rgba(87,202,139,.24); color: var(--green); font-size: 8px; letter-spacing: .08em; }
.host-card { padding: 22px; border: 1px solid var(--line); background: var(--panel); }
.host-card h3 { margin: 0 0 18px; font: 600 18px Georgia, serif; }
.host-metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.system-grid { margin-top: 12px; grid-template-columns: repeat(3,minmax(0,1fr)); }
.system-card { padding: 17px; border: 1px solid var(--line); background: var(--panel); }
.system-card-head { display: flex; justify-content: space-between; gap: 10px; }
.system-card h3 { margin: 0; font-size: 11px; }
.system-card p { color: var(--muted); font-size: 9px; }
.system-actions { display: flex; gap: 5px; margin-top: 14px; }
.system-actions .button { min-height: 30px; padding: 6px 9px; font-size: 8px; }
.case-list, .event-list { max-height: 600px; overflow: auto; }
.case-card, .event-row { padding: 14px 0; border-bottom: 1px solid var(--line); }
.case-card:last-child, .event-row:last-child { border-bottom: 0; }
.case-card strong, .event-row strong { font-size: 10px; }
.case-card p, .event-row p { margin: 6px 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.case-actions { display: flex; gap: 7px; margin-top: 10px; }
.case-actions .button { min-height: 30px; font-size: 8px; }
.upload-panel { margin-top: 14px; }
.file-field input { padding: 8px; }
.schematic-summary { margin-bottom: 12px; padding: 16px 18px; border: 1px solid var(--line); color: var(--muted); background: var(--panel); font-size: 10px; }
.flag-list { display: grid; gap: 7px; }
.flag-row { display: grid; align-items: center; grid-template-columns: minmax(220px,1fr) minmax(150px,.5fr) auto; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); background: var(--panel); }
.flag-row code { color: #c7ced6; font-size: 10px; }
.flag-row input { min-height: 36px; }
.toast-stack { position: fixed; z-index: 80; right: 18px; bottom: 18px; display: grid; width: min(360px,calc(100% - 36px)); gap: 8px; }
.toast { padding: 14px 16px; border: 1px solid var(--line-strong); border-left: 3px solid var(--green); background: #151d26; box-shadow: 0 14px 35px rgba(0,0,0,.4); font-size: 10px; }
.toast.error { border-left-color: var(--red); }
.confirm-dialog { width: min(440px,calc(100% - 28px)); padding: 0; border: 1px solid var(--line-strong); color: #fff; background: var(--panel); }
.confirm-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
.confirm-dialog form { padding: 28px; }
.confirm-dialog h2 { margin: 0; font: 600 23px Georgia, serif; }
.confirm-dialog .button-row { justify-content: flex-end; margin-top: 25px; }
@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .service-strip { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .system-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .action-form { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 780px) {
  :root { --sidebar: 255px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 50px rgba(0,0,0,.5); }
  body.menu-open .sidebar { transform: translateX(0); }
  .workspace { margin-left: 0; }
  .mobile-menu { display: block; }
  .topbar { padding: 14px 16px; }
  .topbar .eyebrow, .update-time { display: none; }
  .topbar-meta { gap: 8px; }
  .identity { display: none; }
  main { width: min(100% - 28px,720px); padding-top: 18px; }
  .hero-status { min-height: 0; align-items: flex-start; flex-direction: column; padding: 25px; }
  .hero-clock { width: 100%; grid-template-columns: auto 1fr; justify-items: start; border-top: 1px solid var(--line); border-left: 0; }
  .hero-clock strong { font-size: 38px; }
  .split-grid, .server-grid, .host-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .login-screen { padding: 16px; }
  .login-card { padding: 28px 22px; }
  .brand-login { margin-bottom: 36px; }
  .login-card h1 { font-size: 28px; }
  .metric-grid, .system-grid, .action-form { grid-template-columns: 1fr; }
  .service-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .section-head { align-items: flex-start; flex-direction: column; }
  .host-metrics { grid-template-columns: 1fr; }
  .flag-row { grid-template-columns: 1fr; }
}
