:root {
  color-scheme: light;
  --ink: #192a2b;
  --muted: #57696b;
  --faint: #687b7b;
  --teal: #007970;
  --teal-dark: #00635c;
  --mint: #e4f3ef;
  --line: #e3eae9;
  --surface: #fff;
  --background: #f4f7f6;
  --panel-radius: 15px;
  --sidebar-width: 225px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
  font-size: 14px;
  line-height: 1.55;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; text-decoration: none; }
svg { display: inline-block; flex-shrink: 0; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #008e83; outline-offset: 3px; }
.skip-link { position: fixed; top: 10px; left: 12px; transform: translateY(-160%); z-index: 12; padding: 8px 12px; border-radius: 6px; color: white; background: var(--teal); }
.skip-link:focus { transform: none; }
.app-layout { min-height: 100vh; }
.main-layout { margin-inline-start: var(--sidebar-width); min-width: 0; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; width: var(--sidebar-width); display: flex; flex-direction: column; background: #fbfdfc; border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 11px; min-height: 77px; padding: 0 22px; }
.brand-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; background: #007a70; color: #fff; box-shadow: 0 3px 6px #00797022; }
.brand-name { font-size: 16px; letter-spacing: .01em; font-weight: 750; white-space: nowrap; }
.primary-nav { min-height: 0; overflow: auto; padding: 5px 14px 10px; }
.nav-group { margin: 0 0 18px; }
.nav-group:last-child { margin-bottom: 0; }
.nav-label { color: #637776; font-size: 11px; padding: 0 11px 6px; letter-spacing: .1em; font-weight: 650; }
.nav-link { display: flex; align-items: center; gap: 10px; min-height: 41px; padding: 8px 11px; border-radius: 8px; color: #435858; font-weight: 540; margin: 2px 0; }
.nav-link > span:first-of-type { flex: 1; }
.nav-link:hover { background: #f0f6f4; color: var(--ink); }
.nav-link.is-active { background: #e4f3ee; color: #00695e; font-weight: 730; }
.nav-indicator { width: 5px; height: 5px; border-radius: 50%; background: #008575; }
.sidebar-footer { margin-top: auto; padding: 7px 14px 16px; }
.workspace-switch { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 8px; margin-top: 9px; text-align: left; background: white; border: 1px solid var(--line); border-radius: 10px; }
.workspace-switch:hover { border-color: #a6ccc2; }
.workspace-switch > span:nth-child(2) { min-width: 0; flex: 1; }
.workspace-switch strong, .workspace-switch small { display: block; white-space: nowrap; }
.workspace-switch strong { font-size: 12px; }
.workspace-switch small { font-size: 10px; color: var(--muted); margin-top: 1px; }
.workspace-icon { display: grid; place-items: center; width: 31px; height: 31px; flex: 0 0 31px; border-radius: 7px; background: #e9f4f0; color: #087a6e; }
.topbar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 0 32px; background: #fff; border-bottom: 1px solid var(--line); }
.topbar-path, .topbar-tools { display: flex; align-items: center; gap: 12px; }
.topbar-path strong { font-size: 13px; font-weight: 720; }
.breadcrumb-root, .breadcrumb-chevron, .topbar-date { color: var(--muted); font-size: 12px; }
.topbar-date { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.workspace-tag { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d4e8df; border-radius: 99px; background: #edf8f2; color: #265f46; padding: 5px 9px; font-size: 11px; font-weight: 690; white-space: nowrap; }
.workspace-tag > span { background: #318457; width: 6px; height: 6px; border-radius: 50%; }
.workspace-tag.tag-demo { color: #825916; background: #fffaee; border-color: #f1e5c8; }
.workspace-tag.tag-demo > span { background: #c79022; }
.icon-button { display: inline-grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; }
.icon-button:hover { background: #eff5f3; color: var(--ink); }
.nav-toggle, .nav-scrim { display: none; }
.page-content { width: 100%; max-width: 1580px; min-height: calc(100vh - 64px); margin: 0 auto; padding: 27px 32px 36px; }
.page-content:focus { outline: none; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 22px; }
.page-head h1 { font-size: clamp(24px, 2.3vw, 32px); letter-spacing: -.025em; font-weight: 750; line-height: 1.23; }
.page-head p { color: var(--muted); margin-top: 7px; font-size: 13px; }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 36px; padding: 6px 12px; border: 1px solid transparent; border-radius: 8px; background: #fff; color: var(--ink); font-size: 13px; line-height: 1.35; font-weight: 640; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn-primary { color: white; background: var(--teal); border-color: var(--teal); box-shadow: 0 2px 4px #0079701a; }
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.page-actions .btn-primary { min-height: 40px; padding-inline: 15px; }
.btn-secondary { border-color: #dce7e4; }
.btn-secondary:hover, .btn-ghost:hover { color: var(--teal-dark); background: #f1f8f6; border-color: #d6e9e4; }
.btn-ghost { color: var(--teal-dark); background: transparent; }
.btn-danger { border-color: #eed7d7; color: #a94444; }
.btn-danger:hover { background: #fff2f2; }
.btn-small, .btn-xs { min-height: 30px; padding: 3px 8px; font-size: 12px; }
.text-link { display: inline-flex; align-items: center; justify-content: flex-start; gap: 5px; padding: 0; background: transparent; border: 0; color: var(--teal-dark); font-size: 12px; font-weight: 680; white-space: nowrap; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--panel-radius); min-width: 0; }
.panel + .panel { margin-top: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 19px; }
.panel-head h2, .panel h2 { font-size: 16px; font-weight: 735; line-height: 1.4; }
.panel-head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.panel-body { padding: 0 19px 17px; }
.panel-body > p { color: var(--muted); }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-body > .toolbar { margin-top: 11px; }
.muted, .subtle { color: var(--muted); }
.numeric, .num, .money { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap { overflow: auto; max-width: 100%; }
.data-table { border-collapse: collapse; width: 100%; text-align: left; white-space: nowrap; font-size: 13px; }
.data-table th, .data-table td { padding: 11px 14px; }
.data-table th:first-child, .data-table td:first-child { padding-left: 19px; }
.data-table th:last-child, .data-table td:last-child { padding-right: 19px; }
.data-table th { font-size: 12px; color: #536865; font-weight: 680; background: #f4f8f7; border-block: 1px solid #edf1ef; }
.data-table td { border-bottom: 1px solid #eef2f0; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f9fcfa; }
.data-table .btn { margin-right: 3px; }
.pill { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 660; line-height: 1.4; color: #485b5d; background: #eff3f3; }
.pill-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill-teal, .pill-mint, .pill-green, .pill-success, .pill-positive { color: #176752; background: #e6f5ed; }
.pill-blue, .pill-info { color: #2e5da0; background: #eaf1fc; }
.pill-amber, .pill-warning, .pill-yellow, .pill-orange { color: #8b5a17; background: #fbf0db; }
.pill-plum, .pill-purple { color: #6c488b; background: #f0ebf6; }
.pill-red, .pill-danger, .pill-negative, .pill-error { color: #a2313f; background: #fbeaec; }
.empty-state { display: grid; gap: 9px; place-content: center; justify-items: center; min-height: 125px; text-align: center; color: var(--muted); padding: 16px; }
.empty-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: #eff6f3; color: #487871; }

.dashboard-hero-grid, .dashboard-insight-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 15px; }
.dashboard-hero-grid > .panel, .dashboard-insight-grid > .panel, .settings-grid > .panel { margin-top: 0; }
.sales-hero { position: relative; isolation: isolate; overflow: hidden; display: flex; justify-content: space-between; align-items: center; min-height: 170px; padding: 22px 24px; border-radius: var(--panel-radius); color: white; background: linear-gradient(116deg, #07514d 1%, #006b62 58%, #087b6d 100%); }
.sales-hero::before { position: absolute; inset: 0; z-index: -2; content: ""; background: radial-gradient(ellipse at 59% 125%, #32c2a750, transparent 64%), radial-gradient(ellipse at 91% 12%, #7ee3b820, transparent 64%); }
.hero-text, .hero-side { position: relative; }
.hero-label { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #d0eee6; font-weight: 650; letter-spacing: .025em; }
.hero-value { display: block; margin: 8px 0 8px; font: 710 clamp(29px, 3.4vw, 48px)/1.08 system-ui, sans-serif; letter-spacing: -.05em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; color: #d8f0ec; font-size: 12px; }
.hero-foot span + span::before { display: inline-block; content: ""; width: 4px; height: 4px; border-radius: 50%; vertical-align: 3px; background: #acd8ce; margin-right: 8px; }
.hero-side { display: flex; flex-direction: column; gap: 12px; min-width: 140px; padding: 1px 0 1px 15px; border-left: 1px solid #b3e9d64a; }
.hero-side > span { display: block; font-size: 11px; color: #d7f0e8; }
.hero-side strong { display: block; color: white; font: 650 21px/1.35 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.hero-art { position: absolute; z-index: -1; inset: 0 -13px 0 47%; overflow: hidden; opacity: .68; mask-image: linear-gradient(90deg, transparent, #000 35%, #000); }
.hero-art i { display: block; position: absolute; width: 297px; height: 156px; border: 1px solid #a8f4db57; border-radius: 16px; transform: rotate(-28deg) skewX(24deg); background: linear-gradient(125deg, #58c6a723, transparent 60%); }
.hero-art i:nth-child(1) { left: 17px; top: 59px; }
.hero-art i:nth-child(2) { left: 28px; top: 46px; }
.hero-art i:nth-child(3) { left: 39px; top: 33px; }
.hero-art i:nth-child(4) { left: 50px; top: 20px; }
.quick-panel .panel-head { padding: 14px 15px 8px; }
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 0 12px 12px; }
.quick-card { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 53px; padding: 7px 8px; text-align: left; border: 1px solid #eaf0ee; border-radius: 9px; background: #f9fbfa; transition: border-color .15s, background .15s; }
.quick-card:hover { border-color: #b7d6cd; background: #f1f8f5; }
.quick-card strong, .quick-card small { display: block; white-space: nowrap; }
.quick-card strong { font-size: 13px; }
.quick-card small { font-size: 10px; color: var(--muted); margin-top: 1px; }
.quick-icon, .metric-icon { display: inline-grid; flex: 0 0 auto; place-items: center; width: 34px; height: 34px; border-radius: 9px; }
.icon-mint { color: #03796c; background: #e2f3ed; }
.icon-blue { color: #3667a5; background: #eaf1fb; }
.icon-plum { color: #805696; background: #f2ebf7; }
.icon-amber { color: #9f6929; background: #fbf0df; }
.metric-grid, .stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 15px 0; }
.metric-card, .stat-card { min-width: 0; min-height: 109px; padding: 12px 13px 11px; background: white; border: 1px solid var(--line); border-radius: 12px; }
.metric-card:hover { border-color: #b7d6cd; }
.metric-top { display: flex; align-items: center; gap: 8px; color: #415857; font-size: 12px; font-weight: 650; }
.metric-top > svg { margin-left: auto; color: #6c8280; }
.metric-card .metric-icon { width: 30px; height: 30px; border-radius: 8px; }
.metric-card > strong, .stat-card > strong { display: block; margin-top: 6px; font: 700 clamp(18px, 1.9vw, 26px)/1.22 system-ui, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -.03em; overflow-wrap: anywhere; }
.metric-card > small, .stat-card > small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.stat-card > span { color: var(--muted); font-size: 12px; font-weight: 650; }
.dashboard-insight-grid { margin-bottom: 15px; }
.chart-panel .panel-head, .rank-panel .panel-head { padding-bottom: 10px; }
.chart-legend { display: flex; gap: 15px; padding: 0 19px 4px; font-size: 11px; color: var(--muted); }
.chart-legend span { display: flex; align-items: center; gap: 5px; }
.chart-legend i { display: block; width: 13px; height: 3px; border-radius: 3px; background: #008779; }
.chart-legend span + span i { background: #8968a4; }
.chart-area { position: relative; padding: 4px 12px 13px 9px; }
.chart-area canvas { display: block; width: 100%; height: 173px; }
.chart-tooltip { position: absolute; z-index: 1; top: 8px; min-width: 155px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: white; pointer-events: none; box-shadow: 0 5px 15px #19302a18; font-size: 11px; }
.chart-tooltip span { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); }
.chart-tooltip b { color: var(--ink); }
.segmented { display: inline-flex; gap: 3px; background: #f1f6f4; border: 1px solid #e7efed; border-radius: 8px; padding: 3px; flex-shrink: 0; }
.segmented button { min-width: 39px; min-height: 24px; white-space: nowrap; padding: 2px 6px; border: 1px solid transparent; border-radius: 5px; color: var(--muted); background: transparent; font-size: 11px; }
.segmented button.is-selected { color: #00685e; font-weight: 700; background: white; box-shadow: 0 1px 2px #20373112; border-color: #e3eeeb; }
.rank-list { padding: 0 15px 7px; }
.rank-row { display: grid; grid-template-columns: 27px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 49px; padding: 6px 3px; border-bottom: 1px solid #edf2ef; }
.rank-row:last-child { border-bottom: 0; }
.rank-index { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: #f0f4f3; color: #526360; font-size: 11px; font-weight: 720; }
.rank-first { background: #e3f3ea; color: #17624d; }
.rank-row > strong { font: 680 14px/1.4 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.rank-person strong, .rank-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-person strong { font-size: 13px; }
.rank-person small { font-size: 10px; color: var(--muted); }
.recent-panel { overflow: hidden; }

.field { display: flex; min-width: 0; flex-direction: column; gap: 5px; color: #435856; font-size: 12px; font-weight: 650; }
.field-row { display: flex; flex-wrap: wrap; gap: 12px; }
.field-row > .field { flex: 1 1 140px; }
.field input, .field select, .field textarea, .toolbar input, .toolbar select, .order-lines input, .order-lines select, .modal-form input:not([type=checkbox]), .modal-form select, .modal-form textarea { min-width: 0; max-width: 100%; min-height: 36px; padding: 6px 9px; border: 1px solid #d7e4e0; border-radius: 8px; background: white; color: var(--ink); font-size: 13px; font-weight: 490; }
.field input::placeholder, .field textarea::placeholder { color: #72817f; }
.field input:focus, .field select:focus, .field textarea:focus, .modal-form input:focus, .modal-form select:focus, .modal-form textarea:focus { border-color: #4aab9d; }
.field textarea, .modal-form textarea { width: 100%; min-height: 72px; resize: vertical; }
.tabs { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.tab { min-height: 34px; padding: 6px 11px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 650; white-space: nowrap; }
.tab:hover { background: #f0f6f4; color: var(--teal-dark); }
.tab.active, .tab.is-active, .tab[aria-selected=true], .tab[aria-current=true] { background: #e8f5f1; color: var(--teal-dark); border-color: #d4eae4; }
.app-dialog { width: min(530px, calc(100vw - 24px)); max-height: calc(100dvh - 28px); border: 1px solid var(--line); padding: 0; border-radius: 15px; color: var(--ink); background: white; box-shadow: 0 18px 70px #0e383935; }
.app-dialog.dialog-wide { width: min(920px, calc(100vw - 24px)); }
.app-dialog::backdrop { background: #102b2c64; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; border-bottom: 1px solid var(--line); padding: 16px 20px 13px; }
.app-dialog[open] > .dialog-head:has([data-action="backDialog"]) { position: sticky; top: 0; z-index: 3; background: white; }
.app-dialog .dialog-head > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.dialog-head h2 { font-size: 19px; line-height: 1.35; padding-top: 3px; }
.dialog-head p { color: var(--muted); margin-top: 4px; font-size: 12px; }
.dialog-header-actions { display: flex; align-items: center; flex: 0 0 auto; gap: 7px; }
.order-print-preview { width: min(860px, calc(100vw - 24px)); max-height: calc(100dvh - 30px); padding: 0; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; color: var(--ink); background: white; box-shadow: 0 18px 70px #0e383935; }
.order-print-preview[open] { display: flex; flex-direction: column; }
.order-print-preview::backdrop { background: #102b2c73; }
.order-print-preview > .dialog-head { flex: 0 0 auto; }
.order-print-preview-tools { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 16px 10px; }
.order-print-preview-tools .btn[aria-pressed=true] { color: var(--teal-dark); background: #e8f5f1; }
.order-print-preview-zoom-label { min-width: 4ch; text-align: center; font-variant-numeric: tabular-nums; font-size: 12px; }
.order-print-preview-body { flex: 1 1 auto; min-height: 0; overflow: auto; scrollbar-gutter: stable; background: #edf3f1; padding: clamp(10px, 2.5vw, 20px); overscroll-behavior: contain; }
.order-print-preview-stage { width: max-content; min-width: 100%; }
.order-print-preview-image { display: block; width: auto; max-width: none; height: auto; margin: 0 auto; background: white; box-shadow: 0 1px 9px #19362e24; }
.order-print-preview-footer { display: flex; justify-content: end; align-items: center; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; padding: 11px 16px; border-top: 1px solid var(--line); }
.order-print-preview-info { flex: 0 0 auto; padding: 9px 16px; color: var(--muted); font-size: 12px; }
.order-print-preview-error { color: #983140; }
.order-print-document > .dialog-head { padding: 13px 16px 10px; }
.order-print-document > .dialog-body { padding: 12px 16px; }
.order-print-document .detail-metrics { gap: 6px; margin-bottom: 8px; }
.order-print-document .detail-metrics > div { padding: 5px 8px; border-radius: 6px; }
.order-print-document .detail-metrics dd { margin-top: 2px; }
.order-print-document .sales-detail-metrics { margin-top: 8px; }
.order-print-document .report-document-meta { gap: 6px 16px; margin-bottom: 11px; }
.order-print-document .data-table th, .order-print-document .data-table td { padding-block: 6px; }
.order-print-document .screen-product-cell { gap: 6px; }
.order-print-document .product-image-thumb { width: 28px; height: 28px; border-radius: 5px; }
.dialog-body { padding: 16px 20px; }
.dialog-body > .field, .dialog-body > .field-row { margin-bottom: 12px; }
.dialog-body > :last-child { margin-bottom: 0; }
.dialog-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 12px 20px; }
.form-error { margin-top: 10px; padding: 8px 10px; border-radius: 6px; background: #fff1f0; color: #a52d35; font-size: 12px; }
.toast { position: fixed; right: 21px; bottom: 20px; z-index: 8; display: flex; align-items: center; gap: 9px; max-width: min(400px, calc(100% - 42px)); padding: 11px 16px; color: #fff; background: #20554e; border-radius: 9px; box-shadow: 0 4px 16px #15332e33; opacity: 0; transform: translateY(7px); pointer-events: none; transition: transform .15s, opacity .15s; }
.toast.is-visible { opacity: 1; transform: none; }
.toast-error { background: #932e3b; }
.workspace-options { display: grid; gap: 8px; }
.workspace-option { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: white; }
.workspace-option:hover, .workspace-option.current { background: #f5faf7; border-color: #cde3dc; }
.workspace-option > span:nth-child(2) { flex: 1; }
.workspace-option strong, .workspace-option small { display: block; }
.workspace-option small { color: var(--muted); font-size: 11px; }
.workspace-option > svg { color: var(--teal); }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.settings-row { display: flex; align-items: center; gap: 10px; }
.settings-row > div { flex: 1; }
.settings-row p, .settings-note { color: var(--muted); font-size: 12px; }
.settings-note { margin-top: 12px; }
.screen-stats { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.screen-stats .stat-card > .muted { display: block; margin-top: 5px; font-weight: 450; }
.screen-tabs { margin: 0 0 13px; }
.screen-toolbar { padding: 0 19px 13px; }
.search-field { position: relative; display: inline-flex; flex: 1 1 180px; max-width: 320px; }
.search-field > span { position: absolute; top: 50%; left: 10px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 34px; width: 100%; }
.screen-date-range, .toolbar-end, .panel-actions, .detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.screen-date-range { font-size: 11px; color: var(--muted); }
.screen-date-range label, .screen-check { display: inline-flex; align-items: center; gap: 5px; }
.toolbar-end { margin-inline-start: auto; }
.screen-check { font-size: 12px; color: var(--muted); cursor: pointer; }
.screen-check input { accent-color: var(--teal); min-height: 0; }
.table-primary { font-weight: 680; }
.table-secondary { color: var(--muted); font-size: 11px; margin-top: 2px; }
.row-action { padding: 3px 7px; min-height: 28px; font-size: 12px; }
.screen-form > .field, .screen-form > .field-row { margin-bottom: 12px; }
.screen-form > :last-child { margin-bottom: 0; }
.field i { color: #a94444; font-style: normal; }
.product-choice-control { position: relative; min-width: 0; }
.product-choice-control input { width: 100%; }
.product-choice-control:has(.product-choice-picker) input { padding-inline-end: 35px; }
.product-choice-picker summary { position: absolute; top: 3px; right: 3px; bottom: 3px; display: grid; place-items: center; width: 29px; border-radius: 6px; color: #49615c; list-style: none; cursor: pointer; }
.product-choice-picker summary::-webkit-details-marker { display: none; }
.product-choice-picker summary:hover, .product-choice-picker[open] summary { color: var(--teal); background: #e9f6f1; }
.product-choice-options { position: absolute; z-index: 2; top: calc(100% + 4px); right: 0; left: 0; display: grid; gap: 2px; max-height: 170px; overflow: auto; padding: 3px; border: 1px solid #cce0db; border-radius: 8px; background: white; box-shadow: 0 7px 21px #163d3529; }
.product-choice-options .btn { justify-content: start; width: 100%; min-height: 31px; padding-inline: 7px; white-space: normal; overflow-wrap: anywhere; text-align: start; }
.screen-fields > .field:has(textarea) { flex-basis: 100%; }
.settlement-fields { margin-bottom: 12px; }
.settlement-fields .field-row > .field { flex-basis: 114px; }
.settlement-hint { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; }
.settlement-hint .form-note { margin: 0; }
.form-section-head, .form-totals { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 12px 0 7px; }
.order-section-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.order-section-title > .field { flex-direction: row; align-items: center; gap: 7px; white-space: nowrap; }
.order-section-title select { min-inline-size: 112px; }
.form-totals { padding: 9px 11px; border-radius: 7px; background: #eff7f4; margin-bottom: 12px; }
.form-totals strong { color: var(--teal-dark); font-size: 17px; }
.form-note { color: var(--muted); font-size: 12px; margin: 8px 0; }
.order-lines { border: 1px solid var(--line); border-radius: 8px; }
.order-lines select { width: 100%; min-width: 160px; }
.order-lines input { width: 99px; }
.order-lines input[name="linePrice"][readonly] { background: #f5f8f7; }
.order-lines th, .order-lines td { padding: 7px 9px; }
.detail-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 8px; margin: 0 0 12px; }
.detail-metrics > div { padding: 8px 10px; border-radius: 8px; background: #f5f8f7; }
.detail-metrics dt { font-size: 11px; color: var(--muted); }
.detail-metrics dd { margin: 3px 0 0; font-weight: 680; }
.sales-detail-metrics { margin-top: 12px; }
.detail-actions { justify-content: end; margin-top: 13px; }
.screen-product-cell, .order-product-field { display: flex; align-items: center; gap: 8px; }
.order-product-field .order-search-choice { flex: 1; min-width: 164px; }
.screen-filter-select { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.data-table .screen-doc-number { padding-inline: 0; margin: 0; }

.product-image-thumb { width: 44px; height: 44px; display: inline-grid; place-items: center; flex: 0 0 auto; padding: 0; overflow: hidden; color: #49736d; background: #edf5f2; border: 1px solid #dfebe7; border-radius: 8px; }
.product-image-thumb.is-compact { width: 34px; height: 34px; border-radius: 7px; }
.product-image-thumb:not(.is-placeholder):hover { border-color: #77b6a8; }
.product-image-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.product-image-editor { margin-bottom: 13px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #f7faf9; }
.product-image-editor-main { display: flex; align-items: center; gap: 10px; }
.product-image-editor .product-image-thumb { width: 72px; height: 72px; }
.product-image-actions, .product-image-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.product-image-actions { align-items: start; flex-direction: column; }
.product-image-picker { cursor: pointer; }
.product-image-status { color: var(--muted); font-size: 11px; }
.product-image-status.is-error { color: #a52d35; }
.product-image-lightbox { width: min(620px, calc(100vw - 22px)); max-height: calc(100dvh - 24px); border: 1px solid var(--line); border-radius: 15px; padding: 0; overflow: hidden; color: var(--ink); background: white; box-shadow: 0 18px 70px #0e383935; }
.product-image-lightbox[open] { display: flex; flex-direction: column; }
.product-image-lightbox::backdrop { background: #102b2c85; }
.product-image-lightbox > .dialog-head { flex: 0 0 auto; }
.product-image-lightbox > .order-print-preview-tools { padding-top: 10px; }
.product-image-preview { background: #f5f8f7; }
.product-image-preview img { border-radius: 6px; }

.order-search-choice, .order-date-search { position: relative; min-width: 0; width: 100%; }
.order-search-choice > input, .order-date-search > input:not(.order-date-native) { width: 100%; padding-inline-end: 31px; }
.order-lines .order-search-choice > input { width: 100%; }
.order-search-chevron, .order-date-trigger { display: grid; place-items: center; position: absolute; top: 0; bottom: 0; right: 7px; color: #49615c; }
.order-search-chevron { pointer-events: none; }
.order-date-trigger { width: 29px; right: 3px; padding: 0; border: 0; border-radius: 6px; background: transparent; }
.order-date-trigger:hover { color: var(--teal); }
.order-date-search .order-date-native { position: absolute; bottom: 0; left: 1px; width: 1px; height: 1px; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
.order-search-menu { position: absolute; z-index: 2; inset: calc(100% + 4px) 0 auto; max-height: 249px; overflow: auto; margin: 0; padding: 3px; border: 1px solid #cce0db; border-radius: 8px; color: var(--ink); background: white; box-shadow: 0 7px 21px #163d3529; font-size: 13px; font-weight: 450; }
.order-search-menu[popover] { position: fixed; inset: auto; }
.order-search-option, .order-search-hint { padding: 7px 9px; border-radius: 5px; text-align: left; overflow-wrap: anywhere; }
.order-search-option { cursor: pointer; }
.order-search-option[aria-selected=true] { color: var(--teal-dark); font-weight: 700; }
.order-search-option:hover, .order-search-option.is-highlighted { background: #e9f6f1; color: var(--teal-dark); }
.order-search-hint { color: var(--muted); font-size: 12px; }

@media (max-width: 1100px) {
  :root { --sidebar-width: 197px; }
  .brand { padding-inline: 17px; }
  .primary-nav, .sidebar-footer { padding-inline: 10px; }
  .page-content { padding-inline: 21px; }
  .topbar { padding-inline: 21px; }
  .dashboard-hero-grid, .dashboard-insight-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 11px; }
  .sales-hero { padding-inline: 17px; }
  .hero-side { min-width: 113px; padding-left: 10px; }
  .hero-side strong { font-size: 17px; }
  .quick-card { gap: 5px; padding-inline: 5px; }
  .quick-card .quick-icon { width: 29px; height: 29px; }
  .metric-grid, .stat-grid { gap: 9px; }
}

@media (max-width: 875px) {
  :root { --sidebar-width: 178px; }
  .brand { gap: 7px; padding-inline: 12px; }
  .brand-name { font-size: 14px; }
  .brand-icon { width: 31px; height: 31px; flex-basis: 31px; }
  .dashboard-hero-grid, .dashboard-insight-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metric-grid, .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-side { padding-left: 18px; min-width: 140px; }
}

@media (max-width: 640px) {
  .sidebar { width: 222px; transform: translateX(-103%); transition: transform .18s; }
  .nav-open .sidebar { transform: none; }
  .nav-open .nav-scrim { display: block; position: fixed; z-index: 4; inset: 0; border: 0; background: #193a4061; }
  .main-layout { margin-inline-start: 0; }
  .nav-toggle { display: inline-grid; margin-left: -7px; }
  .topbar { min-height: 54px; padding-inline: 15px; }
  .topbar-path, .topbar-tools { gap: 7px; }
  .topbar-date, .breadcrumb-root, .breadcrumb-chevron { display: none; }
  .page-content { padding: 17px 12px 25px; }
  .page-head { flex-wrap: wrap; margin-bottom: 14px; }
  .page-head h1 { font-size: 25px; }
  .page-head p { font-size: 12px; }
  .page-actions { flex-shrink: 1; }
  .page-actions .btn-primary { min-height: 35px; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-card { padding-inline: 7px; }
  .sales-hero { min-height: 148px; }
  .hero-value { font-size: clamp(23px, 7vw, 34px); }
  .hero-side { min-width: 96px; padding-left: 9px; }
  .hero-side strong { font-size: 15px; }
  .metric-card, .stat-card { min-height: 96px; }
  .panel-head { padding-inline: 13px; }
  .panel-body { padding-inline: 13px; }
  .screen-toolbar { padding-inline: 13px; }
  .screen-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-legend { padding-left: 13px; }
  .settings-row { flex-wrap: wrap; }
  .settings-row > div { flex-basis: 150px; }
}

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