:root {
  color-scheme: light;
  --background: #f3f5f9;
  --surface: #ffffff;
  --sidebar: #14243b;
  --sidebar-text: #c5d2e4;
  --text: #23344b;
  --muted: #64748b;
  --border: #e0e6ef;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --focus: #f59e0b;
  --danger: #a61b1b;
  --radius: 8px;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 14px;
}

.visually-hidden {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body { background: var(--background); color: var(--text); line-height: 1.6; }

a { color: var(--accent-dark); text-underline-offset: 3px; }

button, input, select, textarea { font: inherit; }

button, input, select, textarea, a { border-radius: 5px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip-link {
  background: var(--surface);
  left: 1rem;
  padding: 0.6rem 0.9rem;
  position: fixed;
  top: -5rem;
  z-index: 100;
}

.skip-link:focus { top: 1rem; }

.app-shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }

.sidebar { background: var(--sidebar); color: var(--sidebar-text); padding: 22px 12px 14px; height: 100vh; overflow-y: auto; position: sticky; top: 0; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: #40536d transparent; }

.brand { align-items: center; display: flex; gap: 11px; margin: 0 10px 22px; }

.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px; background: #2d69e8; color: #fff; font-size: 12px; font-weight: 750; letter-spacing: 0.4px; }
.brand-copy { display: grid; gap: 1px; min-width: 0; }
.brand-copy strong { color: #fff; font-size: 15px; font-weight: 650; white-space: nowrap; }
.brand-copy small { color: #94a8c2; font-size: 10px; letter-spacing: 1px; }

.navigation-panel summary { display: none; }

.navigation-panel nav { display: grid; gap: 4px; }
.nav-group { display: grid; gap: 3px; }
.nav-group-title { color: #94a8c2; font-size: 11px; font-weight: 500; letter-spacing: 1px; margin: 12px 12px 4px; }
.nav-icon { height: 17px; width: 17px; flex-shrink: 0; opacity: 0.9; }
.sidebar-footer { display: flex; gap: 8px; margin: auto 10px 0; padding-top: 22px; color: #92a6c1; font-size: 11px; }
.sidebar-footer small { color: inherit; }

.navigation-panel nav a {
  color: var(--sidebar-text);
  padding: 8px 12px;
  text-decoration: none;
  align-items: center; display: flex; gap: 11px; min-height: 36px; font-size: 13px;
  border: 1px solid transparent; transition: background-color 120ms ease;
}

.navigation-panel nav a:hover { background: #203550; color: #fff; }

.navigation-panel nav a[aria-current="page"] {
  background: #244779;
  border-color: #355a90;
  color: #fff;
  font-weight: 600;
}

.workspace { min-width: 0; }

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  min-height: 76px;
  padding: 13px 28px;
  gap: 16px;
}

.topbar h1 { font-size: 19px; font-weight: 650; margin: 0; }
.breadcrumb { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; margin: 0 0 3px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.runtime-notice { background: #eaf1fb; border-bottom: 1px solid #dae5f5; color: #486382; margin: 0; padding: 6px 28px; font-size: 11px; }

.account { align-items: center; display: flex; gap: 14px; font-size: 12px; }

.account > span { display: grid; text-align: right; }

.account small { color: var(--muted); font-size: 11px; }
.account strong { font-weight: 600; }
.account form { margin: 0; }

.text-button { background: transparent; border: 1px solid var(--border); cursor: pointer; padding: 0.35rem 0.65rem; }

#main-content { padding: 22px 28px 32px; }
h1, h2, h3 { color: #192b43; line-height: 1.4; }
h2 { font-size: 20px; margin: 0 0 14px; letter-spacing: -0.3px; }
h3 { font-size: 15px; margin: 22px 0 12px; }
p { margin: 10px 0; }
small, .muted, .page-description { color: var(--muted); }
code { background: #eef2f7; border-radius: 4px; padding: 2px 5px; font-size: 0.92em; overflow-wrap: anywhere; }
#main-content > section > p { color: var(--muted); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-heading h2 { margin-bottom: 4px; }
.page-description { font-size: 12px; margin: 0; }

.empty-state { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }

.empty-state h2 { margin-top: 0; }

.empty-state p { color: var(--muted); margin-bottom: 0; }

.filter-bar {
  align-items: end;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  margin: 14px 0;
  border-radius: var(--radius);
}

.filter-bar label, .form-field { display: grid; gap: 5px; }
.filter-bar label { flex: 0 1 170px; min-width: 110px; color: #53657c; }
.filter-bar input, .filter-bar select { width: 100%; }
.filter-bar label:has(input[type="date"]) { flex-basis: 160px; }
.filter-bar label:has(input[type="checkbox"]) { display: flex; align-items: center; align-self: center; }
label { font-size: 12px; }

input, select, textarea { background: var(--surface); border: 1px solid #cbd5e1; color: var(--text); min-height: 34px; padding: 6px 10px; min-width: 0; max-width: 100%; }
input:hover, select:hover, textarea:hover { border-color: #94a3b8; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: #8290a3; }
input[type="checkbox"], input[type="radio"] { min-height: auto; accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
input:disabled, select:disabled, button:disabled { cursor: not-allowed; opacity: 0.6; }

button:not(.column-resizer), .primary-button, .secondary-button {
  border: 1px solid #cbd5e1;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px;
  padding: 6px 13px;
  text-decoration: none;
  font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1.6;
  background: var(--surface); color: var(--text);
}

button.primary-button, .primary-button { background: var(--accent); border-color: var(--accent); color: white; }

button:not(.column-resizer):hover, .secondary-button:hover { background: #f1f5f9; border-color: #94a3b8; }
button.primary-button:hover, .primary-button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

[data-recalculation-button][aria-busy="true"]::before {
  animation: recalculation-spin 0.8s linear infinite;
  border: 2px solid rgb(255 255 255 / 45%);
  border-radius: 50%;
  border-top-color: white;
  content: "";
  display: inline-block;
  height: 0.8rem;
  margin-right: 0.45rem;
  vertical-align: -0.08rem;
  width: 0.8rem;
}

.recalculation-status { color: var(--muted); min-height: 1.5rem; }

.recalculation-status[data-state="error"] { color: var(--danger); }

@keyframes recalculation-spin { to { transform: rotate(360deg); } }

.secondary-button { background: var(--surface); color: var(--accent-dark); }

.wide-table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.column-settings { border-bottom: 1px solid var(--border); }
.column-settings > summary { cursor: pointer; padding: 10px 16px; color: #53657c; font-size: 12px; list-style-position: inside; user-select: none; }
.column-settings > summary:hover { background: #f8fafc; }

.column-controls { border: 0; display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 0; padding: 4px 16px 14px; }

.column-controls legend { font-size: 12px; color: var(--muted); margin-bottom: 8px; }

.column-controls label { align-items: center; display: inline-flex; gap: 6px; }

.column-controls input { min-height: auto; }

.wide-table-scroll { max-height: min(60vh, 48rem); max-width: 100%; overflow: auto; position: relative; border-radius: 0 0 var(--radius) var(--radius); scrollbar-width: thin; scrollbar-color: #b5c2d3 #f5f7fa; }

.wide-table-scroll:focus-visible { outline-offset: -3px; }

.wide-table table { border-collapse: separate; border-spacing: 0; min-width: 100%; white-space: normal; font-size: 12px; }
.wide-table th, .wide-table td { white-space: pre-line; overflow-wrap: anywhere; word-break: normal; vertical-align: top; min-width: 100px; max-width: 360px; }
.wide-table th > a, .wide-table td > a, .wide-table .status-badge { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.permission-panel { border: 1px solid #dce5f1; border-radius: 8px; padding: 18px; margin: 20px 0; max-width: 900px; }
.permission-matrix { width: 100%; border-collapse: collapse; }
.permission-matrix th, .permission-matrix td { padding: 10px 16px; border-bottom: 1px solid #e8edf4; text-align: left; }
.permission-matrix input { min-height: auto; width: 18px; height: 18px; }
.permission-actions { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.multi-search-help { display: block; flex: 0 0 100%; grid-column: 1 / -1; color: #64748b; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.account-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.account-heading h2 { margin-bottom: 6px; }
.account-note, .account-subtext { color: #64748b; font-size: 12px; font-weight: normal; }
.account-subtext { display: block; margin: 5px 0; }
.account-table td, .account-table th { padding: 16px; vertical-align: middle; overflow-wrap: anywhere; }
.account-table { background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.account-table table { width: 100%; border-collapse: collapse; text-align: left; }
.account-table caption { text-align: left; padding: 14px 16px; color: #64748b; }
.account-table thead { background: #f4f7fb; }
.account-table tbody tr + tr { border-top: 1px solid #edf1f6; }
.account-table tbody tr:hover { background: #fafcff; }
.account-role-form, .account-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.account-role-form select { width: 130px; }
.account-actions form { margin: 0; }
.account-status { display: inline-block; padding: 5px 10px; border-radius: 20px; color: #64748b; background: #eef2f6; white-space: nowrap; }
.account-status.is-active { color: #047857; background: #ecfdf5; }
.account-disable { color: #b42318; }
.account-secondary { margin-top: 18px; border: 1px solid var(--border); border-radius: 10px; background: white; padding: 16px; }
.account-secondary summary { cursor: pointer; color: #53657c; }
.account-password-panel { max-width: 640px; margin: 20px auto; }
.account-password-panel input { display: block; width: 100%; margin-top: 8px; }
.filter-bar input[data-multi-search] { min-width: 0; width: 100%; }
.account-form-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; max-width: 900px; }
.account-form-fields label { display: block; margin-bottom: 6px; font-weight: 600; }
.account-form-fields input, .account-form-fields select { width: 100%; max-width: 100%; }
.account-form-fields details { margin-top: 6px; color: #64748b; font-size: 12px; }
@media (max-width: 760px) { .account-form-fields { grid-template-columns: 1fr; } }

.wide-table caption { color: #334760; font-weight: 600; padding: 10px 16px; text-align: left; font-size: 13px; }

.wide-table th, .wide-table td { background: var(--surface); border-right: 1px solid #edf0f5; border-top: 1px solid #e8edf4; padding: 10px 13px; text-align: left; height: 41px; }
.wide-table th { font-weight: 600; }
.wide-table tbody tr:nth-child(even) > * { background: #fafbfd; }
.wide-table tbody tr:hover > * { background: #edf4ff; }
.wide-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }

[data-table-id="order-kitting-details-v1"] td[data-column-key="detail_15"],
[data-table-id="order-kitting-details-v1"] td[data-column-key="detail_16"],
[data-table-id="order-kitting-details-v1"] td[data-column-key="detail_20"] {
  white-space: pre-line;
  min-width: 280px;
  max-width: 420px;
  overflow-wrap: anywhere;
}

.wide-table thead th { position: relative; }

.wide-table thead th > a[data-sort-column] { color: inherit; padding-right: 9px; text-decoration: none; }
.wide-table thead th > a[data-sort-column]:hover { color: var(--accent-dark); text-decoration: underline; }

.column-resizer {
  background: transparent;
  border: 0;
  border-radius: 0;
  bottom: 0;
  cursor: col-resize;
  padding: 0;
  position: absolute;
  right: -0.35rem;
  top: 0;
  width: 0.7rem;
  z-index: 5;
}

.column-resizer::after { background: var(--border); bottom: 0; content: ""; position: absolute; right: 0.3rem; top: 0; width: 1px; }

.column-resizer:focus-visible::after { background: var(--focus); width: 3px; }

.wide-table thead th { background: #f1f5fa; color: #52647d; position: sticky; top: 0; z-index: 2; height: 40px; }

.wide-table .sticky-key-column { left: var(--sticky-left, 0); position: sticky; z-index: 1; }

.wide-table thead .sticky-key-column { background: #eaf0f8; z-index: 3; }

.wide-table tbody th.sticky-key-column { font-weight: 600; color: #314c72; }

[data-column-key][hidden] { display: none; }

.no-results { color: var(--muted); height: 140px !important; padding: 32px !important; text-align: center !important; }

.pagination { align-items: center; display: flex; gap: 12px; justify-content: space-between; padding: 14px 0; font-size: 12px; }

.pagination-controls { align-items: center; display: flex; gap: 6px; }

.pagination-summary { color: var(--muted); }

.kpi-cards, .metric-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); padding: 0; margin: 16px 0 20px; }

.kpi-cards > div, .metric-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 17px 20px; min-width: 0; }

.kpi-cards dt, .metric-card dt { color: var(--muted); font-size: 12px; }

.kpi-cards dd, .metric-card dd { font-size: 25px; font-weight: 650; line-height: 1.4; letter-spacing: -0.6px; margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.metric-card dd:has(.status-badge) { font-size: 14px; letter-spacing: 0; }
.metric-card small { display: block; margin-top: 5px; font-size: 11px; }

.dashboard-warning { background: #fff8eb; border: 1px solid #f0dfb8; color: #805918; border-radius: 6px; padding: 11px 14px; font-size: 12px; }

.dashboard-grid, .integration-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr)); margin-top: 18px; }

.panel, .dashboard-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; min-width: 0; }

.dashboard-panel h3 { margin-top: 0; }

.dashboard-table-scroll { overflow-x: auto; }

.dashboard-panel table { border-collapse: collapse; min-width: 42rem; width: 100%; font-size: 12px; }

.dashboard-panel caption { color: var(--muted); padding: 0 0 0.65rem; text-align: left; }

.dashboard-panel th, .dashboard-panel td { border-top: 1px solid var(--border); padding: 0.65rem; text-align: left; }

.amount-bar { background: #e7edf2; display: block; min-width: 7rem; position: relative; }

.amount-bar::before { background: #d0dffc; content: ""; inset: 0 auto 0 0; position: absolute; width: var(--bar-share); }

.amount-bar span { display: block; padding: 0.2rem 0.35rem; position: relative; }

.pagination-controls > a, .pagination-controls > span { border: 1px solid var(--border); border-radius: 5px; padding: 5px 10px; text-decoration: none; background: var(--surface); }
.pagination-controls > a:hover { border-color: var(--accent); }
.pagination-controls > [aria-current="page"] { background: #eaf1ff; border-color: #d6e4fd; color: var(--accent-dark); }

.pagination [aria-disabled="true"] { color: #8290a3; background: #f7f9fc; }

@media (max-width: 42rem) {
  .pagination { align-items: flex-start; flex-direction: column; }
}

.login-page { align-items: center; display: flex; justify-content: center; min-height: 100vh; padding: 1rem; }

.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; max-width: 390px; padding: 32px; width: 100%; box-shadow: 0 12px 40px #14243b0d; }

.login-card h1 { font-size: 1.5rem; margin: 0.2rem 0; }

.login-card header > p:last-child { color: var(--muted); }

.login-card form { display: grid; gap: 1rem; margin-top: 1.5rem; }

.eyebrow { color: var(--accent-dark); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; margin: 0; }

.form-error { background: #fff0f0; border-left: 4px solid var(--danger); color: var(--danger); padding: 0.7rem; }

/* Shared ERP panels, compact toolbars and progressive-disclosure forms. */
.section-tabs, #main-content nav[aria-label$="预设"] { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 0 0 12px; margin: 0 0 20px; border: 0; border-bottom: 1px solid var(--border); background: transparent; }
.section-tabs a, #main-content nav[aria-label$="预设"] a { display: inline-flex; padding: 7px 14px; color: #53657c; text-decoration: none; font-size: 13px; }
.section-tabs a:hover, #main-content nav[aria-label$="预设"] a:hover { background: #e7edf6; color: var(--accent-dark); }
.section-tabs a[aria-current="page"] { background: #e5edfd; color: #1d4ed8; font-weight: 600; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.form-grid > label { display: grid; gap: 5px; color: #53657c; }
.form-grid .check-field, .check-field { display: flex; align-items: center; gap: 7px; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.settings-form p { display: flex; flex-direction: column; gap: 5px; margin: 0; }
.settings-form .helptext { color: var(--muted); font-size: 11px; }
.settings-form input[type="checkbox"] { align-self: start; }
.settings-form { margin-top: 18px; }
.settings-form .form-grid > div:not(.check-field) { display: grid; gap: 5px; align-content: start; }
.settings-form .form-grid input:not([type="checkbox"]), .form-grid select { width: 100%; }
#main-content form:not(.filter-bar):not([data-sync-form]):not([data-async-form]) > p:has(label) { display: grid; gap: 6px; max-width: 660px; }
#main-content form:not(.filter-bar) > p .helptext { font-size: 12px; color: var(--muted); }
.errorlist { color: var(--danger); font-size: 12px; padding-left: 20px; }
.panel > h3:first-child, .panel-heading h3 { margin-top: 0; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-heading h3 { margin: 0; }
.panel-heading h4 { margin: 0; font-size: 13px; }
.panel-heading > .muted { font-size: 12px; }
.panel + .panel { margin-top: 18px; }
.integration-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.integration-grid .metric-card { padding: 16px; }
.integration-grid .panel-heading { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.integration-grid p { font-size: 12px; }
.panel > dl, .panel > ul { margin-bottom: 0; }
.panel ul { padding-left: 20px; color: var(--muted); font-size: 12px; }
.panel li + li { margin-top: 7px; }
.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 500; line-height: 1.65; white-space: nowrap; }
.status-success { background: #e7f5ee; color: #176b45; }
.status-warning { background: #fff3dc; color: #8a5200; }
.status-danger { background: #fdebea; color: #b42318; }
.status-neutral { background: #edf1f6; color: #5c6d83; }
.status-info { background: #e8efff; color: #2954b1; }
.notice { border: 1px solid #dbe6f6; background: #edf4fd; color: #365579; border-radius: 6px; padding: 11px 14px; font-size: 12px; margin: 14px 0; }
.notice p { margin: 4px 0; }
.notice-warning { background: #fff8eb; border-color: #f0dfb8; color: #805918; }
.notice .secondary-button { margin-left: 12px; }
.help-details { margin: 12px 0; background: #f8fafc; border: 1px solid var(--border); border-radius: 6px; padding: 10px 14px; font-size: 12px; }
.help-details > summary { cursor: pointer; color: #526781; font-weight: 500; }
.help-details p { color: var(--muted); }
.credential-grid { display: grid; gap: 0 20px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 14px 0; }
.credential-grid > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #eef2f7; }
.credential-grid dt { color: var(--muted); font-size: 12px; }
.credential-grid dd { margin: 0; font-size: 12px; }
.sync-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0; }
.sync-actions form { margin: 0; }
.sync-section-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; min-width: 0; font-size: 12px; }
.sync-all-form { margin: 0; max-width: 420px; }
.dataset-sync-form { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 14px; }
.sync-help { font-size: 11px; line-height: 1.6; }
[data-sync-status] { white-space: normal; }
[data-sync-status][data-state="error"] { color: var(--danger); }
[data-sync-status][data-state="success"] { color: #176b45; }
button[aria-busy="true"]::before { animation: recalculation-spin 0.8s linear infinite; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; content: ""; display: inline-block; height: 12px; width: 12px; flex-shrink: 0; }
button:disabled { cursor: not-allowed; }
[data-form-status], [data-sync-status] { font-size: 12px; overflow-wrap: anywhere; }
[data-form-status]:empty, [data-sync-status]:empty { display: none; }
.edit-list { display: grid; gap: 8px; margin: 12px 0 22px; }
.edit-card { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.edit-summary { cursor: pointer; padding: 12px 16px; font-size: 12px; color: #3e526e; }
.edit-summary strong { font-weight: 600; }
.edit-summary .status-badge, .edit-summary .muted { margin-left: 10px; }
.edit-summary { overflow-wrap: anywhere; }
.edit-summary .status-badge { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.edit-card[open] > summary { border-bottom: 1px solid var(--border); background: #f8fafc; }
.edit-body { padding: 16px; }
.edit-body form { margin: 0; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 194px minmax(0, 1fr); }
  #main-content { padding: 20px; }
  .topbar, .runtime-notice { padding-left: 20px; padding-right: 20px; }
  .metric-grid { grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { padding: 14px; height: auto; position: static; overflow: visible; }
  .brand { margin: 0 4px 12px; }
  .brand-mark { width: 34px; height: 34px; }
  .sidebar-footer { display: none; }
  .navigation-panel summary { cursor: pointer; display: block; font-weight: 500; padding: 7px 9px; background: #203550; font-size: 12px; }
  .navigation-panel nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding-top: 8px; }
  .navigation-panel nav > a { align-self: start; }
  .nav-group-title { margin-top: 6px; }
  .topbar { align-items: flex-start; gap: 0.8rem; padding: 0.8rem 1rem; }
  .account { gap: 8px; font-size: 11px; }
  .account > span { max-width: 8rem; overflow-wrap: anywhere; }
  .runtime-notice { padding: 6px 16px; }
  #main-content { padding: 18px 14px; }
  .page-heading { align-items: flex-start; flex-wrap: wrap; }
  .filter-bar { gap: 12px; padding: 14px; }
  .filter-bar label { flex: 1 1 calc(50% - 12px); min-width: 120px; }
  .filter-bar label:has(input[type="date"]) { flex-basis: calc(50% - 12px); }
  .section-tabs { gap: 2px; }
  .section-tabs a { padding: 7px 9px; font-size: 12px; }
  .panel, .dashboard-panel { padding: 16px; }
  .panel-heading { flex-wrap: wrap; }
  .pagination-controls { flex-wrap: wrap; }
  .metric-grid, .kpi-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-cards > div, .metric-card { padding: 14px; }
  .edit-summary .muted { display: block; margin: 3px 0 0; }
  .notice .secondary-button { margin: 8px 0 0; }
}

@media (min-width: 761px) {
  /* Native details remains closed after a narrow-screen toggle; keep its trigger reachable. */
  .navigation-panel:not([open]) > summary { display: block; cursor: pointer; padding: 8px 12px; border-radius: 5px; background: #203550; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
