:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #252a2d;
  background: #fff;
  font-synthesis: none;
  --ink: #252a2d;
  --muted: #5d666c;
  --line: #dce1e4;
  --paper: #fff;
  --sidebar: #252a2d;
  --soft: #f7f8f8;
  --danger: #a6342f;
  --success: #25634c;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--ink); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
::selection { color: #fff; background: #343b3f; }
* { scrollbar-color: #bcc3c6 transparent; scrollbar-width: thin; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 1.8rem; line-height: 1.25; letter-spacing: -.025em; }
h2 { font-size: 1.17rem; line-height: 1.3; letter-spacing: -.015em; }
h3 { font-size: .98rem; line-height: 1.35; }
p { line-height: 1.6; }
.muted { color: var(--muted); }
.small { font-size: .81rem; }
.numeric { font-variant-numeric: tabular-nums; }
.record-id { color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

.app-shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; min-height: 0; padding: 24px 15px 18px; background: var(--sidebar); color: #fff; }
@media (min-width: 761px) {
  html { zoom: .9; }
  /* 缩放会让 100vh 变短；在基础规则之后覆盖，侧栏才会贴齐实际视口底部。 */
  .app-shell { min-height: 111.112vh; }
  .sidebar { height: 111.112vh; }
}
.brand, .login-brand { display: flex; align-items: center; gap: 11px; }
.brand { padding: 0 10px 30px; }
.brand img, .login-brand img { flex: none; object-fit: contain; }
.brand strong, .login-brand strong { display: block; font-size: 1.03rem; letter-spacing: -.02em; }
.brand span, .login-brand span { display: block; color: #c9ced1; font-size: .68rem; margin-top: 3px; }
.side-nav { display: grid; align-content: start; gap: 3px; }
.nav-section-label { padding: 0 13px 9px; color: #c9ced1; font-size: .69rem; font-weight: 750; letter-spacing: .06em; }
.nav-section-admin { border-top: 1px solid #4e575a; margin-top: 18px; padding-top: 18px; }
.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; border-radius: 4px; background: transparent; padding: 11px 13px; color: #d2d7d9; text-align: left; font-size: .88rem; font-weight: 650; transition: background .18s, color .18s; }
.nav-item:hover { background: #394145; color: #fff; }
.nav-item.active { color: var(--ink); background: #fff; }
.nav-item svg { flex: none; width: 18px; height: 18px; }
.sidebar-foot { display: grid; gap: 14px; margin-top: auto; padding: 12px 10px 0; border-top: 1px solid #4e575a; }
.sidebar-status { display: inline-flex; align-items: center; gap: 7px; color: #c9ced1; font-size: .72rem; }
.sidebar-status i { width: 8px; height: 8px; border-radius: 50%; background: #47b881; box-shadow: 0 0 0 0 rgba(71, 184, 129, .45); animation: connection-breathe 2s ease-out infinite; }
.switch-button { border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); padding: 8px 11px; font-size: .79rem; font-weight: 750; white-space: nowrap; }
.switch-button:hover { background: var(--soft); }
.sidebar .switch-button { background: transparent; color: #fff; border-color: #667074; text-align: left; }
.sidebar .switch-button:hover { background: #394145; }
.workspace { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; height: 64px; padding: 0 34px; border-bottom: 1px solid var(--line); background: #fff; }
.topbar-title { font-size: .85rem; font-weight: 800; }
.topbar-right { display: flex; align-items: center; gap: 13px; flex: none; color: var(--muted); font-size: .77rem; }
.topbar-right #today-label { white-space: nowrap; }
.form-content > .panel-top .text-button { flex: none; white-space: nowrap; }
.user-chip { border: 1px solid var(--line); border-radius: 4px; padding: 7px 10px; color: var(--ink); font-weight: 700; }
.text-button { border: 0; background: transparent; padding: 7px; color: var(--muted); font-size: .82rem; font-weight: 700; }
.text-button:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
#view { max-width: 1500px; margin: 0 auto; padding: 31px 34px 90px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { margin-bottom: 6px; }
.page-head p { margin: 0; color: var(--muted); font-size: .88rem; }
.head-actions { display: flex; align-items: center; gap: 9px; }

.portal-layout { grid-template-columns: minmax(0, 1fr); }
.portal-layout .sidebar, .portal-layout .mobile-nav { display: none; }
.portal-layout #view { width: 100%; max-width: 1240px; padding-top: 48px; }
.portal { border: 1px solid var(--line); border-radius: var(--radius); padding: 32px 34px 26px; background: #fff; }
.portal-header, .portal-brand { display: flex; align-items: center; }
.portal-header { justify-content: space-between; gap: 16px; }
.portal-brand { gap: 10px; }
.portal-brand img { object-fit: contain; }
.portal-brand strong { display: block; font-size: 1.07rem; }
.portal-brand span { display: block; margin-top: 2px; color: var(--muted); font-size: .65rem; letter-spacing: .07em; }
.portal-user { color: var(--muted); font-size: .77rem; }
.portal-intro { margin: 48px 0 29px; }
.portal-intro h1 { margin-bottom: 8px; font-size: 2rem; }
.portal-intro p { margin-bottom: 0; color: var(--muted); font-size: .88rem; }
.portal-doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.portal-door { position: relative; display: flex; flex-direction: column; min-height: 250px; border: 1px solid var(--line); border-top: 4px solid #30363a; border-radius: 0; padding: 23px 24px 20px; background: #fff; color: var(--ink); text-align: left; transition: background .18s, transform .18s; }
.portal-door:nth-child(2) { border-top-color: #a4abb0; }
.portal-door:hover { background: #f9fafb; transform: translateY(-2px); }
.portal-door > svg { position: absolute; top: 23px; right: 24px; }
.door-code { align-self: flex-start; border: 1px solid #a4abb0; border-radius: 3px; padding: 4px 8px; font-size: .7rem; font-weight: 800; letter-spacing: .06em; }
.portal-door > strong { margin-top: 32px; font-size: 1.55rem; letter-spacing: -.025em; }
.door-description { margin-top: 8px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.door-enter { display: inline-flex; align-items: center; gap: 5px; margin-top: auto; font-size: .81rem; font-weight: 800; }
.portal-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 22px; color: var(--muted); font-size: .75rem; }
.portal-admin-link, .back-link { display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; color: var(--ink); padding: 5px 0; font: inherit; font-size: .8rem; font-weight: 800; }
.portal-admin-link span, .back-link span { text-decoration: underline; text-decoration-color: var(--line); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: text-decoration-color .18s; }
.portal-admin-link svg { transition: transform .18s; }
.portal-admin-link:hover span, .back-link:hover span { text-decoration-color: var(--ink); }
.portal-admin-link:hover svg { transform: translateX(3px); }
.back-link { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.back-link:hover { color: var(--ink); }
.back-link svg { transition: transform .18s; }
.back-link:hover svg { transform: translateX(-3px); }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border: 1px solid transparent; border-radius: 5px; padding: 9px 16px; font-size: .85rem; font-weight: 800; white-space: nowrap; transition: background .18s, transform .18s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button.primary { background: var(--ink); color: #fff; }
.button.primary:hover { background: #3a4246; }
.button.secondary, .button.teal { border-color: var(--line); background: var(--soft); color: var(--ink); }
.button.ghost { border-color: var(--line); background: #fff; color: var(--ink); }
.button.full { width: 100%; }
.icon-button { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); }
.icon-button:hover { border-color: var(--ink); background: var(--soft); }
.icon-button:focus-visible, .portal-admin-link:focus-visible, .back-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; background: #fff; }
#view > .panel:not([hidden]) { margin-bottom: 18px; }
.panel h2 { margin-bottom: 16px; }
.panel-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 16px; }
.panel-top h2, .panel-top h3 { margin: 0; }
.panel-top p { margin: 4px 0 0; }
.link-button { display: inline-flex; align-items: center; gap: 4px; border: 0; background: transparent; color: var(--ink); padding: 5px 0; font-size: .8rem; font-weight: 800; white-space: nowrap; }
.link-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.movement-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 132px; }
.movement-action { min-height: 32px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); padding: 6px 9px; font-size: .75rem; font-weight: 800; line-height: 1; white-space: nowrap; }
.movement-action:hover { border-color: var(--ink); background: var(--soft); }
.movement-action:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.movement-action-return { background: var(--ink); border-color: var(--ink); color: #fff; }
.movement-action-return:hover { background: #3a4246; }

.stock-overview { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(285px, .8fr); gap: 18px; }
.stock-action-panel, .stock-pulse-panel { min-height: 268px; }
.action-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.action-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; min-height: 142px; border: 1px solid var(--line); border-radius: 4px; padding: 16px; background: #fff; color: var(--ink); text-align: left; font-size: .95rem; font-weight: 800; }
.action-tile:first-child { border-color: var(--ink); background: var(--ink); color: #fff; }
.action-tile:hover { background: var(--soft); }
.action-tile:first-child:hover { background: #3a4246; }
.action-tile svg:last-child { margin-top: auto; align-self: flex-end; }
.stock-pulse-panel h2 { margin-bottom: 19px; }
.pulse-stats { display: grid; gap: 3px; }
.pulse-stat { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; border-top: 1px solid var(--line); padding: 12px 0; background: #fff; color: var(--ink); text-align: left; }
.pulse-stat span { flex: 1; color: var(--muted); font-size: .82rem; }
.pulse-stat strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stock-pulse-foot { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 13px; }
.stock-pulse-foot p { margin-bottom: 4px; color: var(--muted); font-size: .77rem; }
.recent-panel { margin-top: 18px; }
.sales-panel { margin-top: 18px; border-color: #cfd5d7; background: var(--soft); }
.sales-panel .panel-top { margin-bottom: 19px; }
.analysis-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.analysis-summary > div { min-width: 0; padding: 15px 17px; border-left: 1px solid var(--line); }
.analysis-summary > div:first-child { border-left: 0; }
.analysis-summary span, .analysis-summary em { display: block; color: var(--muted); font-size: .73rem; font-style: normal; }
.analysis-summary strong { display: block; margin: 7px 0 4px; font-size: 1.52rem; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.analysis-summary strong small { margin-left: 3px; font-size: .76rem; letter-spacing: 0; }
.analysis-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 20px; }
.analysis-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 9px; }
.analysis-list-head h3 { margin: 0; font-size: .94rem; }
.analysis-list-head span { color: var(--muted); font-size: .71rem; }
.analysis-list { margin: 0; padding: 0; list-style: none; }
.analysis-list li { display: flex; align-items: center; gap: 10px; min-height: 54px; border-bottom: 1px solid var(--line); }
.analysis-list li:last-child { border-bottom: 0; }
.analysis-list li > div { flex: 1; min-width: 0; }
.analysis-list strong { display: block; overflow-wrap: anywhere; font-size: .81rem; }
.analysis-list small { display: block; margin-top: 2px; color: var(--muted); font-size: .69rem; font-weight: 500; }
.analysis-list b { min-width: 42px; text-align: right; font-size: .98rem; font-variant-numeric: tabular-nums; }
.analysis-list b small { display: inline; margin-left: 2px; }
.analysis-rank { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: .68rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.analysis-empty { color: var(--muted); font-size: .8rem; }
.channel-tabs { display: flex; gap: 8px; overflow: auto; padding-bottom: 10px; margin-bottom: 9px; }
.channel-tab { flex: none; border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; background: #fff; color: var(--muted); font-size: .78rem; font-weight: 750; white-space: nowrap; }
.channel-tab.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .8fr); gap: 18px; }
.dashboard-main, .dashboard-side { display: grid; align-content: start; gap: 18px; min-width: 0; }
.task-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.task { display: flex; align-items: center; gap: 10px; min-height: 90px; border: 1px solid var(--line); border-radius: 4px; padding: 13px; background: #fff; text-align: left; }
.task-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 4px; background: var(--ink); color: #fff; }
.task b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.task span { font-size: .78rem; font-weight: 750; }

.table-scroll { overflow: auto; }
.data-table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: .83rem; }
.data-table th { border-bottom: 1px solid var(--line); padding: 11px 12px; color: var(--muted); text-align: left; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.data-table td { border-bottom: 1px solid var(--line); padding: 14px 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fafafa; }
.data-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.tag { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; color: var(--ink); background: #fff; font-size: .71rem; font-weight: 750; white-space: nowrap; }
.tag.out { border-color: #e4c7c5; color: #8a3530; }
.tag.in { border-color: #bad4c9; color: #286049; }
.tag.warn { border-color: #e7d7bd; color: #826029; }
.tag.legacy { color: var(--muted); }
.danger-text { color: var(--danger); font-weight: 800; }
.success-text { color: var(--success); font-weight: 800; }
.empty-state { padding: 28px 12px; color: var(--muted); text-align: center; }
.empty-state h3 { margin-bottom: 5px; color: var(--ink); }
.empty-state p { margin-bottom: 12px; }
.stats-row { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.stat-chip { border: 1px solid var(--line); border-radius: 4px; padding: 9px 12px; background: #fff; font-size: .8rem; }
.stat-chip strong { color: var(--ink); font-size: .94rem; }
.filters { display: flex; flex-wrap: wrap; gap: 11px; margin-bottom: 17px; }
.filters > * { flex: 0 1 230px; }
.ledger-filters .ledger-search { flex-basis: 310px; }
.movement-filters { display: grid; gap: 11px; margin-bottom: 17px; }
.movement-filter-row { display: grid; grid-template-columns: minmax(260px, 1.65fr) repeat(3, minmax(160px, 1fr)); align-items: end; gap: 11px; }
.movement-filter-row-dates { grid-template-columns: minmax(360px, 1.65fr) minmax(160px, 1fr) 1fr 1fr; }
.movement-date-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.filter-reset { align-self: end; min-height: 42px; }

.inventory-dashboard { margin-bottom: 18px; }
.inventory-overview { display: grid; gap: 20px; }
.inventory-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 4px; }
.inventory-kpis > div { min-width: 0; padding: 14px 15px; border-left: 1px solid var(--line); }
.inventory-kpis > div:first-child { border-left: 0; }
.inventory-kpis small { display: block; margin-bottom: 7px; color: var(--muted); font-size: .71rem; font-weight: 750; }
.inventory-kpis strong { display: block; color: var(--ink); font-size: 1.22rem; font-variant-numeric: tabular-nums; }
.inventory-kpis em { margin-left: 4px; color: var(--muted); font-size: .72rem; font-style: normal; font-weight: 600; }
.inventory-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.inventory-charts h3 { margin: 0 0 12px; font-size: .82rem; }
.inventory-bars { display: grid; gap: 10px; }
.inventory-bar-row { display: grid; grid-template-columns: minmax(72px, .8fr) minmax(80px, 2fr) 28px; align-items: center; gap: 9px; color: var(--muted); font-size: .74rem; }
.inventory-bar-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inventory-bar-row b { color: var(--ink); font-size: .75rem; font-variant-numeric: tabular-nums; text-align: right; }
.inventory-bar-track { height: 7px; overflow: hidden; border-radius: 2px; background: var(--soft); }
.inventory-bar-track i { display: block; min-width: 0; height: 100%; border-radius: inherit; background: var(--ink); }
.inventory-bar-track i.low { background: #9b6b2a; }
.inventory-bar-track i.zero, .inventory-bar-track i.negative { background: var(--danger); }
.inventory-bar-track i.product { background: #4a5358; }

.field, .stack-form label { display: block; min-width: 0; color: var(--ink); font-size: .76rem; font-weight: 800; line-height: 1.4; }
.field input, .field select, .field textarea, .stack-form input, .stack-form select, .stack-form textarea, .filters input, .filters select { display: block; width: 100%; min-height: 42px; margin-top: 8px; border: 1px solid #cfd5d9; border-radius: 4px; padding: 9px 11px; outline: 0; background: #fff; color: var(--ink); font-size: .89rem; font-weight: 500; }
.field input::placeholder, .field textarea::placeholder, .stack-form input::placeholder { color: #657077; opacity: 1; }
.field textarea, .stack-form textarea { min-height: 88px; resize: vertical; }
.field small { display: block; margin-top: 5px; color: var(--muted); font-size: .7rem; font-weight: 500; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus, .stack-form input:focus, .stack-form select:focus, .stack-form textarea:focus, .filters input:focus, .filters select:focus { border-color: var(--ink); box-shadow: 0 0 0 2px #e2e5e6; }
.required { color: var(--danger); }
.stack-form { display: grid; gap: 19px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 15px; }
.form-section, .form-block { border-top: 1px solid var(--line); margin-top: 9px; padding-top: 19px; }
.form-block h3, .form-section h3 { margin: 0 0 16px; font-size: .96rem; }
.form-block .panel-top h3 { margin-bottom: 0; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); padding-top: 16px; }
.form-actions .inline-note { margin-right: auto; }
.form-error { border: 1px solid #e8b6b3; border-radius: 4px; padding: 10px 12px; background: #fff8f7; color: #8e2823; font-size: .8rem; }
.inline-note { margin: 7px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; opacity: .8; }
.line-editor { display: grid; gap: 15px; }
.line-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 54px; gap: 11px; align-items: end; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.legacy-line, .calibration-line { display: grid; grid-template-columns: minmax(0, 1fr) 96px 54px; gap: 11px; align-items: end; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.legacy-line { align-items: start; }
.legacy-line .remove-line { align-self: start; margin-top: 28px; }
.calibration-note-field { grid-column: span 2; }
.sku-finder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 11px; }
.remove-line { min-height: 42px; border: 0; background: #fff; color: var(--muted); font-size: .75rem; font-weight: 750; }
.remove-line:hover { color: var(--danger); }
.sku-option { font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; color: var(--muted); font-size: .77rem; }
.pager button { border: 1px solid var(--line); border-radius: 4px; padding: 7px 10px; background: #fff; color: var(--ink); font-size: .77rem; }
.pager button:hover:not(:disabled) { background: var(--soft); }
.form-workflow { display: grid; grid-template-columns: 190px minmax(0, 1fr); }
#doc-form-panel { padding: 0; overflow: hidden; }
#doc-form-panel:not([hidden]) { margin-bottom: 24px; }
.work-dialog { width: min(1120px, calc(100vw - 40px)); max-height: calc(100vh - 40px); overflow: hidden; border: 0; border-radius: 6px; padding: 0; background: #fff; color: var(--ink); box-shadow: 0 22px 58px rgba(25, 31, 34, .23); }
.work-dialog::backdrop { background: rgba(25, 31, 34, .34); }
.work-dialog-body { max-height: calc(100vh - 40px); overflow: auto; padding: 22px; overscroll-behavior: contain; }
.stock-doc-dialog .work-dialog-body { padding: 0; }
.stock-doc-dialog .form-workflow { min-width: 0; }
.product-create-dialog { width: min(1040px, calc(100vw - 40px)); }
.form-rail { display: grid; align-content: start; gap: 19px; padding: 27px 18px; background: var(--sidebar); color: #fff; }
.form-rail strong { margin-bottom: 15px; font-size: .87rem; }
.form-rail span { display: flex; align-items: center; gap: 9px; color: #cbd0d2; font-size: .75rem; font-weight: 700; }
.form-rail b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #fff; color: var(--ink); font-size: .75rem; }
.form-content { padding: 26px 30px; }
.form-content > .panel-top { margin-bottom: 23px; }
.form-content > .panel-top h2 { font-size: 1.38rem; }
.form-content .stack-form { gap: 15px; }
.form-content .form-block:first-child { margin-top: 0; }
.sku-detail-block .panel-top { align-items: center; }
.sku-detail-block .panel-top p { margin-bottom: 0; }
.sku-composer { display: grid; grid-template-columns: minmax(180px, 1.25fr) minmax(210px, 1.35fr) 88px auto; gap: 12px; align-items: end; padding: 15px; background: var(--soft); }
.search-input { position: relative; display: block; margin-top: 8px; }
.search-input svg { position: absolute; z-index: 1; top: 50%; left: 12px; width: 17px; height: 17px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.field .search-input input { margin-top: 0; padding-left: 38px; }
.sku-add-button { align-self: end; min-height: 42px; }
.sku-composer + .form-error { margin: 12px 0 0; }
.selected-sku-list { gap: 0; margin-top: 16px; }
.selected-sku-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 54px; gap: 11px; align-items: end; border-top: 1px solid var(--line); padding: 13px 0; }
.selected-sku-name { min-width: 0; padding-bottom: 8px; }
.selected-sku-name strong, .selected-sku-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-sku-name strong { color: var(--ink); font-size: .84rem; }
.selected-sku-name span { margin-top: 4px; color: var(--muted); font-size: .72rem; }
.selected-sku-row .field input { margin-top: 5px; }
.sku-detail-note { margin: 5px 0 0; }
.calibration-sheet-block .panel-top { align-items: center; }
.calibration-product-picker { border-top: 0; margin-top: 0; padding-top: 0; }
.calibration-product-field { max-width: 620px; }
.calibration-product-search { max-width: 620px; margin-bottom: 14px; }
.calibration-product-search input { min-height: 48px; border-color: var(--ink); padding: 11px 13px; font-size: .94rem; font-weight: 750; }
.calibration-product-search input:focus { box-shadow: 0 0 0 3px #e2e5e6; }
#calibration-panel:not([hidden]) { margin-bottom: 18px; }
.calibration-matrix-note { margin: 0 0 16px; }
.calibration-matrix-group { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 18px; }
.calibration-matrix-group:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.calibration-matrix-head { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 11px; }
.calibration-matrix-head strong, .calibration-matrix-head small { display: block; }
.calibration-matrix-head strong { color: var(--ink); font-size: .91rem; }
.calibration-matrix-head small { margin-top: 4px; color: var(--muted); font-size: .72rem; }
.calibration-matrix-scroll { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; touch-action: pan-x; }
.calibration-matrix { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: .78rem; }
.calibration-matrix th, .calibration-matrix td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 9px; text-align: center; vertical-align: middle; }
.calibration-matrix tr > *:last-child { border-right: 0; }
.calibration-matrix tbody tr:last-child > * { border-bottom: 0; }
.calibration-matrix thead th { min-width: 126px; background: var(--soft); color: var(--ink); font-size: .74rem; font-weight: 800; }
.calibration-matrix thead th:first-child { position: sticky; z-index: 3; left: 0; min-width: 104px; background: var(--soft); }
.calibration-matrix tbody th { position: sticky; z-index: 2; left: 0; min-width: 104px; background: #fff; color: var(--ink); font-size: .76rem; font-weight: 800; }
.matrix-count-cell { display: grid; justify-items: stretch; gap: 5px; min-width: 106px; }
.matrix-system { color: var(--muted); font-size: .69rem; font-variant-numeric: tabular-nums; }
.matrix-count-cell .counted-qty { width: 100%; min-height: 38px; border: 1px solid #cfd5d9; border-radius: 4px; padding: 7px 9px; background: #fff; color: var(--ink); font: inherit; font-weight: 750; font-variant-numeric: tabular-nums; text-align: center; }
.matrix-count-cell .counted-qty:focus { border-color: var(--ink); box-shadow: 0 0 0 2px #e2e5e6; outline: 0; }
.matrix-empty { min-width: 126px; background: #fafafa; color: #a5acb0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; }
.count-delta { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.count-delta.same, .count-delta.pending { color: var(--muted); }
.count-delta.increase { color: var(--success); }
.count-delta.decrease { color: var(--danger); }
.count-mobile-fields { display: grid; grid-template-columns: 1fr 116px; align-items: end; gap: 12px; margin-top: 10px; color: var(--muted); font-size: .75rem; }
.count-mobile-fields span { padding-bottom: 11px; }
.count-mobile-fields b { margin-left: 5px; color: var(--ink); font-size: .95rem; font-variant-numeric: tabular-nums; }
.count-mobile-fields label { color: var(--ink); font-size: .74rem; font-weight: 800; }
.count-mobile-fields input { display: block; width: 100%; min-height: 42px; margin-top: 5px; border: 1px solid #cfd5d9; border-radius: 4px; padding: 8px 9px; color: var(--ink); font: inherit; font-variant-numeric: tabular-nums; }
.operator-note { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 18px; padding: 10px 12px; background: var(--soft); color: var(--ink); font-size: .77rem; }
.operator-note span { color: var(--muted); font-weight: 500; }
.movement-table { min-width: 980px; }
.sku-quantity-list { display: grid; gap: 5px; min-width: 175px; }
.sku-quantity-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf0f1; padding: 3px 0; }
.sku-quantity-line:last-child { border-bottom: 0; }
.sku-quantity-line code { min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-family: inherit; font-size: .78rem; font-weight: 700; }
.sku-quantity-line > span { display: grid; justify-items: end; flex: none; gap: 1px; min-width: 34px; font-variant-numeric: tabular-nums; }
.sku-quantity-line small { color: var(--muted); font-size: .62rem; line-height: 1; }
.sku-quantity-line b { color: var(--ink); font-size: .87rem; line-height: 1.1; }

.catalog-tools { display: flex; align-items: end; gap: 12px; margin-bottom: 16px; }
.catalog-search { flex: 1; }
.catalog-page-size { width: 150px; }
.catalog-name { display: flex; align-items: center; gap: 11px; min-width: 0; }
.catalog-name strong { display: block; overflow-wrap: anywhere; }
.catalog-name small { display: block; margin-top: 3px; color: var(--muted); font-size: .71rem; }
.catalog-thumb { flex: none; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 4px; object-fit: cover; }
.catalog-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); margin-top: 7px; }
.catalog-footer .pager { margin-top: 12px; }
.product-create-panel { margin: 18px 0; }
.detail-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.detail-actions .button { min-height: 36px; padding: 7px 10px; font-size: .76rem; }
.product-sku-dialog { width: min(1120px, calc(100vw - 40px)); max-height: calc(100vh - 40px); overflow: hidden; border: 0; border-radius: 6px; padding: 0; background: #fff; color: var(--ink); box-shadow: 0 22px 58px rgba(25, 31, 34, .23); }
.product-sku-dialog::backdrop { background: rgba(25, 31, 34, .34); }
.product-sku-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding: 20px 22px 15px; }
.product-sku-dialog-head h2 { margin: 0 0 3px; font-size: 1.17rem; }
.product-sku-dialog-head p { margin: 0; }
.product-sku-dialog-body { max-height: min(620px, calc(100vh - 150px)); overflow: auto; padding: 18px 22px 22px; overscroll-behavior: contain; }
.product-sku-dialog-summary { margin: 0 0 14px; color: var(--muted); font-size: .76rem; }
.product-spec-block .panel-top { align-items: center; }
.generated-sku-list { gap: 0; margin-top: 16px; }
.product-sku-row { display: grid; grid-template-columns: minmax(180px, 1.7fr) repeat(2, minmax(90px, 1fr)) repeat(2, minmax(88px, .75fr)); gap: 10px; align-items: end; border-bottom: 1px solid var(--line); padding: 0 0 15px; }
.generated-sku-code { min-width: 0; padding-bottom: 8px; }
.generated-sku-code small, .generated-sku-code strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.generated-sku-code small { margin-bottom: 5px; color: var(--muted); font-size: .7rem; }
.generated-sku-code strong { color: var(--ink); font-size: .82rem; }
.list-loading { padding: 28px 12px; color: var(--muted); text-align: center; font-size: .83rem; }

.finance-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.account-card { border: 1px solid var(--line); border-radius: 4px; padding: 15px; background: #fff; }
.account-card small { display: block; margin-bottom: 6px; color: var(--muted); }
.account-card strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.account-card em { display: block; margin-top: 5px; color: var(--muted); font-size: .7rem; font-style: normal; }
.master-data-panel + .master-data-panel { margin-top: 18px; }
.master-data-table { min-width: 680px; }
.master-data-table .link-button svg { width: 15px; height: 15px; }
.obligation-table { min-width: 980px; }
.obligation-operation { display: grid; justify-items: start; gap: 8px; min-width: 112px; }
.button.obligation-settle-button { min-height: 36px; border-color: var(--ink); padding: 7px 10px; background: var(--ink); color: #fff; font-size: .76rem; }
.button.obligation-detail-button { min-height: 36px; padding: 7px 10px; background: #fff; color: var(--ink); font-size: .76rem; }
.obligation-direction { display: grid; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 0 15px; }
.obligation-direction strong { color: var(--ink); font-size: .92rem; }
.obligation-direction span { color: var(--muted); font-size: .77rem; line-height: 1.5; }
.obligation-form .form-block { margin-top: 0; }
.settlement-mode-switch { display: flex; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 13px; }
.settlement-mode-button { border: 1px solid var(--line); border-radius: 4px; padding: 9px 12px; background: #fff; color: var(--muted); font: inherit; font-size: .8rem; font-weight: 800; cursor: pointer; }
.settlement-mode-button.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
.settlement-source-intro { margin-bottom: 12px; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.field-wide { grid-column: span 2; }
.settlement-loading { color: var(--muted); font-size: .8rem; }
.compact-empty { padding: 20px 0; text-align: left; }
.compact-empty h3 { margin-bottom: 5px; font-size: .9rem; }
.compact-empty p { color: var(--muted); font-size: .78rem; }
.proof-upload-block { margin-top: 0; }
.proof-upload-block input[type="file"] { width: 100%; min-height: 42px; border: 1px dashed var(--line); border-radius: 4px; padding: 8px; background: var(--soft); color: var(--ink); font: inherit; font-size: .78rem; }
.attachment-list { display: flex; align-items: flex-start; gap: 8px; min-width: 110px; }
.attachment-preview { display: block; flex: none; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--soft); }
.attachment-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.attachment-links { display: grid; gap: 3px; min-width: 0; }
.attachment-links a { overflow: hidden; color: var(--ink); font-size: .72rem; line-height: 1.35; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; text-overflow: ellipsis; white-space: nowrap; }
.attachment-links a:hover { text-decoration-color: var(--ink); }
.month-account-lines { display: grid; gap: 6px; min-width: 290px; }
.month-account-lines > div { display: flex; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding-bottom: 6px; color: var(--muted); font-size: .76rem; }
.month-account-lines > div:last-child { border-bottom: 0; padding-bottom: 0; }
.month-account-lines > div > span:first-child { color: var(--ink); font-weight: 800; }
.month-account-lines b { font-variant-numeric: tabular-nums; }
.settlement-detail-table .data-table { min-width: 890px; }
.settlement-detail-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 16px; border-bottom: 1px solid var(--line); padding: 14px 0; }
.settlement-detail-row:first-child { padding-top: 0; }
.settlement-detail-row:last-child { border-bottom: 0; padding-bottom: 0; }
.settlement-detail-row > div { display: grid; gap: 3px; }
.settlement-detail-row > p { grid-column: 1 / -1; margin: 0; color: var(--ink); font-size: .8rem; line-height: 1.55; }
.settlement-detail-row .attachment-list { grid-column: 1 / -1; margin-top: 3px; }
.settlement-detail-amount { font-variant-numeric: tabular-nums; }
.obligation-mobile-actions { display: grid; gap: 8px; margin-top: 12px; }
.settlement-detail-row dl { display: grid; grid-column: 1 / -1; gap: 8px; margin: 4px 0 0; }
.settlement-detail-row dl div { display: grid; gap: 2px; }
.settlement-detail-row dt { color: var(--muted); font-size: .7rem; }
.settlement-detail-row dd { margin: 0; color: var(--ink); font-size: .8rem; line-height: 1.5; }
.settlement-dialog { width: min(1040px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 32px)); border: 0; border-radius: 6px; padding: 0; background: #fff; color: var(--ink); box-shadow: 0 12px 32px rgba(0,0,0,.18); }
.settlement-dialog::backdrop { background: rgba(37,42,45,.28); }
.settlement-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding: 20px 22px 15px; }
.settlement-dialog-head h2 { margin: 0 0 4px; }
.settlement-dialog-head p { margin: 0; color: var(--muted); font-size: .78rem; }
.settlement-dialog-body { max-height: min(560px, calc(100vh - 205px)); overflow: auto; padding: 20px 22px 22px; }
.settlement-dialog-actions { display: flex; justify-content: flex-end; border-top: 1px solid var(--line); padding: 14px 22px; }
.obligation-mobile-amounts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin: 12px 0; }
.obligation-mobile-amounts span { display: grid; gap: 3px; color: var(--muted); font-size: .69rem; }
.obligation-mobile-amounts b { color: var(--ink); font-size: .79rem; font-variant-numeric: tabular-nums; }
.permission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(205px, 1fr)); gap: 9px; margin-top: 13px; }
.permission-grid label { display: flex; align-items: center; gap: 9px; min-height: 44px; border: 1px solid var(--line); border-radius: 4px; padding: 9px 11px; background: #fff; color: var(--ink); font-size: .81rem; transition: border-color .18s, background .18s; }
.permission-grid label:has(input:checked) { border-color: var(--ink); background: var(--soft); }
.permission-grid input, .filter-check input { appearance: none; flex: none; width: 17px; height: 17px; border: 1px solid #9ca6ab; border-radius: 3px; background: #fff; box-shadow: inset 0 0 0 0 #fff; }
.permission-grid input:checked, .filter-check input:checked { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 4px #fff; }
.permission-grid input:focus-visible, .filter-check input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.account-role-readonly { display: grid; align-content: end; gap: 8px; }
.account-role-readonly strong { display: flex; align-items: center; min-height: 42px; border: 1px solid var(--line); border-radius: 4px; padding: 9px 11px; background: var(--soft); font-size: .89rem; }
.account-active-toggle { display: grid; gap: 8px; align-content: end; }
.toggle-control { display: inline-flex; align-items: center; gap: 9px; min-height: 42px; }
.toggle-control input { appearance: none; position: relative; width: 38px; height: 22px; margin: 0; border: 1px solid #9ca6ab; border-radius: 12px; background: #dce1e4; cursor: pointer; transition: background .18s, border-color .18s; }
.toggle-control input::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; content: ''; transition: transform .18s; }
.toggle-control input:checked { border-color: var(--ink); background: var(--ink); }
.toggle-control input:checked::after { transform: translateX(16px); }
.toggle-control input:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.toggle-control b { font-size: .8rem; }
.account-owner-note { border: 1px solid var(--line); border-radius: 4px; padding: 12px; background: var(--soft); color: var(--muted); font-size: .78rem; line-height: 1.5; }
.filter-check { display: flex; align-items: center; gap: 8px; min-height: 42px; color: var(--ink); font-size: .78rem; font-weight: 700; white-space: nowrap; }
.tracking-inline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tracking-inline input { width: 160px; border: 1px solid var(--line); border-radius: 4px; padding: 7px 8px; }
.tracking-inline button { border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; background: #fff; color: var(--ink); font-size: .74rem; }
.review-block { border-bottom: 1px solid var(--line); padding: 15px 0; }
.review-block:last-child { border-bottom: 0; }
.review-block h3 { margin-bottom: 7px; }
.review-block p { margin-bottom: 5px; }
.issue-list { display: grid; gap: 6px; max-height: 190px; overflow: auto; color: var(--muted); font-size: .78rem; }
.archive-list { max-height: 650px; overflow: auto; margin-top: 15px; }
.archive-list details { border-bottom: 1px solid var(--line); padding: 10px 0; font-size: .78rem; }
.archive-list summary { cursor: pointer; color: var(--ink); }
.archive-list pre { overflow-wrap: anywhere; padding: 10px; background: var(--soft); font-size: .71rem; line-height: 1.5; white-space: pre-wrap; }

.login-screen { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: #fff; }
.login-panel { width: min(100%, 430px); border: 1px solid var(--line); border-radius: 6px; padding: 33px; background: #fff; }
.login-brand { margin-bottom: 42px; }
.login-brand span { color: var(--muted); }
.login-message h1 { margin-bottom: 8px; }
.login-message p { margin-bottom: 27px; color: var(--muted); font-size: .87rem; }
.login-foot { margin: 18px 0 0; color: var(--muted); font-size: .74rem; }
.toast { position: fixed; z-index: 50; right: 25px; bottom: 25px; max-width: min(90vw, 400px); border-radius: 5px; padding: 13px 17px; background: var(--ink); color: #fff; box-shadow: 0 9px 24px rgba(0, 0, 0, .16); }
.toast.error { background: #942d28; }
.loading-skeleton { display: grid; gap: 14px; }
.loading-skeleton > div { height: 96px; border-radius: 4px; background: #f1f2f2; }
.loading-skeleton > div:first-child { height: 72px; }
.error-panel { border: 1px solid var(--line); border-radius: 6px; padding: 25px; background: #fff; }
.mobile-nav, .mobile-more, .mobile-records, .mobile-list { display: none; }
.mobile-item { border-top: 1px solid var(--line); padding: 13px 0; }
.mobile-item:first-child { border-top: 0; }
.mobile-item-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mobile-item-head strong { font-size: .84rem; overflow-wrap: anywhere; }
.mobile-item p { margin: 6px 0 3px; font-size: .81rem; }
.mobile-item small { display: block; color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; }
.mobile-item-actions { display: flex; gap: 13px; margin-top: 5px; }
.qty-badge { flex: none; border: 1px solid var(--line); border-radius: 4px; padding: 5px 7px; font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.qty-badge.low { border-color: #e4c7c5; color: var(--danger); }
.mobile-record { border-top: 1px solid var(--line); padding: 12px 0; }
.mobile-record:first-child { border-top: 0; }
.mobile-record > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mobile-record p { margin: 7px 0 3px; font-size: .83rem; overflow-wrap: anywhere; }
.mobile-record small { display: block; color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; }

@media (max-width: 1120px) {
  .stock-overview, .dashboard-grid { grid-template-columns: 1fr; }
  .inventory-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inventory-kpis > div:nth-child(odd) { border-left: 0; }
  .inventory-kpis > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-sku-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-sku-row .remove-line { align-self: end; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { height: 58px; padding: 0 16px; }
  .topbar-right { gap: 7px; }
  .topbar-right #today-label { display: none; }
  .topbar .switch-button { padding: 6px 8px; font-size: .71rem; }
  .user-chip { padding: 6px 7px; font-size: .71rem; }
  #view { padding: 24px 16px calc(98px + env(safe-area-inset-bottom)); }
  .page-head { gap: 12px; margin-bottom: 19px; }
  .page-head h1 { font-size: 1.45rem; }
  .page-head p { font-size: .78rem; }
  .page-head .button { padding: 8px 10px; font-size: .75rem; }
  .panel { padding: 16px; }
  .portal-layout #view { padding-top: 22px; padding-bottom: 35px; }
  .portal { padding: 22px 18px; }
  .portal-header { align-items: flex-start; }
  .portal-user { text-align: right; max-width: 110px; }
  .portal-intro { margin: 34px 0 23px; }
  .portal-intro h1 { font-size: 1.6rem; }
  .portal-doors { grid-template-columns: 1fr; gap: 12px; }
  .portal-door { min-height: 208px; padding: 19px; }
  .portal-door > strong { margin-top: 24px; }
  .portal-footer { align-items: flex-start; flex-direction: column; }
  .stock-overview { display: flex; flex-direction: column; }
  .stock-action-panel, .stock-pulse-panel { min-height: 0; }
  .action-list { grid-template-columns: 1fr; gap: 8px; }
  .action-tile { flex-direction: row; align-items: center; min-height: 52px; gap: 12px; padding: 13px 14px; font-size: .84rem; }
  .action-tile svg:last-child { align-self: auto; margin: 0 0 0 auto; }
  .stock-pulse-panel { order: 2; }
  .stock-action-panel { order: 1; }
  .finance-summary { grid-template-columns: 1fr; }
  .inventory-charts { grid-template-columns: 1fr; gap: 20px; }
  .inventory-kpis > div { padding: 13px 12px; }
  .movement-filter-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .movement-filter-row .movement-search { grid-column: 1 / -1; }
  .movement-filter-row-dates { grid-template-columns: 1fr; }
  .movement-date-range { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .movement-filters .filter-reset { width: 100%; }
  .movement-actions { width: 100%; min-width: 0; }
  .movement-action { flex: 1 1 auto; min-height: 40px; }
  .analysis-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-summary > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .analysis-summary > div:nth-child(4) { border-top: 1px solid var(--line); }
  .analysis-lists { grid-template-columns: 1fr; gap: 20px; }
  .form-grid, .sku-finder { grid-template-columns: 1fr; }
  .sku-composer { grid-template-columns: 1fr; padding: 14px; }
  .sku-add-button { width: 100%; min-height: 46px; }
  .selected-sku-row { grid-template-columns: minmax(0, 1fr) 76px 46px; }
  .calibration-matrix-group { margin-top: 18px; padding-top: 16px; }
  .calibration-matrix-head { align-items: center; }
  .calibration-matrix-head > .small { display: none; }
  .calibration-matrix-scroll { width: 100%; max-width: 100%; margin-right: 0; }
  .calibration-matrix { font-size: .72rem; }
  .calibration-matrix th, .calibration-matrix td { padding: 7px 6px; }
  .calibration-matrix thead th { min-width: 94px; font-size: .68rem; }
  .calibration-matrix thead th:first-child, .calibration-matrix tbody th { min-width: 76px; font-size: .7rem; }
  .matrix-count-cell { min-width: 82px; gap: 4px; }
  .matrix-system, .matrix-delta { font-size: .64rem; }
  .matrix-count-cell .counted-qty { min-height: 40px; padding: 6px; font-size: .84rem; }
  .line-row { grid-template-columns: minmax(0, 1fr) 76px 46px; }
  .line-row .sku-finder { grid-column: 1 / -1; }
  .legacy-line, .calibration-line { grid-template-columns: minmax(0, 1fr) 76px 46px; }
  .calibration-note-field { grid-column: auto; }
  .form-workflow { grid-template-columns: 1fr; }
  .form-rail { display: flex; align-items: center; gap: 10px; overflow: auto; padding: 13px 14px; }
  .form-rail strong { display: none; }
  .form-rail span { flex: none; font-size: .69rem; }
  .form-rail b { width: 21px; height: 21px; }
  .form-content { padding: 20px 16px; }
  .form-content .operator-note { align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
  .operator-note span { flex-basis: 100%; }
  .form-content .field input, .form-content .field select, .form-content .field textarea { min-height: 46px; font-size: .86rem; }
  .form-actions { flex-wrap: wrap; }
  .form-content .form-actions { position: sticky; z-index: 3; bottom: calc(63px + env(safe-area-inset-bottom)); margin: 4px -16px -20px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -8px 18px rgba(0, 0, 0, .06); }
  .form-actions .inline-note { flex-basis: 100%; }
  .form-content .form-actions .button { flex: 1; min-height: 46px; }
  .product-sku-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-sku-row .generated-sku-code { grid-column: 1 / -1; }
  .catalog-tools { align-items: stretch; }
  .catalog-page-size { width: 100px; }
  .catalog-table { display: none; }
  .product-sku-dialog { width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
  .product-sku-dialog-head { padding: 16px 16px 13px; }
  .product-sku-dialog-head .detail-actions { gap: 6px; }
  .product-sku-dialog-head .detail-actions .button { min-height: 34px; padding: 6px 8px; }
  .product-sku-dialog-body { max-height: calc(100vh - 164px); padding: 16px; }
  .product-sku-dialog .sku-detail-table { display: none; }
  .product-sku-dialog .sku-detail-mobile { display: block; }
  .catalog-panel .table-scroll { overflow: visible; }
  .mobile-list, .mobile-records { display: block; }
  .recent-panel .table-scroll, #sku-list, #doc-list, #ledger-list, #obligation-list { overflow: visible; }
  .recent-panel .data-table, #sku-list .data-table, #doc-list .data-table, #ledger-list .data-table, #obligation-list .obligation-table { display: none; }
  .obligation-mobile-item .obligation-settle-button { width: 100%; min-height: 44px; }
  .obligation-mobile-item .obligation-detail-button { width: 100%; min-height: 44px; }
  .field-wide { grid-column: auto; }
  .attachment-list { margin-top: 9px; }
  .finance-summary { gap: 8px; }
  .account-card { padding: 13px 14px; }
  .account-card small { font-size: .74rem; }
  .account-card strong { font-size: 1.2rem; }
  .filters:has(#entity-filter) { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .filters:has(#entity-filter) select { width: 100%; min-height: 44px; }
  .ledger-filters .ledger-search { grid-column: 1 / -1; }
  .settlement-dialog { width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
  .settlement-dialog-head { padding: 16px 16px 13px; }
  .settlement-dialog-body { max-height: calc(100vh - 170px); padding: 16px; }
  .settlement-dialog-actions { padding: 12px 16px; }
  .settlement-detail-table { display: none; }
  .settlement-detail-mobile { display: grid; }
  .work-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .work-dialog-body { max-height: calc(100vh - 16px); padding: 16px; }
  .stock-doc-dialog .work-dialog-body { padding: 0; }
  .mobile-item { font-size: .8rem; }
  .mobile-item p { font-size: .78rem; line-height: 1.48; }
  .mobile-item .sku-quantity-list, .mobile-record .sku-quantity-list { margin: 9px 0; min-width: 0; }
  .mobile-item .sku-quantity-line, .mobile-record .sku-quantity-line { padding: 5px 0; }
  .mobile-item small, .record-id { font-size: .68rem; }
  .field, .stack-form label { font-size: .72rem; }
  .filters input, .filters select { min-height: 40px; font-size: .84rem; }
  .obligation-mobile-amounts { gap: 5px; }
  #calibration-sheet { overflow: visible; }
  .mobile-nav { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: flex; border-top: 1px solid var(--line); padding: 5px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)); background: #fff; }
  .mobile-nav .nav-item { flex: 1; display: grid; justify-items: center; gap: 2px; min-width: 0; border-radius: 4px; padding: 5px 3px; color: var(--muted); font-size: .63rem; text-align: center; white-space: nowrap; }
  .mobile-nav .nav-item.active { color: var(--ink); background: #f1f2f2; }
  .mobile-nav .nav-item svg { width: 18px; height: 18px; }
  .mobile-more:not([hidden]) { position: fixed; z-index: 29; right: 12px; bottom: calc(71px + env(safe-area-inset-bottom)); display: grid; min-width: 170px; border: 1px solid var(--line); border-radius: 5px; padding: 6px; background: #fff; box-shadow: 0 10px 28px rgba(0, 0, 0, .13); }
  .mobile-more .nav-item { color: var(--ink); }
  .toast { right: 15px; bottom: calc(78px + env(safe-area-inset-bottom)); left: 15px; }
  .login-panel { padding: 25px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@keyframes connection-breathe {
  0% { box-shadow: 0 0 0 0 rgba(71, 184, 129, .45); }
  70% { box-shadow: 0 0 0 6px rgba(71, 184, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(71, 184, 129, 0); }
}
