.stock-page { display: grid; gap: 14px; }
.stock-subtabs { display:flex; width:max-content; max-width:100%; padding:4px; border:1px solid #dfd2bf; border-radius:12px; background:#f4eee5; overflow-x:auto; }
.stock-subtabs button { min-height:40px; padding:0 18px; border:0; border-radius:9px; background:transparent; color:var(--muted); font-weight:800; white-space:nowrap; cursor:pointer; }
.stock-subtabs button.active { background:#fff; color:#8a5412; box-shadow:0 1px 4px rgba(77,48,15,.12); }
.stock-subtabs button:focus-visible { outline:3px solid #d79035; outline-offset:2px; }
[data-stock-panel][hidden] { display:none !important; }
.stock-kicker, .stock-kpis span { display:block; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.stock-toolbar { display:flex; gap: 12px; align-items:end; flex-wrap:wrap; margin:0; }
.stock-toolbar label, .stock-mapping-form label { display:grid; gap:6px; color:var(--muted); font-size:13px; font-weight:700; }
.stock-toolbar input, .stock-toolbar select, .stock-mapping-form input, .stock-mapping-form select { min-height:42px; padding:0 11px; border:1px solid var(--border); border-radius:9px; background:#fff; color:var(--text); }
.stock-select-label { min-width: 250px; }
.stock-load-status { display:flex; gap:7px; align-items:center; flex-wrap:wrap; margin:0 0 1px auto; color:var(--muted); font-size:13px; font-weight:700; }.stock-load-status .is-ready { color:#216d35; }.stock-load-status .is-pending { color:#9b621a; }
.stock-create-period { display:flex; gap:10px; align-items:end; }.stock-create-period[hidden] { display:none; }.stock-create-period label { display:grid; gap:6px; color:var(--muted); font-size:13px; font-weight:700; }
.stock-manual-imports { padding:14px 16px; border:1px dashed #cdbb9d; border-radius:11px; background:#fffdf9; }.stock-manual-imports summary { color:#8a5412; font-weight:800; cursor:pointer; }
.stock-kicker { margin:0 0 5px; color:#9b621a; }
.stock-help { margin:0; color:var(--muted); font-size:14px; line-height:1.5; }
.stock-upload-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:10px; margin-top:16px; }
.stock-file { display:grid; gap:5px; padding:13px; border:1px dashed #cdbb9d; border-radius:10px; background:#fffdf9; cursor:pointer; }
.stock-file:hover { border-color:#a9691b; background:#fffaf0; }
.stock-file strong { font-size:14px; }.stock-file span { color:var(--muted); font-size:12px; line-height:1.35; }.stock-file input { width:100%; font-size:12px; margin-top:5px; }
.stock-file-complete { cursor:default; border-style:solid; border-color:#cce1cf; background:#f7fcf7; }.stock-file-complete > div { display:flex; align-items:center; gap:7px; }.stock-file-check { display:grid; width:19px; height:19px; place-items:center; border-radius:999px; background:#2c8a46; color:#fff !important; font-size:12px !important; font-weight:900; }.stock-file-name { overflow:hidden; color:var(--text) !important; font-weight:700; text-overflow:ellipsis; white-space:nowrap; }.stock-file-complete small { color:var(--muted); font-size:11px; }.stock-hidden-file { display:none; }.stock-replace-button { justify-self:start; min-height:30px; padding:0; border:0; background:transparent; color:#8a5412; font-size:12px; font-weight:800; cursor:pointer; }.stock-replace-button:hover { color:#653b07; text-decoration:underline; }
.stock-file-wide { margin-top:16px; }.stock-status-row { display:flex; gap:7px; flex-wrap:wrap; margin-top:14px; }.stock-status, .stock-pill, .stock-flag { display:inline-flex; padding:5px 8px; border-radius:999px; background:#f0ece5; color:var(--muted); font-size:12px; font-weight:700; }.stock-status.is-ready { background:#e4f1e5; color:#216d35; }
.stock-primary-button { min-height:42px; margin-top:14px; padding:0 15px; border:0; border-radius:9px; background:#9b621a; color:#fff; font-weight:800; cursor:pointer; }.stock-primary-button:hover { background:#805014; }
.stock-waste-panel { border-left: 4px solid #b06a22; }.stock-waste-list { display:grid; gap:9px; }.stock-waste-item { display:grid; grid-template-columns:minmax(0,1fr) auto auto; align-items:center; gap:14px; padding:12px 13px; border:1px solid #eadfce; border-radius:10px; background:#fffcf7; }.stock-waste-item.is-voided { opacity:.58; }.stock-waste-main { min-width:0; }.stock-waste-main strong { display:block; overflow:hidden; font-size:14px; text-overflow:ellipsis; white-space:nowrap; }.stock-waste-main small, .stock-waste-quantity small { display:block; margin-top:4px; color:var(--muted); font-size:11px; line-height:1.35; }.stock-waste-note { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.stock-waste-quantity { text-align:right; white-space:nowrap; }.stock-waste-quantity strong { color:#8a5412; font-size:14px; }.stock-waste-status { padding:5px 8px; border-radius:999px; background:#e4f1e5; color:#216d35; font-size:11px; font-weight:800; }.is-voided .stock-waste-status { background:#f0ece5; color:var(--muted); }.stock-waste-more { margin:2px 0 0; color:var(--muted); font-size:12px; text-align:center; }.stock-waste-empty { padding:12px 0 4px; }
.stock-mapping-layout { display:grid; grid-template-columns: 1fr 340px; gap:22px; }.stock-mapping-form { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:15px; border:1px solid #eadfce; border-radius:11px; background:#fcf9f4; align-content:start; }.stock-mapping-form h3 { grid-column:1/-1; margin:0 0 2px; font-size:17px; }.stock-mapping-form .stock-primary-button { grid-column:1/-1; }.stock-inline-button { border:0; background:transparent; color:#8a5412; font-weight:800; cursor:pointer; }.stock-report-actions { display:flex; gap:12px; align-items:center; }
.stock-preflight-panel { border-left:4px solid #5b6f8f; }.stock-preflight-panel .panel-header { align-items:flex-start; }.stock-preflight-panel .panel-header .stock-primary-button { margin-top:0; }.stock-preflight-files { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; margin:14px 0; }.stock-preflight-error { display:inline-flex; padding:5px 8px; border-radius:999px; background:#f9e4e2; color:#9f2d25; font-size:12px; font-weight:700; }.stock-preflight-panel table { min-width:780px; }.stock-preflight-panel td { vertical-align:top; }.stock-preflight-panel td small { display:block; margin-top:4px; }.stock-preflight-panel .stock-mapping-layout { margin-top:14px; }
.stock-history-chart { display:flex; align-items:end; gap:14px; min-height:172px; padding-top:8px; overflow-x:auto; }.stock-history-item { display:grid; grid-template-rows:auto 108px auto auto; flex:1 0 92px; gap:5px; min-width:92px; text-align:center; }.stock-history-value { font-size:12px; font-weight:800; white-space:nowrap; }.stock-history-bar { display:flex; align-items:end; justify-content:center; border-bottom:1px solid #e5d9c8; }.stock-history-bar i { display:block; width:28px; border-radius:8px 8px 2px 2px; }.stock-history-bar .is-loss { background:#b04a44; }.stock-history-bar .is-surplus { background:#2c8a46; }.stock-history-item strong { font-size:13px; }.stock-history-item small { color:var(--muted); font-size:11px; }
.stock-tracking-list { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px; }.stock-tracking-item { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:5px 12px; padding:13px; border:1px solid #ebe1d2; border-radius:10px; background:#fffcf7; }.stock-tracking-item strong { display:block; font-size:14px; line-height:1.25; }.stock-tracking-item small { display:block; margin-top:4px; color:var(--muted); font-size:12px; line-height:1.35; }.stock-tracking-current { align-self:start; font-weight:800; white-space:nowrap; }.stock-tracking-item svg { grid-column:1/-1; width:100%; height:36px; overflow:visible; }.stock-tracking-item polyline { fill:none; stroke:#a9691b; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }
.stock-kpis { display:grid; grid-template-columns:repeat(4, 1fr); gap:10px; margin: 2px 0 18px; }.stock-kpis > div { padding:13px; border:1px solid #ebe1d2; border-radius:10px; background:#fffcf7; }.stock-kpis strong { display:block; margin-top:5px; font-size:22px; }.stock-report-table small { display:block; margin-top:3px; color:var(--muted); }.stock-negative { color:#a33232; font-weight:800; }.stock-positive { color:#23703b; font-weight:800; }.stock-empty { color:var(--muted); text-align:center; padding:24px; }.stock-message { margin:0; padding:12px 14px; border-radius:10px; font-weight:700; }.stock-message.success { background:#e3f2e4; color:#216d35; }.stock-message.error { background:#f9e4e2; color:#9f2d25; }
.stock-report-filters { display:flex; gap:10px; align-items:end; flex-wrap:wrap; margin:-4px 0 14px; }.stock-report-filters label { display:grid; min-width:180px; gap:5px; color:var(--muted); font-size:12px; font-weight:700; }.stock-report-filters select { min-height:38px; padding:0 9px; border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--text); }
@media (max-width: 860px) { .stock-mapping-layout { grid-template-columns:1fr; }.stock-upload-grid { grid-template-columns:1fr; }.stock-preflight-files { grid-template-columns:1fr; }.stock-kpis { grid-template-columns:repeat(2,1fr); } }
@media (max-width: 560px) {
  .stock-page { gap: 14px; }
  .stock-subtabs { width:100%; box-sizing:border-box; }.stock-subtabs button { flex:1; padding:0 12px; }
  .stock-toolbar { padding:14px; }.stock-toolbar > * { width:100%; }.stock-toolbar button, .stock-primary-button { min-height:48px; }.stock-create-period { display:grid; }
  .stock-waste-item { grid-template-columns:minmax(0,1fr) auto; gap:8px 12px; }.stock-waste-status { grid-column:2; grid-row:1; }.stock-waste-quantity { grid-column:1 / -1; display:flex; justify-content:space-between; align-items:baseline; text-align:left; }.stock-waste-quantity small { margin-top:0; }
  .stock-select-label { min-width:0; }.stock-load-status { margin:0; }.stock-mapping-form { grid-template-columns:1fr; }.stock-kpis { grid-template-columns:1fr 1fr; gap:8px; }.stock-kpis > div { padding:11px; }.stock-kpis strong { font-size:19px; }
  .stock-report-filters { display:grid; grid-template-columns:1fr; }.stock-report-filters label { min-width:0; }
  .stock-history-chart { gap:10px; }.stock-history-item { flex-basis:82px; min-width:82px; }.stock-history-value { font-size:11px; }.stock-tracking-list { grid-template-columns:1fr; }
  .stock-upload-grid { gap:8px; }.stock-file { min-height:116px; padding:12px; }.stock-file input { font-size:11px; }
  .stock-mapping-layout .table-scroll, #stockReportPanel .table-scroll { overflow:visible; }.stock-mapping-layout table, .table-scroll .stock-report-table, .stock-preflight-panel table { min-width:0; }
  .stock-mapping-layout table thead, .stock-report-table thead { display:none; }
  .stock-mapping-layout table, .stock-mapping-layout tbody, .stock-mapping-layout tr, .stock-mapping-layout td, .stock-report-table, .stock-report-table tbody, .stock-report-table tr, .stock-report-table td { display:block; width:100%; }
  .stock-mapping-layout tr, .stock-report-table tr { box-sizing:border-box; margin-bottom:10px; padding:10px 12px; border:1px solid #e9dfd0; border-radius:10px; background:#fffdf9; }
  .stock-mapping-layout td, .stock-report-table td { display:flex; min-width:0; align-items:center; justify-content:space-between; gap:14px; min-height:30px; padding:5px 0; border:0; white-space:normal; overflow-wrap:anywhere; text-align:right; }
  .stock-mapping-layout td::before, .stock-report-table td::before { content:attr(data-label); flex:0 0 40%; color:var(--muted); font-size:11px; font-weight:800; letter-spacing:.05em; text-align:left; text-transform:uppercase; }
  .stock-report-table td:first-child { display:grid; grid-template-columns:40% minmax(0, 1fr); align-items:start; }.stock-report-table td:first-child::before { grid-row:1 / span 2; }.stock-report-table td:first-child strong { grid-column:2; font-size:17px; line-height:1.2; overflow-wrap:anywhere; text-align:right; }.stock-report-table td:first-child small { grid-column:2; max-width:none; font-size:13px; overflow-wrap:anywhere; text-align:right; }
  .stock-empty { display:block !important; text-align:center !important; }.stock-empty::before { display:none; }
}

.stock-replenishment-panel { border-left:4px solid #9b621a; }
.stock-replenishment-actions { display:flex; gap:10px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.stock-replenishment-actions .stock-primary-button { margin-top:0; }
.stock-replenishment-rules { display:grid; gap:9px; margin:14px 0; padding:12px 14px; border:1px solid #eadfce; border-radius:10px; background:#fffdf9; }
.stock-rule-chips { display:flex; gap:7px; flex-wrap:wrap; }
.stock-replenishment-rule-form { display:grid; grid-template-columns:repeat(5, minmax(0, 1fr)); gap:10px; margin:0 0 16px; padding:14px; border:1px solid #eadfce; border-radius:10px; background:#fcf9f4; }
.stock-replenishment-rule-form h3 { grid-column:1/-1; margin:0; font-size:16px; }
.stock-replenishment-rule-form label { display:grid; gap:5px; color:var(--muted); font-size:12px; font-weight:700; }
.stock-replenishment-rule-form input, .stock-replenishment-rule-form select, .stock-replenishment-table input, .stock-replenishment-table select { min-height:36px; width:100%; padding:0 8px; border:1px solid var(--border); border-radius:7px; background:#fff; color:var(--text); }
.stock-replenishment-rule-form .stock-primary-button { grid-column:1/-1; width:max-content; margin-top:0; }
.stock-checkbox { display:flex !important; align-items:center; align-self:end; gap:7px !important; }
.stock-checkbox input { width:auto; min-height:0; }
.stock-replenishment-run-toolbar { display:flex; gap:10px; justify-content:flex-end; margin:0 0 10px; }
.stock-replenishment-run-toolbar label { display:grid; gap:5px; min-width:260px; color:var(--muted); font-size:12px; font-weight:700; }
.stock-replenishment-run-toolbar label:first-child { min-width:150px; }
.stock-replenishment-run-toolbar select { min-height:36px; padding:0 8px; border:1px solid var(--border); border-radius:7px; background:#fff; }
.stock-replenishment-table { min-width:1180px; table-layout:fixed; }
.stock-replenishment-table th:nth-child(1) { width:22%; }
.stock-replenishment-table th:nth-child(2),
.stock-replenishment-table th:nth-child(3),
.stock-replenishment-table th:nth-child(4),
.stock-replenishment-table th:nth-child(5),
.stock-replenishment-table th:nth-child(6) { width:10%; }
.stock-replenishment-table th:nth-child(7),
.stock-replenishment-table th:nth-child(8) { width:9%; }
.stock-replenishment-table th:nth-child(9) { width:10%; }
.stock-replenishment-table td { vertical-align:top; }
.stock-replenishment-table td small { display:block; margin-top:3px; color:var(--muted); font-size:11px; }
.stock-replenishment-flags { max-width:130px; color:#a33232 !important; overflow-wrap:anywhere; }
.stock-status.is-blocked { background:#f9e4e2; color:#9f2d25; }
.stock-replenishment-panel button:focus-visible, .stock-replenishment-panel select:focus-visible, .stock-replenishment-panel input:focus-visible { outline:3px solid #d79035; outline-offset:2px; }
@media (max-width: 860px) { .stock-replenishment-rule-form { grid-template-columns:repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .stock-replenishment-actions { justify-content:flex-start; }
  .stock-replenishment-rule-form { grid-template-columns:1fr; }
  .stock-replenishment-rule-form .stock-primary-button { width:100%; }
  .stock-replenishment-run-toolbar { justify-content:stretch; }.stock-replenishment-run-toolbar label { width:100%; min-width:0; }
  .stock-replenishment-table { min-width:0; }.stock-replenishment-table thead { display:none; }
  .stock-replenishment-table, .stock-replenishment-table tbody, .stock-replenishment-table tr, .stock-replenishment-table td { display:block; width:100%; }
  .stock-replenishment-table tr { box-sizing:border-box; margin-bottom:10px; padding:10px 12px; border:1px solid #e9dfd0; border-radius:10px; background:#fffdf9; }
  .stock-replenishment-table td { display:flex; min-width:0; align-items:center; justify-content:space-between; gap:14px; min-height:30px; padding:5px 0; border:0; text-align:right; }
  .stock-replenishment-table td::before { content:attr(data-label); flex:0 0 40%; color:var(--muted); font-size:11px; font-weight:800; letter-spacing:.05em; text-align:left; text-transform:uppercase; }
  .stock-replenishment-table td:first-child { display:grid; grid-template-columns:40% minmax(0, 1fr); align-items:start; }.stock-replenishment-table td:first-child::before { grid-row:1 / span 2; }.stock-replenishment-table td:first-child strong, .stock-replenishment-table td:first-child small { grid-column:2; text-align:right; }
}
