@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #060a12;
  --bg-soft: #09101d;
  --panel: rgba(12, 20, 34, 0.82);
  --panel-strong: #0d1726;
  --panel-hover: rgba(18, 29, 48, 0.95);
  --border: rgba(143, 170, 210, 0.14);
  --border-strong: rgba(143, 170, 210, 0.24);
  --text: #f4f7ff;
  --muted: #8290a8;
  --muted-2: #5d6b83;
  --violet: #7567ff;
  --violet-soft: #9b7bff;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --green: #2ae6a0;
  --amber: #f5ad43;
  --red: #ff5f7d;
  --radius: 18px;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(64, 76, 196, 0.13), transparent 34rem),
    linear-gradient(135deg, #060a12 0%, #080e19 42%, #07101e 100%);
  color: var(--text);
  font: 400 16px/1.5 'DM Sans', system-ui, sans-serif;
}
button, input { font: inherit; }
button { color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(410px, .72fr);
  min-height: 100vh;
  overflow: hidden;
  background: #060a12;
}
.login-screen.leaving { animation: login-leave .55s cubic-bezier(.4,0,.2,1) forwards; }
.login-art {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  padding: 42px 52px 54px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(3,7,16,.08) 0%, rgba(3,7,16,.05) 54%, rgba(3,7,16,.76) 100%),
    linear-gradient(0deg, rgba(3,7,16,.72) 0%, transparent 48%),
    url('./assets/login-space.png') center center / cover no-repeat;
}
.login-art::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset -60px 0 90px rgba(4,8,16,.62); }
.login-brand, .login-card-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; color: #fff; font: 700 22px/1 'Space Grotesk', sans-serif; letter-spacing: .08em; }
.login-brand .brand-mark { width: 36px; height: 36px; }
.mission-copy { position: relative; z-index: 1; max-width: 590px; }
.mission-eyebrow { display: inline-flex; align-items: center; gap: 10px; color: #9fb4d9; font-size: 12px; font-weight: 700; letter-spacing: .15em; }
.mission-eyebrow::before { content: ''; width: 30px; height: 1px; background: linear-gradient(90deg, #8b5cf6, #22d3ee); }
.mission-copy h1 { max-width: 560px; margin: 12px 0 10px; font: 600 clamp(38px, 5vw, 72px)/.98 'Space Grotesk', sans-serif; letter-spacing: -.055em; text-wrap: balance; text-shadow: 0 8px 42px rgba(0,0,0,.4); }
.mission-copy p { margin: 0; color: #a8b6cc; font-size: 17px; }
.login-side { position: relative; display: grid; place-items: center; min-height: 100vh; padding: 32px clamp(28px, 5vw, 76px); border-left: 1px solid rgba(145,173,215,.12); background: radial-gradient(circle at 100% 0%, rgba(82,68,190,.13), transparent 34rem), rgba(6,11,20,.92); }
.login-side::before, .login-side::after { content: ''; position: absolute; border: 1px solid rgba(108,100,255,.1); border-radius: 50%; pointer-events: none; }
.login-side::before { width: 480px; height: 480px; top: -320px; right: -250px; }
.login-side::after { width: 700px; height: 700px; bottom: -590px; left: -210px; border-color: rgba(34,211,238,.07); }
.login-card { position: relative; z-index: 1; width: min(100%, 410px); padding: 10px 0; }
.login-card-brand { display: none; }
.login-heading { margin-bottom: 34px; }
.login-status { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; color: #8ea0b9; font-size: 12px; }
.login-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px rgba(42,230,160,.72); }
.login-heading h2 { margin: 0 0 8px; font: 600 32px/1.15 'Space Grotesk', sans-serif; letter-spacing: -.04em; }
.login-heading p { margin: 0; color: var(--muted); font-size: 15px; }
.field-label { display: block; margin: 0 0 8px; color: #b8c2d2; font-size: 13px; font-weight: 600; }
.field-shell { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 10px; height: 52px; margin-bottom: 19px; padding: 0 14px; border: 1px solid rgba(139,158,190,.19); border-radius: 13px; background: rgba(12,21,35,.78); box-shadow: inset 0 1px 0 rgba(255,255,255,.025); transition: .2s ease; }
.field-shell:focus-within { border-color: rgba(117,103,255,.68); box-shadow: 0 0 0 3px rgba(117,103,255,.1), inset 0 1px 0 rgba(255,255,255,.035); }
.field-shell > svg { width: 19px; height: 19px; fill: none; stroke: #687792; stroke-width: 1.7; }
.field-shell input { width: 100%; height: 100%; border: 0; outline: 0; background: transparent; color: #eef3ff; font-size: 15px; }
.field-shell input::placeholder { color: #526077; }
.password-toggle { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #687792; cursor: pointer; }
.password-toggle:hover { color: #b2bdd0; background: rgba(255,255,255,.04); }
.password-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.login-error { min-height: 20px; margin: -7px 0 9px; color: #ff8298; font-size: 13px; }
.login-button { display: flex; align-items: center; justify-content: space-between; width: 100%; height: 52px; padding: 0 18px; border: 1px solid rgba(143,132,255,.48); border-radius: 13px; background: linear-gradient(100deg, #6757e9, #376dde 58%, #168bab); color: #fff; font-weight: 700; cursor: pointer; box-shadow: 0 14px 35px rgba(73,81,214,.25), inset 0 1px 0 rgba(255,255,255,.16); transition: transform .2s ease, filter .2s ease; }
.login-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.login-button:disabled { cursor: wait; opacity: .7; transform: none; }
.login-button b { font-size: 20px; font-weight: 400; }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 19px; color: #627087; font-size: 12px; }
.secure-note svg { width: 15px; height: 15px; fill: none; stroke: #61728f; stroke-width: 1.7; }
.logout-button { display: flex; align-items: center; gap: 8px; width: 100%; margin: 14px 0 2px; padding: 8px 0; border: 0; background: transparent; color: #77859c; font-size: 12px; cursor: pointer; }
.logout-button:hover { color: #bac4d5; }
.logout-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.ambient { position: fixed; border-radius: 50%; pointer-events: none; filter: blur(110px); opacity: .12; }
.ambient-one { width: 420px; height: 420px; background: #4f46e5; top: -220px; right: 12%; }
.ambient-two { width: 340px; height: 340px; background: #0891b2; bottom: -220px; left: 16%; }

.app-shell { position: relative; min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 22px;
  border-right: 1px solid var(--border);
  background: rgba(6, 10, 18, .74);
  backdrop-filter: blur(22px);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 26px; color: var(--text); text-decoration: none; font: 700 20px/1 'Space Grotesk', sans-serif; letter-spacing: .07em; }
.brand-mark { width: 32px; height: 32px; }
.brand-mark svg { width: 100%; height: 100%; }
.nav-list { display: grid; gap: 7px; }
.nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: #93a0b6;
  text-align: left;
  cursor: pointer;
  transition: .2s ease;
}
.nav-item svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.035); }
.nav-item.active { color: #fff; border-color: rgba(117, 103, 255, .28); background: linear-gradient(100deg, rgba(117, 103, 255, .28), rgba(36, 65, 132, .13)); box-shadow: inset 3px 0 0 #7567ff; }
.nav-count { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 8px; background: rgba(245, 173, 67, .15); color: var(--amber); font-size: 12px; font-weight: 700; }
.sidebar-foot { margin-top: auto; padding: 18px 10px 0; border-top: 1px solid var(--border); }
.agent-status { display: flex; align-items: center; gap: 10px; }
.agent-status strong, .agent-status small { display: block; }
.agent-status strong { font-size: 13px; }
.agent-status small, .version { color: var(--muted-2); font-size: 12px; }
.version { display: block; margin: 12px 0 0 18px; }
.pulse-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 16px rgba(42, 230, 160, .65); }
.pulse-dot::after { content: ''; position: absolute; inset: -5px; border: 1px solid rgba(42, 230, 160, .35); border-radius: inherit; animation: pulse 2s infinite; }

.main-content { min-width: 0; padding: 0 30px 40px; }
.topbar { min-height: 142px; display: flex; align-items: center; justify-content: space-between; gap: 30px; border-bottom: 1px solid var(--border); }
.eyebrow, .panel-kicker { color: #718099; font-size: 11px; font-weight: 700; letter-spacing: .13em; }
.machine-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 13px; margin: 4px 0 6px; }
.machine-heading h1 { margin: 0; font: 700 clamp(26px, 2.4vw, 38px)/1.1 'Space Grotesk', sans-serif; letter-spacing: -.035em; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border: 1px solid rgba(42, 230, 160, .23); border-radius: 999px; background: rgba(42, 230, 160, .08); color: var(--green); font-size: 13px; font-weight: 600; }
.status-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(42, 230, 160, .8); }
.status-pill.offline { border-color: rgba(255,95,125,.24); background: rgba(255,95,125,.08); color: var(--red); }
.status-pill.offline span { background: var(--red); box-shadow: 0 0 12px rgba(255,95,125,.65); }
.machine-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; color: var(--muted); font-size: 13px; }
.machine-meta i { width: 3px; height: 3px; border-radius: 50%; background: #3e4b61; }
.machine-meta strong { color: #abb7ca; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.domain-chip { padding: 9px 13px; border: 1px solid var(--border); border-radius: 10px; color: #8c99ae; background: rgba(255,255,255,.02); font-size: 12px; }
.icon-button { display: grid; place-items: center; width: 39px; height: 39px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255,255,255,.025); cursor: pointer; transition: .2s ease; }
.icon-button svg { width: 18px; height: 18px; fill: none; stroke: #9ba7b9; stroke-width: 1.8; }
.icon-button:hover { border-color: var(--border-strong); background: rgba(255,255,255,.05); }
.icon-button.spinning svg { animation: spin .7s ease; }

.view { display: none; padding-top: 24px; animation: view-in .32s ease; }
.view.active { display: block; }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card {
  position: relative;
  min-height: 120px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 18px;
  overflow: visible;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(15, 25, 42, .92), rgba(10, 18, 31, .82));
  box-shadow: 0 10px 40px rgba(0,0,0,.13);
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease;
}
.metric-card::before { content: ''; position: absolute; inset: 0; border-radius: inherit; opacity: 0; background: linear-gradient(110deg, rgba(117,103,255,.08), transparent 45%); transition: opacity .25s; }
.metric-card:hover, .metric-card:focus-within { z-index: 10; }
.metric-card:hover { transform: translateY(-2px); border-color: rgba(128,139,255,.32); }
.metric-card:hover::before { opacity: 1; }
.metric-card:focus-visible { outline: 2px solid #7f79ff; outline-offset: 3px; }
.metric-card.warning-glow { border-color: rgba(245, 173, 67, .23); }
.metric-info { position: absolute; z-index: 3; top: 11px; right: 11px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 1px solid rgba(143,170,210,.16); border-radius: 50%; background: rgba(8,14,24,.78); color: #8190a8; font: 700 11px/1 'DM Sans', sans-serif; cursor: help; }
.metric-info:hover, .metric-info:focus-visible { border-color: rgba(127,121,255,.55); color: #c3c9ff; outline: none; }
.metric-info::after { content: attr(data-tooltip); position: absolute; z-index: 30; width: 230px; right: -2px; top: 33px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: #111d2f; color: #c7d0df; box-shadow: 0 14px 38px rgba(0,0,0,.42); font-size: 12px; font-weight: 400; line-height: 1.45; text-align: left; pointer-events: none; opacity: 0; transform: translateY(-4px); transition: .18s ease; }
.metric-info:hover::after, .metric-info:focus-visible::after { opacity: 1; transform: translateY(0); }
.metric-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: rgba(42, 230, 160, .1); color: var(--green); }
.metric-icon.violet { color: #7c8cff; background: rgba(101, 111, 255, .12); }
.metric-icon.cyan { color: var(--cyan); background: rgba(34, 211, 238, .1); }
.metric-icon.blue { color: #56a1ff; background: rgba(59, 130, 246, .11); }
.metric-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.metric-label { display: block; color: #93a0b4; font-size: 13px; }
.metric-card strong { display: block; margin: 1px 0; font: 700 27px/1.2 'Space Grotesk', sans-serif; letter-spacing: -.03em; }
.network-rate { display: flex !important; flex-wrap: wrap; gap: 3px 10px; font-size: 15px !important; line-height: 1.35 !important; letter-spacing: -.01em !important; }
.network-rate span { display: inline-flex; align-items: center; gap: 3px; color: #7888a2; font-weight: 500; white-space: nowrap; }
.network-rate b { color: #eef3ff; font-weight: 700; }
.metric-card small { color: var(--muted-2); font-size: 12px; }
.trend.positive { color: #52cfa2; }
.trend.warning { color: var(--amber); }
.metric-spark { align-self: end; display: flex; align-items: end; gap: 3px; height: 32px; opacity: .55; }
.metric-spark i { display: block; width: 3px; border-radius: 2px; background: #51678d; }
.metric-spark i:nth-child(1) { height: 25%; }.metric-spark i:nth-child(2) { height: 46%; }.metric-spark i:nth-child(3) { height: 36%; }.metric-spark i:nth-child(4) { height: 72%; }.metric-spark i:nth-child(5) { height: 100%; }
.bars-green i:last-child { background: var(--green); }.bars-blue i:last-child { background: var(--cyan); }
.mini-badge { align-self: start; padding: 4px 7px; border-radius: 7px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.mini-badge.warning { color: var(--amber); background: rgba(245,173,67,.1); }
.mini-badge.normal { color: var(--green); background: rgba(42,230,160,.08); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(330px, .78fr); gap: 16px; margin-top: 16px; }
.charts-column, .insights-column { display: grid; align-content: start; gap: 16px; }
.panel { border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(145deg, rgba(13, 22, 38, .9), rgba(9, 16, 28, .86)); box-shadow: var(--shadow); }
.chart-panel { padding: 20px 22px 16px; }
.chart-panel.compact { padding-bottom: 15px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.panel-head h2 { margin: 2px 0 0; font: 600 19px/1.25 'Space Grotesk', sans-serif; letter-spacing: -.02em; }
.range-control { display: flex; padding: 3px; border: 1px solid var(--border); border-radius: 9px; background: rgba(0,0,0,.18); }
.range { min-width: 38px; height: 28px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.range.active { color: #fff; background: rgba(117, 103, 255, .22); }
.chart-wrap { position: relative; padding: 2px 0 25px 48px; }
.line-chart { width: 100%; height: 250px; overflow: visible; }
.chart-panel.compact .line-chart { height: 180px; }
.grid-lines line { stroke: rgba(147, 169, 205, .1); stroke-width: 1; stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.stroke-path { fill: none; stroke-width: 2.2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 7px rgba(91, 109, 255, .25)); }
.last-point { fill: #26d4ed; stroke: rgba(38, 212, 237, .2); stroke-width: 7; vector-effect: non-scaling-stroke; }
.chart-y-labels { position: absolute; inset: -6px auto 25px 0; display: flex; flex-direction: column; justify-content: space-between; color: #59677c; font-size: 11px; }
.chart-x-labels { position: absolute; left: 48px; right: 0; bottom: 0; display: flex; justify-content: space-between; color: #59677c; font-size: 11px; }
.chart-tooltip { position: absolute; z-index: 3; padding: 7px 9px; transform: translate(-50%, -115%); border: 1px solid var(--border-strong); border-radius: 8px; background: #111d2e; color: #e8edfb; font-size: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.35); pointer-events: none; }
.legend { display: flex; gap: 15px; color: var(--muted); font-size: 12px; }
.legend span { display: flex; align-items: center; gap: 6px; }.legend i { width: 7px; height: 7px; border-radius: 50%; }.legend-1 { background: #7567ff; }.legend-5 { background: #22d3ee; }.legend-15 { background: #e851d6; }
.load-one { stroke: #7567ff; }.load-five { stroke: #22d3ee; }.load-fifteen { stroke: #e851d6; }

.alerts-panel, .rules-panel { padding: 20px; }
.count-badge { display: inline-grid; place-items: center; min-width: 24px; height: 24px; margin-left: 6px; padding: 0 7px; border: 1px solid rgba(245, 173, 67, .28); border-radius: 8px; background: rgba(245, 173, 67, .1); color: var(--amber); font: 700 12px/1 'DM Sans', sans-serif; vertical-align: 2px; }
.text-button { border: 0; padding: 8px 0; background: none; color: #7688ff; font-size: 12px; cursor: pointer; }
.text-button:hover { color: #a5aeff; }
.active-alert { display: grid; grid-template-columns: 38px 1fr; gap: 12px; padding: 15px; border: 1px solid rgba(245, 173, 67, .22); border-radius: 14px; background: linear-gradient(110deg, rgba(245,173,67,.09), rgba(245,173,67,.025)); }
.alert-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: rgba(245,173,67,.12); color: var(--amber); }
.alert-icon svg, .resolved-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.alert-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.alert-title-row strong { font-size: 15px; }.alert-title-row time { color: #77849a; font-size: 11px; }
.alert-copy p { margin: 4px 0 11px; color: #a5afbf; font-size: 13px; }
.alert-reading { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 5px 8px; align-items: center; }
.alert-reading span { color: #727f94; font-size: 11px; }.alert-reading strong { font: 600 14px 'Space Grotesk', sans-serif; }
.ack-button { margin-top: 13px; padding: 7px 10px; border: 1px solid rgba(245,173,67,.2); border-radius: 8px; background: rgba(245,173,67,.08); color: #fac06b; font-size: 12px; cursor: pointer; }
.ack-button:hover { background: rgba(245,173,67,.14); }
.acknowledged-label { display: inline-block; margin-top: 13px; color: var(--muted); font-size: 12px; }
.ack-button.acknowledged { border-color: var(--border); background: rgba(255,255,255,.03); color: var(--muted); }
.healthy-row { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: center; margin-top: 13px; padding: 13px 14px; border: 1px solid rgba(42,230,160,.1); border-radius: 13px; background: rgba(42,230,160,.025); }
.healthy-icon { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(42,230,160,.25); border-radius: 50%; color: var(--green); }
.healthy-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.healthy-row strong, .healthy-row small { display: block; }.healthy-row strong { font-size: 13px; }.healthy-row small { color: var(--muted); font-size: 11px; }
.rule-mini { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 11px; min-height: 58px; border-top: 1px solid var(--border); }
.rule-mini:first-of-type { border-top: 0; }.rule-mini strong, .rule-mini small { display: block; }.rule-mini strong { font-size: 13px; }.rule-mini small { color: var(--muted); font-size: 11px; }
.severity { width: 7px; height: 7px; border-radius: 50%; }.severity.critical { background: var(--red); box-shadow: 0 0 10px rgba(255,95,125,.4); }.severity.warning { background: var(--amber); box-shadow: 0 0 10px rgba(245,173,67,.35); }
.enabled-label { color: #69cfa9; font-size: 11px; }
.enabled-label.paused { color: var(--muted-2); }
.agent-status.offline .pulse-dot { background: var(--red); box-shadow: 0 0 16px rgba(255,95,125,.5); }
.agent-status.offline .pulse-dot::after { border-color: rgba(255,95,125,.3); }

.page-title { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 4px 0 22px; }
.page-title h2 { margin: 3px 0 3px; font: 700 30px/1.2 'Space Grotesk', sans-serif; letter-spacing: -.035em; }.page-title p { margin: 0; color: var(--muted); font-size: 14px; }
.health-layout { display: grid; grid-template-columns: .82fr 1.18fr; gap: 16px; }
.health-score { display: flex; align-items: center; gap: 24px; padding: 26px; }
.health-score h3 { margin: 4px 0 6px; font: 600 20px 'Space Grotesk', sans-serif; }.health-score p { margin: 0; color: var(--muted); font-size: 14px; }
.score-ring { flex: 0 0 auto; width: 118px; height: 118px; display: grid; place-content: center; position: relative; border-radius: 50%; background: conic-gradient(var(--amber) 0 92%, rgba(255,255,255,.06) 92%); }
.score-ring::before { content: ''; position: absolute; inset: 7px; border-radius: inherit; background: #0c1625; }
.score-ring span, .score-ring small { position: relative; z-index: 1; text-align: center; }.score-ring span { font: 700 34px/1 'Space Grotesk', sans-serif; }.score-ring small { color: var(--muted); font-size: 11px; }
.signal-list { padding: 8px 22px; }
.signal-row { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px; min-height: 76px; border-bottom: 1px solid var(--border); }.signal-row:last-child { border-bottom: 0; }
.signal-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; }.signal-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; }.signal-icon.good { color: var(--green); background: rgba(42,230,160,.08); }.signal-icon.warn { color: var(--amber); background: rgba(245,173,67,.09); }
.signal-row strong, .signal-row small { display: block; }.signal-row strong { font-size: 14px; }.signal-row small { color: var(--muted); font-size: 12px; }.signal-value { font-size: 12px; font-weight: 700; }.good-text { color: var(--green); }.warning-text { color: var(--amber); }
.facts-panel { margin-top: 16px; padding: 22px; }.facts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: 13px; background: var(--border); }.facts-grid div { padding: 17px; background: #0b1422; }.facts-grid span, .facts-grid strong { display: block; }.facts-grid span { color: var(--muted); font-size: 12px; }.facts-grid strong { margin-top: 3px; font-size: 14px; }

.summary-pills { display: flex; gap: 8px; }.summary-pill { padding: 8px 12px; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font-size: 12px; }.summary-pill b { color: var(--text); }.summary-pill.amber { border-color: rgba(245,173,67,.2); color: #d7a65d; background: rgba(245,173,67,.06); }.summary-pill.amber b { color: var(--amber); }
.alert-list { display: grid; gap: 12px; }.alert-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 18px 20px; box-shadow: 0 12px 36px rgba(0,0,0,.16); }.alert-row.active-row { border-color: rgba(245,173,67,.22); }.alert-main > div { display: flex; align-items: center; gap: 10px; }.alert-main strong { font: 600 16px 'Space Grotesk', sans-serif; }.alert-main p { margin: 4px 0 3px; color: #a5afbf; font-size: 14px; }.alert-main small { color: var(--muted-2); font-size: 12px; }.status-label { display: inline-flex; padding: 3px 7px; border-radius: 6px; font-size: 9px; font-weight: 700; letter-spacing: .08em; }.status-label.warning { color: var(--amber); background: rgba(245,173,67,.1); }.status-label.critical { color: var(--red); background: rgba(255,95,125,.1); }.status-label.resolved { color: var(--green); background: rgba(42,230,160,.08); }
.empty-state { display: flex; align-items: center; gap: 15px; min-height: 150px; padding: 24px; }
.empty-state.compact-empty { min-height: 112px; padding: 17px; border: 1px solid rgba(42,230,160,.1); border-radius: 14px; background: rgba(42,230,160,.025); }
.empty-state strong { display: block; font: 600 16px 'Space Grotesk', sans-serif; }
.empty-state p { max-width: 620px; margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.alert-actions { display: flex; align-items: center; gap: 13px; }.duration { color: var(--muted); font-size: 12px; white-space: nowrap; }.secondary-button { min-height: 36px; padding: 0 13px; border: 1px solid var(--border-strong); border-radius: 9px; background: rgba(255,255,255,.035); cursor: pointer; }.secondary-button:hover { background: rgba(255,255,255,.065); }.resolved-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(42,230,160,.2); border-radius: 50%; color: var(--green); }

.rules-total { color: var(--muted); font-size: 13px; }.rules-total b { color: var(--green); }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }.rule-card { position: relative; display: grid; grid-template-columns: 48px 1fr auto; gap: 15px; align-items: start; min-height: 224px; padding: 22px; box-shadow: 0 12px 36px rgba(0,0,0,.16); }.rule-symbol { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 13px; }.rule-symbol svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }.rule-symbol.critical { color: var(--red); background: rgba(255,95,125,.09); }.rule-symbol.warning { color: var(--amber); background: rgba(245,173,67,.09); }
.rule-content h3 { margin: 7px 0 4px; font: 600 18px 'Space Grotesk', sans-serif; }.rule-content p { min-height: 42px; margin: 0 0 17px; color: var(--muted); font-size: 13px; }.condition { padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; background: rgba(0,0,0,.15); }.condition span, .condition strong { display: block; }.condition span { color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }.condition strong { margin-top: 2px; font-size: 12px; }
.switch { position: relative; width: 44px; height: 24px; cursor: pointer; }.switch input { position: absolute; opacity: 0; pointer-events: none; }.switch span { display: block; width: 100%; height: 100%; border-radius: 999px; background: #263247; transition: .2s; }.switch span::after { content: ''; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 7px rgba(0,0,0,.35); transition: .2s; }.switch input:checked + span { background: linear-gradient(90deg, #6259ee, #3889ff); box-shadow: 0 0 20px rgba(98,89,238,.25); }.switch input:checked + span::after { transform: translateX(20px); }.switch input:focus-visible + span { outline: 2px solid #92a0ff; outline-offset: 3px; }

.metric-detail-view { max-width: 1360px; margin: 0 auto; }
.back-button { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; margin: 0 0 18px; padding: 0 11px 0 8px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.025); color: #9aa8bc; font-size: 13px; cursor: pointer; transition: .2s ease; }
.back-button:hover { border-color: var(--border-strong); background: rgba(255,255,255,.05); color: #eef3ff; }
.back-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.detail-hero { position: relative; display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 18px; min-height: 132px; padding: 25px 28px; overflow: hidden; border: 1px solid var(--border); border-radius: 20px; background: linear-gradient(118deg, rgba(24,31,58,.92), rgba(10,19,33,.92) 58%, rgba(13,24,41,.84)); box-shadow: var(--shadow); }
.detail-hero::after { content: ''; position: absolute; width: 360px; height: 360px; right: -190px; top: -210px; border: 1px solid rgba(106,99,255,.15); border-radius: 50%; box-shadow: 0 0 90px rgba(83,76,230,.08); }
.detail-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; color: #8a83ff; background: linear-gradient(145deg, rgba(117,103,255,.18), rgba(34,211,238,.08)); }
.detail-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.detail-title .panel-kicker { display: block; }.detail-title h2 { margin: 3px 0 4px; font: 700 28px/1.15 'Space Grotesk', sans-serif; letter-spacing: -.035em; }.detail-title p { margin: 0; color: var(--muted); font-size: 13px; }
.detail-current { position: relative; z-index: 1; text-align: right; }.detail-current strong { display: block; font: 700 36px/1.05 'Space Grotesk', sans-serif; letter-spacing: -.04em; }.detail-current span { display: inline-flex; align-items: center; gap: 6px; margin-top: 7px; color: var(--green); font-size: 12px; font-weight: 600; }.detail-current span::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }.detail-current span.warning { color: var(--amber); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .72fr); gap: 16px; margin-top: 16px; }
.detail-main-panel, .detail-info-panel { padding: 22px; }
.detail-main-panel .panel-head { margin-bottom: 20px; }
.detail-chart-shell { position: relative; min-height: 300px; padding: 10px 0 30px 48px; }
.detail-chart-shell .line-chart { height: 275px; }
.detail-chart-shell .chart-y-labels { bottom: 30px; }
.detail-chart-shell .chart-y-labels.rate-labels { left: -8px; align-items: flex-end; font-size: 9px; white-space: nowrap; }
.detail-chart-shell .chart-x-labels { left: 48px; }
.detail-side { display: grid; align-content: start; gap: 16px; }
.detail-info-panel h3 { margin: 5px 0 9px; font: 600 17px/1.25 'Space Grotesk', sans-serif; }.detail-info-panel p { margin: 0; color: #939fb2; font-size: 13px; line-height: 1.65; }
.detail-rule { margin-top: 18px; padding: 13px; border: 1px solid var(--border); border-radius: 11px; background: rgba(0,0,0,.14); }.detail-rule span, .detail-rule strong { display: block; }.detail-rule span { color: var(--muted-2); font-size: 10px; font-weight: 700; letter-spacing: .09em; }.detail-rule strong { margin-top: 4px; font-size: 13px; }
.detail-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: 13px; background: var(--border); }.detail-stat { padding: 16px; background: #0b1422; }.detail-stat span, .detail-stat strong { display: block; }.detail-stat span { color: var(--muted); font-size: 11px; }.detail-stat strong { margin-top: 4px; font: 600 18px 'Space Grotesk', sans-serif; }
.heartbeat-track { display: grid; grid-template-columns: repeat(24, 1fr); gap: 4px; margin: 28px 0 13px; }.heartbeat-track i { height: 54px; border-radius: 5px; background: linear-gradient(180deg, rgba(42,230,160,.85), rgba(42,230,160,.24)); box-shadow: 0 0 12px rgba(42,230,160,.08); }.heartbeat-caption { display: flex; justify-content: space-between; color: var(--muted-2); font-size: 11px; }
.uptime-orbit { position: relative; display: grid; place-items: center; width: 230px; height: 230px; margin: 10px auto 22px; border: 1px solid rgba(117,103,255,.18); border-radius: 50%; }.uptime-orbit::before, .uptime-orbit::after { content: ''; position: absolute; border: 1px solid rgba(34,211,238,.12); border-radius: 50%; }.uptime-orbit::before { inset: 24px; }.uptime-orbit::after { inset: 52px; border-color: rgba(117,103,255,.28); }.uptime-orbit div { position: relative; z-index: 1; text-align: center; }.uptime-orbit strong { display: block; font: 700 31px 'Space Grotesk', sans-serif; }.uptime-orbit span { color: var(--muted); font-size: 12px; }

.toast { position: fixed; left: 50%; bottom: 25px; z-index: 50; max-width: calc(100vw - 30px); padding: 11px 15px; transform: translate(-50%, 25px); border: 1px solid var(--border-strong); border-radius: 11px; background: #111c2c; color: #eef3ff; box-shadow: 0 18px 60px rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: .25s ease; font-size: 13px; }.toast.show { transform: translate(-50%, 0); opacity: 1; }

@keyframes pulse { 0%,100% { transform: scale(.75); opacity: 0; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes login-leave { to { opacity: 0; transform: scale(1.015); visibility: hidden; } }

@media (max-width: 980px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-art { position: absolute; inset: 0; min-height: 100%; padding: 28px; opacity: .46; background-position: 42% center; }
  .login-art::after { box-shadow: inset 0 0 140px 30px #050a13; background: rgba(4,9,17,.28); }
  .login-art > * { display: none; }
  .login-side { border: 0; background: rgba(5,10,18,.65); backdrop-filter: blur(4px); }
  .login-card { max-width: 430px; padding: 32px; border: 1px solid rgba(145,173,215,.14); border-radius: 22px; background: rgba(8,15,26,.84); box-shadow: 0 30px 80px rgba(0,0,0,.42); backdrop-filter: blur(22px); }
  .login-card-brand { display: flex; margin-bottom: 38px; font-size: 18px; }
  .login-card-brand .brand-mark { width: 29px; height: 29px; }
}

@media (max-width: 520px) {
  .login-side { align-items: stretch; padding: 0; }
  .login-card { width: 100%; max-width: none; min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 28px 24px; border: 0; border-radius: 0; background: rgba(5,10,18,.76); }
  .login-heading h2 { font-size: 27px; }
}

@media (max-width: 1180px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .insights-column { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-side { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 840px) {
  .app-shell { display: block; }
  .sidebar { position: sticky; height: auto; padding: 12px 18px; flex-direction: row; align-items: center; gap: 18px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { padding: 0; font-size: 16px; }.brand-mark { width: 26px; height: 26px; }
  .nav-list { display: flex; flex: 1; justify-content: center; gap: 4px; }.nav-item { display: flex; min-height: 42px; padding: 0 11px; }.nav-item span:not(.nav-count) { display: none; }.nav-item svg { width: 19px; height: 19px; }.nav-item.active { box-shadow: inset 0 -2px 0 #7567ff; }
  .sidebar-foot { display: none; }
  .main-content { padding: 0 18px 30px; }.topbar { min-height: 125px; }.domain-chip { display: none; }
  .health-layout { grid-template-columns: 1fr; }.facts-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-side { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .sidebar { gap: 8px; }.brand span:last-child { display: none; }.nav-list { justify-content: flex-end; }
  .topbar { align-items: flex-start; min-height: 154px; padding: 25px 0 18px; }.topbar-right { position: absolute; right: 18px; top: 78px; }.machine-meta i, .machine-meta span:nth-of-type(2) { display: none; }
  .metrics-grid, .insights-column, .rules-grid { grid-template-columns: 1fr; }.metric-card { min-height: 106px; }.chart-panel { padding: 17px 14px 14px; }.chart-wrap { padding-left: 38px; }.chart-x-labels { left: 38px; }.line-chart { height: 210px; }.chart-panel.compact .line-chart { height: 160px; }.legend { gap: 8px; font-size: 10px; }
  .page-title { align-items: flex-start; flex-direction: column; }.page-title h2 { font-size: 26px; }.health-score { align-items: flex-start; flex-direction: column; }.facts-grid { grid-template-columns: 1fr; }
  .alert-row { grid-template-columns: 40px 1fr; }.alert-actions, .alert-row > .duration { grid-column: 2; justify-content: flex-start; }.alert-main > div { align-items: flex-start; flex-direction: column; gap: 5px; }
  .rule-card { grid-template-columns: 46px 1fr; }.rule-card .switch { position: absolute; right: 18px; top: 20px; }.rule-content p { min-height: 0; }
  .metric-info::after { position: fixed; width: min(270px, calc(100vw - 30px)); right: 15px; top: 84px; }
  .detail-hero { grid-template-columns: 48px 1fr; padding: 21px; }.detail-icon { width: 46px; height: 46px; }.detail-current { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--border); text-align: left; }.detail-current strong { font-size: 31px; }
  .detail-main-panel, .detail-info-panel { padding: 17px; }.detail-chart-shell { min-height: 230px; padding-left: 37px; }.detail-chart-shell .line-chart { height: 210px; }.detail-chart-shell .chart-x-labels { left: 37px; }.detail-stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
