/* Audit visual system — presentation only. All control IDs and behavior remain in app.js. */
:root {
  --bg: #f4f7f9;
  --surface: #fff;
  --surface-soft: #f7f9fb;
  --ink: #172c3d;
  --muted: #677b8b;
  --faint: #8b9ca9;
  --line: #e3e9ed;
  --line-strong: #d3dee5;
  --navy: #0b1928;
  --navy-soft: #132638;
  --accent: #0f766e;
  --accent-dark: #0a5c56;
  --accent-soft: #eaf7f4;
  --cyan: #0e7490;
  --good: #15805f;
  --good-soft: #eaf7f1;
  --warning: #a45d0b;
  --warning-soft: #fff6e6;
  --danger: #bc3b50;
  --danger-soft: #fff0f2;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(17, 39, 57, .025), 0 5px 20px rgba(17, 39, 57, .025);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 340px; font-size: 14px; line-height: 1.65; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .42; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 16px; background: var(--ink); color: #fff; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; background-image: linear-gradient(rgba(31, 66, 86, .025) 1px, transparent 1px), linear-gradient(90deg, rgba(31, 66, 86, .025) 1px, transparent 1px); background-size: 56px 56px; mask-image: linear-gradient(to bottom, #000, transparent 70%); }
.ambient span { position: absolute; border-radius: 50%; }
.ambient span:first-child { width: 700px; height: 700px; right: -280px; top: -350px; background: radial-gradient(circle, rgba(45, 212, 191, .075), transparent 68%); }
.ambient span:last-child { width: 550px; height: 550px; left: -270px; top: 280px; background: radial-gradient(circle, rgba(48, 121, 153, .045), transparent 68%); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.3; letter-spacing: -.035em; }
h1 { font-size: 30px; margin: 8px 0; font-weight: 700; }
h2 { font-size: 20px; margin: 0 0 6px; font-weight: 700; }
h3 { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.eyebrow { font: 600 10px/1.5 var(--mono); letter-spacing: .18em; color: var(--accent); }

/* Brand and navigation */
.brand { display: flex; align-items: center; gap: 11px; font-size: 22px; font-weight: 750; letter-spacing: -.7px; white-space: nowrap; }
.brand-word { color: #f1f8f7; }
.brand small { font: 500 9px var(--mono); color: #79909e; letter-spacing: .12em; border-left: 1px solid #2d3d4a; padding-left: 13px; margin-left: 3px; }
.brand-mark { display: flex; gap: 3px; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid rgba(114, 224, 204, .2); border-radius: 9px; background: rgba(45, 212, 191, .07); }
.brand-mark i { display: block; width: 3px; border-radius: 2px; background: #45d8bd; }
.brand-mark i:nth-child(1) { height: 10px; }
.brand-mark i:nth-child(2) { height: 18px; }
.brand-mark i:nth-child(3) { height: 14px; }
.live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 4px rgba(21, 128, 95, .09); animation: breathe 3s ease-in-out infinite; }
.button { border: 1px solid transparent; border-radius: 7px; min-height: 38px; padding: 8px 15px; font-weight: 600; font-size: 12px; transition: background .16s, border-color .16s, transform .16s, box-shadow .16s; display: inline-flex; align-items: center; justify-content: center; gap: 9px; white-space: nowrap; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary { background: var(--accent); color: #fff; box-shadow: 0 3px 9px rgba(15, 118, 110, .14); }
.button.primary:hover:not(:disabled) { background: var(--accent-dark); box-shadow: 0 5px 14px rgba(15, 118, 110, .2); }
.button.secondary { background: var(--surface); border-color: var(--line-strong); color: #405768; }
.button.secondary:hover { border-color: #85b9af; color: var(--accent); background: #fbfefd; }
.button.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
.button.ghost:hover:not(:disabled) { background: var(--surface-soft); color: var(--ink); border-color: var(--line-strong); }
.button.danger { background: var(--danger); color: #fff; }
.button.full { width: 100%; justify-content: space-between; padding: 11px 17px; min-height: 46px; }
.icon-button { width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center; background: transparent; border: 1px solid transparent; border-radius: 7px; color: var(--muted); font-size: 21px; line-height: 1; }
.icon-button:hover { background: var(--accent-soft); color: var(--accent); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(15, 118, 110, .2); outline-offset: 2px; }

/* Fields and surfaces */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: 11px; font-weight: 600; color: #5a7080; }
.field input, .field select, .field textarea { width: 100%; height: 41px; padding: 8px 11px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 7px; outline: none; transition: border .15s, box-shadow .15s; }
.field textarea { height: auto; }
.field input::placeholder { color: #9cacb7; font-weight: 400; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #a1b5c1; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(15, 118, 110, .08); }
.field input:disabled { background: var(--surface-soft); color: var(--muted); }
.field input[type="checkbox"] { width: 17px; height: 17px; min-height: 17px; padding: 0; accent-color: var(--accent); align-self: flex-start; margin-top: 3px; }
.field output { display: flex; align-items: center; min-height: 41px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: #45616f; font: 11px var(--mono); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-size: 16px; font-weight: 700; margin-bottom: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.notice { padding: 11px 14px; border: 1px solid #cde5df; border-radius: 8px; background: var(--accent-soft); color: var(--accent-dark); margin-bottom: 16px; font-size: 12px; }
.notice:empty { display: none; }
.notice.error { background: var(--danger-soft); border-color: #f2ccd4; color: var(--danger); }

/* Login */
.login-shell { position: relative; z-index: 1; max-width: 1440px; min-height: 100vh; margin: auto; padding: 64px 80px; display: grid; grid-template-columns: 1.15fr minmax(380px, .85fr); align-items: center; gap: 110px; }
.login-intro { position: relative; min-height: auto; margin: 0; padding: 0; overflow: visible; background: transparent; color: var(--ink); }
.login-intro::before { display: none; }
.login-intro > * { position: relative; }
.brand-large { font-size: 25px; margin-bottom: 80px; }
.login-intro .brand-word { color: var(--ink); }
.login-intro .brand-mark { border-color: transparent; background: transparent; }
.login-intro .brand-mark i { background: var(--accent); }
.login-intro .eyebrow { color: var(--accent); display: flex; align-items: center; gap: 10px; }
.login-intro .live-dot { background: var(--good); box-shadow: 0 0 0 4px rgba(21, 128, 95, .09); }
.login-intro > h1 { font-size: clamp(40px, 4vw, 52px); font-weight: 650; letter-spacing: -2.5px; margin: 18px 0 22px; color: var(--ink); }
.login-intro > h1 > span { color: var(--accent); }
.login-intro > p { color: var(--muted); font-size: 15px; line-height: 1.9; }
.signal-art { position: relative; width: 350px; height: 180px; margin: 27px 0 0 25px; perspective: 700px; }
.signal-art::before { content: ""; position: absolute; left: 160px; top: 72px; width: 58px; height: 58px; border-radius: 50%; background: rgba(15, 118, 110, .08); filter: blur(13px); animation: signalHalo 3.6s ease-in-out infinite; }
.orbit { position: absolute; left: 80px; top: 10px; border: 1px solid rgba(15, 118, 110, .2); border-radius: 50%; transform: rotate(-24deg); }
.orbit::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; border: 1px solid transparent; border-top-color: rgba(15, 118, 110, .7); border-right-color: rgba(15, 118, 110, .22); animation: orbitTrace 7s linear infinite; }
.orbit-one { width: 220px; height: 140px; animation: orbitOne 18s ease-in-out infinite alternate; }
.orbit-two { width: 260px; height: 110px; left: 60px; top: 24px; transform: rotate(24deg); animation: orbitTwo 23s ease-in-out infinite alternate; }
.orbit-two::after { animation-duration: 10s; animation-direction: reverse; }
.orbit-three { width: 160px; height: 160px; left: 110px; top: 0; transform: rotate(68deg); animation: orbitThree 20s ease-in-out infinite alternate; }
.orbit-three::after { animation-duration: 12s; }
.signal-core { position: absolute; left: 166px; top: 62px; width: 46px; height: 46px; border-radius: 13px; transform: rotate(45deg); background: linear-gradient(135deg, #4bcbb1, #168c80); box-shadow: 0 0 0 10px rgba(15, 118, 110, .055), 0 0 45px rgba(15, 118, 110, .17); display: grid; place-items: center; animation: signalCore 4s ease-in-out infinite; }
.signal-core span { width: 10px; height: 10px; border: 2px solid #fff; border-radius: 50%; }
.node { position: absolute; width: 9px; height: 9px; background: var(--surface); border: 2px solid var(--accent); border-radius: 50%; box-shadow: 0 0 0 5px rgba(15, 118, 110, .055); }
.node-one { left: 69px; top: 90px; animation: nodePulse 4.5s ease-in-out infinite; }
.node-two { left: 309px; top: 69px; animation: nodePulse 4.5s 1.5s ease-in-out infinite; }
.node-three { left: 200px; top: 162px; animation: nodePulse 4.5s 3s ease-in-out infinite; }
.signal-label { position: absolute; font: 9px var(--mono); letter-spacing: .08em; color: var(--muted); }
.signal-label b { color: var(--accent); font-weight: 500; margin-left: 7px; }
.label-one { left: 0; top: 55px; }
.label-two { right: -8px; top: 32px; }
.label-three { right: 16px; bottom: 0; }
.login-foot { display: flex; gap: 25px; margin-top: 19px; color: var(--faint); font: 9px var(--mono); letter-spacing: .08em; }
.login-foot span:last-child { font-family: inherit; letter-spacing: .12em; }
.login-card { position: relative; width: 100%; max-width: 440px; justify-self: center; padding: 42px 40px; background: rgba(255, 255, 255, .96); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 70px rgba(20, 42, 56, .075); }
.login-card::before { content: ""; position: absolute; top: -1px; left: 40px; width: 48px; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.login-card h2 { font-size: 27px; margin-top: 14px; }
.login-card > .muted { margin-bottom: 30px; font-size: 13px; }
.login-card form { display: flex; flex-direction: column; gap: 20px; }
.security-note { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 20px; font-size: 11px; color: var(--muted); text-align: center; }
.security-note span { color: var(--accent); margin-right: 5px; }
.mobile-brand { display: none; }

/* Application shell */
.topbar { height: 68px; position: relative; z-index: 5; display: flex; align-items: center; gap: 26px; padding: 0 max(32px, calc((100vw - 1440px)/2)); border-bottom: 1px solid #223442; background: rgba(11, 25, 40, .98); box-shadow: 0 1px 8px rgba(11, 25, 40, .08); }
.header-status { display: flex; gap: 8px; margin-left: auto; }
.system-pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 20px; font-size: 10px; font-weight: 600; background: rgba(255, 255, 255, .04); border: 1px solid #2b3c49; white-space: nowrap; }
.system-pill i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.system-pill.good { color: #73d9bd; background: rgba(45, 212, 191, .07); border-color: rgba(98, 207, 186, .2); }
.system-pill.warning { color: #eac488; background: rgba(217, 164, 78, .07); border-color: rgba(234, 196, 136, .2); }
.system-pill.neutral { color: #8ca2b0; }
.account { display: flex; align-items: center; gap: 10px; padding-left: 22px; border-left: 1px solid #2b3c49; font-size: 11px; color: #b6c8d1; }
.account .icon-button { color: #8ca2b0; margin-left: 4px; }
.account .icon-button:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.avatar { width: 29px; height: 29px; display: grid; place-items: center; background: rgba(45, 212, 191, .1); border: 1px solid rgba(98, 207, 186, .18); color: #76d8c2; border-radius: 8px; font-weight: 700; }
.workspace { position: relative; z-index: 1; max-width: 1440px; min-height: calc(100vh - 140px); margin: 0 auto; padding: 36px 32px 64px; outline: none; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 27px; }
.page-heading p { margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.heading-meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font: 10px var(--mono); }
.slash { color: var(--line-strong); }
.tabs { display: flex; gap: 8px; padding: 5px; border: 1px solid var(--line); border-radius: 10px; background: #eaf0f3; margin-bottom: 30px; overflow-x: auto; scrollbar-width: thin; }
.tab { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 8px 14px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; transition: color .16s, background .16s, box-shadow .16s; }
.tab svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tab:hover { color: var(--ink); background: rgba(255, 255, 255, .5); }
.tab.active { color: var(--accent); background: var(--surface); border-color: #dce6e7; box-shadow: 0 2px 6px rgba(17, 39, 57, .055); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 19px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.view { animation: viewIn .22s ease-out; }
.filter-panel { padding: 22px; margin-bottom: 20px; }
.filter-panel > h3 { margin-bottom: 10px; }
.filter-panel > p { color: var(--muted); font-size: 12px; line-height: 1.85; }
.filter-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 17px 16px; }
.filter-grid .custom-time { display: none; }
.filter-panel.custom .filter-grid .custom-time { display: flex; }
.filter-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.advanced-toggle { border: 0; background: transparent; color: var(--accent); padding: 5px 0; font-size: 11px; font-weight: 600; }
.advanced-filters { border-top: 1px dashed var(--line-strong); margin-top: 18px; padding-top: 20px; }
.filter-footer > div { display: flex; gap: 8px; }
.records-panel { overflow: hidden; }
.panel-toolbar { min-height: 59px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 21px; border-bottom: 1px solid var(--line); }
.panel-toolbar > div { display: flex; align-items: center; gap: 10px; }
.panel-title { font-weight: 700; font-size: 13px; }
.count-chip { font: 10px var(--mono); padding: 2px 7px; border-radius: 5px; background: var(--surface-soft); border: 1px solid var(--line); color: var(--muted); }
.table-wrap { overflow: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { text-align: left; padding: 12px 17px; background: #f8fafb; border-bottom: 1px solid var(--line); font-size: 10px; font-weight: 600; color: #738694; letter-spacing: .035em; }
.data-table td { padding: 16px 17px; border-bottom: 1px solid #edf1f3; font-size: 12px; vertical-align: middle; }
.data-table tbody tr { transition: background .12s; }
.data-table tbody tr:hover { background: #f7fbfa; }
.data-table tbody tr.selected { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .numeric { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.cell-primary { font-weight: 600; color: #2d4354; }
.cell-secondary { display: block; color: var(--muted); font-size: 10px; margin-top: 4px; }
.status-line { display: flex; align-items: center; gap: 7px; margin: 2px 0; }
.status-label { min-width: 24px; color: var(--faint); font-size: 9px; }
.model-cell { max-width: 250px; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 11px; }
.type-chip { font: 10px var(--mono); color: #5d7382; background: var(--surface-soft); border: 1px solid var(--line); padding: 3px 7px; border-radius: 5px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--muted); }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.good { color: var(--good); }
.status.bad { color: var(--danger); }
.status.warning { color: var(--warning); }
.row-action { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px; color: var(--accent); background: var(--surface); transition: background .15s, transform .15s; }
.row-action:hover { background: var(--accent-soft); border-color: #b8d9d2; transform: translateX(2px); }
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--line); background: #fcfdfd; }
.pagination > div { display: flex; gap: 8px; }
.loading { min-height: 70px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); padding: 24px; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid #d4e2df; border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.empty-state { text-align: center; padding: 54px 20px; color: var(--muted); }
.empty-state h3 { color: var(--ink); margin: 12px 0 7px; }
.empty-state p { margin: 0; font-size: 12px; }
.empty-symbol { font-size: 36px; color: #8faeaa; }
.footer { position: relative; z-index: 1; display: flex; justify-content: space-between; max-width: 1440px; margin: auto; padding: 22px 32px; color: var(--faint); font: 9px var(--mono); letter-spacing: .08em; border-top: 1px solid var(--line); }

/* Operational metrics */
.health-banner { position: relative; overflow: hidden; padding: 27px 28px; display: flex; align-items: center; gap: 24px; margin-bottom: 20px; background: linear-gradient(112deg, #102535, #133c40); border-color: #214a4d; color: #eefaf7; }
.health-banner::after { content: ""; position: absolute; right: 10%; width: 220px; height: 220px; border: 1px solid rgba(104, 216, 193, .1); border-radius: 50%; box-shadow: 0 0 0 30px rgba(104, 216, 193, .025), 0 0 0 60px rgba(104, 216, 193, .018); pointer-events: none; }
.health-banner h3 { margin: 6px 0; font-size: 21px; }
.health-banner p { margin: 0; font-size: 12px; color: #a2bfc4; }
.health-banner .eyebrow { color: #69d4be; }
.health-orbit { position: relative; flex: none; width: 54px; height: 54px; border: 1px solid #3d726d; border-radius: 50%; display: grid; place-items: center; animation: softGlow 3s ease-in-out infinite; }
.health-orbit::before { content: ""; position: absolute; inset: 7px; border: 1px dashed #4e8c81; border-radius: 50%; animation: spin 15s linear infinite; }
.health-orbit span { width: 12px; height: 12px; border-radius: 50%; background: #59d3b6; box-shadow: 0 0 16px rgba(89, 211, 182, .35); }
.health-time { position: relative; z-index: 1; margin-left: auto; display: flex; flex-direction: column; text-align: right; font-size: 10px; color: #9ab5bd; }
.health-time strong { font: 12px var(--mono); color: #e1f1ee; margin: 4px 0; }
.health-time small { font-size: 10px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi-card { position: relative; overflow: hidden; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi-label { font-size: 11px; font-weight: 600; color: var(--muted); display: flex; justify-content: space-between; }
.kpi-label > span { font: 9px var(--mono); color: #96a7b1; letter-spacing: .08em; }
.kpi-card > strong { display: block; font-size: 34px; font-weight: 650; letter-spacing: -1.5px; line-height: 1.3; margin: 18px 0 6px; font-variant-numeric: tabular-nums; }
.kpi-card > p { font-size: 10px; color: var(--muted); margin: 0; }
.kpi-line { height: 2px; position: absolute; bottom: 0; left: 22px; right: 22px; background: linear-gradient(90deg, var(--accent), #77c8b8, transparent); opacity: .65; }
.metrics-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; }
.resource-list, .metric-list { padding: 5px 21px 15px; margin: 0; }
.resource-list > div, .metric-list > div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.resource-list > div:last-child, .metric-list > div:last-child { border: 0; }
.resource-list dt, .metric-list dt { font-size: 12px; color: var(--muted); }
.resource-list dd, .metric-list dd { margin: 0; font: 600 11px var(--mono); text-align: right; }
.metric-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 30px; }
.footnote { font-size: 11px; color: var(--muted); margin: 16px 4px; line-height: 1.8; }
.maintenance-layout { margin-top: 20px; }
.history-chart { padding: 16px 20px 0; }
.history-chart > div { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }
.history-chart strong { font: 600 12px var(--mono); color: var(--ink); }
.history-chart svg { display: block; width: 100%; height: 90px; margin-top: 8px; overflow: visible; background: repeating-linear-gradient(to bottom, transparent, transparent 28px, var(--line) 29px, var(--line) 30px); }
.trend-line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.trend-hit { fill: transparent; stroke: transparent; cursor: crosshair; }
.trend-hit:hover { fill: var(--surface); stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.history-panel .footnote { margin: 10px 20px 16px; }
.filter-panel.compact .filter-grid { grid-template-columns: 1fr 1fr 1fr auto; align-items: end; }

/* Detail, messages and feedback */
.drawer-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(8, 23, 34, .32); backdrop-filter: blur(3px); animation: fadeIn .15s; }
.detail-drawer { position: fixed; right: 0; top: 0; bottom: 0; z-index: 21; width: min(700px, 100vw); background: var(--bg); border-left: 1px solid var(--line-strong); box-shadow: -20px 0 70px rgba(10, 30, 43, .16); overflow: auto; animation: slideIn .2s ease-out; }
.drawer-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; background: rgba(255, 255, 255, .96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.drawer-header h2 { margin: 4px 0 0; }
.drawer-header .eyebrow { font-size: 9px; }
#detail-content { padding: 22px 26px 45px; }
#summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 19px; margin-bottom: 20px; box-shadow: var(--shadow); }
.detail-statuses { display: flex; gap: 13px; flex-wrap: wrap; margin-bottom: 15px; }
.detail-id { font: 11px var(--mono); color: var(--muted); word-break: break-all; }
.detail-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px 15px; margin: 20px 0; padding-top: 18px; border-top: 1px solid var(--line); }
.detail-facts dt { font-size: 10px; color: var(--muted); }
.detail-facts dd { margin: 4px 0 0; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.detail-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line-strong); margin-bottom: 20px; }
.detail-tabs button { padding: 0 0 11px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: 12px; }
.detail-tabs button.active { color: var(--accent); border-color: var(--accent); }
.message { margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.message-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 16px; background: #f8fafb; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; }
.message-role { display: flex; align-items: center; gap: 8px; }
.role-dot { width: 6px; height: 6px; border-radius: 2px; background: var(--accent); }
.message.user .role-dot { background: var(--cyan); }
.message.system .role-dot, .message.developer .role-dot { background: var(--warning); }
.message.error .role-dot { background: var(--danger); }
.message pre { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; margin: 0; padding: 18px; font: 12px/1.85 var(--mono); color: #304858; max-height: none; overflow: visible; }
.message.tool pre { background: #f8fafb; }
.message-empty { padding: 30px 15px; text-align: center; color: var(--muted); }
.raw-detail, #enhancements-state, #replicas-state, #backup-schedule-result, #lifecycle-result { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; padding: 18px; margin: 12px 0 0; border: 1px solid #243c4d; border-radius: 10px; background: #112433; color: #d1e3e6; font: 11px/1.8 var(--mono); max-height: 460px; overflow: auto; }
.raw-detail:empty, #enhancements-state:empty, #replicas-state:empty, #backup-schedule-result:empty, #lifecycle-result:empty { display: none; }
.copy-button { border: 0; background: none; color: var(--accent); padding: 2px 5px; font-size: 10px; }
.toast { position: fixed; z-index: 50; bottom: 28px; left: 50%; transform: translateX(-50%); padding: 12px 19px; border: 1px solid #2a4553; border-radius: 9px; background: #102635; color: #fff; box-shadow: 0 8px 30px rgba(10, 30, 43, .25); font-size: 12px; max-width: calc(100vw - 32px); animation: toastIn .18s ease-out; }
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 29px; width: min(430px, calc(100vw - 32px)); color: var(--ink); box-shadow: 0 24px 90px rgba(10, 30, 43, .24); }
dialog::backdrop { background: rgba(8, 23, 34, .4); backdrop-filter: blur(3px); }
dialog p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.dialog-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--warning-soft); color: var(--warning); font-weight: 700; margin-bottom: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 25px; }

/* Settings */
#remote-storage-fields > .button { margin-top: 18px; }
#remote-panel pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow: auto; }
#remote-storage-result:empty, #rules-result:empty { display: none; }
#rules-result, #remote-storage-result { color: var(--accent); font-size: 12px; margin: 14px 0 0; }
.rules-list { display: grid; gap: 14px; margin: 18px 0; }
.rule-row { border: 1px solid var(--line); border-radius: 10px; padding: 18px; background: #fafcfc; }
.rule-row .filter-grid { margin-bottom: 10px; }
.rule-row > .button { min-height: 32px; padding: 5px 10px; margin: 4px 5px 0 0; font-size: 11px; }
#rules-preview-result { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; }
#rules-sample { width: 100%; resize: vertical; }
#rules-form .button + .button { margin-left: 8px; }
#backup-schedule-form .filter-grid { align-items: end; }

@keyframes orbitTrace { to { transform: rotate(360deg); } }
@keyframes orbitOne { from { transform: rotate(-24deg); } to { transform: rotate(-12deg); } }
@keyframes orbitTwo { from { transform: rotate(24deg); } to { transform: rotate(36deg); } }
@keyframes orbitThree { from { transform: rotate(68deg); } to { transform: rotate(82deg); } }
@keyframes signalCore { 0%, 100% { transform: rotate(45deg) scale(1); box-shadow: 0 0 0 10px rgba(15, 118, 110, .055), 0 0 35px rgba(15, 118, 110, .14); } 50% { transform: rotate(45deg) scale(1.06); box-shadow: 0 0 0 14px rgba(15, 118, 110, .035), 0 0 48px rgba(15, 118, 110, .23); } }
@keyframes signalHalo { 50% { transform: scale(1.35); opacity: .55; } }
@keyframes nodePulse { 0%, 60%, 100% { transform: scale(1); box-shadow: 0 0 0 5px rgba(15, 118, 110, .055); } 25% { transform: scale(1.35); box-shadow: 0 0 0 8px rgba(15, 118, 110, .09), 0 0 14px rgba(15, 118, 110, .25); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { box-shadow: 0 0 0 6px rgba(21, 128, 95, .04); } }
@keyframes softGlow { 50% { box-shadow: 0 0 22px rgba(89, 211, 182, .12); } }
@keyframes slideIn { from { transform: translateX(30px); opacity: .5; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes viewIn { from { opacity: .5; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; margin-bottom: -5px; } to { opacity: 1; margin-bottom: 0; } }

@media (min-width: 1500px) {
  .login-shell { grid-template-columns: 1.2fr minmax(400px, .8fr); }
}
@media (max-width: 1100px) {
  .login-shell { gap: 48px; padding: 48px; }
  .login-intro { margin: 0; padding: 0; }
  .login-intro > h1 { font-size: 42px; }
  .signal-art { transform: scale(.85); transform-origin: left center; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .brand small { display: none; }
  .filter-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 24px; }
  .tab { padding: 8px 12px; }
}
@media (max-width: 800px) {
  .login-shell { display: block; padding: 32px 20px; min-height: 100vh; }
  .login-intro { display: none; }
  .login-card { max-width: 430px; margin: 9vh auto 0; padding: 34px 28px; }
  .mobile-brand { display: flex; margin-bottom: 35px; }
  .mobile-brand .brand-word { color: var(--navy); }
  .mobile-brand .brand-mark { background: var(--navy); }
  .topbar { height: auto; min-height: 64px; padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  .topbar .brand { font-size: 19px; }
  .header-status { order: 3; width: 100%; justify-content: flex-start; }
  .account { margin-left: auto; padding-left: 8px; }
  .account #identity { display: none; }
  .workspace { padding: 27px 16px 45px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 25px; }
  .heading-meta { display: none; }
  .tabs { gap: 5px; }
  .tab { padding: 8px 11px; }
  .section-heading { align-items: flex-start; }
  .filter-grid, .filter-panel.compact .filter-grid { grid-template-columns: 1fr; }
  .filter-footer { flex-wrap: wrap; align-items: flex-start; flex-direction: column; }
  .filter-footer > .small { flex: 1; min-width: 0; }
  .filter-footer > div { align-self: flex-end; }
  .panel-toolbar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .panel-toolbar > div { width: 100%; flex-wrap: wrap; }
  .data-table th, .data-table td { padding: 12px; }
  .pagination { padding: 12px; gap: 8px; }
  .pagination .button { padding: 7px 9px; font-size: 11px; }
  .health-banner { padding: 23px 19px; gap: 16px; align-items: flex-start; }
  .health-orbit { width: 42px; height: 42px; }
  .health-time { display: none; }
  .health-banner h3 { font-size: 18px; }
  .kpi-grid { gap: 12px; }
  .kpi-card { padding: 18px; }
  .kpi-card > strong { font-size: 28px; }
  .metrics-layout { grid-template-columns: 1fr; }
  .metric-list { grid-template-columns: 1fr; }
  .detail-facts { grid-template-columns: 1fr 1fr; }
  .drawer-header { padding: 18px 20px; }
  #detail-content { padding: 18px 16px 35px; }
  .footer { padding: 20px 16px; flex-direction: column; gap: 5px; }
  .custom-time { grid-column: auto; }
  .rule-row .filter-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .records-panel { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .records-panel .panel-toolbar, .records-panel .pagination { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px; }
  .records-panel .panel-toolbar { margin-bottom: 12px; }
  .records-panel .pagination { margin-top: 12px; }
  .records-panel .table-wrap { overflow: visible; }
  .data-table, .data-table tbody { display: block; }
  .data-table thead { display: none; }
  .data-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; position: relative; margin-bottom: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); white-space: normal; }
  .data-table td { display: block; padding: 8px 0; border: 0; min-width: 0; }
  .data-table td::before { content: attr(data-label); display: block; color: var(--faint); font-size: 9px; margin-bottom: 4px; }
  .data-table td:first-child { grid-column: 1/-1; border-bottom: 1px solid var(--line); padding-top: 0; margin-bottom: 4px; padding-right: 28px; }
  .data-table td:nth-child(3), .data-table td:nth-child(5) { grid-column: 1/-1; }
  .data-table td.numeric { text-align: left; }
  .data-table td:last-child { position: absolute; right: 12px; top: 15px; }
  .data-table td:last-child::before { display: none; }
  .data-table .model-cell { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .data-table .cell-secondary { overflow-wrap: anywhere; }
  .data-table td.numeric .cell-secondary { font-size: 9px; }
  .records-panel .empty-state { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
  .advanced-filters { grid-template-columns: 1fr; }
  .section-heading { flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .tab { font-size: 11px; padding: 8px 10px; }
  .tab svg { width: 14px; height: 14px; }
  .section-heading .button { font-size: 11px; padding: 7px 10px; }
  .section-heading h2 { font-size: 19px; }
  .pagination > span { display: none; }
  .pagination { justify-content: flex-end; }
  .rule-row .filter-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.conversation-image { margin: 16px; }
.conversation-image img { display: block; max-width: 100%; height: auto; margin-top: 12px; }
.conversation-image a { display: block; overflow-wrap: anywhere; margin-top: 8px; }

/* Stream integrity banner (流式缺口) */
.gap-alert { margin: 0 0 16px; padding: 12px 15px; border: 1px solid var(--line); border-left: 4px solid var(--faint); border-radius: 9px; background: var(--surface-soft); color: var(--ink); font-size: 13px; line-height: 1.6; }
.gap-alert.ok { border-left-color: var(--good); background: var(--good-soft); color: var(--good); }
.gap-alert.warn { border-left-color: var(--warning); background: var(--warning-soft); color: var(--warning); }
.gap-alert.alert { border-left-color: var(--danger); background: var(--danger-soft); color: var(--danger); font-weight: 600; }

/* Stage 1–2: explicit request states, association semantics and detail hierarchy */
.status.neutral { color: var(--muted); }
.panel-status { margin: 0 0 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--muted); font-size: 12px; line-height: 1.65; }
.panel-status.loading { color: var(--accent); border-color: #cde5df; background: var(--accent-soft); }
.panel-status.error { color: var(--danger); border-color: #f2ccd4; background: var(--danger-soft); }
.panel-status.success { color: var(--good); }
.data-table tbody tr[role="button"] { cursor: pointer; }
.data-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.detail-section { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.detail-section > h3 { margin: 0 0 14px; color: var(--ink); font-size: 12px; letter-spacing: .02em; }
.detail-section .detail-facts { margin-top: 0; padding-top: 0; border-top: 0; }
.detail-actions { display: grid; gap: 12px; }
.detail-actions .filter-grid { margin: 0; }
.detail-error { margin: 22px 26px 45px; padding: 20px; border: 1px solid #f2ccd4; border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); }
.detail-error h3 { margin-bottom: 8px; }
.detail-error p { margin-bottom: 16px; overflow-wrap: anywhere; }
.metrics-section-title { margin: 24px 0 14px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; }
@media (max-width: 600px) {
  .detail-error { margin: 18px 16px 35px; }
  .detail-section { margin-top: 16px; padding-top: 14px; }
}


/* Query controls and detail downloads share one visual row */
.section-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.section-tools .field { display: flex; flex-direction: row; align-items: center; gap: 8px; margin: 0; }
.section-tools .field > span { white-space: nowrap; }
.section-tools .field select { width: auto; min-width: 140px; margin: 0; }
.section-tools .button { margin: 0; }
.detail-download-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-download-row .button, .detail-download-row a { margin: 0; }
@media (max-width: 600px) {
  .section-tools { align-items: flex-start; }
  .section-tools .field { flex: 1 1 180px; }
  .section-tools .field select { flex: 1; min-width: 0; }
}

/* ===== IP 预警 ===== */
.ip-toolbar{display:flex;flex-wrap:wrap;gap:.75rem;align-items:flex-end;margin:.5rem 0 1rem}
.ip-toolbar .field{margin:0}
.ip-batch-toolbar{justify-content:flex-start;align-items:center;min-height:0;padding:10px 0 12px;border-bottom:0;gap:16px}
.ip-batch-toolbar label{display:flex;align-items:center;gap:.35rem;margin:0;color:var(--muted);font-size:12px;line-height:1.4;white-space:nowrap}
.ip-batch-toolbar input[type=checkbox]{width:17px;height:17px;margin:0;accent-color:var(--accent,#2e6bd8)}
.ip-batch-toolbar .button{margin-left:4px}
.ip-map-wrap{margin:1rem 0 1.25rem;padding:1rem;border:1px solid var(--border,#dfe5ee);border-radius:10px;background:var(--surface,#fff)}
.ip-map{width:100%;height:360px}
.ip-map-footer{margin:.65rem 0 0}
.ip-spark{width:100%;height:110px;color:var(--accent,#2e6bd8);display:block;margin:.25rem 0 1rem}
.row-actions{display:flex;gap:.35rem;flex-wrap:wrap}
.row-actions .button{padding:.2rem .55rem;font-size:.78rem}
td.empty{text-align:center;color:var(--muted,#76839a);padding:1.5rem}
td.mono,th.mono{font-variant-numeric:tabular-nums;white-space:nowrap}
.ip-detail-chart{width:100%;height:272px}
.field.checkbox label{display:flex;align-items:center;gap:.35rem;font-weight:400;white-space:nowrap}
/* ===== AI 分析 ===== */
.analysis-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:.75rem;margin:.5rem 0 1rem}
.analysis-grid .field{margin:0}
.analysis-result{margin:0 0 1rem;padding:1rem;border:1px solid var(--border,#dfe5ee);border-radius:10px;background:var(--surface,#fff)}
.button.analysis-running:disabled{opacity:1;border-color:var(--accent,#2e6bd8);color:var(--accent,#2e6bd8);cursor:progress}
.analysis-evidence{margin:.5rem 0;padding:.55rem .7rem;border:1px solid var(--border,#dfe5ee);border-radius:8px;overflow-wrap:anywhere}
.analysis-evidence summary{cursor:pointer;font-weight:600}
.analysis-evidence p{white-space:pre-wrap}
.ip-pagination{justify-content:center;gap:.75rem;margin-top:.75rem}
#ip-rows input[type=checkbox]{vertical-align:middle;accent-color:var(--accent,#2e6bd8)}
.analysis-summary{font-size:1.02rem;font-weight:600;margin:.25rem 0 .5rem}
.analysis-chips{display:flex;flex-wrap:wrap;gap:.4rem;margin:.5rem 0}
.analysis-chips .chip{padding:.15rem .55rem;border-radius:999px;font-size:.78rem;border:1px solid var(--border,#dfe5ee);color:var(--muted,#76839a)}
.analysis-chips .chip.high{background:#fde8e6;border-color:#f3b4ad;color:#b42318}
.analysis-chips .chip.medium{background:#fdf0dd;border-color:#f0cfa2;color:#b45309}
.analysis-chips .chip.low{background:#eef6ff;border-color:#bcd6f5;color:#1d4ed8}

.archive-preview{max-height:32rem;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere}
