:root {
  --bg: #050505;
  --surface: #0a0a0a;
  --surface-2: #0f0f0f;
  --surface-3: #151515;
  --border: #242424;
  --border-strong: #333;
  --text: #ededed;
  --muted: #a0a0a0;
  --muted-2: #7d7d7d;
  --green: #45d483;
  --green-soft: rgba(69, 212, 131, .1);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, .1);
  --amber: #f5b942;
  --amber-soft: rgba(245, 185, 66, .1);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, .1);
  --sidebar: 232px;
  --topbar: 58px;
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
button { color: inherit; }
button:disabled { opacity: .45; cursor: not-allowed !important; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
.subtle { color: var(--muted); font-size: 12px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar); display: flex; flex-direction: column; background: #080808; border-right: 1px solid var(--border); }
.brand { height: var(--topbar); display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); }
.brand-mark { width: 27px; height: 27px; display: grid; place-items: center; color: #050505; background: var(--text); border-radius: 6px; }
.brand-mark svg { width: 18px; height: 18px; stroke-width: 2.2; }
.brand strong { display: block; font-size: 13px; line-height: 1.2; letter-spacing: .08em; }
.brand span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }

.nav { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 14px 10px; }
.nav-item { position: relative; width: 100%; height: 38px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: #999; font-size: 13px; text-align: left; cursor: pointer; transition: color .16s ease, background .16s ease; }
.nav-item svg { width: 17px; height: 17px; color: #777; transition: color .16s ease; }
.nav-item:hover { background: #111; color: #d4d4d4; }
.nav-item:hover svg { color: #aaa; }
.nav-item.active { background: #161616; color: #fff; box-shadow: inset 0 0 0 1px #222; }
.nav-item.active svg { color: #fff; }
.nav-count { margin-left: auto; min-width: 22px; padding: 1px 5px; border: 1px solid #2b2b2b; border-radius: 10px; color: #888; font: 10px/15px "SFMono-Regular", Consolas, monospace; text-align: center; }
.nav-dot { width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

.sidebar-foot { padding: 12px 10px; border-top: 1px solid var(--border); }
.live-state { display: flex; align-items: center; gap: 10px; padding: 8px 9px 12px; }
.live-state strong, .live-state span { display: block; }
.live-state strong { font-size: 11px; font-weight: 550; text-transform: capitalize; }
.live-state div span { margin-top: 3px; color: var(--muted); font: 10px "SFMono-Regular", Consolas, monospace; }
.status-pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-pulse.operational { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.status-pulse.degraded { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.status-pulse.critical { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.operator-button { width: 100%; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 9px; border: 1px solid var(--border); border-radius: 6px; background: #0d0d0d; color: #999; font-size: 11px; cursor: pointer; transition: border-color .16s ease, color .16s ease, background .16s ease; }
.operator-button:hover { border-color: #3a3a3a; background: #121212; color: #ddd; }
.operator-button svg { width: 14px; height: 14px; }
.operator-button.unlocked { color: var(--green); border-color: rgba(69,212,131,.25); background: var(--green-soft); }

.main { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar); display: flex; align-items: center; padding: 0 24px; background: rgba(5,5,5,.92); border-bottom: 1px solid var(--border); backdrop-filter: blur(14px); }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.breadcrumb span { color: var(--muted); }
.breadcrumb i { color: #3b3b3b; font-style: normal; }
.breadcrumb strong { font-weight: 500; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.timestamp { min-width: 135px; color: var(--muted); font: 10px "SFMono-Regular", Consolas, monospace; text-align: right; }
.stream-indicator { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.stream-indicator span { width: 5px; height: 5px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.stream-indicator.offline span { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.icon-button { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; background: #0a0a0a; color: #888; cursor: pointer; transition: color .16s ease, border-color .16s ease, background .16s ease; }
.icon-button:hover { color: #fff; border-color: #3a3a3a; background: #111; }
.icon-button svg { width: 15px; height: 15px; }
.icon-button.spinning svg { animation: spin .7s linear infinite; }
.mobile-menu { display: none; margin-right: 10px; }

.content { width: min(100%, 1540px); margin: 0 auto; padding: 30px 30px 60px; }
.view { display: none; animation: fade-up .2s ease; }
.view.active { display: block; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h1 { margin: 3px 0 7px; font-size: clamp(25px, 2.2vw, 34px); font-weight: 580; letter-spacing: -.045em; }
.page-heading p:not(.eyebrow) { max-width: 690px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.eyebrow, .panel-kicker { margin: 0; color: #8b8b8b; font: 10px/1.4 "SFMono-Regular", Consolas, monospace; text-transform: uppercase; letter-spacing: .14em; }
.health-badge { display: flex; align-items: center; gap: 9px; height: 35px; padding: 0 12px; border: 1px solid var(--border); border-radius: 6px; background: #0b0b0b; font-size: 11px; text-transform: capitalize; white-space: nowrap; }
.health-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.health-badge.operational { color: var(--green); border-color: rgba(69,212,131,.23); background: var(--green-soft); }
.health-badge.operational span { background: var(--green); }
.health-badge.degraded { color: var(--amber); border-color: rgba(245,185,66,.23); background: var(--amber-soft); }
.health-badge.degraded span { background: var(--amber); }
.health-badge.critical { color: var(--red); border-color: rgba(248,113,113,.23); background: var(--red-soft); }
.health-badge.critical span { background: var(--red); }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.metric-card { min-width: 0; min-height: 129px; padding: 17px 16px 14px; border-right: 1px solid var(--border); background: var(--surface); transition: background .18s ease; }
.metric-card:last-child { border-right: 0; }
.metric-card:hover { background: #0d0d0d; }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.metric-icon { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--border); border-radius: 5px; color: #777; }
.metric-icon svg { width: 13px; height: 13px; }
.metric-card > strong { display: block; margin-top: 13px; font: 500 25px/1.1 "SFMono-Regular", Consolas, monospace; letter-spacing: -.04em; }
.metric-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 13px; color: var(--muted-2); font-size: 10px; white-space: nowrap; }
.delta { overflow: hidden; text-overflow: ellipsis; }
.delta.good { color: var(--green); }.delta.bad { color: var(--red); }.delta.warn { color: var(--amber); }

.dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-top: 14px; }
.span-2 { grid-column: span 2; }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.panel-head { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 0 18px; border-bottom: 1px solid var(--border); }
.panel-head h2 { margin: 4px 0 0; font-size: 13px; font-weight: 530; letter-spacing: -.01em; }
.legend { display: flex; gap: 13px; color: var(--muted); font-size: 9px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 13px; height: 1px; }.legend i.green { background: var(--green); }.legend i.red { border-top: 1px dashed var(--red); }.legend i.blue { border-top: 1px dotted var(--blue); }
.chart-summary { display: flex; align-items: center; justify-content: space-between; padding: 17px 18px 0; }
.chart-summary strong { display: block; font: 500 22px "SFMono-Regular", Consolas, monospace; }
.chart-summary span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.chart-window, .filter-group, .tabs { display: flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: #070707; }
.chart-window button, .filter-group button, .tabs button { min-height: 25px; padding: 0 9px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 9px; cursor: pointer; transition: color .16s ease, background .16s ease; }
.chart-window button:hover, .filter-group button:hover, .tabs button:hover { color: #ddd; }
.chart-window button.active, .filter-group button.active, .tabs button.active { background: #1a1a1a; color: #eee; box-shadow: 0 0 0 1px #252525; }
#activity-chart { display: block; width: 100%; height: 230px; padding: 8px 10px 12px; }
.count-chip { min-width: 24px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 10px; color: var(--muted); font: 9px "SFMono-Regular", Consolas, monospace; text-align: center; }
.insight-list { max-height: 335px; overflow: auto; }
.insight { display: grid; grid-template-columns: 8px 1fr auto; gap: 11px; padding: 15px 17px; border-bottom: 1px solid #1c1c1c; }
.insight:last-child { border-bottom: 0; }
.insight-mark { width: 7px; height: 7px; margin-top: 4px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.insight.warning .insight-mark { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.insight.error .insight-mark { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.insight.success .insight-mark { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.insight strong { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 550; }
.insight p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.insight em { color: #aaa; font: normal 10px "SFMono-Regular", Consolas, monospace; white-space: nowrap; }
.skeleton-block { height: 56px; margin: 14px; border-radius: 5px; background: #111; animation: pulse 1.4s ease-in-out infinite; }

.pipeline-panel { margin-top: 14px; }
.pipeline { display: flex; align-items: stretch; padding: 20px 18px 22px; overflow-x: auto; }
.pipeline-node { position: relative; flex: 1 0 135px; min-height: 85px; padding: 13px; border: 1px solid var(--border); border-radius: 6px; background: #0c0c0c; }
.pipeline-node small, .pipeline-node strong, .pipeline-node em { display: block; }
.pipeline-node small { color: var(--muted-2); font: 8px "SFMono-Regular", Consolas, monospace; text-transform: uppercase; letter-spacing: .1em; }
.pipeline-node strong { margin-top: 10px; font-size: 12px; font-weight: 550; }
.pipeline-node em { margin-top: 5px; color: var(--muted); font: normal 8px "SFMono-Regular", Consolas, monospace; }
.node-state { position: absolute; top: 13px; right: 13px; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }.node-state.ok { background: var(--green); }.node-state.warn { background: var(--amber); }.node-state.error { background: var(--red); }
.pipeline-edge { position: relative; flex: 0 0 48px; }
.pipeline-edge::before { content: ""; position: absolute; top: 42px; left: 7px; right: 7px; height: 1px; background: #333; }
.pipeline-edge::after { content: ""; position: absolute; top: 39px; right: 7px; width: 6px; height: 6px; border-top: 1px solid #555; border-right: 1px solid #555; transform: rotate(45deg); }
.pipeline-edge span { position: absolute; top: 40px; left: 8px; width: 4px; height: 4px; border-radius: 50%; background: var(--green); animation: flow 2.2s linear infinite; }

.primary-button, .secondary-button, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border-radius: 6px; cursor: pointer; transition: background .16s ease, border-color .16s ease, color .16s ease; }
.primary-button { min-height: 34px; padding: 0 12px; border: 1px solid #f5f5f5; background: #ededed; color: #050505; font-size: 11px; font-weight: 550; }
.primary-button:hover { background: #fff; }
.secondary-button { min-height: 34px; padding: 0 12px; border: 1px solid var(--border-strong); background: #101010; color: #ddd; font-size: 11px; }
.secondary-button:hover { background: #161616; border-color: #484848; }
.text-button { min-height: 28px; padding: 0 5px; border: 0; background: transparent; color: var(--muted); font-size: 10px; }
.text-button:hover { color: #fff; }
.primary-button svg, .secondary-button svg { width: 14px; height: 14px; }
.primary-button.full { width: 100%; min-height: 38px; }
.outline-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 29px; padding: 0 9px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); font: 9px "SFMono-Regular", Consolas, monospace; white-space: nowrap; }
.outline-badge span { width: 5px; height: 5px; border-radius: 50%; background: var(--green); }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.search-field { min-width: 250px; max-width: 390px; height: 33px; flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: #090909; color: var(--muted); }
.search-field:focus-within { border-color: #444; }
.search-field svg { width: 14px; height: 14px; flex: 0 0 auto; }
.search-field input { width: 100%; border: 0; background: transparent; color: var(--text); font-size: 11px; }
.search-field input:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }
.search-field input::placeholder { color: #555; }
.table-count { margin-left: auto; color: var(--muted); font: 9px "SFMono-Regular", Consolas, monospace; }
.table-panel { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 39px; padding: 0 14px; border-bottom: 1px solid var(--border); color: var(--muted-2); font: 9px "SFMono-Regular", Consolas, monospace; text-align: left; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
td { height: 53px; padding: 0 14px; border-bottom: 1px solid #1b1b1b; color: #b5b5b5; font-size: 11px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #0e0e0e; }
.meter-cell strong, .meter-cell span { display: block; }
.meter-cell strong { color: #e0e0e0; font: 500 11px "SFMono-Regular", Consolas, monospace; }
.meter-cell span { margin-top: 4px; color: var(--muted-2); font-size: 9px; }
.status-tag { display: inline-flex; align-items: center; gap: 6px; color: #aaa; font-size: 9px; text-transform: capitalize; }
.status-tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.status-tag.connected i, .status-tag.healthy i { background: var(--green); }.status-tag.degraded i { background: var(--amber); }.status-tag.quarantined i { background: var(--red); }
.table-action { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.table-action:hover { border-color: var(--border); background: #151515; color: #fff; }
.table-action svg { width: 13px; height: 13px; }
.empty-state { padding: 45px 20px; color: var(--muted); font-size: 10px; text-align: center; }

.compact-metrics { display: grid; grid-template-columns: repeat(5, 1fr); margin-bottom: 14px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.compact-metrics div { padding: 14px 16px; border-right: 1px solid var(--border); background: var(--surface); }
.compact-metrics div:last-child { border-right: 0; }
.compact-metrics span, .compact-metrics strong { display: block; }
.compact-metrics span { color: var(--muted); font-size: 9px; }
.compact-metrics strong { margin-top: 8px; font: 500 19px "SFMono-Regular", Consolas, monospace; }
.tabs-head { min-height: 50px; }
.tab-content { display: none; }.tab-content.active { display: block; }
.event-feed { max-height: 520px; overflow: auto; }
.event-row { display: grid; grid-template-columns: 138px 90px minmax(0,1fr) auto; align-items: center; gap: 12px; min-height: 54px; padding: 8px 16px; border-bottom: 1px solid #1b1b1b; }
.event-row:last-child { border-bottom: 0; }
.event-row time { color: var(--muted-2); font: 8px "SFMono-Regular", Consolas, monospace; }
.event-row strong { color: #ccc; font-size: 10px; font-weight: 500; }
.event-row p { margin: 3px 0 0; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.security-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.security-card { min-height: 140px; display: flex; align-items: flex-start; gap: 15px; padding: 19px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.security-card-icon { width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid; border-radius: 7px; }.security-card-icon svg { width: 16px; height: 16px; }
.security-card-icon.blue { color: var(--blue); border-color: rgba(96,165,250,.2); background: var(--blue-soft); }.security-card-icon.green { color: var(--green); border-color: rgba(69,212,131,.2); background: var(--green-soft); }.security-card-icon.amber { color: var(--amber); border-color: rgba(245,185,66,.2); background: var(--amber-soft); }
.security-card span { color: var(--muted); font-size: 9px; }.security-card strong { display: block; margin-top: 7px; font: 500 24px "SFMono-Regular", Consolas, monospace; }.security-card p { margin: 9px 0 0; color: var(--muted-2); font-size: 9px; line-height: 1.5; }
.security-detail-grid { grid-template-columns: 2fr 1fr; }
.state-machine { display: flex; align-items: center; padding: 28px 20px; overflow-x: auto; }
.state-step { min-width: 110px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; background: #0c0c0c; }
.state-step i { display: block; width: 6px; height: 6px; margin-bottom: 9px; border-radius: 50%; background: var(--blue); }.state-step.risk i { background: var(--amber); }.state-step.success i { background: var(--green); }
.state-step span, .state-step small { display: block; }.state-step span { color: #ddd; font: 9px "SFMono-Regular", Consolas, monospace; }.state-step small { margin-top: 5px; color: var(--muted-2); font-size: 8px; }
.state-machine > b { flex: 1 0 25px; height: 1px; background: #333; }
.callout { display: flex; gap: 11px; margin: 0 18px 18px; padding: 13px; border: 1px solid; border-radius: 6px; }.callout svg { width: 16px; height: 16px; flex: 0 0 auto; }.callout strong { display: block; font-size: 10px; }.callout p { margin: 5px 0 0; font-size: 9px; line-height: 1.55; }.callout.warning { color: var(--amber); border-color: rgba(245,185,66,.2); background: var(--amber-soft); }.callout.warning p { color: #a98b51; }.callout.info { color: var(--blue); border-color: rgba(96,165,250,.2); background: var(--blue-soft); }.callout.info p { color: #7189a6; }
.definition-list, .config-list { margin: 0; }
.definition-list div, .config-list div { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 43px; padding: 0 17px; border-bottom: 1px solid #1b1b1b; }
.definition-list div:last-child, .config-list div:last-child { border-bottom: 0; }
.definition-list dt, .config-list dt { color: var(--muted); font-size: 9px; }.definition-list dd, .config-list dd { margin: 0; color: #ccc; font: 9px "SFMono-Regular", Consolas, monospace; text-align: right; }

.log-panel { overflow: hidden; }
.log-head { display: grid; grid-template-columns: 150px 70px 1fr; gap: 10px; height: 36px; align-items: center; padding: 0 15px; border-bottom: 1px solid var(--border); color: var(--muted-2); font: 8px "SFMono-Regular", Consolas, monospace; text-transform: uppercase; letter-spacing: .08em; }
.log-stream { max-height: calc(100vh - 235px); min-height: 460px; overflow: auto; font-family: "SFMono-Regular", Consolas, monospace; }
.log-entry { display: grid; grid-template-columns: 150px 70px minmax(0,1fr); gap: 10px; min-height: 39px; align-items: start; padding: 10px 15px; border-bottom: 1px solid #171717; font-size: 10px; }
.log-entry:hover { background: #0e0e0e; }
.log-entry time { color: #555; }.log-level { font-weight: 600; }.log-level.ERROR { color: var(--red); }.log-level.WARN { color: var(--amber); }.log-level.INFO { color: var(--green); }.log-level.DEBUG, .log-level.TRACE { color: var(--blue); }
.log-message { min-width: 0; color: #bbb; line-height: 1.45; word-break: break-word; }.log-target { color: #555; }.log-fields { margin-left: 7px; color: #6f7d8d; }

.config-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(320px,.75fr); gap: 14px; }
.config-list { display: grid; grid-template-columns: 1fr 1fr; }
.config-list div:nth-child(odd) { border-right: 1px solid #1b1b1b; }
.config-list div:nth-last-child(-n+2) { border-bottom: 0; }
.action-panel form { display: grid; gap: 15px; padding: 18px; }
.action-panel label, .modal label { display: grid; gap: 7px; color: var(--muted); font-size: 9px; }
.action-panel input, .action-panel select, .modal input { width: 100%; height: 37px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; background: #070707; color: #ddd; font-size: 11px; transition: border-color .16s ease; }
.action-panel input:focus-visible, .action-panel select:focus-visible, .modal input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.action-panel input:focus, .action-panel select:focus, .modal input:focus { border-color: #4a4a4a; }
.lock-state { color: var(--red); font: 9px "SFMono-Regular", Consolas, monospace; }.lock-state.unlocked { color: var(--green); }
.form-note { margin: 0; padding: 0 18px 18px; color: var(--muted-2); font-size: 8px; line-height: 1.5; }
.action-result { margin: 0 18px 18px; padding: 11px; border: 1px solid rgba(69,212,131,.2); border-radius: 6px; background: var(--green-soft); color: var(--green); font-size: 9px; line-height: 1.5; }
.action-result.error { color: var(--red); border-color: rgba(248,113,113,.2); background: var(--red-soft); }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; overflow-y: auto; background: rgba(0,0,0,.78); backdrop-filter: blur(7px); }
.modal { position: relative; width: min(100%, 410px); max-height: calc(100dvh - 40px); padding: 28px; overflow-y: auto; border: 1px solid #333; border-radius: 10px; background: #0b0b0b; box-shadow: 0 24px 90px rgba(0,0,0,.7); animation: modal-in .18s ease; }
.modal-close { position: absolute; top: 13px; right: 13px; width: 27px; height: 27px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; }.modal-close:hover { color: #fff; }.modal-close svg { width: 15px; height: 15px; }
.modal-icon { width: 35px; height: 35px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 7px; background: #111; }.modal-icon svg { width: 17px; height: 17px; }
.modal h2 { margin: 19px 0 8px; font-size: 17px; font-weight: 560; letter-spacing: -.02em; }.modal > p { margin: 0 0 20px; color: var(--muted); font-size: 10px; line-height: 1.55; }.modal .primary-button { margin-top: 16px; }.modal-hint { display: block; margin-top: 12px; color: var(--muted-2); font-size: 8px; text-align: center; }
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: grid; gap: 8px; }
.toast { width: min(360px, calc(100vw - 36px)); padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 7px; background: #111; box-shadow: 0 15px 40px rgba(0,0,0,.45); animation: toast-in .2s ease; }.toast strong { display: block; font-size: 10px; }.toast span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }.toast.error { border-color: rgba(248,113,113,.35); }.toast.success { border-color: rgba(69,212,131,.35); }

@keyframes fade-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flow { from { transform: translateX(0); opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } to { transform: translateX(30px); opacity: 0; } }

@media (max-width: 1220px) {
  .metric-grid { grid-template-columns: repeat(3,1fr); }
  .metric-card { border-bottom: 1px solid var(--border); }
  .metric-card:nth-child(3) { border-right: 0; }
  .metric-card:nth-child(n+4) { border-bottom: 0; }
  .compact-metrics { grid-template-columns: repeat(3,1fr); }
  .compact-metrics div:nth-child(3) { border-right: 0; }
  .compact-metrics div:nth-child(n+4) { border-top: 1px solid var(--border); }
  .config-layout { grid-template-columns: 1fr; }
}

@media (max-width: 960px) {
  :root { --sidebar: 210px; }
  .content { padding: 24px 20px 50px; }
  .dashboard-grid, .security-detail-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .security-grid { grid-template-columns: 1fr 1fr; }
  .security-card:last-child { grid-column: span 2; }
}

@media (max-width: 760px) {
  :root { --topbar: 54px; }
  .sidebar { transform: translateX(-100%); box-shadow: 20px 0 60px rgba(0,0,0,.5); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .mobile-menu { display: grid; }
  .topbar { padding: 0 14px; }
  .timestamp { display: none; }
  .content { padding: 20px 14px 42px; }
  .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 18px; }
  .page-heading > button, .page-heading > span, .page-heading > .health-badge { align-self: flex-start; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric-card { min-height: 118px; }
  .metric-card:nth-child(2n) { border-right: 0; }
  .metric-card:nth-child(3) { border-right: 1px solid var(--border); }
  .metric-card:nth-child(n+3) { border-bottom: 1px solid var(--border); }
  .metric-card:nth-child(n+5) { border-bottom: 0; }
  .toolbar { flex-wrap: wrap; }
  .search-field { min-width: 100%; max-width: none; }
  .filter-group { max-width: 100%; overflow-x: auto; }
  .table-count { margin-left: 0; }
  .security-grid { grid-template-columns: 1fr; }
  .security-card:last-child { grid-column: span 1; }
  .compact-metrics { grid-template-columns: 1fr 1fr; }
  .compact-metrics div:nth-child(3) { border-right: 1px solid var(--border); }
  .compact-metrics div:nth-child(2n) { border-right: 0; }
  .compact-metrics div:nth-child(n+3) { border-top: 1px solid var(--border); }
  .tabs-head { align-items: flex-start; flex-direction: column; padding: 10px; }
  .tabs { width: 100%; overflow-x: auto; }
  .event-row { grid-template-columns: 1fr auto; }
  .event-row time { grid-column: span 1; }.event-row > div { grid-column: 1 / -1; }
  .config-list { grid-template-columns: 1fr; }
  .config-list div:nth-child(odd) { border-right: 0; }
  .config-list div:nth-last-child(2) { border-bottom: 1px solid #1b1b1b; }
  .log-head { grid-template-columns: 88px 56px 1fr; }.log-entry { grid-template-columns: 88px 56px minmax(0,1fr); padding-left: 10px; padding-right: 10px; }.log-target { display: none; }
}

@media (max-width: 430px) {
  .breadcrumb span, .breadcrumb i { display: none; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card, .metric-card:nth-child(3) { border-right: 0; border-bottom: 1px solid var(--border); }
  .metric-card:last-child { border-bottom: 0; }
  .compact-metrics { grid-template-columns: 1fr; }
  .compact-metrics div, .compact-metrics div:nth-child(3) { border-right: 0; border-top: 1px solid var(--border); }
  .compact-metrics div:first-child { border-top: 0; }
  .legend { display: none; }
  .chart-summary { align-items: flex-start; flex-direction: column; gap: 12px; }
  .pipeline-edge { flex-basis: 28px; }
}

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