:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-muted: #f8f9f8;
  --ink: #17191c;
  --muted: #687078;
  --line: #dfe3e1;
  --line-strong: #cbd1ce;
  --sidebar: #181b1d;
  --sidebar-muted: #929a9d;
  --green: #16875f;
  --green-soft: #e8f5ef;
  --red: #cb3e3e;
  --red-soft: #faecec;
  --amber: #b7791f;
  --amber-soft: #fbf1de;
  --cyan: #237b91;
  --cyan-soft: #e5f2f5;
  --blue: #3569b0;
  --shadow: 0 1px 2px rgba(17, 24, 28, 0.05), 0 8px 24px rgba(17, 24, 28, 0.04);
  --radius: 6px;
  --font: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
}

body {
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background: #eef1ef;
  background-image:
    linear-gradient(#dce1de 1px, transparent 1px),
    linear-gradient(90deg, #dce1de 1px, transparent 1px);
  background-size: 40px 40px;
}

.login-panel {
  width: min(100%, 400px);
  padding: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.product-kicker,
.page-title-block p,
.panel-header p,
.table-header-row p,
.drawer-head p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-panel h1 {
  margin: 17px 0 8px;
  font-size: 30px;
  line-height: 1.15;
}

.brand-mark {
  width: 48px;
  height: 36px;
  display: flex;
  align-items: end;
  gap: 5px;
}

.brand-mark span {
  width: 10px;
  background: var(--ink);
  border-radius: 2px 2px 0 0;
}

.brand-mark span:nth-child(1) { height: 16px; }
.brand-mark span:nth-child(2) { height: 30px; background: var(--green); }
.brand-mark span:nth-child(3) { height: 23px; background: var(--cyan); }

.brand-mark--small {
  width: 34px;
  height: 27px;
  gap: 3px;
}

.brand-mark--small span { width: 7px; }
.brand-mark--small span:nth-child(1) { height: 12px; }
.brand-mark--small span:nth-child(2) { height: 24px; }
.brand-mark--small span:nth-child(3) { height: 18px; }

.login-status {
  margin: 0 0 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot--live {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 135, 95, 0.13);
}

.field-label {
  display: block;
  margin: 16px 0 7px;
  color: #454b50;
  font-size: 12px;
  font-weight: 700;
}

.input-wrap {
  height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #fff;
}

.input-wrap:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 135, 95, 0.12);
}

.input-wrap svg {
  width: 17px;
  color: var(--muted);
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}

.input-action {
  width: 30px !important;
  height: 30px !important;
  margin-right: -6px;
  border: 0 !important;
}

.form-error {
  min-height: 19px;
  margin: 10px 0 0;
  color: var(--red);
  font-size: 12px;
}

.primary-button,
.icon-text-button,
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  height: 46px;
  margin-top: 8px;
  border-radius: 5px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

.primary-button:hover { background: #2c3034; }
.primary-button:disabled { opacity: 0.65; cursor: wait; }
.primary-button svg { width: 17px; }

.login-footnote {
  margin: 20px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.login-footnote svg { width: 15px; color: var(--green); }

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 224px;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 16px;
  background: var(--sidebar);
  color: #f1f3f2;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 8px 23px;
  border-bottom: 1px solid #303437;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong { font-size: 15px; }
.sidebar-brand span { margin-top: 3px; color: var(--sidebar-muted); font-size: 11px; }

.nav-list {
  display: grid;
  gap: 5px;
  margin-top: 22px;
}

.nav-item,
.logout-button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: #b8bec0;
  cursor: pointer;
  text-align: left;
}

.nav-item:hover,
.logout-button:hover { background: #24282a; color: #fff; }
.nav-item.active { border-color: #3b4144; background: #2a2e31; color: #fff; }
.nav-item svg,
.logout-button svg { width: 18px; height: 18px; }
.nav-item b { margin-left: auto; min-width: 20px; padding: 2px 5px; border-radius: 10px; background: #373c3f; font-size: 10px; text-align: center; }
.nav-item.active b { background: var(--green); color: #fff; }

.sidebar-node {
  margin: auto 3px 14px;
  padding: 13px 12px;
  border: 1px solid #34393c;
  border-radius: 5px;
  background: #202426;
}

.node-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.sidebar-node strong {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.sidebar-node > span {
  display: block;
  margin-top: 4px;
  color: var(--sidebar-muted);
  font-size: 10px;
}

.logout-button { margin-top: 0; }

.main-area {
  min-width: 0;
  margin-left: 224px;
  padding: 0 28px 24px;
}

.topbar {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.page-title-block h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-control,
.filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
}

.range-control button,
.filter-tabs button {
  min-width: 38px;
  height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.range-control button:hover,
.filter-tabs button:hover { color: var(--ink); }
.range-control button.active,
.filter-tabs button.active { background: var(--ink); color: #fff; }

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
}

.icon-button:hover { border-color: #aab1ad; background: var(--surface-muted); }
.icon-button svg { width: 17px; height: 17px; }
.icon-button.spinning svg { animation: spin 0.8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.auto-refresh {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.auto-refresh input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { width: 27px; height: 16px; padding: 2px; border-radius: 10px; background: #b9c0bc; transition: background 0.2s; }
.toggle-track span { width: 12px; height: 12px; display: block; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.auto-refresh input:checked + .toggle-track { background: var(--green); }
.auto-refresh input:checked + .toggle-track span { transform: translateX(11px); }

.stale-banner {
  margin-top: 16px;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: 1px solid #e5c787;
  border-radius: 5px;
  background: var(--amber-soft);
  color: #785315;
  font-size: 12px;
}

.stale-banner svg { width: 17px; }
.view { display: none; padding-top: 22px; }
.view.active { display: block; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card {
  min-width: 0;
  min-height: 145px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpi-card--score { border-top: 3px solid var(--green); padding-top: 14px; }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.kpi-head svg { width: 17px; color: #858d91; }
.kpi-card > strong { display: block; margin-top: 18px; font-size: 27px; line-height: 1; }
.kpi-card p { min-height: 30px; margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.score-row { display: flex; align-items: baseline; gap: 4px; margin-top: 13px; }
.score-row strong { font-size: 31px; }
.score-row span { color: var(--muted); font-size: 12px; }
.score-track,
.mini-track { height: 5px; margin-top: 12px; overflow: hidden; border-radius: 3px; background: #e8ebe9; }
.score-track span,
.mini-track span { height: 100%; display: block; width: 0; border-radius: inherit; background: var(--green); transition: width 0.3s; }
.status-split { height: 5px; display: flex; gap: 2px; margin-top: 12px; overflow: hidden; border-radius: 3px; background: #e8ebe9; }
.status-split span { display: block; height: 100%; }
.status-split .good { background: var(--green); }
.status-split .bad { background: var(--red); }
.threat-pulse { display: flex; align-items: end; gap: 3px; height: 12px; margin-top: 8px; }
.threat-pulse span { width: 5px; border-radius: 1px; background: var(--red); opacity: 0.75; }
.threat-pulse span:nth-child(1) { height: 4px; }.threat-pulse span:nth-child(2) { height: 9px; }.threat-pulse span:nth-child(3) { height: 6px; }.threat-pulse span:nth-child(4) { height: 12px; }.threat-pulse span:nth-child(5) { height: 7px; }

.overview-grid,
.security-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.panel,
.table-panel,
.event-stream-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel { padding: 18px; }
.panel--wide { min-height: 310px; }
.panel-header,
.table-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-header h2,
.table-header-row h2,
.drawer-head h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.legend { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; display: inline-block; border-radius: 50%; }
.legend-cpu { background: var(--green); }.legend-memory { background: var(--cyan); }.legend-load { background: var(--amber); }
.chart-frame { position: relative; height: 238px; margin-top: 14px; }
.chart-frame--compact { height: 145px; }

.count-badge,
.metric-chip {
  min-width: 28px;
  padding: 4px 8px;
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.count-badge--danger { background: var(--red-soft); color: var(--red); }

.incident-list { display: grid; gap: 0; margin-top: 13px; }
.incident-item { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 11px 0; border-bottom: 1px solid #ecefed; }
.incident-item:last-child { border-bottom: 0; }
.incident-marker { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--amber); }
.incident-marker.critical { background: var(--red); }
.incident-item strong { display: block; overflow-wrap: anywhere; font-size: 12px; }
.incident-item p { margin: 3px 0 0; display: -webkit-box; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.incident-item time { color: #949b9e; font-size: 10px; white-space: nowrap; }
.empty-state { min-height: 130px; display: grid; place-items: center; color: var(--muted); text-align: center; }
.empty-state svg { width: 30px; margin-bottom: 8px; color: var(--green); }

.text-button { padding: 5px 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 700; }
.text-button svg { width: 14px; }
.service-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin-top: 15px; }
.service-tile { min-width: 0; height: 90px; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-muted); cursor: pointer; }
.service-tile:hover { border-color: var(--line-strong); background: #fff; }
.service-tile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.service-tile strong { font-size: 12px; line-height: 1.2; overflow-wrap: anywhere; }
.service-tile p { margin: 9px 0 0; color: var(--muted); font-size: 10px; }
.state-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 9px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 700; white-space: nowrap; }
.state-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.state-pill.problem { background: var(--red-soft); color: var(--red); }
.state-pill.warning { background: var(--amber-soft); color: var(--amber); }
.state-pill.neutral { background: #edf0ee; color: #687078; }

.endpoint-mini-list { display: grid; gap: 7px; margin-top: 8px; }
.endpoint-mini { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 11px; }
.endpoint-mini span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.endpoint-mini b { color: var(--muted); font-size: 10px; }

.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.search-box { width: min(390px, 100%); height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--surface); }
.search-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 135, 95, 0.1); }
.search-box svg { width: 16px; color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; }

.table-panel { overflow: hidden; }
.table-header-row { min-height: 69px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.table-header-row > span { color: var(--muted); font-size: 11px; }
.table-scroll { width: 100%; overflow: auto; }
.table-scroll--short { max-height: 345px; }
.table-scroll--medium { max-height: 520px; }
table { width: 100%; border-collapse: collapse; }
th { height: 38px; padding: 0 13px; border-bottom: 1px solid var(--line); background: #f7f8f7; color: var(--muted); font-size: 10px; font-weight: 700; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { height: 50px; max-width: 360px; padding: 8px 13px; border-bottom: 1px solid #ecefed; color: #353a3e; font-size: 11px; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover td { background: #f8faf9; }
.service-cell { display: flex; align-items: center; gap: 9px; min-width: 165px; }
.service-icon { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 4px; background: #edf0ee; color: #4e565a; }
.service-icon svg { width: 15px; }
.service-cell strong { display: block; color: var(--ink); font-size: 11px; }
.service-cell span { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.reason-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-action { width: 28px; height: 28px; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
.table-action:hover { background: #ecefed; }
.table-action svg { width: 15px; }
.group-tag { display: inline-block; padding: 3px 6px; border-radius: 3px; background: #edf1ef; color: #58605d; font-size: 9px; font-weight: 700; text-transform: uppercase; }

.security-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.summary-stat { min-height: 88px; padding: 14px 15px; border: 1px solid var(--line); border-left: 3px solid var(--cyan); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.summary-stat.red { border-left-color: var(--red); }.summary-stat.green { border-left-color: var(--green); }.summary-stat.amber { border-left-color: var(--amber); }
.summary-stat span { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.summary-stat strong { display: block; margin-top: 11px; font-size: 24px; line-height: 1; }
.summary-stat small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.icon-text-button { min-height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: #454b50; font-size: 11px; font-weight: 700; }
.icon-text-button:hover { background: var(--surface-muted); }
.icon-text-button svg { width: 15px; }
.jail-list { display: grid; gap: 8px; margin-top: 14px; }
.jail-item { padding: 10px 11px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-muted); }
.jail-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.jail-item strong { font-size: 11px; }
.jail-item span { color: var(--muted); font-size: 10px; }
.jail-bars { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 8px; }
.jail-track { height: 4px; overflow: hidden; border-radius: 2px; background: #dfe4e1; }
.jail-track i { height: 100%; display: block; background: var(--red); }
.panel--wide-grid { min-width: 0; }

.network-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; }
.mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 10px; }
.availability-bar { width: 88px; height: 5px; overflow: hidden; border-radius: 3px; background: #e5e8e6; }
.availability-bar span { height: 100%; display: block; background: var(--green); }
.tls-good { color: var(--green); font-weight: 700; }.tls-warn { color: var(--amber); font-weight: 700; }.tls-bad { color: var(--red); font-weight: 700; }

.event-stream-panel { overflow: hidden; }
.event-stream { max-height: calc(100vh - 240px); min-height: 430px; overflow: auto; }
.event-row { display: grid; grid-template-columns: 110px 28px minmax(160px, 0.7fr) minmax(250px, 1.8fr) 145px; align-items: center; gap: 10px; min-height: 54px; padding: 8px 16px; border-bottom: 1px solid #ecefed; }
.event-row:hover { background: #f8faf9; }
.event-time { color: var(--muted); font-size: 10px; }
.event-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; background: var(--amber-soft); color: var(--amber); }
.event-icon.success { background: var(--green-soft); color: var(--green); }.event-icon.failed,.event-icon.denied { background: var(--red-soft); color: var(--red); }.event-icon.blocked { background: #eceff5; color: var(--blue); }
.event-icon svg { width: 14px; }
.event-source strong,.event-detail strong { display: block; font-size: 11px; }
.event-source span,.event-detail span { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.event-ip { overflow: hidden; color: #444b4f; font-family: "Cascadia Mono", Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.dashboard-footer { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 15px; color: #81898c; font-size: 10px; }

.service-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 50;
  width: min(440px, 100vw);
  padding: 20px;
  transform: translateX(105%);
  border-left: 1px solid var(--line-strong);
  background: #fff;
  box-shadow: -12px 0 30px rgba(12, 18, 20, 0.12);
  transition: transform 0.22s ease;
}

.service-drawer.open { transform: translateX(0); }
.drawer-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(15, 18, 20, 0.32); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.drawer-body { height: calc(100vh - 95px); overflow: auto; padding: 17px 2px 30px; }
.drawer-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 16px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.detail-item { min-height: 67px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-muted); }
.detail-item span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.detail-item strong { display: block; margin-top: 7px; overflow-wrap: anywhere; font-size: 12px; }
.drawer-section { margin-top: 20px; }
.drawer-section h3 { margin: 0 0 10px; font-size: 12px; }
.reason-block { padding: 12px; border-left: 3px solid var(--amber); background: var(--amber-soft); color: #694a16; font-size: 11px; line-height: 1.5; }
.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; padding: 0 0 15px 20px; border-left: 1px solid var(--line-strong); }
.timeline-item::before { content: ""; position: absolute; left: -4px; top: 2px; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); }
.timeline-item strong { display: block; font-size: 10px; }.timeline-item span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 80; max-width: min(360px, calc(100vw - 40px)); padding: 11px 14px; transform: translateY(20px); border: 1px solid var(--line-strong); border-radius: 5px; background: var(--ink); color: #fff; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; font-size: 11px; box-shadow: var(--shadow); }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .service-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .sidebar { position: sticky; top: 0; width: 100%; height: auto; flex-direction: row; align-items: center; padding: 10px 12px; overflow-x: auto; }
  .sidebar-brand { min-width: 180px; padding: 0 14px 0 0; border: 0; }
  .nav-list { display: flex; gap: 4px; margin: 0; }
  .nav-item { width: auto; min-width: 42px; padding: 0 10px; }
  .nav-item span { display: none; }
  .nav-item b { margin-left: 0; }
  .sidebar-node,.logout-button span { display: none; }
  .logout-button { width: 42px; margin-left: auto; padding: 0 11px; }
  .main-area { margin-left: 0; padding: 0 16px 20px; }
  .overview-grid,.security-grid { grid-template-columns: 1fr; }
  .panel--wide-grid { grid-column: auto; }
}

@media (max-width: 720px) {
  .sidebar-brand div:last-child { display: none; }
  .sidebar-brand { min-width: 42px; }
  .topbar { align-items: flex-start; min-height: 112px; padding: 16px 0; flex-direction: column; }
  .topbar-actions { width: 100%; }
  .range-control { flex: 1; overflow-x: auto; }
  .range-control button { flex: 1; min-width: 36px; }
  .auto-refresh > span:last-child { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card { min-height: 134px; }
  .security-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar-row { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .filter-tabs { width: 100%; overflow-x: auto; }
  .filter-tabs button { flex: 1; }
  .network-grid { grid-template-columns: 1fr; }
  .event-row { grid-template-columns: 78px 26px minmax(0, 1fr); }
  .event-detail { grid-column: 3; }
  .event-ip { grid-column: 3; }
  .chart-frame { height: 210px; }
  .dashboard-footer { align-items: flex-start; flex-direction: column; justify-content: center; }
}

@media (max-width: 440px) {
  .main-area { padding-inline: 10px; }
  .login-panel { padding: 26px 20px; }
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 125px; }
  .service-strip { grid-template-columns: 1fr; }
  .security-summary { grid-template-columns: 1fr; }
  .legend { display: none; }
  .panel { padding: 14px; }
  .page-title-block h1 { font-size: 19px; }
  .auto-refresh { padding-inline: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
