:root {
  color-scheme: dark;
  --bg: #0b1215;
  --bg-soft: #10191d;
  --bg-muted: #172328;
  --panel: #121d22;
  --panel-raised: #17242a;
  --line: rgba(223, 241, 247, .10);
  --line-strong: rgba(223, 241, 247, .18);
  --ink: #f2f8fa;
  --ink-2: #c0d0d6;
  --ink-3: #91a5ad;
  --accent: #5bc8a5;
  --accent-strong: #7de3bf;
  --accent-soft: rgba(91, 200, 165, .13);
  --accent-line: rgba(91, 200, 165, .34);
  --blue: #68b7e8;
  --blue-soft: rgba(104, 183, 232, .13);
  --warning: #f3bd68;
  --warning-soft: rgba(243, 189, 104, .13);
  --danger: #ff8295;
  --danger-soft: rgba(255, 130, 149, .13);
  --ok: #5dd5a1;
  --shadow: 0 18px 60px rgba(0, 0, 0, .26);
  --radius-sm: 8px;
  --radius: 13px;
  --radius-lg: 20px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6f5;
  --bg-soft: #f8faf9;
  --bg-muted: #e9efed;
  --panel: #ffffff;
  --panel-raised: #f8fbfa;
  --line: #dfe7e4;
  --line-strong: #cbd8d4;
  --ink: #14231f;
  --ink-2: #455b54;
  --ink-3: #5b7069;
  --accent: #087c5b;
  --accent-strong: #09694f;
  --accent-soft: #e5f5ef;
  --accent-line: #abdccc;
  --blue: #176d9e;
  --blue-soft: #e8f3f9;
  --warning: #8a5708;
  --warning-soft: #fff3dc;
  --danger: #a62f46;
  --danger-soft: #fdebf0;
  --ok: #087c5b;
  --shadow: 0 18px 50px rgba(27, 55, 46, .10);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scrollbar-gutter: stable; }
body { min-width: 320px; min-height: 100svh; margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { color: inherit; }
button, [role="button"] { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 1000; transform: translateY(-150%); padding: 9px 13px; border-radius: var(--radius-sm); background: var(--ink); color: var(--bg); font-weight: 700; }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* Login */
.login-shell { min-height: 100svh; display: grid; place-items: center; padding: 28px 18px; background: radial-gradient(circle at 75% 12%, var(--accent-soft), transparent 34%), radial-gradient(circle at 12% 90%, var(--blue-soft), transparent 30%), var(--bg); }
.login-card { width: min(100%, 470px); padding: clamp(25px, 6vw, 44px); border: 1px solid var(--line); border-radius: 26px; background: color-mix(in srgb, var(--panel) 93%, transparent); box-shadow: var(--shadow); }
.login-brand { position: relative; width: 76px; height: 76px; display: grid; place-items: center; margin-bottom: 30px; }
.login-orbit { position: absolute; inset: 0; border: 1px solid var(--accent-line); border-radius: 50%; animation: orbit 12s linear infinite; }
.login-orbit span { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.login-orbit span:nth-child(1) { top: -3px; left: 50%; }
.login-orbit span:nth-child(2) { right: 4px; bottom: 12px; }
.login-orbit span:nth-child(3) { left: 2px; bottom: 18px; background: var(--blue); }
@keyframes orbit { to { transform: rotate(360deg); } }
.login-copy h1 { max-width: 360px; margin: 5px 0 10px; font-size: clamp(28px, 7vw, 38px); line-height: 1.08; letter-spacing: -.045em; }
.login-copy > p:last-child { margin: 0 0 28px; color: var(--ink-3); font-size: 14px; }
.login-form { display: grid; gap: 8px; }
.login-form label { margin-top: 7px; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.login-form input, .filter-bar input, .filter-bar select { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); outline: 0; background: var(--bg-soft); color: var(--ink); }
.login-form input:focus, .filter-bar input:focus, .filter-bar select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-error { margin: 4px 0 0; color: var(--danger); font-size: 12.5px; }
.login-meta { margin: 22px 0 0; color: var(--ink-3); text-align: center; font-size: 11.5px; }

/* Shell e topbar */
.app-shell { width: min(100%, 1440px); min-height: 100svh; margin: 0 auto; padding: 0 28px 52px; }
.topbar { position: static; z-index: 40; margin: 0 -28px; padding: 0 28px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); }
.topbar-inner { min-height: 68px; display: flex; align-items: center; gap: 16px; }
.brand { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; min-width: 190px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border: 1px solid var(--accent-line); border-radius: 10px; background: linear-gradient(145deg, var(--accent-soft), var(--blue-soft)); color: var(--accent-strong); font-weight: 850; font-size: 11px; letter-spacing: -.04em; }
.brand-mark-large { width: 48px; height: 48px; border-radius: 15px; font-size: 14px; }
.brand-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-copy strong { white-space: nowrap; font-size: 14px; }
.brand-copy small { color: var(--ink-3); font-size: 10.5px; }
.topbar-version { margin-left: 5px; color: var(--ink-3); font-size: 9.5px; font-weight: 750; letter-spacing: 0; }
.global-search { min-width: 160px; max-width: 420px; height: 38px; flex: 1 1 300px; display: flex; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg-soft); color: var(--ink-3); }
.global-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.global-search svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); }
.global-search input::placeholder { color: var(--ink-3); }
kbd { padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--bg-muted); color: var(--ink-3); font: 10px var(--font); }
.topbar-status { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sync-pill { min-width: 0; height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--accent-line); border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); cursor: pointer; white-space: nowrap; font-size: 11px; font-weight: 750; }
.sync-pill.stale { border-color: color-mix(in srgb, var(--warning) 40%, transparent); background: var(--warning-soft); color: var(--warning); }
.sync-pill.unavailable { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); color: var(--danger); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 16%, transparent); }
.icon-button { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); cursor: pointer; }
.icon-button:hover, .icon-button[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent-strong); }
.icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.account { display: flex; align-items: center; gap: 8px; margin-left: 4px; padding-left: 11px; border-left: 1px solid var(--line); }
.account-avatar { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; background: var(--bg-muted); color: var(--ink-2); font-size: 11px; font-weight: 800; }
.account-copy { max-width: 140px; display: flex; flex-direction: column; line-height: 1.15; }
.account-copy strong, .account-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 11.5px; }
.account-copy small { color: var(--ink-3); font-size: 10px; text-transform: capitalize; }
.text-button { padding: 6px 8px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 12px; font-weight: 700; }
.text-button:hover { color: var(--accent-strong); }
.privacy-banner { min-height: 32px; display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0 -28px; padding: 7px 28px; border-top: 1px solid var(--line); background: var(--accent-soft); color: var(--accent-strong); font-size: 11px; }
.privacy-banner svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Navegação e conteúdo */
.view-nav { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: repeat(6, minmax(108px, 1fr)); gap: 5px; margin: 16px 0 0; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--panel) 92%, transparent); box-shadow: 0 6px 26px rgba(0, 0, 0, .06); backdrop-filter: blur(16px); }
.view-nav button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 10px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 12px; font-weight: 700; white-space: nowrap; }
.view-nav button:hover { background: var(--bg-muted); color: var(--ink); }
.view-nav button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent-strong); box-shadow: inset 0 0 0 1px var(--accent-line); }
.nav-icon { font-size: 14px; }
.content { min-height: calc(100svh - 210px); outline: 0; }
.view { padding: clamp(30px, 5vw, 55px) 0 24px; animation: view-in .22s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }
.view-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.eyebrow, .panel-kicker { margin: 0; color: var(--accent-strong); font-size: 10.5px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.view-heading h1 { margin: 4px 0 3px; font-size: clamp(26px, 4vw, 38px); line-height: 1.12; letter-spacing: -.04em; }
.view-heading p:last-child { margin: 0; color: var(--ink-3); }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 750; font-size: 12px; }
.button:disabled { cursor: wait; opacity: .65; }
.button-primary { border: 1px solid var(--accent); background: var(--accent); color: #071611; }
:root[data-theme="light"] .button-primary { color: #fff; }
.button-secondary { border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink-2); }
.button-secondary:hover { border-color: var(--accent-line); color: var(--accent-strong); }
.button-wide { width: 100%; margin-top: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.metric { min-width: 0; padding: 17px 18px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric-label { display: block; margin-bottom: 3px; color: var(--ink-3); font-size: 10.5px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.metric-value { display: block; font-size: 25px; font-weight: 780; letter-spacing: -.035em; }
.metric-note { display: block; overflow: hidden; color: var(--ink-3); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.metric.tone-warning .metric-value { color: var(--warning); }
.metric.tone-danger .metric-value { color: var(--danger); }
.metric.tone-ok .metric-value { color: var(--ok); }
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.entity-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: 0 2px 10px rgba(0, 0, 0, .035); cursor: pointer; }
.entity-card:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.entity-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.entity-card h2 { overflow: hidden; margin: 0; font-size: 14.5px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.entity-card .identity { margin: 2px 0 15px; color: var(--ink-3); font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.entity-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.entity-meta span { min-width: 0; padding: 8px 9px; border-radius: 8px; background: var(--bg-soft); color: var(--ink-2); font-size: 11px; }
.entity-meta small { display: block; color: var(--ink-3); font-size: 9px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.badge { display: inline-flex; align-items: center; max-width: 100%; padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg-soft); color: var(--ink-2); font-size: 10px; font-weight: 750; white-space: nowrap; }
.badge.ok { border-color: var(--accent-line); background: var(--accent-soft); color: var(--ok); }
.badge.warning { border-color: color-mix(in srgb, var(--warning) 40%, transparent); background: var(--warning-soft); color: var(--warning); }
.badge.danger { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); color: var(--danger); }
.badge.info { border-color: color-mix(in srgb, var(--blue) 38%, transparent); background: var(--blue-soft); color: var(--blue); }

/* Filtros e tabelas */
.filter-bar { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)) auto auto; align-items: end; gap: 9px; margin: -4px 0 18px; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.filter-bar-compact { grid-template-columns: minmax(220px, 1fr) auto auto; max-width: 670px; }
.filter-bar label { min-width: 0; color: var(--ink-3); font-size: 10.5px; font-weight: 750; }
.filter-bar input { min-height: 38px; margin-top: 4px; }
.clear-filters { min-height: 38px; }
.table-card { min-height: 160px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 11px 13px; border-bottom: 1px solid var(--line); background: var(--bg-soft); color: var(--ink-3); text-align: left; font-size: 9.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.data-table td { max-width: 300px; padding: 13px; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: var(--accent-soft); }
.cell-main { display: block; overflow: hidden; color: var(--ink); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.cell-sub { display: block; overflow: hidden; margin-top: 2px; color: var(--ink-3); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.progress { width: 110px; max-width: 100%; height: 6px; margin-top: 6px; overflow: hidden; border-radius: 999px; background: var(--bg-muted); }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

/* Carga, alertas e estados */
.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.panel > header { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.panel h2 { margin: 2px 0 0; font-size: 15px; }
.load-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.load-row:last-child { border-bottom: 0; }
.load-name { min-width: 0; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.load-bar { height: 8px; overflow: hidden; border-radius: 999px; background: var(--bg-muted); }
.load-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--blue)); }
.load-value { min-width: 24px; color: var(--ink-2); text-align: right; font-weight: 800; }
.alert-list { display: grid; gap: 10px; }
.alert-card { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 15px 17px; border: 1px solid var(--line); border-left: 3px solid var(--warning); border-radius: var(--radius); background: var(--panel); cursor: pointer; }
.alert-card.critical { border-left-color: var(--danger); }
.alert-card:hover { border-color: var(--accent-line); }
.alert-days { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: var(--warning-soft); color: var(--warning); text-align: center; font-size: 10px; font-weight: 750; line-height: 1; }
.alert-card.critical .alert-days { background: var(--danger-soft); color: var(--danger); }
.alert-days strong { display: block; font-size: 17px; }
.alert-title { overflow: hidden; margin: 0; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.alert-copy { margin: 3px 0 0; color: var(--ink-3); font-size: 11px; }
.empty-state, .loading-state, .error-state { min-height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; grid-column: 1 / -1; padding: 30px 18px; color: var(--ink-3); text-align: center; }
.empty-icon { width: 44px; height: 44px; display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: 13px; background: var(--bg-soft); color: var(--accent); font-size: 18px; }
.empty-state strong, .error-state strong { color: var(--ink); font-size: 13px; }
.empty-state p, .error-state p { max-width: 360px; margin: 0; font-size: 11.5px; }
.empty-state.ok .empty-icon { border-color: var(--accent-line); background: var(--accent-soft); color: var(--ok); }
.error-state .empty-icon { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: var(--danger-soft); color: var(--danger); }
.loading-state::before { width: 23px; height: 23px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; content: ""; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Drawer, toast e rodapé */
.drawer-host { position: fixed; inset: 0; z-index: 100; }
.drawer-scrim { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(2, 10, 12, .56); backdrop-filter: blur(2px); cursor: default; }
.drawer { position: absolute; top: 0; right: 0; width: min(470px, 100%); height: 100%; overflow-y: auto; border-left: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow); animation: drawer-in .2s ease-out; }
@keyframes drawer-in { from { transform: translateX(100%); } }
.drawer > header { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 21px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(12px); }
.drawer h2 { margin: 3px 0 0; font-size: 20px; }
.drawer-body { padding: 20px; }
.detail-list { margin: 0; }
.detail-row { display: grid; grid-template-columns: minmax(105px, 36%) minmax(0, 1fr); gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.detail-row dt { color: var(--ink-3); font-size: 10.5px; font-weight: 750; text-transform: uppercase; }
.detail-row dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--ink-2); }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 130; width: min(340px, calc(100% - 26px)); display: grid; gap: 8px; }
.toast { display: grid; grid-template-columns: 29px minmax(0, 1fr); gap: 10px; padding: 12px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--panel-raised); box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.toast-icon { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--ok); font-weight: 900; }
.toast.error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast strong { display: block; font-size: 12px; }
.toast span { display: block; color: var(--ink-3); font-size: 11px; }
.app-footer { display: flex; justify-content: space-between; gap: 18px; padding-top: 25px; color: var(--ink-3); font-size: 10.5px; }

@media (max-width: 1060px) {
  .topbar-inner { flex-wrap: wrap; padding: 10px 0; }
  .brand { min-width: 0; }
  .global-search { order: 3; max-width: none; flex-basis: 100%; }
  .topbar-status { margin-left: auto; }
  .view-nav { top: 0; overflow-x: auto; grid-template-columns: repeat(6, minmax(120px, 1fr)); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .filter-bar .button, .filter-bar .text-button { justify-self: start; }
}

@media (max-width: 720px) {
  .app-shell { padding: 0 13px 42px; }
  .topbar { margin: 0 -13px; padding: 0 13px; }
  .topbar-inner { gap: 8px; }
  .brand-copy small, .account-copy, .account .text-button { display: none; }
  .sync-pill { flex: 1 1 145px; max-width: 210px; overflow: hidden; }
  .sync-pill span:last-child { overflow: hidden; text-overflow: ellipsis; }
  .privacy-banner { margin: 0 -13px; padding: 7px 13px; justify-content: flex-start; }
  .view-nav { top: 0; margin-top: 10px; border-radius: 11px; }
  .view-nav button { min-width: 102px; }
  .view-heading { align-items: flex-start; }
  .view-heading .button { flex: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .card-grid, .split-grid { grid-template-columns: 1fr; }
  .filter-bar, .filter-bar-compact { grid-template-columns: 1fr; max-width: none; }
  .filter-bar .button, .filter-bar .text-button { width: 100%; }
  .table-card { border: 0; overflow: visible; background: transparent; }
  .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; }
  .data-table thead { display: none; }
  .data-table tr { margin-bottom: 9px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
  .data-table td { display: grid; grid-template-columns: minmax(92px, 35%) minmax(0, 1fr); gap: 8px; max-width: none; padding: 7px 0; border: 0; }
  .data-table td::before { content: attr(data-label); color: var(--ink-3); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
  .alert-card { grid-template-columns: 48px minmax(0, 1fr); }
  .alert-card > .badge { grid-column: 2; justify-self: start; }
  .app-footer { flex-direction: column; gap: 5px; }
}

@media (max-width: 420px) {
  .login-shell { padding: 0; }
  .login-card { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; border: 0; border-radius: 0; box-shadow: none; }
  .brand-copy strong { font-size: 12.5px; }
  .sync-pill { max-width: 160px; }
  .view-nav { top: 0; margin-left: -13px; margin-right: -13px; border-left: 0; border-right: 0; border-radius: 0; }
  .view { padding-top: 32px; }
  .view-heading { display: block; }
  .view-heading .button { width: 100%; margin-top: 14px; }
  .metric { padding: 14px; }
  .metric-value { font-size: 21px; }
  .card-grid { gap: 9px; }
  .entity-meta { grid-template-columns: 1fr; }
  .data-table td { grid-template-columns: 1fr; gap: 1px; }
  .load-row { grid-template-columns: minmax(0, 1fr) auto; }
  .load-bar { grid-row: 2; grid-column: 1 / -1; }
  .drawer { 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; }
}
