:root {
  color-scheme: dark;
  --bg: #050b14;
  --surface: #091321;
  --surface-2: #0d1a2a;
  --surface-3: #122236;
  --line: #1d3045;
  --line-soft: rgba(128, 164, 196, .13);
  --text: #e8f1f8;
  --muted: #8296aa;
  --subtle: #5c7084;
  --teal: #22d3be;
  --teal-soft: rgba(34, 211, 190, .12);
  --blue: #4d7dff;
  --blue-soft: rgba(77, 125, 255, .14);
  --critical: #ff5470;
  --critical-soft: rgba(255, 84, 112, .12);
  --high: #ff8b4d;
  --warning: #f5c451;
  --success: #45d483;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 22px 55px rgba(0, 0, 0, .28);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-width: 320px; min-height: 100vh; margin: 0; background: radial-gradient(circle at 75% -15%, rgba(40, 91, 152, .16), transparent 37%), var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px 16px; display: flex; flex-direction: column; background: rgba(7, 16, 28, .96); border-right: 1px solid var(--line-soft); z-index: 30; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 23px; }
.brand img { filter: drop-shadow(0 6px 13px rgba(34, 211, 190, .15)); }
.brand div { display: flex; flex-direction: column; min-width: 0; }
.brand strong { font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.brand span { margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
.organization-label, .site-filter-label { color: var(--subtle); font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.organization-label { margin: 0 8px 7px; }
.organization-select, .compact-select { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: var(--radius-sm); }
.organization-select { width: 100%; padding: 11px 32px 11px 11px; margin-bottom: 18px; font-size: 13px; }

.main-navigation { display: grid; gap: 4px; }
.main-navigation button { width: 100%; display: grid; grid-template-columns: 25px 1fr auto; align-items: center; gap: 8px; padding: 10px 11px; border: 0; border-radius: var(--radius-sm); color: #8ca0b5; background: transparent; text-align: left; font-size: 13px; transition: background .16s ease, color .16s ease; }
.main-navigation button:hover { color: var(--text); background: rgba(255, 255, 255, .035); }
.main-navigation button.active { color: #dffffb; background: linear-gradient(90deg, rgba(34, 211, 190, .14), rgba(34, 211, 190, .035)); box-shadow: inset 2px 0 var(--teal); }
.nav-icon { width: 22px; height: 22px; display: grid; place-items: center; color: currentColor; font-weight: 800; }
.nav-count { min-width: 21px; padding: 2px 6px; border-radius: 999px; background: var(--critical-soft); color: #ff8ca0; font-size: 10px; font-weight: 800; text-align: center; }
.sidebar-footer { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.connection-state { display: flex; align-items: center; gap: 7px; padding: 0 10px 10px; color: var(--muted); font-size: 11px; }
.connection-state span { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(69, 212, 131, .09); }
.connection-state.offline span { background: var(--critical); box-shadow: 0 0 0 4px var(--critical-soft); }
.user-button { width: 100%; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 9px; align-items: center; padding: 8px; border: 0; border-radius: var(--radius-sm); color: var(--text); background: transparent; text-align: left; }
.user-button:hover { background: rgba(255, 255, 255, .035); }
.user-button > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.user-button strong, .user-button small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-button strong { font-size: 12px; }
.user-button small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.user-avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--blue-soft); color: #9db8ff; font-size: 10px; font-weight: 800; }

.workspace { min-width: 0; }
.topbar { min-height: 91px; display: flex; align-items: center; gap: 16px; padding: 18px 30px; border-bottom: 1px solid var(--line-soft); background: rgba(5, 11, 20, .74); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 20; }
.topbar > div:nth-child(2) { min-width: 0; }
.eyebrow { margin: 0 0 5px; color: var(--teal); font-size: 9px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.topbar h1 { margin: 0; font-size: 21px; letter-spacing: -.025em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.site-filter-label { margin-right: -3px; }
.compact-select { max-width: 230px; padding: 9px 32px 9px 10px; font-size: 12px; }
.icon-button { width: 37px; height: 37px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.icon-button:hover { color: var(--text); border-color: #31506f; }
.menu-button { display: none; }
.content { width: min(1540px, 100%); margin: 0 auto; padding: 27px 30px 55px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.section-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.01em; }
.section-heading p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.section-actions { display: flex; gap: 8px; align-items: center; }
.grid { display: grid; gap: 15px; }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 25px; }
.metric-card, .panel, .data-card { border: 1px solid var(--line-soft); background: linear-gradient(145deg, rgba(13, 26, 42, .93), rgba(8, 18, 31, .94)); box-shadow: 0 8px 30px rgba(0, 0, 0, .10); }
.metric-card { min-height: 136px; padding: 18px; border-radius: var(--radius); position: relative; overflow: hidden; }
.metric-card::after { content: ""; position: absolute; right: -35px; bottom: -55px; width: 110px; height: 110px; border-radius: 50%; background: var(--accent-soft, var(--blue-soft)); filter: blur(4px); }
.metric-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; }
.metric-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; background: var(--accent-soft, var(--blue-soft)); color: var(--accent, var(--blue)); font-weight: 800; }
.metric-value { margin-top: 18px; font-size: 31px; line-height: 1; font-weight: 750; letter-spacing: -.045em; }
.metric-detail { margin-top: 9px; color: var(--muted); font-size: 11px; }
.accent-teal { --accent: var(--teal); --accent-soft: var(--teal-soft); }
.accent-red { --accent: var(--critical); --accent-soft: var(--critical-soft); }
.accent-yellow { --accent: var(--warning); --accent-soft: rgba(245, 196, 81, .11); }

.dashboard-columns { grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); align-items: start; }
.panel { border-radius: var(--radius); overflow: hidden; }
.panel-header { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 17px; border-bottom: 1px solid var(--line-soft); }
.panel-header h2 { margin: 0; font-size: 14px; }
.panel-body { padding: 17px; }
.signal-list { display: grid; gap: 10px; }
.signal-row { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 11px; align-items: center; padding: 11px 12px; border-radius: 10px; background: rgba(255, 255, 255, .022); }
.severity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 4px rgba(130, 150, 170, .08); }
.severity-dot.critical { background: var(--critical); box-shadow: 0 0 0 4px var(--critical-soft); }
.severity-dot.high { background: var(--high); box-shadow: 0 0 0 4px rgba(255, 139, 77, .1); }
.severity-dot.warning { background: var(--warning); box-shadow: 0 0 0 4px rgba(245, 196, 81, .1); }
.signal-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.signal-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.signal-row time { color: var(--subtle); font-size: 10px; }
.distribution { display: grid; gap: 15px; }
.distribution-row { display: grid; grid-template-columns: 85px 1fr 32px; gap: 10px; align-items: center; color: var(--muted); font-size: 11px; }
.distribution-row strong { color: var(--text); text-align: right; font-size: 11px; }
.bar { height: 7px; border-radius: 99px; background: #142437; overflow: hidden; }
.bar span { display: block; height: 100%; min-width: 3px; border-radius: inherit; background: var(--bar-color, var(--blue)); }
.bar-size-1 { width: 10%; }
.bar-size-2 { width: 20%; }
.bar-size-3 { width: 30%; }
.bar-size-4 { width: 40%; }
.bar-size-5 { width: 50%; }
.bar-size-6 { width: 60%; }
.bar-size-7 { width: 70%; }
.bar-size-8 { width: 80%; }
.bar-size-9 { width: 90%; }
.bar-size-10 { width: 100%; }

.button { min-height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border: 1px solid transparent; border-radius: 9px; text-decoration: none; font-size: 11px; font-weight: 700; }
.button-primary { border-color: rgba(34, 211, 190, .32); background: linear-gradient(135deg, #19bdaa, #2789bd); color: #031513; box-shadow: 0 8px 20px rgba(25, 189, 170, .12); }
.button-primary:hover { filter: brightness(1.08); }
.button-secondary { border-color: #29455f; background: var(--surface-3); color: var(--text); }
.button-secondary:hover { border-color: #3f6585; }
.button-ghost { border-color: var(--line); background: transparent; color: var(--muted); }
.button-danger { border-color: rgba(255, 84, 112, .3); background: var(--critical-soft); color: #ff8ca0; }
.button-small { min-height: 29px; padding: 5px 9px; font-size: 10px; }
.button-wide { width: 100%; min-height: 43px; }
.button[disabled] { opacity: .48; cursor: not-allowed; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.filters input, .filters select { min-height: 36px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); color: var(--text); font-size: 11px; }
.filters input { width: min(280px, 100%); }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius); background: rgba(9, 19, 33, .86); }
.data-table { width: 100%; min-width: 780px; border-collapse: collapse; }
.data-table th { padding: 11px 14px; color: var(--subtle); background: rgba(255, 255, 255, .018); border-bottom: 1px solid var(--line-soft); font-size: 9px; font-weight: 800; letter-spacing: .12em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); color: #b6c6d5; font-size: 11px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, .018); }
.cell-title { display: block; color: var(--text); font-size: 12px; font-weight: 650; }
.cell-subtitle { display: block; max-width: 360px; margin-top: 4px; color: var(--subtle); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 12px; }
.pagination .button:first-child { justify-self: start; }
.pagination .button:last-child { justify-self: end; }
.pagination span { color: var(--subtle); font-size: 9px; font-weight: 700; letter-spacing: .04em; text-align: center; text-transform: uppercase; }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; background: rgba(130, 150, 170, .09); color: #9cafc0; font-size: 9px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.active, .status.open, .status.up { background: var(--teal-soft); color: var(--teal); }
.status.down { background: rgba(255, 91, 110, .12); color: var(--danger); }
.status.unknown { background: rgba(130, 150, 170, .08); color: var(--muted); }
.status.resolved, .status.closed { background: rgba(130, 150, 170, .08); color: var(--muted); }
.status.acknowledged, .status.investigating { background: rgba(77, 125, 255, .12); color: #83a4ff; }
.status.contained { background: rgba(245, 196, 81, .11); color: var(--warning); }
.status.pending, .status.upcoming { background: rgba(245, 196, 81, .11); color: var(--warning); }
.status.suppressed { background: rgba(164, 140, 255, .12); color: #baaaff; }
.status.ended, .status.cancelled { background: rgba(130, 150, 170, .08); color: var(--muted); }
.status.accepted { background: var(--teal-soft); color: var(--teal); }
.status.expired, .status.revoked { background: rgba(130, 150, 170, .08); color: var(--muted); }
.severity { font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.severity.critical { color: var(--critical); }
.severity.high { color: var(--high); }
.severity.warning { color: var(--warning); }
.severity.low, .severity.info { color: #6ea4df; }
.sla-overdue .cell-title { color: var(--critical); }
.empty-state { min-height: 260px; display: grid; place-items: center; padding: 40px 20px; border: 1px dashed var(--line); border-radius: var(--radius); text-align: center; }
.empty-state-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 14px; background: var(--blue-soft); color: #8faaff; font-size: 22px; }
.empty-state h2 { margin: 0; font-size: 15px; }
.empty-state p { max-width: 420px; margin: 8px auto 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.empty-state .button { margin-top: 17px; }

.site-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.data-card { padding: 17px; border-radius: var(--radius); }
.data-card-header { display: flex; align-items: start; justify-content: space-between; gap: 12px; }
.data-card h2 { margin: 0; font-size: 14px; }
.data-card p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.data-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 20px 0; }
.data-card dt { color: var(--subtle); font-size: 9px; text-transform: uppercase; }
.data-card dd { margin: 4px 0 0; font-size: 11px; }
.data-card-footer { display: flex; justify-content: flex-end; padding-top: 13px; border-top: 1px solid var(--line-soft); }

.policy-layout { grid-template-columns: 310px minmax(0, 1fr); align-items: start; }
.policy-sidebar, .policy-editor { padding: 17px; border: 1px solid var(--line-soft); border-radius: var(--radius); background: rgba(9, 19, 33, .86); }
.policy-sidebar h2, .policy-editor h2 { margin: 0 0 14px; font-size: 14px; }
.form-grid { display: grid; gap: 13px; }
.form-grid.two-columns { grid-template-columns: 1fr 1fr; }
.form-field { display: grid; gap: 6px; }
.form-field label { color: var(--muted); font-size: 10px; font-weight: 650; }
.form-field input, .form-field select, .form-field textarea { width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: #07111e; color: var(--text); font-size: 11px; }
.form-field textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.form-field select[multiple] { min-height: 105px; padding: 5px; }
.form-field select[multiple] option { padding: 7px 8px; border-radius: 5px; }
.field-hint { margin: 0; color: var(--subtle); font-size: 9px; }
.policy-json { min-height: 300px !important; font: 11px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; tab-size: 2; }
.policy-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 13px; }
.meta-chip { padding: 4px 8px; border-radius: 99px; background: rgba(255, 255, 255, .04); color: var(--muted); font-size: 9px; }
.policy-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 13px; }
.policy-actions p { margin: 0; color: var(--muted); font-size: 10px; }
.policy-form { display: grid; gap: 13px; }
.policy-group { padding: 15px; border: 1px solid var(--line-soft); border-radius: 11px; background: rgba(255, 255, 255, .018); }
.policy-group-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.policy-group-heading h3 { margin: 0; font-size: 12px; }
.policy-group-heading p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.policy-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.policy-field { display: grid; align-content: start; gap: 7px; padding: 11px; border: 1px solid rgba(130, 150, 170, .09); border-radius: 9px; background: rgba(4, 12, 22, .45); }
.policy-field-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.policy-field-heading > label { color: var(--text); font-size: 10px; font-weight: 700; }
.policy-field > input, .policy-field > select, .policy-list-json { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #07111e; color: var(--text); font-size: 10px; }
.policy-field > input:disabled, .policy-field > select:disabled, .policy-list-json:disabled { color: var(--muted); opacity: .72; }
.policy-field-footer { display: grid; gap: 5px; }
.policy-override { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; cursor: pointer; }
.policy-override input { margin: 0; accent-color: var(--blue); }
.policy-source { flex: none; padding: 3px 6px; border-radius: 999px; font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.policy-source.local { background: var(--blue-soft); color: #8faaff; }
.policy-source.inherited { background: rgba(130, 150, 170, .08); color: var(--muted); }
.policy-list-json { min-height: 150px; resize: vertical; font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 2; }
.policy-collection .policy-override { margin-top: 9px; }
.policy-advanced { margin-top: 16px; padding: 15px; border: 1px solid var(--line-soft); border-radius: 11px; background: rgba(5, 12, 22, .65); }
.policy-advanced > summary { color: #9fb2c5; font-size: 10px; font-weight: 750; cursor: pointer; }
.policy-advanced > p { margin: 9px 0 12px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.effective-summary { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--line-soft); }
.effective-summary summary { color: var(--muted); font-size: 10px; cursor: pointer; }
.effective-summary pre { max-height: 300px; padding: 12px; overflow: auto; border-radius: 9px; background: #050c16; color: #9eb5c9; font: 10px/1.55 ui-monospace, monospace; white-space: pre-wrap; }

.modal { width: min(570px, calc(100vw - 32px)); max-height: calc(100vh - 36px); padding: 0; overflow: hidden; border: 1px solid #29425d; border-radius: 16px; background: #091523; color: var(--text); box-shadow: var(--shadow); }
.modal.modal-large { width: min(920px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(0, 5, 12, .76); backdrop-filter: blur(5px); }
.modal form { max-height: calc(100vh - 38px); display: flex; flex-direction: column; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 20px; border-bottom: 1px solid var(--line-soft); }
.modal-header h2 { margin: 0; font-size: 16px; }
.modal-content { padding: 20px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.modal .form-error { margin: 0; padding: 0 20px; }
.secret-box { padding: 14px; border: 1px solid rgba(34, 211, 190, .25); border-radius: 10px; background: var(--teal-soft); }
.secret-box code { display: block; margin-top: 8px; overflow-wrap: anywhere; color: #bffcf4; font: 11px/1.5 ui-monospace, monospace; user-select: all; }
.access-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 25px; }
.access-section { margin-top: 25px; }
.access-section > h2 { margin: 0 0 12px; font-size: 13px; }
.access-subject { display: grid; gap: 4px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: rgba(255, 255, 255, .02); }
.access-subject strong { font-size: 12px; }
.access-subject span { color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.confirmation { padding: 14px; border: 1px solid rgba(255, 84, 112, .24); border-radius: 11px; background: var(--critical-soft); }
.confirmation strong { display: block; color: var(--text); font-size: 12px; }
.confirmation p { margin: 8px 0 0; color: #c4a9af; font-size: 10px; line-height: 1.6; }
.incident-detail { display: grid; gap: 20px; }
.incident-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--line-soft); }
.incident-summary-grid > div { min-height: 76px; padding: 13px; background: #0a1725; }
.incident-summary-grid dt { color: var(--subtle); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.incident-summary-grid dd { margin: 8px 0 0; color: var(--text); font-size: 11px; }
.incident-description, .incident-actions, .incident-timeline { padding-top: 2px; }
.incident-description h3, .incident-actions h3, .incident-timeline h3, .incident-transition h3, .comment-compose h3 { margin: 0 0 9px; font-size: 12px; }
.incident-description p { margin: 0; padding: 13px; border-radius: 10px; background: rgba(255, 255, 255, .022); color: #aebfd0; font-size: 11px; line-height: 1.65; white-space: pre-wrap; }
.incident-actions { display: grid; grid-template-columns: auto minmax(270px, 1fr) minmax(270px, 1fr); gap: 12px; align-items: start; }
.incident-transition, .comment-compose { display: grid; gap: 8px; padding: 13px; border: 1px solid var(--line-soft); border-radius: 11px; background: rgba(255, 255, 255, .018); }
.incident-transition textarea, .comment-compose textarea { width: 100%; min-height: 76px; padding: 10px 11px; resize: vertical; border: 1px solid var(--line); border-radius: 9px; background: #07111e; color: var(--text); font-size: 10px; line-height: 1.5; }
.comment-compose .button { justify-self: end; }
.timeline { display: grid; }
.timeline-entry { display: grid; grid-template-columns: 13px minmax(0, 1fr); gap: 10px; position: relative; padding: 0 0 18px; }
.timeline-entry:not(:last-child)::before { content: ""; position: absolute; top: 9px; bottom: -1px; left: 5px; width: 1px; background: var(--line); }
.timeline-marker { width: 11px; height: 11px; margin-top: 4px; border: 2px solid #47739a; border-radius: 50%; background: #091523; z-index: 1; }
.timeline-entry.status_changed .timeline-marker { border-color: var(--teal); }
.timeline-entry.commented .timeline-marker { border-color: var(--blue); }
.timeline-entry.evidence_registered .timeline-marker, .timeline-entry.custody-registered .timeline-marker { border-color: #a48cff; }
.timeline-entry.evidence_custody_recorded .timeline-marker, .timeline-entry.custody-verified .timeline-marker { border-color: var(--teal); }
.timeline-entry h4 { margin: 0; font-size: 11px; }
.timeline-entry p { margin: 5px 0; color: #9bafc2; font-size: 10px; line-height: 1.55; white-space: pre-wrap; }
.timeline-entry small { color: var(--subtle); font-size: 9px; }
.incident-evidence { padding: 17px; border: 1px solid var(--line-soft); border-radius: 12px; background: rgba(77, 125, 255, .035); }
.incident-evidence .section-heading { align-items: center; margin-bottom: 13px; }
.evidence-list { display: grid; gap: 8px; }
.evidence-card { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: #091624; }
.evidence-card-main { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 5px 10px; }
.evidence-card h4 { min-width: 0; margin: 0; overflow: hidden; color: var(--text); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.evidence-card code { grid-column: 1 / -1; color: #95abc0; font: 9px/1.5 ui-monospace, monospace; }
.evidence-card small { grid-column: 1 / -1; color: var(--subtle); font-size: 9px; }
.evidence-type { padding: 3px 6px; border-radius: 99px; background: rgba(164, 140, 255, .12); color: #baaaff; font-size: 8px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.evidence-file-zone { padding: 14px; border: 1px dashed #31506f; border-radius: 11px; background: rgba(77, 125, 255, .045); }
.evidence-local-note, .evidence-warning { margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.evidence-warning { padding: 11px; border: 1px solid rgba(245, 196, 81, .2); border-radius: 9px; background: rgba(245, 196, 81, .07); color: #c5b681; }
.evidence-detail-actions { display: flex; justify-content: space-between; gap: 8px; }
.evidence-integrity { display: inline-flex; padding: 4px 8px; border-radius: 99px; background: rgba(130, 150, 170, .1); color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.evidence-integrity.verified { background: var(--teal-soft); color: var(--teal); }
.evidence-integrity.mismatch, .evidence-integrity.broken { background: var(--critical-soft); color: #ff8ca0; }
.evidence-manifest { padding: 15px; border: 1px solid var(--line-soft); border-radius: 11px; background: rgba(255, 255, 255, .018); }
.evidence-manifest h3 { margin: 0 0 12px; font-size: 12px; }
.evidence-manifest dl { display: grid; gap: 10px; margin: 0; }
.evidence-manifest dl > div { display: grid; grid-template-columns: 135px minmax(0, 1fr); gap: 12px; }
.evidence-manifest dt { color: var(--subtle); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.evidence-manifest dd { min-width: 0; margin: 0; color: #afc0d0; font-size: 10px; overflow-wrap: anywhere; }
.evidence-manifest code, .custody-timeline code { display: block; color: #a9c1d5; font: 9px/1.5 ui-monospace, monospace; overflow-wrap: anywhere; user-select: all; }
.evidence-manifest > p { margin: 13px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; white-space: pre-wrap; }
.custody-timeline .timeline-entry > div { min-width: 0; }
.custody-timeline small { display: block; margin-top: 5px; }
.evidence-chain-broken { margin: 0; padding: 12px; border: 1px solid rgba(255, 84, 112, .3); border-radius: 10px; background: var(--critical-soft); color: #ff9aaa; font-size: 10px; }
.form-error { min-height: 18px; color: #ff8398; font-size: 10px; }
.toasts { position: fixed; right: 20px; bottom: 20px; width: min(350px, calc(100vw - 40px)); display: grid; gap: 8px; z-index: 100; }
.toast { padding: 12px 14px; border: 1px solid #29445f; border-radius: 11px; background: #0d1b2b; box-shadow: var(--shadow); color: var(--text); font-size: 11px; animation: toast-in .18s ease-out; }
.toast.error { border-color: rgba(255, 84, 112, .38); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.loading { min-height: 320px; display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.spinner { width: 27px; height: 27px; margin: 0 auto 11px; border: 2px solid #173049; border-top-color: var(--teal); border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 50% 0, rgba(35, 115, 143, .2), transparent 38%), radial-gradient(circle at 15% 90%, rgba(44, 65, 127, .15), transparent 32%); }
.login-card { width: min(475px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 20px; background: rgba(8, 18, 31, .95); box-shadow: var(--shadow); }
.brand-login { padding: 0 0 33px; }
.brand-login strong { font-size: 17px; }
.login-card h1 { margin: 0; font-size: clamp(27px, 5vw, 38px); line-height: 1.08; letter-spacing: -.045em; }
.login-copy { margin: 18px 0 24px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.dev-login { margin-top: 18px; border-top: 1px solid var(--line-soft); }
.dev-login summary { padding: 15px 0 10px; color: var(--muted); font-size: 10px; cursor: pointer; }
.dev-login label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.invitation-gate { margin-top: 18px; padding-top: 17px; border-top: 1px solid var(--line-soft); }
.invitation-gate label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; }
.invitation-gate input { width: 100%; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: #050d17; color: var(--text); font: 10px/1.5 ui-monospace, monospace; }
.invitation-gate input + label { margin-top: 12px; }
.gate-hint { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.gate-actions { display: flex; gap: 8px; margin-top: 10px; }
.input-action { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.input-action input { min-width: 0; padding: 10px 11px; border: 1px solid var(--line); border-radius: 9px; background: #050d17; color: var(--text); font-size: 11px; }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-columns { grid-template-columns: 1fr; }
  .access-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-102%); width: 252px; transition: transform .2s ease; box-shadow: var(--shadow); }
  body.menu-open .sidebar { transform: translateX(0); }
  body.menu-open::after { content: ""; position: fixed; inset: 0; z-index: 25; background: rgba(0, 5, 12, .65); }
  .menu-button { display: grid; }
  .topbar { padding: 14px 17px; }
  .content { padding: 20px 17px 45px; }
  .site-filter-label { display: none; }
  .compact-select { max-width: 170px; }
  .policy-layout { grid-template-columns: 1fr; }
  .policy-fields { grid-template-columns: 1fr; }
  .incident-actions { grid-template-columns: 1fr; }
  .evidence-card { align-items: stretch; flex-direction: column; }
  .evidence-card .button { align-self: start; }
}

@media (max-width: 580px) {
  .metric-grid, .site-grid, .access-summary { grid-template-columns: 1fr; }
  .metric-card { min-height: 120px; }
  .topbar h1 { font-size: 18px; }
  .topbar-actions { gap: 6px; }
  .compact-select { width: 42px; color: transparent; padding-left: 8px; }
  .compact-select option { color: var(--text); }
  .section-heading { align-items: start; flex-direction: column; }
  .form-grid.two-columns { grid-template-columns: 1fr; }
  .incident-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .evidence-manifest dl > div { grid-template-columns: 1fr; gap: 4px; }
  .login-view { padding: 16px; }
  .login-card { padding: 25px; }
  .policy-actions { align-items: stretch; flex-direction: column; }
  .pagination { grid-template-columns: 1fr 1fr; }
  .pagination span { grid-column: 1 / -1; grid-row: 1; }
}

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