:root {
  color-scheme: dark;
  --bg: #06101d;
  --surface: #0b1726;
  --surface-2: #101f31;
  --surface-3: #14263a;
  --border: #203750;
  --border-strong: #315170;
  --text: #e9f1fa;
  --muted: #91a6ba;
  --blue: #5b9cff;
  --blue-soft: #17365e;
  --amber: #f6b94b;
  --amber-soft: #493515;
  --green: #4fd1a1;
  --green-soft: #123c32;
  --red: #ff7c88;
  --red-soft: #4a2029;
  --violet: #8b5cf6;
  --violet-soft: #251746;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
  font-family: "Fira Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 74% -10%, rgba(42, 94, 163, .22), transparent 34rem), var(--bg); color: var(--text); }
button, select, a { font: inherit; }
button, select { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.skip-link { position: fixed; left: 16px; top: -60px; z-index: 100; padding: 10px 14px; border-radius: 8px; background: var(--blue); color: #04101f; font-weight: 700; }
.skip-link:focus { top: 16px; }

.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-width: 0; min-height: 100vh; }
.sidebar { position: sticky; top: 0; min-width: 0; height: 100vh; display: flex; flex-direction: column; gap: 30px; padding: 28px 18px 20px; border-right: 1px solid var(--border); background: rgba(6, 16, 29, .9); backdrop-filter: blur(20px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid #386da7; border-radius: 12px; color: var(--blue); background: linear-gradient(145deg, #17345a, #0d1d31); box-shadow: 0 0 24px rgba(91, 156, 255, .15); }
.brand strong, .brand span { display: block; }
.brand strong { letter-spacing: -.02em; }
.brand div > span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.nav-list { display: grid; min-width: 0; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--muted); text-align: left; transition: color .2s ease, background-color .2s ease, border-color .2s ease; }
.nav-item:hover { color: var(--text); background: var(--surface); }
.nav-item.is-active { color: #ddebff; border-color: #274e79; background: linear-gradient(90deg, #17365e, #10233b); }
.nav-item:focus-visible, .icon-button:focus-visible, .text-button:focus-visible, .primary-button:focus-visible, .secondary-button:focus-visible, select:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.sidebar-foot strong, .sidebar-foot span { display: block; }
.sidebar-foot strong { font-size: 13px; }
.sidebar-foot div > span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.status-dot { width: 9px; height: 9px; border-radius: 99px; background: var(--amber); box-shadow: 0 0 12px currentColor; }
.status-dot.ok { color: var(--green); background: var(--green); }
.status-dot.error { color: var(--red); background: var(--red); }

.main-content { min-width: 0; padding: 26px 32px 46px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.topbar > div:first-child { min-width: 0; }
h1, h2, p { margin: 0; }
h1 { margin-top: 4px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.04em; }
h1 { overflow-wrap: anywhere; }
h2 { font-size: 17px; letter-spacing: -.02em; }
.eyebrow { color: var(--blue); font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.last-updated { color: var(--muted); font-size: 12px; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); transition: border-color .2s ease, background-color .2s ease; }
.icon-button:hover { border-color: var(--border-strong); background: var(--surface-2); }
.icon-button.is-loading svg { animation: spin 1s linear infinite; }

.view { display: grid; gap: 24px; }
.view[hidden] { display: none; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { min-height: 134px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(145deg, rgba(16, 31, 49, .95), rgba(9, 22, 37, .95)); box-shadow: var(--shadow); }
.metric-card span, .metric-card small { display: block; color: var(--muted); }
.metric-card span { font-size: 13px; }
.metric-card strong { display: block; margin: 14px 0 9px; font-family: "Fira Code", ui-monospace, monospace; font-size: 28px; letter-spacing: -.04em; }
.metric-card small { font-size: 11px; }
.section-heading, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.section-heading { margin: 4px 0 -10px; }
.section-heading h2, .panel-head h2 { margin-top: 4px; }
.pipeline-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pipeline-card { position: relative; overflow: hidden; padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.pipeline-card::after { content: ""; position: absolute; inset: auto 0 0; height: 2px; background: var(--blue); opacity: .6; }
.pipeline-card.warn::after { background: var(--amber); }
.pipeline-card.error::after { background: var(--red); }
.pipeline-card .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pipeline-card h3 { margin: 0; font-size: 14px; }
.pipeline-card p { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.pipeline-card strong { font-family: "Fira Code", ui-monospace, monospace; font-size: 21px; }

.content-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; }
.span-2 { min-width: 0; }
.panel { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(11, 23, 38, .93); box-shadow: var(--shadow); }
.panel-head { margin-bottom: 18px; }
.text-button { border: 0; padding: 7px 0; background: transparent; color: var(--blue); font-size: 12px; }
.text-button:hover { color: #9bc3ff; }
.badge { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border: 1px solid transparent; border-radius: 99px; font-size: 11px; white-space: nowrap; }
.badge.ok { color: #9cf0d1; border-color: #296650; background: var(--green-soft); }
.badge.warn { color: #ffd991; border-color: #755723; background: var(--amber-soft); }
.badge.error { color: #ffabb4; border-color: #7a3641; background: var(--red-soft); }
.badge.neutral { color: #afc6dd; border-color: var(--border); background: var(--surface-2); }
.badge.info { color: #acd0ff; border-color: #315b89; background: var(--blue-soft); }

.table-wrap { overflow-x: auto; }
.table-wrap.large { max-height: 640px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { position: sticky; top: 0; z-index: 1; padding: 10px 12px; border-bottom: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); font-weight: 600; text-align: left; white-space: nowrap; }
td { padding: 13px 12px; border-bottom: 1px solid rgba(32, 55, 80, .7); color: #cbd9e7; vertical-align: top; }
tbody tr { transition: background-color .18s ease; }
tbody tr:hover { background: rgba(25, 51, 81, .32); }
.empty-cell { padding: 34px 12px; color: var(--muted); text-align: center; }
.mono { font-family: "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; word-break: break-all; }
.token-cell strong, .token-cell span { display: block; }
.token-cell strong { color: var(--text); }
.token-cell span { margin-top: 4px; color: var(--muted); }
.token-link { color: #9bc3ff; text-decoration: none; }
.token-link:hover { text-decoration: underline; }
.summary-cell { max-width: 420px; line-height: 1.5; }
.bar-list { display: grid; gap: 16px; padding-top: 4px; }
.bar-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) 34px; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.bar-track { height: 7px; overflow: hidden; border-radius: 99px; background: #17283a; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3f7fd4, #6cacff); }

.filter-head { align-items: flex-end; }
.filters { display: flex; gap: 10px; }
.filters label { display: grid; gap: 5px; color: var(--muted); font-size: 10px; }
select { min-width: 120px; padding: 8px 28px 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.lark-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .9fr); gap: 18px; }
.lead { margin: 8px 0 22px; color: #bfd0e1; line-height: 1.65; }
.status-list { margin: 0; }
.status-list > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid rgba(32, 55, 80, .65); }
.status-list dt { color: var(--muted); font-size: 12px; }
.status-list dd { margin: 0; color: #d4e1ed; font-size: 12px; text-align: right; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border-radius: 10px; font-weight: 700; font-size: 12px; text-decoration: none; transition: background-color .2s ease, border-color .2s ease, color .2s ease; }
.primary-button { border: 1px solid #75adfa; background: var(--blue); color: #06111f; }
.primary-button:hover { background: #7fb3ff; }
.secondary-button { border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); }
.secondary-button:hover { border-color: #4d7599; background: var(--surface-3); }
.secondary-button:disabled { cursor: wait; opacity: .65; }
.probe-result { margin-top: 16px; padding: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.probe-result:not(:empty) { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: rgba(6, 16, 29, .7); }
.score-gates { display: grid; gap: 12px; }
.gate { display: grid; grid-template-columns: 66px 1fr auto; align-items: center; gap: 10px; font-size: 12px; }
.gate span { color: var(--muted); }
.gate .track { height: 6px; border-radius: 99px; background: #17283a; }
.gate .fill { height: 100%; border-radius: inherit; background: var(--blue); }
.gate.risk .fill { background: var(--amber); }
.muted { margin-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; max-width: min(420px, calc(100vw - 40px)); padding: 12px 15px; border: 1px solid var(--border-strong); border-radius: 11px; background: #14273b; color: var(--text); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

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

/* Login */
.login-page { min-height: 100svh; background: #050b14; }
.login-page::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 16% 12%, rgba(74, 128, 210, .15), transparent 28rem), radial-gradient(circle at 90% 85%, rgba(139, 92, 246, .1), transparent 24rem); }
.login-shell { position: relative; display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(430px, .88fr); min-height: 100svh; }
.login-visual { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; min-width: 0; padding: clamp(30px, 5vw, 72px); border-right: 1px solid rgba(76, 110, 148, .2); background: linear-gradient(150deg, rgba(8, 20, 35, .98), rgba(5, 13, 24, .98)); }
.login-visual::before { content: ""; position: absolute; z-index: -1; inset: 0; opacity: .14; background-image: linear-gradient(rgba(91, 156, 255, .18) 1px, transparent 1px), linear-gradient(90deg, rgba(91, 156, 255, .18) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to bottom, #000, transparent 80%); }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand strong, .login-brand span { display: block; }
.login-brand strong { font-size: 15px; letter-spacing: -.01em; }
.login-brand div > span { margin-top: 4px; color: #71879c; font-family: "Fira Code", ui-monospace, monospace; font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
.login-hero-copy { position: relative; z-index: 2; max-width: 650px; margin-top: clamp(76px, 13vh, 142px); }
.login-hero-copy .eyebrow { color: var(--amber); }
.login-hero-copy h1 { margin: 20px 0 0; max-width: 720px; font-size: clamp(42px, 5.2vw, 76px); font-weight: 650; line-height: 1.08; letter-spacing: -.065em; }
.login-hero-copy h1 span { color: #92a9c1; }
.login-lead { max-width: 580px; margin-top: 24px; color: #8ea4b9; font-size: clamp(14px, 1.5vw, 17px); line-height: 1.85; }
.signal-map { position: relative; width: min(640px, 94%); height: clamp(170px, 26vh, 280px); margin: auto 0 10px; }
.signal-map svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.signal-map svg path { fill: none; stroke: rgba(246, 185, 75, .85); stroke-width: 2; filter: drop-shadow(0 0 6px rgba(246, 185, 75, .24)); stroke-dasharray: 800; animation: signal-draw 2.2s cubic-bezier(.25, .8, .25, 1) both; }
.signal-map svg .signal-line-soft { stroke: rgba(91, 156, 255, .25); stroke-width: 1; animation-delay: .2s; }
.signal-grid { position: absolute; inset: 0; opacity: .22; background-image: linear-gradient(rgba(120, 159, 198, .2) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 159, 198, .2) 1px, transparent 1px); background-size: 38px 38px; mask-image: linear-gradient(to right, #000, transparent); }
.signal-node { position: absolute; z-index: 2; width: 8px; height: 8px; border: 2px solid #07121f; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 5px rgba(246, 185, 75, .08), 0 0 18px rgba(246, 185, 75, .5); }
.node-core { left: 51.5%; top: 45%; width: 11px; height: 11px; }
.node-one { left: 27%; top: 64%; background: var(--blue); box-shadow: 0 0 0 5px rgba(91, 156, 255, .08), 0 0 18px rgba(91, 156, 255, .5); }
.node-two { left: 73%; top: 22%; }
.node-three { left: 91%; top: 5%; background: var(--violet); box-shadow: 0 0 0 5px rgba(139, 92, 246, .08), 0 0 18px rgba(139, 92, 246, .45); }
.orbit { position: absolute; z-index: 1; border: 1px solid rgba(91, 156, 255, .14); border-radius: 50%; }
.orbit-one { left: 46%; top: 28%; width: 78px; height: 78px; animation: orbit-pulse 2.8s ease-in-out infinite; }
.orbit-two { left: 67%; top: 5%; width: 116px; height: 116px; animation: orbit-pulse 3.4s .5s ease-in-out infinite; }
.login-visual-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 24px; border-top: 1px solid rgba(56, 86, 117, .45); color: #73889c; font-size: 11px; }
.chain-list { display: flex; gap: 8px; }
.chain-list span { padding: 6px 9px; border: 1px solid rgba(78, 111, 146, .5); border-radius: 7px; font-family: "Fira Code", ui-monospace, monospace; letter-spacing: .08em; }
.system-ready { display: flex; align-items: center; gap: 8px; }
.system-ready > span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(79, 209, 161, .7); }
.login-form-panel { display: grid; place-items: center; min-width: 0; padding: clamp(24px, 5vw, 72px); background: rgba(5, 11, 20, .84); }
.login-card { width: min(100%, 440px); }
.secure-label { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid rgba(139, 92, 246, .34); border-radius: 99px; background: rgba(37, 23, 70, .6); color: #c3aef9; font-family: "Fira Code", ui-monospace, monospace; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.secure-label svg { width: 14px; height: 14px; }
.login-heading { margin: 26px 0 38px; }
.login-heading h2 { color: #f2f6fb; font-size: clamp(30px, 4vw, 40px); letter-spacing: -.045em; }
.login-heading p { margin-top: 12px; color: #8197ac; font-size: 14px; line-height: 1.7; }
#login-form { display: grid; gap: 22px; }
.form-field { display: grid; gap: 9px; }
.form-field label { color: #c9d5e1; font-size: 12px; font-weight: 650; letter-spacing: .02em; }
.input-shell { position: relative; display: flex; align-items: center; min-height: 54px; border: 1px solid #263c54; border-radius: 12px; background: rgba(11, 23, 38, .8); transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease; }
.input-shell:focus-within { border-color: #6b9fe3; background: #0d1c2d; box-shadow: 0 0 0 3px rgba(91, 156, 255, .12), 0 14px 30px rgba(0, 0, 0, .18); }
.input-shell > svg { flex: 0 0 auto; width: 18px; height: 18px; margin-left: 16px; color: #65809a; }
.input-shell input { width: 100%; min-width: 0; height: 52px; padding: 0 15px; border: 0; outline: 0; background: transparent; color: #f1f6fb; font: inherit; font-size: 14px; }
.input-shell input::placeholder { color: #5f7387; }
.input-shell input:-webkit-autofill { -webkit-text-fill-color: #f1f6fb; transition: background-color 9999s ease-out; }
.password-toggle { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; margin-right: 5px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #7690a9; transition: color .2s ease, background-color .2s ease; }
.password-toggle:hover { color: #c9d8e7; background: rgba(91, 156, 255, .08); }
.password-toggle:focus-visible, .login-submit:focus-visible, .input-shell:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 3px; }
.password-toggle svg { width: 18px; height: 18px; }
.password-toggle .eye-closed, .password-toggle.is-visible .eye-open { display: none; }
.password-toggle.is-visible .eye-closed { display: block; }
.field-error { min-height: 0; color: #ff9aa4; font-size: 11px; }
.field-error:empty { display: none; }
.form-field:has(input[aria-invalid="true"]) .input-shell { border-color: #a74854; box-shadow: 0 0 0 3px rgba(255, 124, 136, .08); }
.login-error { display: none; margin-top: -4px; padding: 11px 13px; border: 1px solid #74343e; border-radius: 10px; background: rgba(74, 32, 41, .62); color: #ffb2ba; font-size: 12px; line-height: 1.5; }
.login-error.is-visible { display: block; animation: error-in .2s ease both; }
.login-submit { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px; margin-top: 4px; padding: 0 18px; overflow: hidden; border: 1px solid #e6aa3d; border-radius: 12px; background: linear-gradient(135deg, #f6b94b, #e7a52e); color: #171006; font-weight: 800; box-shadow: 0 14px 34px rgba(180, 117, 20, .18); transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, color .2s ease; }
.login-submit::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .22), transparent 70%); transform: translateX(-120%); transition: transform .45s ease; }
.login-submit:hover:not(:disabled)::before { transform: translateX(120%); }
.login-submit:hover:not(:disabled) { border-color: #f9ca71; background: #f8c15a; box-shadow: 0 16px 38px rgba(180, 117, 20, .26); }
.login-submit:disabled { cursor: wait; opacity: .76; }
.login-submit > * { position: relative; }
.login-submit svg { width: 18px; height: 18px; }
.button-spinner { display: none; width: 17px; height: 17px; border: 2px solid rgba(23, 16, 6, .3); border-top-color: #171006; border-radius: 50%; animation: spin .8s linear infinite; }
.login-submit.is-loading .button-spinner { display: block; }
.login-submit.is-loading svg { display: none; }
.login-submit.is-success { border-color: #4fd1a1; background: #4fd1a1; }
.login-security-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 28px; padding-top: 22px; border-top: 1px solid #1b2b3e; color: #6f8498; font-size: 11px; line-height: 1.6; }
.login-security-note svg { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 1px; color: #7b94ac; }
.login-footnote { position: absolute; right: clamp(24px, 5vw, 72px); bottom: 24px; color: #4e6275; font-family: "Fira Code", ui-monospace, monospace; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }

@keyframes signal-draw { from { stroke-dashoffset: 800; opacity: 0; } to { stroke-dashoffset: 0; opacity: 1; } }
@keyframes orbit-pulse { 0%, 100% { opacity: .3; transform: scale(.92); } 50% { opacity: .8; transform: scale(1.06); } }
@keyframes error-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 920px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-visual { min-height: 330px; padding: 28px clamp(22px, 6vw, 56px) 30px; border-right: 0; border-bottom: 1px solid rgba(76, 110, 148, .2); }
  .login-hero-copy { margin-top: 58px; }
  .login-hero-copy h1 { font-size: clamp(38px, 8vw, 58px); }
  .login-lead { max-width: 620px; }
  .signal-map { position: absolute; right: -9%; bottom: 8px; width: 55%; height: 190px; opacity: .66; }
  .login-visual-footer { margin-top: 54px; }
  .login-form-panel { min-height: 620px; padding: 68px 24px 86px; }
  .login-footnote { right: 24px; }
}

@media (max-width: 560px) {
  .login-visual { min-height: 300px; padding: 22px 20px 24px; }
  .login-brand .brand-mark { width: 36px; height: 36px; }
  .login-hero-copy { margin-top: 50px; }
  .login-hero-copy h1 { margin-top: 14px; font-size: clamp(34px, 11vw, 46px); }
  .login-lead { margin-top: 18px; font-size: 13px; line-height: 1.7; }
  .signal-map { display: none; }
  .login-visual-footer { margin-top: auto; padding-top: 20px; }
  .system-ready { display: none; }
  .login-form-panel { display: block; min-height: 600px; padding: 48px 20px 82px; }
  .login-card { margin: 0 auto; }
  .login-heading { margin: 22px 0 30px; }
  .login-heading h2 { font-size: 31px; }
  .input-shell, .login-submit { min-height: 52px; }
  .login-footnote { left: 20px; right: auto; bottom: 22px; }
}

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline-grid { grid-template-columns: 1fr; }
  .content-grid, .lark-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 100%; overflow-x: clip; }
  .sidebar { position: static; width: 100%; max-width: 100%; height: auto; gap: 14px; padding: 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .brand { min-width: 0; }
  .nav-list { display: flex; width: 100%; max-width: 100%; overflow-x: auto; }
  .nav-item { width: auto; min-width: max-content; }
  .sidebar-foot { display: none; }
  .main-content { padding: 20px 16px 36px; }
  .topbar { align-items: flex-start; }
  .last-updated { display: none; }
  .filter-head { align-items: flex-start; flex-direction: column; }
  .filters { width: 100%; }
  .filters label, select { width: 100%; }
}

@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 116px; }
  .topbar h1 { font-size: 25px; }
  .status-list > div { grid-template-columns: 1fr; gap: 6px; }
  .status-list dd { text-align: left; }
  .button-row > * { width: 100%; }
}

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