:root {
  --ink: #17202b;
  --muted: #647181;
  --nav: #263746;
  --nav-hover: #385164;
  --accent: #16624a;
  --accent-dark: #104c3a;
  --paper: #fff;
  --canvas: #edf0f2;
  --line: #c3cbd2;
  --head: #dfe6e3;
  --warning: #9a5a00;
  --danger: #a12727;
  --success: #146c43;
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 12px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: #175f8c; text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { min-height: 40px; padding: 0 11px; display: flex; align-items: center; gap: 11px; position: sticky; top: 0; z-index: 50; color: #fff; background: var(--nav); box-shadow: 0 1px 5px #10212d33; }
.brand { display: flex; align-items: center; gap: 7px; color: white; font-weight: 500; font-size: 13px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { display: block; width: 80px; height: 27px; object-fit: contain; }
.brand strong { font-weight: 500; font-size: 13px; letter-spacing: .5px; }
.nav { display: flex; height: 40px; align-items: stretch; }
.nav-group { position: relative; display: flex; align-items: stretch; }
.nav-category { min-height: 40px; padding: 0 11px; border: 0; border-left: 1px solid #ffffff17; border-radius: 0; background: transparent; color: #e9f0f4; font-size: 12px; font-weight: 400; white-space: nowrap; }
.nav-category:hover, .nav-group.submenu-open .nav-category { background: var(--nav-hover); color: #fff; }
.nav-submenu { display: none; position: absolute; top: 100%; left: 0; z-index: 70; min-width: 142px; padding: 4px 0; background: #fff; border: 1px solid #aeb9c0; box-shadow: 0 4px 12px #10212d33; }
.nav-group:hover .nav-submenu, .nav-group.submenu-open .nav-submenu { display: grid; }
.nav-submenu-right { right: 0; left: auto; }
.nav-submenu a { display: flex; align-items: center; min-height: 33px; padding: 6px 13px; color: #243a46; font-size: 12.5px; font-weight: 400; white-space: nowrap; }
.nav-submenu a:hover, .nav-submenu a:focus { background: #e7efec; color: #104c3a; text-decoration: none; outline: 0; }
.pwa-install-button { margin-left: auto; min-height: 27px; padding: 3px 9px; color: #fff; border-color: #7fa28f; background: #315f49; font-weight: 800; }
.pwa-install-button:hover { color: #fff; background: #244d3a; }
.pwa-install-button:not([hidden]) + .today { margin-left: 0; }
.today { margin-left: auto; color: #c7d1d8; font-variant-numeric: tabular-nums; }
.user-account { display: flex; align-items: center; gap: 7px; color: #dce7e1; font-size: 11px; white-space: nowrap; }
.user-account a { color: #fff; }
.user-account form { margin: 0; }
.user-account button { min-height: 25px; padding: 2px 7px; border-color: #7fa28f; color: #fff; background: #315f49; font-size: 11px; }
.user-account button:hover { background: #244d3a; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: #eef3f1; }
.login-card { width: min(380px, 100%); padding: 28px; border: 1px solid #cad6d0; border-radius: 10px; background: #fff; box-shadow: 0 16px 42px #10251b1c; }
.login-brand { display: block; width: 132px; margin: 0 auto 22px; }
.login-card h1 { margin: 0 0 6px; color: var(--nav); text-align: center; font-size: 22px; }
.login-description { margin: 0 0 20px; color: var(--muted); text-align: center; }
.login-form { display: grid; gap: 14px; }
.login-form label { display: grid; gap: 5px; color: #33483e; font-weight: 800; }
.login-form input { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #9dafA5; border-radius: 4px; font: inherit; }
.login-form button { min-height: 42px; margin-top: 2px; color: #fff; border-color: var(--accent-dark); background: var(--accent); font-size: 14px; }
.login-error { margin: 0; padding: 9px 10px; color: #8b1d1d; border: 1px solid #ddb0b0; border-radius: 4px; background: #fff0f0; }
.nav-toggle { display: none; }
main { padding: 7px 9px 12px; max-width: none; margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 5px; min-height: 28px; }
.page-head h1 { margin: 0; font-size: 17px; letter-spacing: -.2px; }
.page-head p { display: none; }
.actions { display: flex; gap: 4px; flex-wrap: wrap; }
.button, button { min-height: 27px; padding: 4px 8px; border: 1px solid #8da096; border-radius: 2px; background: #f8faf9; color: #244237; font: inherit; font-weight: 750; white-space: nowrap; cursor: pointer; }
.button:hover, button:hover { background: #e8f1ed; text-decoration: none; }
.button.primary, button.primary { background: var(--accent); color: #fff; border-color: var(--accent-dark); }
.button.primary:hover, button.primary:hover { background: var(--accent-dark); }
.button.danger-button, button.danger-button, .danger-button { color: #fff; border-color: #7f1f1f; background: var(--danger); }
.button.danger-button:hover, button.danger-button:hover, .danger-button:hover { color: #fff; background: #7f1f1f; }
.button.small, button.small { min-height: 23px; padding: 2px 6px; font-size: 11px; }
.messages { margin: 0 0 6px; padding: 0; list-style: none; }
.messages li { padding: 6px 9px; margin-bottom: 3px; background: #e7f2f7; border-left: 3px solid #4682a1; }
.messages .success { background: #e4f3ea; border-color: var(--success); }
.messages .warning { background: #fff4d8; border-color: var(--warning); }
.messages .error { background: #fae6e6; border-color: var(--danger); }
.panel { background: var(--paper); border: 1px solid var(--line); box-shadow: 0 1px 2px #17202b0d; }
.panel-title { margin: 0; padding: 5px 7px; font-size: 12px; background: var(--head); border-bottom: 1px solid var(--line); }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(140px, 1fr)); margin-bottom: 12px; border: 1px solid #9eaaa4; background: white; }
.metric { padding: 12px 14px; border-right: 1px solid var(--line); }
.metric:last-child { border: 0; }
.metric span { color: var(--muted); }
.metric strong { display: block; margin-top: 3px; font-size: 24px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.dashboard-grid { display: grid; grid-template-columns: minmax(400px, 1fr) minmax(500px, 1.4fr); gap: 12px; align-items: start; }
.dashboard-empty { min-height: calc(100vh - 76px); }
.operations-dashboard { display: grid; gap: 10px; max-width: 1760px; margin: 0 auto; }
.dashboard-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; padding: 9px 13px; border: 1px solid var(--line); background: #f8fafb; }
.dashboard-hero h1 { margin: 0; font-size: 20px; font-weight: 650; }
.dashboard-hero p { margin: 3px 0 0; color: var(--muted); }
.dashboard-month-form { display: flex; align-items: center; gap: 6px; }
.dashboard-month-form input { width: 125px; }
.dashboard-sales-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 39px; padding: 7px 10px; border-bottom: 1px solid var(--line); background: #fff; }
.dashboard-sales-quick, .dashboard-sales-period { display: flex; align-items: center; gap: 5px; }
.dashboard-sales-quick > span { margin-right: 2px; color: var(--muted); font-weight: 700; }
.dashboard-sales-quick a { display: inline-flex; align-items: center; min-height: 25px; padding: 3px 8px; color: #2e3b45; border: 1px solid #aeb8c4; background: #f7f8fa; font-weight: 700; text-decoration: none; }
.dashboard-sales-quick a.active { color: #153f63; border-color: #2f5f8f; background: #dce9f7; }
.dashboard-sales-period input[type="month"] { width: 125px; min-height: 26px; height: 26px; padding: 2px 5px; }
.dashboard-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: -4px; }
.dashboard-section-head > div { display: flex; align-items: baseline; gap: 8px; }
.dashboard-section-head h2 { margin: 0; font-size: 15px; }
.dashboard-section-head span { color: var(--muted); }
.dashboard-fx-grid { display: grid; grid-template-columns: repeat(4, minmax(210px, 1fr)); gap: 8px; }
.dashboard-fx-card { position: relative; min-height: 218px; padding: 15px 17px 11px; border: 1px solid #d0d8de; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px #14232d0a; overflow: hidden; cursor: default; transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease; }
.dashboard-fx-card:hover { z-index: 3; transform: translateY(-3px); border-color: #83cdb1; box-shadow: 0 12px 28px #152b3a24; }
.dashboard-fx-title { display: flex; align-items: baseline; justify-content: space-between; }
.dashboard-fx-title span { font-size: 14px; font-weight: 650; }
.dashboard-fx-title small { color: #71808b; letter-spacing: .5px; }
.dashboard-fx-card > strong { display: block; margin-top: 12px; font-size: 24px; line-height: 1; font-weight: 650; font-variant-numeric: tabular-nums; }
.dashboard-fx-card > strong em { margin-left: 5px; color: #66747d; font-size: 11px; font-style: normal; font-weight: 400; }
.dashboard-fx-change { margin-top: 8px; color: #4e5c66; font-variant-numeric: tabular-nums; }
.dashboard-fx-card.fx-up .dashboard-fx-change { color: #c83737; }
.dashboard-fx-card.fx-down .dashboard-fx-change { color: #2667b2; }
.dashboard-fx-date { display: block; margin-top: 7px; color: #7a858d; }
.dashboard-fx-chart { display: block; width: 100%; height: 82px; margin-top: 8px; overflow: visible; }
.dashboard-fx-chart polygon { fill: #84dcb826; }
.dashboard-fx-chart polyline { fill: none; stroke: #78d9b3; stroke-width: 1.8; vector-effect: non-scaling-stroke; transition: stroke 150ms ease, stroke-width 150ms ease; }
.dashboard-fx-card:hover .dashboard-fx-chart polyline { stroke: #24b67e; stroke-width: 2.4; }
.dashboard-fx-hover { position: absolute; right: 10px; bottom: 9px; left: 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; padding: 8px; border: 1px solid #c8d5df; border-radius: 7px; background: #fffffff7; box-shadow: 0 8px 18px #0f172a1f; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 150ms ease, transform 150ms ease; }
.dashboard-fx-card:hover .dashboard-fx-hover { opacity: 1; transform: translateY(0); }
.dashboard-fx-hover span, .dashboard-fx-hover strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-fx-hover span { color: #657282; font-size: 9px; }
.dashboard-fx-hover strong { margin-top: 2px; font-size: 10px; font-variant-numeric: tabular-nums; }
.dashboard-sales-summary { display: flex; align-items: baseline; gap: 9px; margin-bottom: -4px; }
.dashboard-sales-summary span { color: #50606a; font-weight: 600; }
.dashboard-sales-summary strong { font-size: 18px; color: #163f5d; }
.dashboard-sales-summary small { color: var(--muted); }
.dashboard-sales-metrics { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); border: 1px solid #9fabb5; border-right: 0; background: #fff; }
.dashboard-sales-metrics > div { min-height: 76px; padding: 8px 11px; border-right: 1px solid #9fabb5; }
.dashboard-sales-metrics span, .dashboard-sales-metrics small { display: block; }
.dashboard-sales-metrics span { color: #5b6975; font-weight: 600; }
.dashboard-sales-metrics strong { display: block; margin-top: 4px; font-size: 23px; line-height: 1; font-variant-numeric: tabular-nums; }
.dashboard-sales-metrics small { margin-top: 5px; color: var(--muted); }
.dashboard-chart-grid { display: grid; grid-template-columns: minmax(650px, 1.35fr) minmax(420px, .8fr); gap: 9px; }
.dashboard-card { min-width: 0; border: 1px solid var(--line); background: #fff; }
#sales-chart-panel { overflow: hidden; }
.dashboard-card-title { display: flex; align-items: baseline; justify-content: space-between; min-height: 35px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: linear-gradient(#eef2f1, #dfe6e3); }
.dashboard-card-title h2 { margin: 0; font-size: 14px; font-weight: 600; }
.dashboard-card-title span { color: var(--muted); font-size: 11px; }
.dashboard-bar-chart-scroll { width: 100%; min-width: 0; overflow-x: auto; overflow-y: hidden; }
.dashboard-bar-chart { display: grid; grid-template-columns: repeat(12, minmax(46px, 1fr)); gap: 9px; align-items: end; width: 100%; height: 300px; padding: 14px 14px 10px; }
.dashboard-bar-column { position: relative; display: grid; grid-template-rows: 1fr 22px 24px; align-self: stretch; min-width: 42px; color: inherit; text-decoration: none; }
.dashboard-bar-column:hover { text-decoration: none; }
.dashboard-bar-value { padding-top: 4px; overflow: hidden; color: #153f63; font-size: 11px; font-weight: 750; text-align: center; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dashboard-bar-track { display: flex; align-items: flex-end; min-height: 205px; border-bottom: 1px solid #aeb9c2; background: repeating-linear-gradient(to top, #f8fafb 0, #f8fafb 49px, #e5e9ec 50px); }
.dashboard-bar-stack { display: flex; flex-direction: column-reverse; width: 74%; min-height: 2px; margin: 0 auto; overflow: hidden; border-radius: 3px 3px 0 0; transition: height .2s ease, filter .15s ease; }
.dashboard-bar-stack b { display: block; min-height: 1px; transition: opacity 150ms ease, filter 150ms ease; }
.dashboard-bar-column:hover .dashboard-bar-stack { filter: brightness(1.06) saturate(1.12); }
.dashboard-bar-label { padding-top: 5px; text-align: center; font-variant-numeric: tabular-nums; }
.dashboard-bar-column.selected .dashboard-bar-label { color: #1f6b47; font-weight: 750; }
.dashboard-bar-tooltip { position: absolute; bottom: 46px; left: 50%; z-index: 20; display: none; width: 235px; padding: 8px 9px; color: #24333d; border: 1px solid #53616c; background: #fffffff5; box-shadow: 0 9px 25px #14232d2e; transform: translateX(-50%); pointer-events: none; }
.dashboard-bar-column:first-child .dashboard-bar-tooltip { left: 0; transform: none; }
.dashboard-bar-column:last-child .dashboard-bar-tooltip { right: 0; left: auto; transform: none; }
.dashboard-bar-column:hover .dashboard-bar-tooltip { display: grid; gap: 3px; }
.dashboard-bar-tooltip strong { padding-bottom: 4px; border-bottom: 1px solid #dce2e6; }
.dashboard-bar-tooltip em { font-style: normal; font-weight: 650; }
.dashboard-bar-tooltip small { display: grid; grid-template-columns: 9px 1fr; align-items: center; gap: 5px; }
.dashboard-bar-tooltip small i { width: 8px; height: 8px; }
.dashboard-donut-layout { display: grid; grid-template-columns: minmax(190px, .9fr) minmax(200px, 1fr); align-items: center; gap: 18px; min-height: 300px; padding: 20px; }
.dashboard-donut { position: relative; display: grid; place-items: center; width: min(225px, 100%); aspect-ratio: 1; margin: 0 auto; }
.dashboard-donut svg { width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.dashboard-donut-bg, .dashboard-donut-segment { fill: none; stroke-width: 10.5; }
.dashboard-donut-bg { stroke: #e8edf2; }
.dashboard-donut-segment { cursor: pointer; transform-origin: 21px 21px; transition: opacity 150ms ease, stroke-width 150ms ease, filter 150ms ease; }
.dashboard-donut > div { position: absolute; inset: 31%; display: grid; place-items: center; padding: 8px; border-radius: 50%; background: #fff; text-align: center; }
.dashboard-donut strong { max-width: 100%; overflow: hidden; color: #283c4b; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-donut span { color: var(--muted); font-size: 10px; }
.dashboard-donut-legend { display: grid; gap: 13px; }
.dashboard-donut-legend > div { display: grid; grid-template-columns: 11px 1fr auto; gap: 5px 7px; align-items: center; padding: 5px 6px; border-radius: 4px; cursor: pointer; transition: opacity 150ms ease, background 150ms ease, transform 150ms ease; }
.dashboard-donut svg:focus, .dashboard-donut-segment:focus, .dashboard-donut-legend > div:focus { outline: none; }
.dashboard-donut-legend > div:focus-visible { box-shadow: 0 0 0 2px #5e9b8080; }
.dashboard-donut-legend i { width: 11px; height: 11px; border-radius: 2px; }
.dashboard-donut-legend span { font-weight: 650; }
.dashboard-donut-legend strong { font-size: 14px; }
.dashboard-donut-legend small { grid-column: 2 / 4; color: var(--muted); font-variant-numeric: tabular-nums; }
.operations-dashboard.has-sales-highlight [data-sales-category] { opacity: .2; }
.operations-dashboard.has-sales-highlight [data-sales-category].is-active { opacity: 1; }
.operations-dashboard.has-sales-highlight .dashboard-donut-segment.is-active { stroke-width: 12; filter: brightness(1.03) saturate(1.15); }
.operations-dashboard.has-sales-highlight .dashboard-bar-stack b.is-active { filter: brightness(1.08) saturate(1.15); }
.dashboard-donut-legend > div.is-active { background: #eef5f2; transform: translateX(3px); }
.dashboard-ranking-grid { display: grid; grid-template-columns: repeat(2, minmax(500px, 1fr)); gap: 9px; align-items: start; }
.dashboard-ranking-wrap { overflow-x: auto; }
.dashboard-ranking-table thead { position: sticky; top: 0; z-index: 2; }
.dashboard-ranking-table .rank { width: 48px; text-align: center; color: #607080; }
.dashboard-ranking-table td { height: 28px; }
.stack { display: grid; gap: 12px; }
.filters { display: flex; align-items: end; gap: 5px; flex-wrap: wrap; padding: 5px 6px; margin-bottom: 5px; background: #fffdea; border: 1px solid #d4cf9e; }
.advanced-filters { display: grid; gap: 4px; }
.filter-grid { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 3px 6px; width: 100%; }
.filter-grid .field { display: grid; grid-template-columns: 60px minmax(0, 1fr); align-items: center; gap: 3px; min-width: 0; }
.filter-grid .field label { line-height: 1.15; }
.filter-grid input, .filter-grid select { min-height: 24px; height: 24px; padding: 2px 5px; }
.product-picker-control { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; min-width: 0; }
.filter-grid .product-picker-open { width: auto; min-height: 24px; height: 24px; padding: 2px 7px; white-space: nowrap; }
.product-picker-open.has-selection { color: #fff; border-color: var(--accent-dark); background: var(--accent); }
.filter-grid .date-range-field { grid-column: span 2; }
.date-range-inputs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 5px; min-width: 0; }
.date-range-separator { color: #58645f; font-weight: 750; text-align: center; }
.filter-actions { display: flex; justify-content: flex-end; align-items: center; gap: 5px; padding-top: 4px; border-top: 1px solid #ded9ac; }
.result-count { margin-right: auto; color: #56645e; font-weight: 700; font-variant-numeric: tabular-nums; }
.field { display: grid; gap: 2px; min-width: 110px; }
.field.grow { flex: 1 1 220px; }
label, .field-label { font-weight: 700; color: #35433e; }
input, select, textarea { width: 100%; min-height: 27px; padding: 3px 6px; border: 1px solid #9ea9b2; border-radius: 2px; background: white; color: var(--ink); font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid #5e9b8080; border-color: var(--accent); }
input[type="checkbox"] { width: auto; min-height: auto; }
.check-field { display: flex; min-height: 27px; align-items: center; gap: 4px; }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--line); }
.table-wrap.query-result-wrap { overflow: auto; }
.query-summary-footer { position: sticky; bottom: 0; z-index: 6; box-shadow: 0 -2px 5px #26352d24; }
.query-summary-footer td, .query-summary-footer th { height: 28px; color: #20362a; border-top: 2px solid #76966f; background: #dcebd0 !important; font-weight: 800; font-variant-numeric: tabular-nums; }
.query-summary-footer .summary-label { min-width: 92px; color: #244834; white-space: nowrap; }
.excel-export-button { color: #244e2f; border-color: #789779; background: #edf6e8; font-weight: 800; }
.excel-export-button::before { content: "X"; display: inline-grid; place-items: center; width: 15px; height: 15px; margin-right: 4px; color: #fff; background: #2d7d46; font-size: 10px; font-weight: 900; }
.excel-export-button:disabled { opacity: .65; cursor: wait; }
table { width: 100%; border-collapse: collapse; font-size: 12px; line-height: 1.1; }
th, td { height: 24px; padding: 2px 5px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; }
th { height: 22px; padding-top: 2px; padding-bottom: 2px; background: linear-gradient(#edf1ef, #d7dfdb); text-align: center; color: #27342f; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #f8faf9; }
tbody tr:hover { background: #fff8d8; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.negative { color: var(--danger); font-weight: 750; }
.low { color: var(--danger); font-weight: 800; background: #fff0f0; }
.muted { color: var(--muted); }
.empty { padding: 24px !important; text-align: center; color: var(--muted); }
.badge { display: inline-block; padding: 1px 5px; border-radius: 8px; background: #e3ebe7; color: #34433c; font-size: 10px; font-weight: 750; }
.badge.sale { background: #e1edf7; color: #1b547e; }
.badge.receipt, .badge.return { background: #e1f2e8; color: #17603d; }
.badge.shipment { background: #f5e8df; color: #80431e; }
.badge.adjustment { background: #eee7f7; color: #65428a; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 6px; }
.infinite-pagination { color: var(--muted); font-weight: 700; }
.infinite-pagination.auto-load-enabled [data-infinite-next] { display: none; }
.form-panel { max-width: 1050px; padding: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 8px; }
.form-grid .wide { grid-column: 1 / -1; }
.errorlist { color: var(--danger); margin: 2px 0 0; padding-left: 18px; font-weight: 650; }
.nonfield { padding: 8px 10px; background: #fae6e6; border-left: 4px solid var(--danger); }
.size-entry { grid-column: 1 / -1; padding-top: 8px; border-top: 1px solid var(--line); }
.size-grid { display: grid; grid-template-columns: repeat(9, minmax(65px, 1fr)); gap: 4px; margin-top: 3px; }
.size-input label { display: block; text-align: center; padding: 3px; background: var(--head); border: 1px solid var(--line); border-bottom: 0; }
.size-input input { text-align: right; }
.help { color: var(--muted); font-size: 12px; }
.hidden { display: none !important; }
.product-picker-dialog { width: min(760px, calc(100vw - 24px)); height: min(620px, calc(100vh - 24px)); max-height: none; padding: 0; border: 1px solid #73828c; border-radius: 3px; background: #f5f7f8; box-shadow: 0 10px 32px #10212d55; }
.multi-filter-source { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; opacity: 0; pointer-events: none; }
.multi-filter-control { display: grid; grid-template-columns: minmax(0, 1fr); gap: 3px; min-width: 0; }
.multi-filter-control input { min-width: 0; cursor: text; text-overflow: ellipsis; }
.multi-filter-control input.has-selection { color: #174f3a; border-color: #6c927d; background: #f1f8f4; font-weight: 700; }
.multi-filter-dialog { width: min(760px, calc(100vw - 24px)); height: min(620px, calc(100vh - 24px)); max-height: none; padding: 0; border: 1px solid #73828c; border-radius: 3px; background: #f5f7f8; box-shadow: 0 12px 34px #10212d55; }
.multi-filter-dialog::backdrop { background: #10212d66; }
.multi-filter-dialog[open] { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); }
.multi-filter-head { display: flex; align-items: center; justify-content: space-between; min-height: 42px; padding: 6px 10px; color: #fff; background: var(--nav); }
.multi-filter-head h2 { margin: 0; font-size: 15px; }
.multi-filter-head button { min-width: 30px; color: #fff; border-color: #ffffff55; background: transparent; }
.multi-filter-search-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 8px 9px; border-bottom: 1px solid var(--line); background: #eef2f4; }
.multi-filter-search-row input { height: 28px; }
.multi-filter-meta { display: flex; align-items: center; gap: 5px; min-height: 39px; padding: 5px 9px; color: var(--muted); border-bottom: 1px solid var(--line); background: #fff; }
.multi-filter-meta label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-weight: 700; }
.multi-filter-meta label[hidden] { display: none; }
.multi-filter-meta label select { min-width: 94px; height: 28px; }
.multi-filter-meta span { margin: 0 auto 0 4px; font-weight: 700; }
.multi-filter-table-wrap { min-height: 0; overflow: auto; background: #fff; }
.multi-filter-table { min-width: 560px; }
.multi-filter-table, .product-picker-table, .manual-product-table { border: 1px solid var(--line); }
.multi-filter-table tbody tr:last-child td,
.product-picker-table tbody tr:last-child td,
.manual-product-table tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.multi-filter-table tr > :last-child,
.product-picker-table tr > :last-child,
.manual-product-table tr > :last-child { border-right: 1px solid var(--line); }
.multi-filter-table thead { position: sticky; top: 0; z-index: 2; }
.multi-filter-table th, .multi-filter-table td { height: 27px; padding: 2px 7px; }
.multi-filter-table .multi-filter-check-column { width: 58px; }
.multi-filter-table th:nth-child(2) { width: 210px; }
.multi-filter-option { cursor: pointer; }
.multi-filter-option input { width: auto; min-height: auto; }
.multi-filter-empty td { height: 80px; color: var(--muted); text-align: center; }
.product-picker-dialog[open] { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); }
.product-picker-dialog::backdrop { background: #17202b66; }
.product-picker-head { display: flex; align-items: center; padding: 6px 8px; color: #fff; background: var(--nav); }
.product-picker-head h2 { margin: 0; font-size: 14px; }
.product-picker-head .icon-button { width: 25px; min-height: 24px; margin-left: auto; padding: 0; border-color: #ffffff55; color: #fff; background: transparent; font-size: 18px; line-height: 1; }
.product-picker-search { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; align-items: center; gap: 6px; padding: 8px; border-bottom: 1px solid var(--line); background: #eef2f4; }
.product-picker-search input { height: 28px; }
.product-picker-toolbar { display: flex; align-items: center; gap: 5px; padding: 6px 8px; background: #fff; border-bottom: 1px solid var(--line); }
.product-picker-toolbar #product-picker-status { margin: 0 auto 0 4px; color: var(--muted); font-weight: 700; }
.product-picker-table-wrap { min-height: 0; overflow: auto; background: #fff; }
.product-picker-table { min-width: 620px; }
.product-picker-table thead { position: sticky; top: 0; z-index: 1; }
.product-picker-table .picker-check-column { width: 52px; }
.product-picker-table th:nth-child(2) { width: 175px; }
.product-picker-table th:nth-child(4) { width: 95px; }
.product-picker-table th:nth-child(5) { width: 145px; }
.product-picker-table tbody tr { cursor: pointer; }
.product-picker-table input[type="checkbox"] { pointer-events: auto; }
.product-picker-table .inactive-product { color: var(--muted); background: #f0f1f1; }
.detail-grid { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); margin-bottom: 7px; background: white; border: 1px solid var(--line); }
.detail-item { min-height: 45px; padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-item span { display: block; color: var(--muted); font-size: 11px; }
.detail-item strong { display: block; margin-top: 2px; font-size: 12px; }
.inventory-table th, .inventory-table td { text-align: center; }
.inventory-table .product-cell { text-align: left; min-width: 150px; }
.size-head small { display: block; color: #765; font-weight: 600; }
.stock-lines { display: grid; gap: 1px; }
.stock-line { display: grid; grid-template-columns: 17px 1fr; align-items: center; min-height: 17px; }
.stock-line b { color: var(--muted); font-size: 10px; }
.stock-line.low-value { color: var(--danger); }
.two-actions { display: flex; gap: 4px; }
.channel-list { display: grid; gap: 6px; }
.channel-card { display: grid; grid-template-columns: 220px 1fr auto; align-items: center; gap: 9px; padding: 8px; }
.channel-card h2 { margin: 0 0 2px; font-size: 13px; }
.channel-form { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; align-items: end; gap: 8px; }
.channel-form p { margin: 0; }
.channel-import { margin: 0; }
.stock-filter-body { display: grid; grid-template-columns: minmax(720px, 1fr) minmax(280px, .42fr); gap: 10px; align-items: start; }
.filter-grid.stock-filter-grid { grid-template-columns: repeat(4, minmax(180px, 1fr)); }
.stock-filter-options { display: grid; gap: 5px; align-content: start; min-height: 51px; padding: 3px 8px; border-left: 1px solid #d4cf9e; }
.stock-filter-options label { display: flex; align-items: center; gap: 5px; min-height: 20px; white-space: nowrap; }
.stock-filter-options input { width: auto; min-height: auto; margin: 0; }
.filter-grid .unavailable select { color: #7a8580; background: #eef0ed; cursor: not-allowed; }
.warehouse-table-wrap { overflow-x: auto; }
.warehouse-table { width: max-content; min-width: 100%; }
.warehouse-table thead { position: sticky; top: 0; z-index: 5; }
.warehouse-table thead th,
.warehouse-table .group-head th,
.warehouse-table thead tr:nth-child(2) th { background: linear-gradient(#edf1ef, #d7dfdb) !important; border-bottom-color: var(--line); }
.warehouse-table .group-head th { height: 21px; font-weight: 700; }
.warehouse-table .sku-cell { min-width: 145px; }
.warehouse-table .name-cell { min-width: 140px; }
.warehouse-table th:nth-child(4), .warehouse-table td:nth-child(4) { min-width: 100px; }
.warehouse-table th:nth-child(5), .warehouse-table td:nth-child(5),
.warehouse-table th:nth-child(6), .warehouse-table td:nth-child(6) { min-width: 105px; }
.warehouse-table .size-column, .warehouse-table .size-value { width: 36px; min-width: 36px; padding-left: 3px; padding-right: 3px; }
.warehouse-table .stock-total { min-width: 64px; font-weight: 750; }
.warehouse-table th:nth-last-child(-n+2), .warehouse-table td:nth-last-child(-n+2) { min-width: 135px; }
.receipt-filter-grid { grid-template-columns: repeat(6, minmax(180px, 1fr)); }
.receipt-history-table { width: max-content; min-width: 100%; }
.receipt-history-table thead { position: sticky; top: 0; z-index: 5; }
.receipt-history-table thead th,
.receipt-history-table .group-head th,
.receipt-history-table thead tr:nth-child(2) th { background: linear-gradient(#edf1ef, #d7dfdb) !important; border-bottom-color: var(--line); }
.receipt-history-table .group-head th { height: 21px; font-weight: 700; }
.receipt-history-table .sku-cell { min-width: 135px; }
.receipt-history-table .name-cell { min-width: 130px; }
.receipt-history-table .size-column,
.receipt-history-table .size-value { width: 36px; min-width: 36px; padding-left: 3px; padding-right: 3px; }
.receipt-history-table .stock-total { min-width: 52px; font-weight: 750; }
.receipt-history-table th:nth-child(4), .receipt-history-table td:nth-child(4) { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.receipt-history-table th:nth-child(12), .receipt-history-table td:nth-child(12),
.receipt-history-table th:nth-child(13), .receipt-history-table td:nth-child(13),
.receipt-history-table th:nth-child(14), .receipt-history-table td:nth-child(14) { min-width: 90px; }
.receipt-upload-panel { max-width: 720px; }
.receipt-upload-guide, .receipt-preview-help { margin: 0 0 10px; padding: 8px 10px; background: #fffdea; border-left: 3px solid #b08b24; }
.receipt-preview-summary { display: flex; flex-wrap: wrap; gap: 5px 16px; margin-bottom: 5px; padding: 7px 9px; background: #fff; border: 1px solid var(--line); }
.positive { color: var(--success); font-weight: 750; }
.receipt-import-preview-wrap { max-height: calc(100vh - 265px); }
.receipt-import-preview-table { width: max-content; min-width: 100%; }
.receipt-import-preview-table thead { position: sticky; top: 0; z-index: 5; }
.receipt-import-preview-table input { min-width: 74px; height: 23px; min-height: 23px; padding: 1px 4px; }
.receipt-import-preview-table input[data-field="sku"] { min-width: 130px; }
.receipt-import-preview-table input[data-field="product_name"] { min-width: 145px; }
.receipt-import-preview-table input[data-field="receipt_partner"], .receipt-import-preview-table input[data-field="warehouse_name"] { min-width: 95px; }
.receipt-import-preview-table input[data-field="pre_cost"] { min-width: 90px; }
.receipt-import-preview-table .preview-size-input { width: 48px; min-width: 48px; }
.receipt-import-preview-table .preview-status-cell { min-width: 190px; max-width: 260px; white-space: normal; }
.receipt-import-preview-table .preview-status-cell .button { display: inline-block; margin-top: 2px; }
.receipt-import-preview-table .preview-issue-row { background: #fff0f0; }
.receipt-preview-actions { justify-content: flex-end; padding: 6px; background: #fff; border: 1px solid var(--line); border-top: 0; }
.receipt-confirm-bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; position: sticky; bottom: 0; z-index: 20; padding: 8px; background: #f8faf9; border: 1px solid #8da096; box-shadow: 0 -2px 8px #17202b22; }
.legacy-history-wrap { max-height: calc(100vh - 175px); }
.legacy-history-table { width: max-content; min-width: 100%; }
.legacy-history-table thead { position: sticky; top: 0; z-index: 5; }
.legacy-history-table thead th, .legacy-history-table .group-head th { background: linear-gradient(#edf1ef, #d7dfdb) !important; }
.legacy-history-table .group-head th { height: 21px; }
.legacy-history-table .sku-cell { min-width: 135px; }
.legacy-history-table .name-cell { min-width: 125px; }
.legacy-history-table .size-column, .legacy-history-table .size-value { width: 48px; min-width: 48px; padding-left: 3px; padding-right: 3px; }
.legacy-history-table .stock-total { font-weight: 800; }
.legacy-history-table .history-return-row, .legacy-history-table .history-return-row a { color: #d02020; }
.sales-report-filters { align-items: center; }
.sales-report-filters .field { grid-template-columns: 48px minmax(230px, auto); align-items: center; }
.sales-report-filters .field + .field { grid-template-columns: 36px minmax(180px, 260px); }
.sales-basis-note { margin: 0 0 5px; padding: 6px 8px; color: #46554f; border-left: 3px solid var(--accent); background: #edf6f2; }
.sales-report-metrics { display: grid; grid-template-columns: repeat(3, minmax(160px, 260px)); margin-bottom: 6px; border: 1px solid var(--line); background: #fff; }
.sales-report-metrics > div { padding: 7px 10px; border-right: 1px solid var(--line); }
.sales-report-metrics > div:last-child { border-right: 0; }
.sales-report-metrics span { display: block; color: var(--muted); font-size: 11px; }
.sales-report-metrics strong { display: block; margin-top: 2px; font-size: 17px; font-variant-numeric: tabular-nums; }
.sales-report-grid { display: grid; grid-template-columns: minmax(590px, 1.15fr) minmax(380px, .85fr); gap: 6px; align-items: start; }
.sales-report-grid .sales-report-main { grid-row: span 2; }
.sales-report-grid .table-wrap { max-height: calc(100vh - 230px); }
.sales-report-grid .panel-title { background: #dbeace; }
.sales-summary-table thead { position: sticky; top: 0; z-index: 2; }
.sales-summary-table tfoot { position: sticky; bottom: 0; background: #e7f2dd; }
.sales-summary-table tfoot th { background: #e7f2dd; }
.sales-summary-table .amount-cell { font-weight: 800; color: #154f74; }
.sales-summary-table .saturday td:first-child, .sales-summary-table .saturday td:nth-child(2) { color: #185eb5; }
.sales-summary-table .sunday td:first-child, .sales-summary-table .sunday td:nth-child(2) { color: var(--danger); }
.daily-sales-grid { display: grid; grid-template-columns: minmax(360px, .72fr) minmax(410px, .9fr) minmax(620px, 1.25fr); gap: 6px; align-items: start; }
.daily-sales-grid .table-wrap { height: calc(100vh - 165px); overflow: auto; }
.daily-sales-grid .panel-title { background: #dbeace; }
.daily-sales-grid thead { position: sticky; top: 0; z-index: 2; }
.daily-sales-grid tfoot { position: sticky; bottom: 0; z-index: 2; }
.daily-sales-grid tfoot th { background: #e7f2dd; }
.report-clickable-row { cursor: pointer; }
.report-clickable-row:hover td { background: #edf5e7; }
.report-clickable-row:focus { outline: 2px solid #1884d8; outline-offset: -2px; }
.daily-sales-grid .selection-summary { height: 27px; padding: 5px 7px; color: #405148; border-bottom: 1px solid var(--line); background: #f7faf5; font-weight: 750; text-align: right; }
.selected-report-row, .selected-report-row:nth-child(even), .selected-report-row:hover { background: #fff2ad; }
.selected-report-row td:first-child { box-shadow: inset 3px 0 var(--accent); }
.history-tabs { display: flex; gap: 4px; margin-bottom: 5px; }
.history-delete-guide { margin: 0 0 5px; padding: 7px 9px; border-left: 3px solid #b08b24; background: #fffdea; }
.import-history-table th:nth-child(2), .import-history-table td:nth-child(2) { min-width: 260px; }
.import-history-summary { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 5px; padding: 8px 10px; border: 1px solid var(--line); background: #fff; }
.import-history-actions { display: flex; justify-content: flex-end; gap: 5px; margin-bottom: 5px; }
.import-history-detail-wrap { max-height: calc(100vh - 185px); }
.import-history-detail-table th:first-child, .import-history-detail-table td:first-child { width: 42px; text-align: center; }
.registration-layout { display: grid; grid-template-columns: minmax(520px, 1fr) minmax(360px, .65fr); gap: 8px; align-items: start; }
.registration-input-panel { max-width: none; }
.registration-input-panel textarea { min-height: 230px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.registration-or { display: flex; align-items: center; gap: 8px; margin: 9px 0; color: var(--muted); }
.registration-or::before, .registration-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.registration-submit { justify-content: flex-end; margin-top: 8px; }
.registration-guide { padding-bottom: 8px; }
.registration-guide > p, .registration-guide > textarea, .registration-guide > button, .registration-field-list { margin-left: 8px; margin-right: 8px; }
.registration-guide textarea { width: calc(100% - 16px); font: 11px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace; }
.registration-field-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.registration-field-list span { padding: 2px 5px; border: 1px solid var(--line); background: #f4f7f5; }
.registration-preview-summary { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 5px; padding: 7px 9px; border: 1px solid var(--line); background: #fff; }
.registration-preview-wrap { max-height: calc(100vh - 220px); }
.registration-preview-table { width: max-content; min-width: 100%; }
.registration-preview-table thead { position: sticky; top: 0; z-index: 5; }
.registration-preview-table input[data-key] { width: 90px; min-width: 90px; height: 23px; min-height: 23px; padding: 1px 3px; }
.registration-preview-table input[data-key="sku"], .registration-preview-table input[data-key="product_name"], .registration-preview-table input[data-key="name"] { width: 135px; }
.registration-preview-table input[data-key="store_name"], .registration-preview-table input[data-key="supplier"] { width: 120px; }
.registration-error-cell { min-width: 180px; max-width: 260px; white-space: normal; }
.registration-error-cell span { display: block; }
.registration-preview-actions { justify-content: flex-end; padding: 5px; border: 1px solid var(--line); border-top: 0; background: #fff; }
.manual-registration { margin-bottom: 8px; }
.registration-workspace { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 6px; align-items: stretch; }
.registration-entry-pane { min-width: 0; }
.registration-entry-pane .manual-registration { height: 100%; margin: 0; }
.registration-entry-pane .manual-grid-panel { height: 100%; }
.registration-batch-sidebar { min-width: 0; overflow: hidden; }
.registration-sidebar-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; padding: 7px; border-bottom: 1px solid var(--line); background: #fffde8; }
.registration-sidebar-filter .date-range-inputs { grid-column: 1 / -1; }
.registration-sidebar-filter input, .registration-sidebar-filter select { width: 100%; height: 25px; min-height: 25px; padding: 2px 4px; }
.registration-group-summary { padding: 6px 8px; color: var(--muted); border-bottom: 1px solid var(--line); background: #f7f9f8; font-weight: 700; }
.registration-group-list { max-height: 500px; overflow: auto; background: #fff; }
.registration-group-list table { width: 100%; min-width: 0; table-layout: fixed; font-size: 10px; }
.registration-group-list thead { position: sticky; top: 0; z-index: 3; }
.registration-group-list th, .registration-group-list td { height: 27px; padding: 1px 3px; }
.registration-group-list th:nth-child(1) { width: 72px; }
.registration-group-list th:nth-child(2) { width: 38px; }
.registration-group-list th:nth-child(3) { width: 43px; }
.registration-group-list th:nth-child(4) { width: auto; }
.registration-group-memo { width: 100%; height: 24px; min-height: 24px; padding: 1px 3px; border: 0; border-radius: 0; background: transparent; font-size: 10px; }
.registration-group-memo:focus { outline: 2px solid #1884d8; background: #fff; }
.registration-group-row.active .registration-group-memo { color: #fff; }
.registration-group-row.active .registration-group-memo:focus { color: var(--text); }
.registration-group-row { cursor: pointer; }
.registration-group-row.active, .registration-group-row.active:hover { color: #fff; background: #0877c9; }
.manual-grid-panel { overflow: hidden; }
.manual-grid-modebar { display: flex; align-items: baseline; gap: 9px; min-height: 34px; padding: 7px 8px; color: #fff; background: var(--nav); }
.manual-grid-modebar strong { font-size: 13px; }
.manual-grid-modebar span { color: #d4dfe6; }
.manual-grid-toolbar { display: grid; grid-template-columns: 170px minmax(120px, 175px) minmax(210px, 340px) minmax(180px, 245px) 1fr; align-items: end; gap: 5px; padding: 7px 8px; border-bottom: 1px solid #c9c48d; background: #fffde8; }
.manual-grid-toolbar .field { grid-template-columns: 58px minmax(0, 1fr); align-items: center; gap: 4px; }
.manual-grid-toolbar .manual-direction-field { grid-template-columns: 34px minmax(0, 1fr); }
.manual-grid-toolbar .manual-reference-field { grid-template-columns: 76px minmax(0, 1fr); }
.manual-grid-toolbar .manual-reference-field label { white-space: nowrap; }
.manual-grid-toolbar input, .manual-grid-toolbar select { height: 25px; min-height: 25px; }
.manual-grid-buttons { display: flex; justify-content: flex-end; gap: 4px; }
.manual-grid-help { min-height: 29px; padding: 6px 8px; color: #53615b; border-bottom: 1px solid var(--line); background: #f4f7f6; }
.manual-grid-wrap { max-height: 430px; overflow-x: hidden; overflow-y: auto; border: 0; }
.manual-grid-table { width: 100%; min-width: 0; table-layout: fixed; font-size: 10px; }
.manual-grid-table thead { position: sticky; top: 0; z-index: 5; }
.manual-grid-table tfoot { position: sticky; bottom: 0; z-index: 4; }
.manual-grid-table th, .manual-grid-table td { height: 26px; padding: 0 1px; overflow: hidden; text-overflow: ellipsis; }
.manual-grid-table tfoot th { color: #244834; border-top: 2px solid #76966f; background: #dcebd0; }
.manual-grid-table .manual-row-number { width: 25px; text-align: center; color: #5e6964; }
.manual-grid-table .manual-col-sku { width: 80px; }
.manual-grid-table .manual-col-name { width: 65px; }
.manual-grid-table .manual-col-color { width: 68px; }
.manual-grid-table .manual-col-unit { width: 52px; }
.manual-grid-table .manual-col-total { width: 32px; }
.manual-grid-table .manual-size-head, .manual-grid-table td:has(.manual-qty) { width: 25px; min-width: 25px; }
.manual-grid-table .manual-col-actions { width: 42px; }
.manual-grid-table input { width: 100%; height: 25px; min-height: 25px; padding: 1px; border: 0; border-radius: 0; background: transparent; font-size: 10px; }
.manual-grid-table input:focus { position: relative; z-index: 2; outline: 2px solid #1884d8; background: #fff; }
.manual-grid-table input:disabled { color: #9da5a1; background: #e8ebe9; cursor: not-allowed; }
.manual-grid-table input[readonly]:not(:disabled) { color: #24333d; background: #f4f6f5; cursor: default; }
.manual-grid-table .manual-sku-input { color: #104f88; font-weight: 750; }
.manual-row-actions { display: flex; align-items: center; justify-content: center; gap: 0; }
.manual-grid-table .manual-delete-row, .manual-grid-table .manual-price-row { width: 20px; min-height: 22px; padding: 0; border-color: transparent; background: transparent; }
.manual-grid-table .manual-delete-row { color: var(--danger); font-size: 16px; }
.manual-grid-table .manual-price-row { color: #0b659b; font-size: 10px; font-weight: 850; }
.manual-registration.is-history-view #manual-add-row, .manual-registration.is-history-view #manual-save-grid, .manual-registration.is-history-view .manual-delete-row { display: none; }
.manual-registration.is-history-view .manual-grid-help { color: #435d72; background: #edf4f9; }
.manual-product-dialog { width: min(760px, calc(100vw - 24px)); height: min(600px, calc(100vh - 24px)); max-height: none; padding: 0; border: 1px solid #73828c; border-radius: 3px; background: #f5f7f8; box-shadow: 0 12px 34px #10212d55; }
.manual-product-dialog[open] { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); }
.manual-product-dialog::backdrop { background: #10212d66; }
.manual-product-search { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 8px 9px; border-bottom: 1px solid var(--line); background: #eef2f4; }
.manual-product-search input { height: 28px; }
.manual-product-toolbar { display: flex; align-items: center; gap: 5px; min-height: 38px; padding: 5px 9px; border-bottom: 1px solid var(--line); background: #fff; }
.manual-product-toolbar span { margin-right: auto; color: var(--muted); font-weight: 700; }
.manual-product-table-wrap { min-height: 0; overflow: auto; background: #fff; }
.manual-product-table { min-width: 620px; }
.manual-product-table thead { position: sticky; top: 0; z-index: 2; }
.manual-product-table th, .manual-product-table td { height: 27px; padding: 2px 7px; }
.manual-product-table th:nth-child(1) { width: 180px; }
.manual-product-table th:nth-child(3) { width: 140px; }
.manual-product-table th:nth-child(4) { width: 90px; }
.manual-product-table tbody tr { cursor: pointer; }
.manual-product-table tbody tr.active { color: #fff; background: #0877c9; }
.registration-history-panel { margin-top: 8px; }
.registration-history-title { display: flex; align-items: center; justify-content: space-between; min-height: 33px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--head); }
.registration-history-title h2 { margin: 0; font-size: 13px; }
.registration-history-title span { color: var(--muted); }
.registration-history-filter { margin: 0; border: 0; border-bottom: 1px solid #d4cf9e; }
.registration-history-filter .date-range-field { min-width: 330px; }
.registration-history-wrap { max-height: 330px; overflow: auto; border: 0; }
.registration-history-table thead { position: sticky; top: 0; z-index: 3; }
.registration-history-table th, .registration-history-table td { height: 27px; }
.registration-history-table th:nth-child(8), .registration-history-table td:nth-child(8) { min-width: 190px; }
.registration-file-section { margin-top: 8px; }
.registration-file-section > summary { padding: 8px 10px; cursor: pointer; color: #28443a; background: linear-gradient(#f3f6f4, #dfe6e3); font-weight: 800; }
.registration-file-section[open] > summary { border-bottom: 1px solid var(--line); }
.registration-file-section .registration-layout { padding: 8px; }
@media (max-width: 1300px) {
  .filter-grid { grid-template-columns: repeat(4, minmax(180px, 1fr)); }
  .receipt-filter-grid { grid-template-columns: repeat(4, minmax(180px, 1fr)); }
  .stock-filter-body { grid-template-columns: 1fr; gap: 5px; }
  .stock-filter-options { grid-template-columns: repeat(2, max-content); border-left: 0; border-top: 1px solid #d4cf9e; padding: 5px 2px 1px; }
  .registration-layout { grid-template-columns: 1fr; }
  .manual-grid-toolbar { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .manual-grid-buttons { grid-column: 1 / -1; }
  .registration-workspace { grid-template-columns: 248px minmax(0, 1fr); }
}
@media (max-width: 1100px) {
  .registration-workspace { grid-template-columns: 1fr; }
  .registration-group-list { max-height: 260px; }
}
@media (max-width: 1000px) {
  .topbar { flex-wrap: wrap; gap: 5px; padding: 5px 9px; }
  .nav-toggle { display: block; margin-left: auto; min-height: 27px; color: white; border-color: #ffffff55; background: transparent; }
  .today { display: none; }
  .nav { display: none; flex: 1 0 100%; height: auto; align-items: stretch; flex-wrap: wrap; background: #1e2f3c; }
  .nav-open .nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-group { display: block; min-width: 0; }
  .sales-report-grid { grid-template-columns: 1fr; }
  .sales-report-grid .sales-report-main { grid-row: auto; }
  .daily-sales-grid { grid-template-columns: 1fr; }
  .daily-sales-grid .table-wrap { height: auto; max-height: 520px; }
  .registration-workspace { grid-template-columns: 1fr; }
  .registration-group-list { max-height: 260px; }
  .nav-category { width: 100%; min-height: 34px; border-bottom: 1px solid #ffffff17; text-align: left; }
  .nav-group:hover .nav-submenu { display: none; }
  .nav-group.submenu-open .nav-submenu { display: grid; }
  .nav-submenu, .nav-submenu-right { position: static; min-width: 0; padding: 0; border: 0; box-shadow: none; background: #fff; }
  .nav-submenu a { min-height: 32px; padding-left: 15px; border-bottom: 1px solid #d7dfdb; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(2n) { border-right: 0; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .size-grid { grid-template-columns: repeat(5, 1fr); }
  .detail-grid { grid-template-columns: repeat(2, 1fr); }
  .channel-card { grid-template-columns: 1fr; }
  .filter-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
  .receipt-filter-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
  .filter-grid.stock-filter-grid { grid-template-columns: repeat(3, minmax(180px, 1fr)); }
}
@media (max-width: 600px) {
  main { padding: 6px 5px; }
  .page-head { align-items: flex-start; }
  .page-head h1 { font-size: 16px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { padding: 9px; }
  .metric strong { font-size: 19px; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .size-grid { grid-template-columns: repeat(3, 1fr); }
  .filters .field { flex: 1 1 130px; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .receipt-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid.stock-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-grid .field { display: grid; grid-template-columns: 1fr; gap: 3px; }
  .filter-grid .date-range-field { grid-column: 1 / -1; }
  .filter-grid input, .filter-grid select { min-height: 28px; height: 28px; }
  .filter-grid .product-picker-open { min-height: 28px; height: 28px; }
  .filter-actions { flex-wrap: wrap; }
  .stock-filter-options { grid-template-columns: 1fr; }
  .result-count { flex: 1 0 100%; }
  .channel-form { grid-template-columns: 1fr; }
  .nav-open .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-picker-search { grid-template-columns: 1fr auto; }
  .product-picker-search label { grid-column: 1 / -1; }
  .product-picker-toolbar { flex-wrap: wrap; }
  .product-picker-toolbar #product-picker-status { order: 3; flex: 1 0 100%; }
}

/* Online order workflow */
.order-flow { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); margin-bottom: 7px; border: 1px solid var(--line); background: #fff; }
.order-flow a { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; position: relative; color: #586861; font-weight: 800; border-right: 1px solid var(--line); }
.order-flow a:last-child { border-right: 0; }
.order-flow a:hover { background: #f1f6f3; text-decoration: none; }
.order-flow a.active { color: #fff; background: var(--accent); }
.order-flow a span { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; }
.order-flow a:not(:last-child)::after { content: ""; width: 7px; height: 7px; position: absolute; right: -4px; z-index: 1; transform: rotate(45deg); border-top: 1px solid var(--line); border-right: 1px solid var(--line); background: inherit; }
.collect-panel { max-width: 1160px; margin: 0 auto; }
.collect-panel-head { padding: 15px 18px 12px; border-bottom: 1px solid var(--line); }
.collect-panel-head h2 { margin: 0 0 4px; font-size: 16px; }
.collect-panel-head p { margin: 0; color: var(--muted); }
.collect-form { padding: 0 18px 18px; }
.collect-condition { display: grid; grid-template-columns: 145px minmax(300px, 1fr); align-items: center; gap: 12px; min-height: 62px; border-bottom: 1px solid #e0e5e2; }
.condition-label { font-size: 13px; font-weight: 800; }
.collect-condition .date-range-inputs { max-width: 500px; }
.radio-group { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-group label { display: flex; align-items: center; gap: 5px; min-width: 250px; padding: 9px 11px; border: 1px solid #b8c3bd; border-radius: 4px; background: #fbfcfb; cursor: pointer; }
.radio-group label:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: #edf7f2; }
.radio-group input, .store-option input, .store-select-head input { width: auto; min-height: auto; }
.radio-group small { margin-left: auto; color: var(--muted); font-weight: 500; }
.store-select-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 0 8px; }
.store-select-head > div, .store-select-head label { display: flex; align-items: center; gap: 6px; }
.store-select-head strong { font-size: 13px; }
.store-select-head span { padding: 1px 6px; color: var(--accent); border-radius: 9px; background: #e8f4ee; font-weight: 700; }
.store-select-grid { display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 8px; }
.store-option { display: grid; grid-template-columns: auto 36px 1fr auto; align-items: center; gap: 9px; min-height: 66px; padding: 9px 12px; border: 1px solid #b8c3bd; border-radius: 5px; background: #fff; cursor: pointer; }
.store-option:has(input:checked) { border-color: var(--accent); background: #f4faf7; }
.store-option.disabled { opacity: .55; cursor: not-allowed; }
.store-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: #fff; background: #03c75a; font-size: 16px; font-weight: 900; }
.store-option strong, .store-option small { display: block; }
.store-option small { margin-top: 3px; color: var(--muted); font-weight: 500; }
.connection-state { padding: 2px 6px; color: var(--success); border-radius: 9px; background: #e4f3ea; font-size: 10px; }
.connection-state.off { color: var(--muted); background: #e9ecea; }
.empty-store { grid-column: 1 / -1; padding: 24px; color: var(--muted); text-align: center; border: 1px dashed var(--line); }
.collect-submit { display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding-top: 16px; }
.collect-submit span { color: var(--muted); }
.collect-button { min-width: 130px; min-height: 36px; font-size: 13px; }
.collection-result-dialog { width: min(650px, calc(100vw - 24px)); padding: 0; border: 0; border-radius: 8px; box-shadow: 0 16px 45px #10212d66; }
.collection-result-dialog::backdrop { background: #17202b88; }
.result-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; color: #fff; background: var(--nav); }
.result-dialog-head > div, .result-store { display: flex; align-items: center; gap: 9px; }
.result-dialog-head h2, .result-dialog-head p { margin: 0; }
.result-dialog-head h2 { font-size: 16px; }
.result-dialog-head p { margin-top: 2px; color: #d5dfe5; }
.result-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--accent); background: #fff; font-size: 18px; font-weight: 900; }
.result-dialog-head .result-dialog-close { width: 30px; min-height: 26px; padding: 0; color: #fff; border: 0; background: transparent; font-size: 23px; }
.result-dialog-body { display: grid; gap: 8px; max-height: 55vh; padding: 14px; overflow: auto; background: #f1f4f3; }
.collection-result-card { display: grid; grid-template-columns: minmax(230px, 1fr) 90px; gap: 8px 12px; padding: 12px; border: 1px solid var(--line); border-left: 4px solid var(--success); border-radius: 4px; background: #fff; }
.collection-result-card.waiting { border-left-color: var(--warning); }
.collection-result-card.failed { border-left-color: var(--danger); }
.result-store .store-mark { width: 30px; height: 30px; font-size: 14px; }
.result-store strong, .result-store small { display: block; }
.result-store small { color: var(--muted); }
.result-state { margin-left: auto; color: var(--success); font-weight: 800; }
.waiting .result-state { color: var(--warning); }
.failed .result-state { color: var(--danger); }
.collection-result-card .result-count { display: grid; align-content: center; text-align: right; }
.collection-result-card .result-count strong { color: var(--accent); font-size: 21px; }
.collection-result-card .result-count span { color: var(--muted); font-size: 10px; }
.collection-result-card p { grid-column: 1 / -1; margin: 0; padding-top: 8px; color: #53615b; border-top: 1px solid #edf0ee; }
.result-dialog-actions { display: flex; justify-content: flex-end; gap: 6px; padding: 10px 14px; background: #fff; }
.workflow-filters { flex-wrap: nowrap; }
.workflow-filters .date-filter { min-width: 300px; }
.workflow-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 39px; padding: 5px 7px; border: 1px solid var(--line); border-bottom: 0; background: #fff; }
.workflow-toolbar > div:first-child { display: flex; align-items: center; gap: 12px; }
.workflow-toolbar span { color: var(--muted); }
.workflow-table-wrap { max-height: calc(100vh - 245px); }
.workflow-table { width: max-content; min-width: 100%; }
.workflow-table thead { position: sticky; top: 0; z-index: 4; }
.workflow-table th:first-child, .workflow-table td:first-child { width: 36px; text-align: center; }
.workflow-table td strong, .workflow-table td small { display: block; }
.workflow-table td small { max-width: 360px; margin-top: 2px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; }
.workflow-table input[type="checkbox"] { width: auto; }
.order-status { display: inline-block; min-width: 57px; padding: 2px 6px; border-radius: 9px; text-align: center; font-size: 10px; font-weight: 800; }
.status-new { color: #175f8c; background: #e1edf7; }
.status-confirmed { color: #684e0c; background: #fff0bd; }
.status-n_delivery, .status-n-delivery { color: #075f69; background: #d8f4f2; }
.status-excluded { color: #606b73; background: #e8ecef; }
.status-cancel_requested { color: #973b1d; background: #ffeadf; }
.status-ready { color: #75368d; background: #f1e5f6; }
.status-shipped { color: var(--success); background: #e1f2e8; }
.status-cancelled { color: var(--danger); background: #fae6e6; }
.workflow-cancel-controls { display: flex; align-items: center; gap: 5px; }
.workflow-cancel-controls select { width: 128px; }
.workflow-cancel-controls input { width: 170px; }
.invoice-upload { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 11px; margin-bottom: 5px; border-left: 4px solid var(--accent); }
.invoice-upload p { margin: 3px 0 0; color: var(--muted); }
.invoice-upload form { display: grid; grid-template-columns: 125px minmax(220px, 1fr) auto; gap: 5px; }
.invoice-table select { min-width: 105px; height: 23px; min-height: 23px; padding: 1px 3px; }
.invoice-table input[name^="tracking_number"] { min-width: 145px; height: 23px; min-height: 23px; padding: 1px 4px; }

@media (max-width: 1300px) { .workflow-filters { flex-wrap: wrap; } }
@media (max-width: 1000px) {
  .order-flow { overflow-x: auto; grid-template-columns: repeat(4, minmax(145px, 1fr)); }
  .store-select-grid { grid-template-columns: 1fr; }
  .collect-condition { grid-template-columns: 115px minmax(0, 1fr); }
  .invoice-upload { align-items: stretch; flex-direction: column; }
  .dashboard-chart-grid { grid-template-columns: 1fr; }
  .dashboard-fx-grid, .dashboard-ranking-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-sales-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-sales-controls { align-items: stretch; flex-direction: column; }
  .dashboard-sales-period { justify-content: flex-end; }
}
@media (max-width: 600px) {
  .collect-form { padding: 0 10px 12px; }
  .collect-panel-head { padding: 12px 10px; }
  .collect-condition { grid-template-columns: 1fr; gap: 5px; padding: 10px 0; }
  .radio-group label { width: 100%; min-width: 0; }
  .store-option { grid-template-columns: auto 32px 1fr; padding: 8px; }
  .store-option .connection-state { display: none; }
  .collect-submit, .workflow-toolbar { align-items: stretch; flex-direction: column; }
  .collect-submit span { text-align: right; }
  .invoice-upload form { grid-template-columns: 1fr; }
  .workflow-toolbar > div:first-child { align-items: flex-start; flex-direction: column; gap: 2px; }
  .workflow-toolbar button { align-self: flex-end; }
  .dashboard-hero { align-items: flex-start; flex-direction: column; }
  .dashboard-fx-grid, .dashboard-ranking-grid { grid-template-columns: 1fr; }
  .dashboard-sales-metrics { grid-template-columns: 1fr; }
  .dashboard-sales-quick, .dashboard-sales-period { flex-wrap: wrap; justify-content: flex-start; }
  .dashboard-donut-layout { grid-template-columns: 1fr; }
  .dashboard-bar-chart { grid-template-columns: repeat(12, 58px); }
}
