:root {
  color-scheme: light;
  font-family: Inter, Aptos, "Segoe UI", system-ui, sans-serif;
  color: #20222a;
  background: #f4f5f7;
  --background: #f4f5f7;
  --surface: #fff;
  --surface-alt: #f8f8fa;
  --text: #20222a;
  --muted: #646a79;
  --line: #e2e4ea;
  --line-strong: #d6d9e1;
  --red: #ba1626;
  --red-hover: #a11221;
  --red-text: #aa1424;
  --focus: #c52b3d;
  --shadow: 0 1px 2px #20222a08;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  color: #f3f2f4;
  background: #14151a;
  --background: #14151a;
  --surface: #1d1f26;
  --surface-alt: #24262f;
  --text: #f3f2f4;
  --muted: #aeb3c1;
  --line: #323540;
  --line-strong: #494d5a;
  --red: #bb1c2c;
  --red-hover: #d02537;
  --red-text: #ff8792;
  --focus: #ff7d8a;
  --shadow: 0 1px 2px #0002;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
h1, h2, h3, p { margin: 0; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.boot { padding: 32px; }

.brand { display: flex; align-items: center; gap: 10px; color: #fff; white-space: nowrap; }
.brand img { width: 36px; height: 36px; display: block; border: 1px solid #45454d; border-radius: 9px; }
.brand strong { display: block; font-size: 1.04rem; line-height: 1; letter-spacing: .055em; }
.brand strong span { color: #ff4957; margin: 0 2px; }
.brand small { display: block; margin-top: 5px; font-size: .62rem; font-weight: 600; letter-spacing: .11em; color: #c2c2cd; }

.auth { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 100svh; }
.auth-brand {
  display: grid; grid-template-rows: auto 1fr auto; gap: 24px; position: relative; overflow: hidden;
  background: radial-gradient(ellipse at 45% 30%, #26272c 0%, #19191e 44%, #101115 85%); color: #c7c7cf;
  padding: clamp(28px, 4.7vw, 78px); isolation: isolate;
}
.auth-brand::after { content: ""; position: absolute; z-index: -1; width: 100%; height: 180px; left: -27%; bottom: -140px;
  border-top: 1px solid #ca24354d; border-radius: 50%; transform: rotate(-12deg); box-shadow: 0 -12px 40px #f0202022; }
.auth-brand > p { font-size: .88rem; }
.auth-art { align-self: center; justify-self: center; width: 100%; max-width: 660px; }
.auth-art img { display: block; width: 100%; border-radius: 15px; box-shadow: 0 22px 55px #0009; border: 1px solid #6b6a712e; }
.auth-main { display: grid; position: relative; min-width: 0; place-items: center; padding: 56px 36px 82px; background: var(--surface); }
.auth-mobile-brand { display: none; }
.auth-box { width: min(100%, 390px); }
.auth-lock { display: grid; place-items: center; width: 50px; height: 50px; margin-bottom: 21px; border-radius: 14px; color: var(--red-text); background: #c7192720; }
.auth-box h1 { font-size: clamp(1.9rem, 3.2vw, 2.5rem); line-height: 1.15; letter-spacing: -.04em; }
.subtext { color: var(--muted); line-height: 1.5; margin: 9px 0 29px; }
.stack { display: grid; gap: 16px; }
.auth-box .primary { margin-top: 3px; min-height: 47px; }
.auth-help { color: var(--muted); text-align: center; line-height: 1.5; margin-top: 23px; font-size: .86rem; }
.auth-footer { position: absolute; bottom: 28px; color: var(--muted); text-align: center; font-size: .79rem; }
.auth-footer span { padding: 0 4px; color: var(--red-text); }
.text-button { padding: 5px 0; border: 0; color: var(--red-text); font-weight: 600; background: none; margin-top: 15px; }

.field { color: var(--text); display: grid; gap: 7px; align-content: start; font-size: .88rem; font-weight: 600; min-width: 0; }
input:not([type="checkbox"]), textarea, select { border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text);
  background: var(--surface); padding: 9px 11px; width: 100%; min-width: 0; min-height: 42px; font-size: 1rem; font-weight: 400; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:read-only:not([type="checkbox"]), input:disabled { background: var(--surface-alt); color: var(--muted); }
input:focus, textarea:focus, select:focus { border-color: var(--focus); }
select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%237b8190' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
textarea { resize: vertical; }
input[type="checkbox"] { accent-color: var(--red); width: 18px; height: 18px; margin: 0; }
.input-icon { border: 1px solid var(--line-strong); border-radius: 8px; min-width: 0; display: flex; align-items: center; padding-left: 12px;
  gap: 2px; background: var(--surface); color: var(--muted); }
.input-icon:focus-within { border-color: var(--focus); box-shadow: 0 0 0 2px #c52b3d24; }
.input-icon input { border: 0; outline: none; background: transparent; flex: 1; }
.input-icon .icon-button { margin-right: 3px; }
.check { display: flex; align-items: center; gap: 9px; font-size: .9rem; }
.required-mark { color: var(--red-text); }
.hint { color: var(--muted); font-size: .86rem; line-height: 1.5; }
.form-error { padding: 9px 12px; border-radius: 7px; border: 1px solid #b8192b43; color: var(--red-text); background: #c7192712; font-size: .9rem; }
.button, .icon-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  border: 1px solid transparent; border-radius: 8px; font-size: .88rem; font-weight: 650; line-height: 1.25; }
.button { min-height: 42px; padding: 9px 14px; white-space: nowrap; }
.button.small { min-height: 36px; padding: 7px 11px; }
.primary { color: #fff; background: var(--red); border-color: var(--red); box-shadow: 0 2px 5px #a4142425; }
.primary:hover { background: var(--red-hover); border-color: var(--red-hover); }
.secondary { color: var(--text); background: var(--surface); border-color: var(--line-strong); }
.secondary:hover, .icon-button:hover { background: var(--surface-alt); }
.danger-outline { color: var(--red-text); background: var(--surface); border-color: #be203668; }
.danger-outline:hover { background: #c7192716; }
.icon-button { width: 36px; height: 36px; padding: 0; color: var(--muted); background: transparent; flex: none; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.app-shell { min-height: 100svh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { background: #17181e; position: sticky; top: 0; height: 100svh; min-height: 0; display: flex; flex-direction: column; color: #dddde5; }
.side-brand { display: block; padding: 23px 17px; border-bottom: 1px solid #ffffff13; }
.sidebar nav { display: grid; gap: 5px; padding: 18px 12px; align-content: start; overflow-y: auto; }
.sidebar nav a { display: flex; gap: 12px; align-items: center; min-height: 43px; padding: 9px 11px; border-radius: 8px;
  color: #c4c6d1; border: 1px solid transparent; font-size: .92rem; font-weight: 550; }
.sidebar nav a:hover { background: #ffffff0b; color: #fff; }
.sidebar nav a.active { background: #af172c35; border-color: #f04a5d35; color: #fff0f1; }
.sidebar nav a.active svg { color: #ff7c87; }
.side-account { display: flex; min-height: 69px; margin-top: auto; align-items: center; gap: 9px; padding: 11px 10px 11px 13px; border-top: 1px solid #ffffff13; }
.side-account > div { flex: 1; min-width: 0; }
.side-account strong, .side-account small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-account strong { font-size: .82rem; color: #f0f0f3; }
.side-account small { margin-top: 2px; font-size: .76rem; color: #b5b7c4; }
.side-account .icon-button { color: #c0c2cf; width: 31px; }
.side-account .icon-button:hover { background: #ffffff12; }
.avatar { color: #ffd8dc; background: #6d222e; border: 1px solid #863a46; width: 34px; height: 34px; border-radius: 50%;
  flex: 0 0 34px; display: grid; place-items: center; font-weight: 750; font-size: .78rem; }
.workspace { min-width: 0; }
.topbar { height: 65px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px;
  padding: 0 clamp(16px, 2.6vw, 42px); }
.breadcrumb { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .875rem; }
.breadcrumb strong { color: var(--text); }
.separator { color: var(--muted); opacity: .65; }
.theme-button { margin-left: auto; border-color: var(--line); }
.mobile-menu, .scrim { display: none; }
.content { max-width: 1580px; margin: 0 auto; padding: 27px clamp(16px, 2.6vw, 42px) 44px; min-width: 0; }
.content:focus { outline: none; }
.page-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 13px; margin-bottom: 22px; }
.page-heading h1 { font-size: clamp(1.65rem, 3vw, 2rem); font-weight: 750; line-height: 1.15; letter-spacing: -.035em; }
.page-heading p { margin-top: 5px; color: var(--muted); font-size: .95rem; }
.loading { color: var(--muted); }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.panel-heading { padding: 17px 19px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-heading h2, .section-title h2, .detail-panel h2, .dialog h2 { font-size: 1.14rem; letter-spacing: -.015em; }
.panel-heading p { color: var(--muted); margin-top: 4px; font-size: .87rem; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.metric { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 12px 14px;
  min-height: 66px; min-width: 0; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.metric:hover { border-color: #ba16267c; }
.metric strong { font-size: 1.5rem; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric-label { font-size: .9rem; font-weight: 610; line-height: 1.3; }
.metric-total { border-color: #3d343e; color: #fff; background: linear-gradient(100deg, #27252e, #362329); }
.metric-total .metric-icon { color: #ffb7be; background: #b5344850; }
.metric-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; }
.tone-red { color: #a91529; background: #ffebee; }
.tone-slate { color: #485166; background: #eef0f4; }
.tone-green { color: #17644f; background: #e4f5ed; }
.tone-amber { color: #854c0e; background: #fff1db; }
[data-theme="dark"] .tone-red { color: #ffa5af; background: #552632; }
[data-theme="dark"] .tone-slate { color: #d0d5e3; background: #363b48; }
[data-theme="dark"] .tone-green { color: #9bdfc7; background: #24423b; }
[data-theme="dark"] .tone-amber { color: #ffcc91; background: #503b29; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 11px; }
.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: start; }
.chart-card { padding: 16px; min-width: 0; align-self: stretch; }
.chart-card header { display: flex; min-height: 22px; gap: 8px; align-items: start; justify-content: space-between; flex-wrap: wrap; }
.chart-card header h3 { font-size: 1rem; font-weight: 700; }
.chart-card header p { color: var(--muted); margin-top: 3px; font-size: .78rem; }
.chart-group select { min-height: 31px; padding: 4px 25px 4px 7px; font-size: .8rem; }
.chart-body, .long-chart, .radial { margin-top: 8px; }
.long-chart { max-height: 243px; overflow: auto; }
.chart-card canvas { display: block; width: 100%; height: 170px; }
.long-chart canvas { height: var(--graph-height); }
.radial { display: grid; grid-template-columns: minmax(88px, 1fr) minmax(95px, 1fr); align-items: center; }
.chart-empty { min-height: 170px; display: grid; place-items: center; color: var(--muted); text-align: center; font-size: .86rem; }
.legend { padding: 0 0 0 4px; margin: 0; display: grid; max-height: 165px; overflow: auto; gap: 9px; list-style: none; }
.legend li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 5px; font-size: .79rem; }
.legend span { overflow-wrap: anywhere; }
.legend i { width: 8px; height: 8px; border-radius: 50%; background: var(--swatch); }
.legend b { font-variant-numeric: tabular-nums; }
.chart-data { color: var(--muted); font-size: .79rem; }
.chart-data summary { cursor: pointer; }
.chart-data dl { display: grid; gap: 6px; max-height: 150px; padding-right: 9px; overflow-y: auto; margin-bottom: 0; }
.chart-data dl div { display: flex; justify-content: space-between; gap: 7px; }
.chart-data dd { margin: 0; color: var(--text); }

.filter-panel { padding: 14px; margin-bottom: 16px; }
.filter-main { display: flex; align-items: center; gap: 7px; }
.search { flex: 1; }
.filter-extra { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.filter-extra .actions { justify-content: flex-end; margin-top: 13px; }
.filter-panel .form-error { margin-top: 10px; }
.scroll-table { width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; text-align: left; }
th, td { padding: 10px 13px; border-bottom: 1px solid var(--line); }
thead th { font-size: .84rem; color: var(--muted); background: var(--surface-alt); font-weight: 700; white-space: nowrap; }
thead th a { display: flex; align-items: center; gap: 5px; }
thead th a span { color: var(--muted); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-alt); }
.inventory-table td { white-space: nowrap; }
.inventory-table .battery-state-cell { white-space: normal; min-width: 150px; max-width: 240px; overflow-wrap: anywhere; }
.inventory-table td:nth-child(4), .inventory-table td:nth-child(8) { white-space: normal; min-width: 115px; }
.record-link { color: var(--red-text); font-weight: 700; }
.record-link:hover { text-decoration: underline; }
.records { overflow: hidden; }
.records > .scroll-table:first-child { border-radius: 12px; }
.row-actions { display: flex; }
.row-actions .icon-button { width: 30px; height: 32px; }
.pagination { border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; gap: 9px; color: var(--muted); font-size: .86rem; }
.pill { display: inline-block; font-size: .79rem; font-weight: 650; border-radius: 20px; padding: 4px 9px; white-space: nowrap; }
.empty-state { text-align: center; padding: 36px 16px; }
.empty-state > svg { color: var(--muted); margin-bottom: 7px; }
.empty-state h3 { font-size: 1.02rem; }
.empty-state p { color: var(--muted); margin: 5px 0 12px; font-size: .9rem; }
.first-access { color: var(--muted); display: inline-block; margin-left: 5px; font-size: .8rem; }

.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.wide { grid-column: 1 / -1; }
.equipment-form { display: grid; gap: 12px; }
.form-panel { min-width: 0; margin: 0; padding: 11px 17px 17px; }
.form-panel legend { font-size: 1rem; font-weight: 750; padding: 0 6px; }
.incident-fields h3 { font-size: .97rem; }
.incident-fields { display: grid; gap: 12px; justify-items: start; }
.incident-fields [data-incident-list] { display: grid; gap: 12px; width: 100%; }
.incident-entry { min-width: 0; margin: 0; padding: 10px 14px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-alt); }
.incident-entry > .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.incident-entry > .actions { justify-content: flex-end; margin-top: 8px; }
.model-photo { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; border: 1px solid var(--line); border-radius: 9px; padding: 12px; background: var(--surface-alt); }
.model-photo img { width: min(212px, 100%); height: 124px; object-fit: contain; border-radius: 6px; background: #fff; }
.model-photo strong { display: block; font-size: .9rem; }
.model-photo p { margin-top: 4px; overflow-wrap: anywhere; }
.model-photo a { display: inline-block; margin-top: 4px; color: var(--red-text); font-size: .85rem; font-weight: 650; }
.model-photo a:hover { text-decoration: underline; }
.dossier-photo .model-photo { margin-bottom: 14px; }
.form-footer { position: sticky; bottom: 0; z-index: 1; background: var(--background); display: grid; gap: 7px; padding: 10px 0; }
.form-footer .actions, .delete-footer { justify-content: flex-end; }
.delete-footer { margin-top: 17px; }
.record-badges { display: flex; gap: 6px; margin: -9px 0 14px; }
.custody-card { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 14px; padding: 16px 18px; border-left: 3px solid var(--red); }
.custody-card h2 { margin-bottom: 4px; font-size: .85rem; color: var(--muted); }
.custody-card strong { font-size: 1.13rem; overflow-wrap: anywhere; }
.custody-card p { color: var(--muted); margin-top: 4px; font-size: .9rem; overflow-wrap: anywhere; }
.dossier-nav { display: flex; flex-wrap: wrap; gap: 16px; margin: 13px 0 15px; border-bottom: 1px solid var(--line); }
.dossier-nav a { color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 10px 2px; font-weight: 650; }
.dossier-nav a[aria-current] { color: var(--red-text); border-bottom-color: var(--red); }
.movement-fields, .history-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list > li + li { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.history-list h3, .history-list summary { color: var(--text); font-size: .95rem; font-weight: 700; overflow-wrap: anywhere; }
.history-list summary { cursor: pointer; }
.history-list .hint { margin-top: 3px; }
.history-list dl { margin-top: 9px; }
.history-list td { max-width: 320px; white-space: pre-wrap; overflow-wrap: anywhere; }
.history-list .scroll-table { margin-top: 8px; }
.import-picker { max-width: 660px; }
.import-result { margin-top: 16px; }
.import-counts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 18px 12px; }
.import-counts > div { display: grid; gap: 4px; padding: 9px; border-radius: 8px; }
.import-counts strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.import-counts span { font-size: .83rem; font-weight: 650; overflow-wrap: anywhere; }
.import-filter { padding: 0 18px 12px; }
.import-filter label { width: min(100%, 225px); }
.import-table { max-height: 52vh; }
.import-table thead { position: sticky; top: 0; }
.import-table td { min-width: 92px; vertical-align: top; overflow-wrap: anywhere; }
.import-table td:nth-child(n+3) { min-width: 155px; }
.import-table td p + p { margin-top: 4px; }
.import-mobile-label { display: none; }
.import-line-label { display: none; }
.import-confirm { border-top: 1px solid var(--line); padding: 14px 18px; }
.import-confirm .actions { justify-content: flex-end; }
.import-created { margin-top: 10px; max-height: 48vh; overflow-y: auto; }
.import-origin { margin: -4px 0 12px; overflow-wrap: anywhere; }
.signed-terms { margin-top: 13px; padding: 10px 12px; background: var(--surface-alt); border-radius: 8px; }
.signed-terms h4 { margin: 0 0 5px; font-size: .88rem; }
.signed-terms ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.signed-terms .actions { margin-top: 8px; }
.signed-term-link { display: inline-flex; align-items: flex-start; gap: 6px; color: var(--red-text); font-weight: 650; font-size: .88rem; }
.signed-term-link span, .signed-terms .hint { overflow-wrap: anywhere; }
.history-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.incident-version { margin-top: 9px; padding-left: 10px; border-left: 2px solid var(--line-strong); }
.incident-version p { margin-top: 3px; font-size: .9rem; }
.audit-link { margin-top: 12px; }
.detail-grid, .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.detail-panel { padding: 15px 17px; }
.detail-panel h2 { margin-bottom: 12px; }
.detail-panel dl, .audit-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; }
dt { color: var(--muted); font-size: .82rem; line-height: 1.35; }
.detail-panel dd, .audit-meta dd { margin: 3px 0 0; font-size: .93rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.settings-theme { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.settings-theme h3 { font-size: 1rem; margin-bottom: 8px; }
.dialog { width: min(100% - 26px, 650px); max-height: 88svh; overflow: auto; color: var(--text); padding: 20px; }
.dialog::backdrop { background: #0d0e14a1; }
.dialog header { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-bottom: 12px; }
.dialog .actions { justify-content: flex-end; }
.dialog > p, .dialog .scroll-table { margin-top: 12px; }
.dialog td { overflow-wrap: anywhere; white-space: pre-wrap; }
.toast { position: fixed; z-index: 10; right: 18px; bottom: 18px; max-width: min(90vw, 410px);
  padding: 12px 16px; border-radius: 9px; background: #26232c; color: #fff; border-left: 4px solid #f45766; box-shadow: 0 4px 18px #0003; }

@media (max-width: 1150px) {
  .charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 5; left: 0; bottom: 0; width: min(245px, 83vw); transform: translateX(-100%); visibility: hidden; }
  .menu-open .sidebar { transform: none; visibility: visible; }
  .mobile-menu { display: inline-flex; }
  .menu-open .scrim { display: block; position: fixed; z-index: 4; inset: 0; border: 0; background: #1516208a; }
  .topbar { height: 58px; }
}
@media (max-width: 740px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-main { padding: 33px 22px 66px; grid-template-rows: auto 1fr; min-height: 100svh; gap: 27px; }
  .auth-mobile-brand { display: block; justify-self: start; }
  .auth-mobile-brand .brand { color: var(--text); }
  .auth-mobile-brand .brand small { color: var(--muted); }
  .auth-box { margin: auto 0; }
  .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 590px) {
  .incident-entry > .field-grid { grid-template-columns: minmax(0, 1fr); }
  .import-table thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .import-table tbody { display: block; }
  .import-table tr { display: grid; grid-template-columns: 1fr auto; gap: 6px; border-top: 1px solid var(--line); padding: 11px 15px; }
  .import-table td { min-width: 0; padding: 0; border: 0; }
  .import-table td:nth-child(n+3) { min-width: 0; grid-column: 1 / -1; }
  .import-table td:empty { display: none; }
  .import-mobile-label { display: block; color: var(--muted); font-size: .875rem; }
  .import-line-label { display: inline; }
  .content { padding-top: 20px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .metric { padding: 8px; gap: 6px; min-height: 58px; }
  .metric strong { font-size: 1.27rem; }
  .metric-label { font-size: .79rem; }
  .metric-icon { width: 29px; height: 29px; }
  .metric-icon svg { width: 16px; height: 16px; }
  .metric-total { grid-column: 1 / -1; }
  .charts, .detail-grid, .settings-grid, .history-grid, .movement-fields { grid-template-columns: minmax(0, 1fr); }
  .filter-main { flex-wrap: wrap; }
  .filter-main .search { flex: 1 0 100%; }
  .inventory-table td:nth-child(4), .inventory-table td:nth-child(8) { white-space: nowrap; }
}
@media (max-width: 360px) {
  .field-grid { grid-template-columns: minmax(0, 1fr); }
  .breadcrumb > span { display: none; }
}
@media print {
  :root, :root[data-theme="dark"] { color-scheme: light; color: #000; background: #fff; --surface: #fff; --text: #000; --muted: #555; --line: #ccc; }
  .app-shell, .detail-grid, .history-grid { display: block; }
  .sidebar, .topbar, .actions, .toast, .dossier-nav { display: none !important; }
  .custody-card { margin-bottom: 8px; }
  .content { margin: 0; padding: 0; max-width: none; }
  .detail-panel { break-inside: avoid; margin: 0 0 8px; box-shadow: none; }
  .record-badges { color: #000; }
}
