:root {
  --bg: #07111f;
  --panel: #0d1929;
  --panel-2: #111f31;
  --line: #213249;
  --text: #f3f7fb;
  --muted: #91a0b5;
  --blue: #2587ff;
  --cyan: #39c4dd;
  --green: #48d38a;
  --amber: #f3b548;
  --red: #ff6470;
  --sidebar: 244px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.eyebrow { margin: 0 0 8px; color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .16em; }
.muted { color: var(--muted); }

.boot-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; gap: 16px;
  background: radial-gradient(circle at 50% 35%, #132945 0, var(--bg) 48%);
}
.boot-screen div:last-child { display: grid; gap: 2px; }
.boot-screen span, .sidebar-brand span { color: var(--muted); font-size: 12px; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(145deg, var(--blue), var(--cyan)); color: white; font-weight: 900;
  box-shadow: 0 10px 30px rgba(37, 135, 255, .28);
}
.brand-mark.large { width: 56px; height: 56px; font-size: 24px; border-radius: 14px; }

.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(460px, 1.25fr) minmax(400px, .75fr); }
.login-visual {
  position: relative; overflow: hidden; padding: 52px 64px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(circle at 30% 25%, rgba(37,135,255,.24), transparent 35%), linear-gradient(135deg, #081321, #10243a);
}
.login-visual::before {
  content: ""; position: absolute; inset: 0; opacity: .24;
  background-image: linear-gradient(rgba(80,120,165,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(80,120,165,.12) 1px, transparent 1px);
  background-size: 52px 52px;
}
.brand-lockup, .login-copy { position: relative; z-index: 1; }
.brand-lockup { display: flex; align-items: center; gap: 16px; }
.brand-lockup h1 { margin: 0; letter-spacing: .16em; font-size: 24px; }
.login-copy { max-width: 700px; margin-bottom: 10vh; }
.login-copy h2 { margin: 0 0 20px; max-width: 680px; font-size: clamp(38px, 5vw, 72px); line-height: .98; letter-spacing: -.04em; }
.login-copy > p:last-child { max-width: 620px; color: #b9c5d4; font-size: 17px; line-height: 1.6; }
.signal-line { position: absolute; left: -5%; right: -5%; bottom: 13%; height: 120px; opacity: .55; border-top: 2px solid var(--cyan); transform: skewY(-4deg); box-shadow: 0 -14px 40px rgba(57,196,221,.14); }
.login-panel { display: grid; place-items: center; padding: 40px; background: #f4f7fb; color: #152235; }
.login-card { width: min(420px, 100%); }
.login-card h2 { margin: 0; font-size: 32px; letter-spacing: -.03em; }
.login-card .muted { margin-bottom: 32px; color: #68758a; }
.login-card label { display: block; margin: 18px 0 7px; font-size: 13px; font-weight: 750; }
.login-card input { width: 100%; border: 1px solid #cfd8e5; border-radius: 10px; padding: 13px 14px; background: white; outline: none; }
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,135,255,.14); }
.primary-button { width: 100%; margin-top: 24px; padding: 14px 18px; border: 0; border-radius: 10px; background: var(--blue); color: white; font-weight: 800; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.form-error { min-height: 22px; color: #bb2634; font-size: 13px; }
.security-note { margin-top: 28px; color: #8290a3; font-size: 11px; text-align: center; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; background: #091524; border-right: 1px solid var(--line); z-index: 5; }
.sidebar-brand { height: 78px; display: flex; align-items: center; gap: 12px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.sidebar-brand > div:last-child { display: grid; }
.sidebar-brand strong { letter-spacing: .13em; }
.event-context { margin: 18px 14px 12px; padding: 14px; display: grid; gap: 5px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); }
.event-context strong { font-size: 13px; }
.event-context > span:last-child { color: var(--muted); font-size: 11px; }
.context-label { color: var(--cyan); font-size: 9px; letter-spacing: .13em; font-weight: 800; }
nav { padding: 4px 10px; overflow-y: auto; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 11px; border: 0; border-radius: 8px; padding: 10px 12px; color: #a9b5c5; background: transparent; text-align: left; font-size: 13px; }
.nav-item span { width: 17px; color: #6f819a; text-align: center; }
.nav-item:hover { color: white; background: rgba(255,255,255,.045); }
.nav-item.active { color: white; background: rgba(37,135,255,.16); box-shadow: inset 3px 0 var(--blue); }
.nav-item.active span { color: var(--cyan); }
.sidebar-footer { margin-top: auto; padding: 16px 20px; border-top: 1px solid var(--line); display: grid; gap: 5px; }
.sidebar-footer span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; }
.text-button { width: fit-content; padding: 0; border: 0; background: none; color: var(--cyan); font-size: 12px; }

.workspace { grid-column: 2; min-width: 0; }
.topbar { height: 78px; padding: 0 30px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(7,17,31,.9); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 4; }
.topbar h1 { margin: 0; font-size: 23px; letter-spacing: -.02em; }
.topbar .eyebrow { margin-bottom: 2px; font-size: 9px; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.system-pill { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px currentColor; }
.status-dot.ok { background: var(--green); }
.status-dot.bad { background: var(--red); }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #1c3150; border: 1px solid #365374; color: white; font-size: 12px; font-weight: 800; }
.page-content { padding: 28px 30px 50px; }
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; }
.hero-row h2 { margin: 0 0 4px; font-size: 26px; }
.hero-row p { margin: 0; color: var(--muted); }
.secondary-button { border: 1px solid #315071; border-radius: 8px; padding: 10px 13px; background: #14243a; color: #dbe7f4; font-weight: 700; }
.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cards { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; }
.card { border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(155deg, var(--panel-2), var(--panel)); box-shadow: 0 12px 32px rgba(0,0,0,.12); }
.kpi { padding: 17px; }
.kpi span { color: var(--muted); font-size: 11px; }
.kpi strong { display: block; margin-top: 8px; font-size: 22px; }
.kpi small { color: #6f8198; }
.module-card { min-height: 190px; padding: 18px; }
.module-card header { display: flex; justify-content: space-between; gap: 12px; }
.module-card h3 { margin: 0; font-size: 15px; }
.tag { padding: 4px 7px; border-radius: 999px; background: rgba(72,211,138,.12); color: var(--green); font-size: 9px; font-weight: 850; letter-spacing: .08em; }
.empty-state { height: 120px; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; }
.systems { margin-top: 16px; padding: 18px; }
.systems h3 { margin: 0 0 15px; font-size: 15px; }
.system-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.system-item { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(0,0,0,.12); }
.system-item span { display: block; color: var(--muted); font-size: 10px; }
.system-item strong { display: block; margin-top: 6px; color: var(--green); font-size: 12px; }
.placeholder-page { max-width: 920px; }
.placeholder-page h2 { margin: 0 0 8px; font-size: 28px; }
.placeholder-card { margin-top: 22px; padding: 28px; min-height: 260px; display: grid; place-items: center; text-align: center; }
.placeholder-card strong { display: block; margin-bottom: 7px; font-size: 16px; }
.placeholder-card p { max-width: 520px; color: var(--muted); line-height: 1.6; }
.reference-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 16px; max-width: 1050px; }
.reference-card { min-height: 330px; padding: 24px; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.featured-reference::after { content: ""; position: absolute; width: 280px; height: 280px; right: -95px; top: -110px; border: 42px solid rgba(57,196,221,.06); border-radius: 50%; pointer-events: none; }
.reference-kicker { color: var(--cyan); font-size: 10px; font-weight: 850; letter-spacing: .15em; }
.reference-copy { margin-top: 34px; display: flex; align-items: flex-start; gap: 18px; position: relative; z-index: 1; }
.reference-number { color: #38516e; font-size: 42px; font-weight: 850; line-height: .86; }
.reference-copy h3 { margin: 0 0 10px; font-size: 23px; }
.reference-copy p { margin: 0; max-width: 560px; color: var(--muted); line-height: 1.6; }
.reference-meta { margin-top: auto; margin-bottom: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.reference-meta span, .coming-soon { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: #8fa1b8; font-size: 10px; }
.primary-link { width: fit-content; padding: 11px 14px; border: 0; border-radius: 8px; background: var(--blue); color: white; font-size: 12px; font-weight: 800; text-decoration: none; }
.primary-link:hover { background: #3d94ff; }
.primary-link:disabled { opacity: .6; cursor: wait; }
.primary-link span { margin-left: 8px; }
.muted-reference { opacity: .75; }
.muted-reference .coming-soon { width: fit-content; margin-top: auto; }

@media (max-width: 1100px) {
  .grid.kpis { grid-template-columns: repeat(2, 1fr); }
  .grid.cards { grid-template-columns: 1fr; }
  .system-grid { grid-template-columns: repeat(3, 1fr); }
  .reference-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  :root { --sidebar: 76px; }
  .sidebar-brand > div:last-child, .event-context, .nav-item:not(.active)::after, .nav-item { font-size: 0; }
  .sidebar-brand { justify-content: center; padding: 0; }
  .nav-item { justify-content: center; padding: 12px; }
  .nav-item span { font-size: 16px; }
  .sidebar-footer span { display: none; }
  .sidebar-footer { align-items: center; padding: 16px 8px; }
  .text-button { font-size: 10px; }
  .login-layout { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .topbar { padding: 0 18px; }
  .system-pill span:last-child { display: none; }
  .page-content { padding: 22px 18px; }
}
@media (max-width: 560px) {
  .grid.kpis, .system-grid { grid-template-columns: 1fr; }
  .hero-row { align-items: flex-start; flex-direction: column; }
}
