/* Additions for the .NET app. app.css stays a verbatim copy of the mock; anything new goes here. */

/* Tabs are links (one page per tab) instead of the mock's buttons. */
a.tab-btn { display: inline-block; text-decoration: none; }
a.btn { text-decoration: none; }

/* Shared control geometry keeps anchors, native buttons and form fields aligned. */
.btn { min-height:38px; line-height:20px; justify-content:center; vertical-align:middle; text-align:center; }
.btn-sm { min-height:32px; line-height:20px; }
.btn:disabled { opacity:.5; cursor:not-allowed; transform:none; }
.input:not(textarea),select.select { min-height:38px; line-height:20px; }
.btn svg { flex-shrink:0; }
.card-head > .toolbar { margin-bottom:0; }
.card-head > div:first-child { min-width:0; }
.card-sub { line-height:1.6; }
.toolbar { row-gap:10px; }
.toolbar:has(> label),.toolbar:has(> .field) { align-items:flex-end; }
.toolbar > label { min-width:0; }
/* Filter labels sit above their box (as on the report pages), not glued to its left edge. Checkboxes stay inline. */
.toolbar > label:not(:has(input[type="checkbox"])) { display:grid; gap:6px; font-size:13px; color:var(--text-secondary); }
.toolbar > label:has(input[type="checkbox"]) { display:inline-flex; align-items:center; gap:8px; font-size:13px; align-self:center; }
.row-actions { align-items:center; }
.header-actions { flex-shrink:0; }
.header-actions .header-icon { flex:0 0 38px; width:38px; padding:8px; }
.export-card { display:flex; flex-direction:column; align-items:flex-start; }
.export-card .btn { margin-top:auto; }
@media(max-width:760px) {
  .card-head { align-items:flex-start; }
  .card-head > .toolbar { width:100%; }
  .header-actions { flex-shrink:1; }
  .toolbar > label { flex:1 1 140px; }
  .filter-row .field { flex:1 1 140px; min-width:0; }
  .filter-row .field .input,.filter-row .field .select { width:100%; }
  .btn { white-space:normal; overflow-wrap:anywhere; }
}

/* Blazor focuses each page's heading after navigation (for screen readers); no visible ring for that. */
[tabindex="-1"]:focus { outline: none; }

/* Placeholder shown on tabs that a later phase builds. */
.coming-soon { text-align: center; padding: 48px 20px; }
.coming-soon h2 { font-size: 18px; margin-bottom: 6px; }
.coming-soon .phase-pill {
  display: inline-block; margin-top: 12px; padding: 4px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 700;
}

/* Blazor's error bar, restyled with the mock's colours. */
#blazor-error-ui {
  background: var(--critical-soft); color: var(--text-primary); border-top: 1px solid var(--critical);
  bottom: 0; box-shadow: var(--shadow-md); display: none; left: 0; padding: 10px 20px;
  position: fixed; width: 100%; z-index: 1000; font-size: 13px;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 16px; top: 8px; }
.blazor-error-boundary { background: var(--critical-soft); padding: 12px 16px; border-radius: var(--radius-sm); color: var(--text-primary); }
.blazor-error-boundary::after { content: "Terjadi kesalahan. Silakan muat ulang halaman."; }

/* Admin screens */
.admin-subnav { margin-top: -8px; }
.check-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.temp-password { font-size: 15px; font-weight: 700; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border-strong); }
.msg-success { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
tr.row-inactive td { color: var(--text-muted); }

/* A contained split login card; the surrounding page stays open and scrollable. */
.login-page { min-height:100svh; display:flex; align-items:center; justify-content:center; padding:48px 24px; }
.login-frame { width:100%; max-width:920px; }
.login-card { display:grid; grid-template-columns:1fr 1fr; border:1px solid var(--border); border-radius:22px; overflow:hidden; background:var(--surface); box-shadow:0 20px 60px rgb(0 0 0 / 9%); }
.login-brand { position:relative; isolation:isolate; overflow:hidden; display:flex; flex-direction:column; justify-content:space-between; gap:64px; padding:42px; background:#164b39; color:#fff; }
.login-brand::before,.login-brand::after { content:""; position:absolute; z-index:-1; border:1px solid rgb(197 224 176 / 15%); border-radius:50%; width:440px; height:440px; right:-260px; bottom:-220px; }
.login-brand::after { width:570px; height:570px; right:-290px; bottom:-260px; background:radial-gradient(ellipse at center,rgb(150 187 111 / 12%),transparent 70%); }
.login-wordmark { display:flex; align-items:center; gap:13px; font-size:10px; letter-spacing:.16em; line-height:1.6; font-weight:600; }
.login-monogram { font-family:Manrope,Inter,sans-serif; font-size:33px; font-weight:800; letter-spacing:-.05em; padding-right:15px; border-right:1px solid rgb(255 255 255 / 30%); line-height:1.1; }
.login-eyebrow { color:#c5d8a5; font-size:10px; letter-spacing:.18em; font-weight:700; margin:0 0 18px; }
.login-brand h1 { color:#fff; font-family:Manrope,Inter,sans-serif; font-size:40px; font-weight:700; line-height:1.17; letter-spacing:-.035em; margin:0 0 22px; }
.login-brand-copy > p:last-child { color:#d0e0d7; max-width:285px; font-size:14px; line-height:1.8; margin:0; }
.login-brand-footer { display:flex; align-items:center; gap:10px; color:#bdd3c8; font-size:9px; letter-spacing:.14em; }
.login-brand-line { width:24px; height:1px; background:#c5d8a5; }
.login-form-panel { padding:30px 42px 36px; min-width:0; }
.login-form-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:30px; color:var(--text-muted); font-size:10px; letter-spacing:.14em; font-weight:600; }
.login-theme-toggle { min-width:38px; min-height:38px; padding:5px; font-size:19px; border-radius:50%; }
.login-form-panel h2 { font-family:Manrope,Inter,sans-serif; font-size:26px; font-weight:800; letter-spacing:-.03em; margin:0 0 9px; }
.login-intro { font-size:13px; color:var(--text-secondary); line-height:1.7; margin:0 0 28px; }
.login-field { margin-bottom:18px; }
.login-field .field-label { display:block; margin-bottom:8px; font-size:12px; }
.login-field .input { min-height:46px; width:100%; padding:11px 13px; border-radius:8px; }
.login-submit { display:flex; width:100%; min-height:46px; margin-top:20px; justify-content:space-between; padding:12px 17px; border-radius:8px; }
.login-submit span { font-size:19px; line-height:1; }
.login-help { border-top:1px solid var(--border); padding-top:20px; margin:24px 0 0; color:var(--text-secondary); font-size:11px; line-height:1.8; }
.login-help strong { font-weight:600; color:var(--text-primary); }
.login-copyright { text-align:center; color:var(--text-secondary); font-size:11px; line-height:1.8; padding:22px 12px 0; }
@media(max-width:700px) {
  .login-page { padding:24px 16px; }
  .login-frame { max-width:440px; }
  .login-card { grid-template-columns:1fr; border-radius:18px; }
  .login-brand { padding:26px 28px; gap:28px; }
  .login-wordmark { font-size:9px; }
  .login-monogram { font-size:28px; }
  .login-eyebrow { font-size:9px; margin-bottom:10px; }
  .login-brand h1 { font-size:29px; margin-bottom:12px; }
  .login-brand-copy > p:last-child { font-size:12px; max-width:100%; }
  .login-brand-footer { display:none; }
  .login-form-panel { padding:20px 28px 28px; }
  .login-form-top { margin-bottom:18px; }
  .login-field .input { font-size:16px; }
  .login-copyright { font-size:10px; padding-top:18px; }
}

/* Shared app chrome: compact brand, familiar tabs and unchanged account actions. */
.app-header { background:var(--surface); min-height:86px; padding:20px 22px; margin-bottom:16px; border-radius:16px; box-shadow:none; }
.app-header::before,.app-header::after { display:none; }
.app-title { display:flex; align-items:center; gap:14px; min-width:0; }
.app-brand-mark { display:flex; align-items:center; justify-content:center; flex-shrink:0; width:48px; height:48px; border-radius:13px; background:#164b39; color:#fff; font-family:var(--font-display); font-size:17px; font-weight:800; letter-spacing:-.06em; }
.app-title h1 { font-size:16px; line-height:1.4; color:var(--text-primary); text-wrap:wrap; }
:root:not([data-theme="light"]) .app-title h1 { color:var(--text-primary); }
.app-title p { font-size:11px; margin-top:3px; }
.header-actions { gap:8px; }
.header-actions .btn { min-height:36px; }
.badge-admin { background:var(--accent-soft); color:var(--accent-strong); border:1px solid var(--border); font-size:10px; }
:root:not([data-theme="light"]) .badge-admin { color:var(--accent-strong); }
.tabbar { gap:6px; border:0; padding:4px; margin-bottom:28px; background:var(--surface); border-radius:12px; }
a.tab-btn { font-size:12px; padding:10px 13px; border:0; border-radius:8px; }
.tab-btn.active { background:var(--accent-soft); color:var(--accent-strong); border:0; }
.tab-btn:hover { background:var(--surface-alt); }

/* Dashboard: stock first, then receiving and the next warehouse actions. */
.dashboard { --dash-gap:20px; }
.dash-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin:0 2px 22px; }
.dash-eyebrow { font-size:10px; font-weight:700; letter-spacing:.15em; color:var(--accent); margin:0 0 8px; }
.dash-heading h2 { font-size:30px; font-weight:800; letter-spacing:-.04em; line-height:1.2; }
.dash-subtitle { margin:9px 0 0; color:var(--text-secondary); font-size:13px; }
.dash-date { display:flex; flex-direction:column; gap:5px; text-align:right; font-size:12px; color:var(--text-primary); }
.dash-date span:last-child { font-size:10px; color:var(--text-secondary); }
.dash-toolbar { display:flex; justify-content:space-between; align-items:center; gap:16px; margin-bottom:20px; }
.dash-update { display:flex; align-items:center; gap:9px; color:var(--text-secondary); font-size:11px; }
.dash-update small { display:block; font-size:10px; color:var(--text-secondary); margin-top:2px; }
.dash-live-dot { width:7px; height:7px; border-radius:50%; background:var(--accent); flex-shrink:0; }
.dash-actions { display:flex; flex-wrap:wrap; gap:8px; }
.dash-actions .btn { min-height:39px; font-size:12px; }
.dash-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:var(--dash-gap); }
.dash-metric { min-width:0; padding:21px 22px 17px; border:1px solid var(--border); border-radius:15px; background:var(--surface); box-shadow:0 2px 4px rgb(0 0 0 / 2%); }
.dash-metric-top { display:flex; justify-content:space-between; align-items:center; gap:10px; color:var(--text-secondary); font-size:12px; font-weight:600; }
.dash-material-code { font-size:9px; letter-spacing:.05em; padding:4px 7px; border-radius:6px; color:var(--accent-strong); background:var(--accent-soft); }
.dash-metric-value { margin:17px 0 20px; font-family:var(--font-display); font-size:clamp(23px,2.3vw,32px); line-height:1.2; font-weight:800; letter-spacing:-.04em; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.dash-metric-value > span { font-family:var(--font-body); font-size:12px; letter-spacing:0; font-weight:500; color:var(--text-secondary); }
.dash-metric-foot { display:flex; align-items:center; justify-content:space-between; gap:8px; padding-top:12px; border-top:1px solid var(--border); color:var(--text-secondary); font-size:10px; }
.dash-metric-foot a { text-decoration:none; font-weight:600; white-space:nowrap; }
.dash-metric-pending { background:color-mix(in srgb,var(--warning-soft) 30%,var(--surface)); }
.dash-pending-symbol { display:flex; justify-content:center; align-items:center; width:26px; height:26px; font-size:20px; background:var(--warning-soft); color:var(--text-primary); border-radius:7px; }
.dash-workspace { display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:var(--dash-gap); align-items:start; }
.dash-panel { min-width:0; background:var(--surface); border:1px solid var(--border); border-radius:16px; overflow:hidden; }
.dash-panel-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:22px 22px 18px; }
.dash-panel-heading h3 { font-size:16px; font-weight:800; letter-spacing:-.02em; }
.dash-panel-heading p:not(.dash-eyebrow) { margin:5px 0 0; font-size:11px; color:var(--text-secondary); line-height:1.6; }
.dash-text-link { font-size:11px; font-weight:600; text-decoration:none; }
.dash-text-link:hover,.dash-lot-identity a:hover,.dash-queue a:hover { text-decoration:underline; }
.dash-receipt-tools { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:0 22px 18px; }
.dash-receipt-tools .input { width:100%; max-width:280px; min-width:0; min-height:38px; font-size:12px; background:var(--surface); }
.dash-view-switch { display:flex; gap:3px; flex-shrink:0; background:var(--surface-alt); padding:3px; border:1px solid var(--border); border-radius:8px; }
.dash-view-switch button { border:0; padding:7px 10px; background:transparent; color:var(--text-secondary); border-radius:5px; font-size:10px; font-weight:600; cursor:pointer; white-space:nowrap; }
.dash-view-switch button[aria-pressed="true"] { background:var(--surface); color:var(--text-primary); box-shadow:0 1px 3px rgb(0 0 0 / 10%); }
.dash-view-switch button:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.dash-receipt-grid-head,.dash-receipt-row { display:grid; grid-template-columns:minmax(0,1.7fr) minmax(0,.9fr) minmax(0,1fr) minmax(0,.85fr); gap:14px; align-items:center; padding:14px 22px; }
.dash-receipt-grid-head { background:var(--surface-alt); color:var(--text-secondary); font-size:9px; font-weight:600; letter-spacing:.06em; border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.dash-receipt-grid-head span:nth-child(3) { text-align:right; }
.dash-receipt-list { list-style:none; padding:0; margin:0; }
.dash-receipt-row { border-bottom:1px solid var(--border); font-size:12px; transition:background .12s; }
.dash-receipt-row:last-child { border-bottom:0; }
.dash-receipt-row:hover { background:var(--surface-alt); }
.dash-receipt-row > div { min-width:0; overflow-wrap:anywhere; }
.dash-lot-identity a { display:block; font-weight:700; font-size:13px; color:var(--text-primary); text-decoration:none; margin-bottom:4px; }
.dash-lot-identity > span { display:block; color:var(--text-secondary); font-size:11px; }
.dash-receipt-row small { display:block; color:var(--text-secondary); font-size:10px; margin-top:4px; }
.dash-lot-balance { text-align:right; font-variant-numeric:tabular-nums; }
.dash-lot-balance b { font-size:13px; white-space:nowrap; }
.dash-lot-balance b small { display:inline; font-size:9px; font-weight:400; }
.dash-status { display:inline-block; max-width:100%; font-size:10px; font-weight:600; padding:4px 8px; border-radius:6px; background:var(--surface-alt); color:var(--text-secondary); }
.dash-status-available { background:var(--accent-soft); color:var(--accent-strong); }
.dash-panel-footer { padding:15px 22px; border-top:1px solid var(--border); display:flex; justify-content:space-between; gap:12px; align-items:center; color:var(--text-secondary); font-size:10px; }
.dash-full-table { padding:0 10px; }
.dash-full-table .data-table { font-size:11px; }
.dash-count { display:inline-block; vertical-align:middle; border-radius:6px; padding:3px 6px; background:var(--surface-alt); font-family:var(--font-body); font-size:10px; margin-left:4px; }
.dash-queue { list-style:none; padding:0 22px; margin:0; }
.dash-queue li { padding:15px 0; display:flex; align-items:start; gap:12px; justify-content:space-between; border-top:1px solid var(--border); }
.dash-queue li > div { min-width:0; overflow-wrap:anywhere; }
.dash-queue a { display:block; font-size:12px; font-weight:700; color:var(--text-primary); text-decoration:none; }
.dash-queue a span { color:var(--accent); }
.dash-queue p { margin:5px 0 3px; font-size:11px; color:var(--text-secondary); }
.dash-queue small { font-size:10px; color:var(--text-secondary); }
.dash-queue b { font-size:12px; text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.dash-queue b small { display:block; font-size:9px; font-weight:400; margin-top:5px; }
.dash-queue-footer { padding:8px 22px 22px; }
.dash-queue-footer .btn { width:100%; justify-content:center; min-height:40px; font-size:11px; }
.dash-stock-note { display:flex; gap:12px; padding:20px 5px; }
.dash-note-mark { flex-shrink:0; width:19px; height:19px; display:flex; justify-content:center; align-items:center; border:1px solid var(--border-strong); border-radius:50%; font-family:serif; color:var(--text-secondary); }
.dash-stock-note h4 { font-family:var(--font-body); font-size:11px; font-weight:600; }
.dash-stock-note p { font-size:10px; line-height:1.8; color:var(--text-secondary); margin:7px 0; }
.dash-stock-note summary { font-size:10px; color:var(--accent); cursor:pointer; margin-top:10px; }
.dash-empty { padding:50px 24px; text-align:center; }
.dash-empty-mark { display:inline-flex; align-items:center; justify-content:center; width:46px; height:46px; background:var(--accent-soft); color:var(--accent); border-radius:13px; font-size:24px; margin-bottom:16px; }
.dash-empty h4 { font-size:15px; }
.dash-empty p { color:var(--text-secondary); font-size:12px; margin:9px 0 20px; }
.dash-pending-empty { text-align:center; padding:18px 22px 32px; }
.dash-pending-empty > span { display:inline-flex; width:34px; height:34px; justify-content:center; align-items:center; background:var(--accent-soft); color:var(--accent); border-radius:50%; margin-bottom:12px; }
.dash-pending-empty h4 { font-size:12px; }
.dash-pending-empty p { color:var(--text-secondary); font-size:11px; line-height:1.7; margin:8px 0 0; }
@media(max-width:1100px) {
  .dash-workspace { grid-template-columns:minmax(0,1fr); }
  .dash-sidebar { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px; }
  .dash-metric { padding:18px 16px 14px; }
}
@media(max-width:700px) {
  .app-header { padding:16px; align-items:flex-start; }
  .app-title h1 { font-size:14px; }
  .app-title p { font-size:10px; }
  .app-brand-mark { width:40px; height:40px; border-radius:10px; font-size:15px; }
  .header-actions { flex-wrap:wrap; }
  .tabbar { margin-bottom:22px; }
  .dash-heading { align-items:flex-start; margin-bottom:18px; }
  .dash-heading h2 { font-size:27px; }
  .dash-date { display:none; }
  .dash-subtitle { font-size:12px; max-width:300px; line-height:1.7; }
  .dash-toolbar { flex-direction:column; align-items:stretch; }
  .dash-actions .btn { justify-content:center; min-height:44px; flex:1; padding:8px 10px; font-size:11px; }
  .dash-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .dash-metric-top { font-size:11px; flex-wrap:wrap; gap:6px; }
  .dash-metric-value { font-size:24px; margin:14px 0; }
  .dash-metric-foot { flex-direction:column; align-items:flex-start; gap:3px; font-size:9px; }
  .dash-panel-heading { padding:18px; flex-wrap:wrap; }
  .dash-receipt-tools { padding:0 18px 16px; flex-wrap:wrap; }
  .dash-receipt-tools .input { max-width:none; min-height:44px; font-size:16px; }
  .dash-view-switch { width:100%; }
  .dash-view-switch button { flex:1; min-height:38px; font-size:11px; }
  .dash-receipt-grid-head { display:none; }
  .dash-receipt-list { border-top:1px solid var(--border); }
  .dash-receipt-row { grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:12px; padding:18px; }
  .dash-lot-identity { grid-column:1; grid-row:1; }
  .dash-lot-balance { grid-column:2; grid-row:1; }
  .dash-lot-origin { grid-column:1; grid-row:2; }
  .dash-lot-status { grid-column:2; grid-row:2; text-align:right; }
  .dash-lot-identity a { font-size:12px; }
  .dash-panel-footer { padding:16px 18px; flex-direction:column; align-items:flex-start; gap:8px; }
  .dash-sidebar { grid-template-columns:minmax(0,1fr); gap:0; }
  .dash-stock-note { padding:20px 8px; }
}

/* Phase 2: phone forms and printed warehouse documents. */
.fs-form { max-width: 980px; margin: 0 auto; }
.fs-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:18px 0; }
.fs-fields label, .fs-pallet label { display:flex; flex-direction:column; gap:6px; font-size:13px; font-weight:600; }
.fs-fields input,.fs-fields select,.fs-fields textarea { width:100%; min-width:0; }
.fs-wide { grid-column:1/-1; }
fieldset { border:0; min-width:0; padding:0; margin:0; }
.fs-footer { margin-top:20px; }
.fs-section { margin-top:24px; }
.fs-section summary { cursor:pointer; font-weight:700; padding:12px 0; border-top:1px solid var(--border); }
.fs-kpis { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:16px; margin:18px 0; }
.fs-photos { display:flex; flex-wrap:wrap; gap:16px; margin:16px 0; }
.fs-photos a { display:flex; flex-direction:column; gap:6px; font-size:12px; }
.fs-photos img { width:180px; height:130px; object-fit:cover; border-radius:8px; }
.fs-picker { display:flex; flex-direction:column; gap:5px; padding:16px; margin:10px 0; border:1px solid var(--border); border-radius:8px; color:var(--text-primary); text-decoration:none; }
.fs-picker:hover { border-color:var(--accent); }
.fs-pallet { border:1px solid var(--border); border-radius:8px; padding:16px; margin:16px 0; }
.fs-bags { display:flex; flex-wrap:wrap; gap:12px; margin:12px 0; }
.fs-bag { display:flex; gap:4px; align-items:end; }
.fs-bag input { width:92px; }
.fs-summary { padding:16px; background:var(--accent-soft); border-radius:8px; line-height:1.8; }
.fs-print-actions { text-align:center; margin:16px; }
.fs-label-sheet,.fs-weigh-sheet { background:white; color:black; width:271mm; min-height:184mm; padding:10mm; margin:16px auto; box-sizing:border-box; }
.fs-label-sheet h1 { font:700 52pt/1.1 Arial,sans-serif; text-align:center; margin:0 0 10mm; }
.fs-label-sheet table { width:100%; font:28pt/1.3 Arial,sans-serif; border-collapse:collapse; }
.fs-label-sheet td { padding:2mm; overflow-wrap:anywhere; }
.fs-label-sheet td:first-child { width:43%; }
.fs-weigh-sheet header,.fs-signatures { display:flex; justify-content:space-between; }
.fs-weigh-sheet h1 { text-align:center; margin:18px; font-size:22px; }
.fs-weigh-sheet table { width:100%; border-collapse:collapse; margin:16px 0; }
.fs-weigh-sheet td,.fs-weigh-sheet th { border:1px solid black; padding:8px; }
.fs-signatures { margin:30px 40px; }
@media(max-width:640px) {
  .fs-fields { grid-template-columns:1fr; }
  .fs-form .input,.fs-form .select,.fs-fields .input,.fs-fields .select { min-height:44px; font-size:16px; }
  .card-head { flex-wrap:wrap; gap:12px; }
  .fs-form .btn { min-height:44px; }
}
@media print {
  @page { size:A4 landscape; margin:12.7mm; }
  .fs-print-actions { display:none!important; }
  .fs-label-sheet,.fs-weigh-sheet { margin:0; padding:0; width:auto; min-height:0; }
  .fs-label-sheet { break-after:page; }
  .fs-label-sheet:last-of-type { break-after:auto; }
  .fs-weigh-sheet tr { break-inside:avoid; }
  .fs-weigh-sheet thead { display:table-header-group; }
}

/* Production workflow */
.production-metrics { display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:20px 0; }
.production-metrics>div { background:var(--bg);border:1px solid var(--border);border-radius:14px;padding:18px;display:grid;gap:6px; }
.production-metrics b { font-size:1.6rem; }.production-metrics span { color:var(--text-muted);font-size:.8rem; }
.production-panel { border:1px solid var(--border);border-radius:14px;padding:20px;margin:20px 0; }
.production-fields { display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px;margin:16px 0; }
.production-fields label,.production-charge label,.production-panel>label { display:grid;gap:6px;font-size:.85rem; }
.production-charge { display:grid;grid-template-columns:minmax(200px,2fr) repeat(3,minmax(100px,1fr)) auto;align-items:end;gap:12px;margin:16px 0; }
.production-panel input:not([type=checkbox]),.production-panel select,.production-fields input,.production-fields select { width:100%;min-width:0; }
.production-panel input[type=checkbox] { width:auto; }
@media(max-width:760px){.production-charge{grid-template-columns:1fr 1fr}.production-charge>label:first-child{grid-column:1/-1}.production-metrics{gap:8px}.production-metrics>div{padding:12px}.production-metrics b{font-size:1.15rem}.production-panel{padding:14px}.production-panel .card-head{flex-wrap:wrap}}
.dwo-print {font-size:10px;break-after:page}.dwo-print:last-child{break-after:auto}.dwo-print h1{font-size:17px;margin:12px 0}.dwo-print h3{font-size:12px;margin:12px 0 5px}.dwo-print-heading{display:flex;justify-content:space-between;line-height:1.6}.dwo-print table{font-size:10px}.dwo-print table td,.dwo-print table th{padding:5px}.dwo-print footer{text-align:center;font-size:9px;margin-top:10px}.dwo-print .fs-signatures{margin-top:14px}
@media print{.dwo-print{margin:0;padding:0;box-shadow:none}.dwo-print tr{break-inside:avoid}}

.production-panel .card-sub { overflow-wrap:anywhere; }
@media screen and (max-width:760px){
 .pwf-pallets,.pwf-pallets tbody,.pwf-pallets tr,.pwf-pallets td{display:block;min-width:0!important;width:100%}
 .pwf-pallets thead{display:none}.pwf-pallets tr{padding:8px;border-bottom:1px solid var(--border)}
 .pwf-pallets td{border:0!important;padding:6px 4px!important;white-space:normal!important}
 .pwf-pallets td[data-label]::before{content:attr(data-label);display:block;font-size:12px;color:var(--text-secondary);margin-bottom:4px}
 .pwf-pallets input{width:100%!important;min-width:0!important}
}
@media print{
 .dwo-print{font-size:9px;line-height:1.25;border:0;border-radius:0}
 .dwo-print:last-of-type{break-after:auto}
 .dwo-print h1{font-size:15px;margin:8px 0}.dwo-print h3{font-size:10px;margin:7px 0 4px}
 .dwo-print table{font-size:9px;margin:6px 0}.dwo-print table td,.dwo-print table th{padding:4px}
 .dwo-print p{margin:6px 0}.dwo-print .fs-signatures{margin-top:8px;line-height:1.2}
 .dwo-print footer{margin-top:8px;padding:0;font-size:8px}
 #blazor-error-ui,#components-reconnect-modal{display:none!important}
}

/* Racks and SFG */
.rack-nav {margin-bottom:18px;gap:8px;flex-wrap:wrap}
.rack-filters label,.rack-field {display:grid;gap:6px;font-size:13px}
.rack-field {margin:16px 0}.rack-field .input,.rack-field .select {width:100%}
.rack-zone {margin:26px 0}.rack-zone h3 {margin-bottom:14px}.rack-zone h3 small {font-size:12px;font-weight:500;color:var(--text-secondary);margin-left:12px}
.rack-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.rack-tile {border:1px solid var(--border);border-radius:12px;background:var(--surface-alt);overflow:hidden;min-width:0}
.rack-tile summary {cursor:pointer;padding:16px;display:grid;gap:7px}.rack-tile summary b {font-size:17px}.rack-tile summary span,.rack-tile summary small {font-size:12px;color:var(--text-secondary)}
.rack-occupied {border-top:3px solid var(--accent)}.rack-tile>.toolbar {padding:12px;flex-wrap:wrap}
.rack-lot-link {display:grid;gap:4px;padding:12px 16px;border-top:1px solid var(--border);text-decoration:none;overflow-wrap:anywhere}.rack-lot-link span{font-size:12px;color:var(--text-secondary)}
.rack-notice {padding:14px;border-radius:10px;background:var(--accent-soft);color:var(--text-primary);line-height:1.7}
.rack-check{display:flex;gap:12px;align-items:flex-start;line-height:1.7}.rack-check input{margin-top:7px}.rack-check span{overflow-wrap:anywhere;min-width:0}
.rack-review-item{border-bottom:1px solid var(--border);padding:14px 0}.rack-review-item p{font-size:13px}.rack-review>.btn{margin-top:14px}
.rack-manage-grid{display:flex;gap:8px;flex-wrap:wrap}.rack-print{font-size:11px}.rack-print table{font-size:10px}.rack-print footer{font-size:9px;text-align:center;margin-top:24px}.rack-blank-row{height:34px}
@media(max-width:760px){.rack-grid{grid-template-columns:1fr 1fr}.rack-tile summary{padding:12px}.rack-nav .btn{font-size:11px;white-space:normal}.rack-tile>.toolbar .btn{font-size:11px}.rack-filters{display:grid;grid-template-columns:1fr 1fr}.rack-filters label:first-child{grid-column:1/-1}.rack-review{padding:12px}.rack-manage-grid .btn{white-space:normal}}
@media print{.rack-print{font-size:10px;line-height:1.25;border:0;border-radius:0}.rack-print h1{font-size:18px;margin:10px 0}.rack-print table{margin:10px 0}.rack-print th,.rack-print td{padding:5px}.rack-print .fs-signatures{margin-top:16px}.rack-print footer{margin-top:14px}.rack-blank-row{height:30px}}

/* Phase 5 production workflows reuse the application's theme tokens. */
.phase5-nav { margin-bottom: 16px; flex-wrap: wrap; }
.phase5-list { margin-top: 20px; }
.phase5-form { border: 0; padding: 0; min-width: 0; display: grid; gap: 16px; }
.phase5-form.production-panel { padding: 18px; }
.phase5-form label { display: grid; gap: 6px; font-size: 13px; }
.phase5-form label:has(input[type=checkbox]) { display: flex; align-items: center; }
.phase5-form .production-fields { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.phase5-form .input, .phase5-form .select { width: 100%; min-width: 0; }
.phase5-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 20px 0; }
.phase5-metrics > div { border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.phase5-metrics span { display: block; font-size: 12px; margin-bottom: 8px; opacity: .75; }
.phase5-metrics strong { font-size: 20px; }
@media (max-width: 640px) { .phase5-metrics { grid-template-columns: 1fr; gap: 8px; } .phase5-metrics > div { padding: 12px; } .phase5-form .production-fields { grid-template-columns: 1fr; } }

/* Admin → Roles */
.roles-matrix { min-width: 720px; }
.roles-matrix th.role-col { text-align: center; vertical-align: top; }
.roles-matrix th.role-col div { margin-top: 4px; }
.roles-matrix td.center { text-align: center; }
.roles-matrix .is-selected { background: var(--accent-soft); }
.roles-matrix .group-row td { background: var(--surface-alt); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.roles-matrix .role-yes { color: var(--status-good); font-weight: 800; }
.roles-matrix .role-no { color: var(--text-muted); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--accent); cursor: pointer; text-decoration: underline; }
.link-btn:disabled { color: var(--text-muted); cursor: default; }
.roles-editor { border: 0; padding: 0; margin: 0; min-width: 0; }
.roles-editor section { margin-top: 18px; }
.roles-editor h3 { font-size: 13px; font-weight: 700; margin: 0 0 8px; }
.roles-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; }
.roles-perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px 16px; }
.roles-perms .perm { align-items: flex-start; }
.roles-perms .perm input { margin-top: 3px; }
.roles-perms .perm b { color: var(--text-primary); font-weight: 600; }
.roles-perms .perm small { display: block; color: var(--text-muted); font-size: 11.5px; margin-top: 2px; }
.roles-perms .perm.is-locked { opacity: .65; }
.roles-fixed { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-secondary); }

/* Feedback button (page header, every page) and its drop-down panel. */
.fb { position:relative; display:inline-flex; }
.fb-btn { border-color:var(--accent) !important; color:var(--accent) !important; }
/* Fixed, so the header card cannot clip it; lines up with the right edge of the page. */
.fb-panel { position:fixed; right:max(16px, calc((100vw - 1400px) / 2 + 24px)); top:96px; z-index:1100; width:min(380px, calc(100vw - 32px)); background:var(--surface); text-align:left; border:1px solid var(--border); border-radius:14px; box-shadow:0 18px 48px rgba(0,0,0,.22); padding:14px; display:grid; gap:10px; }
.fb-head { display:flex; justify-content:space-between; align-items:center; }
.fb-kinds { display:flex; flex-wrap:wrap; gap:6px; }
.fb-kinds label { display:inline-flex; align-items:center; gap:6px; font-size:12.5px; padding:5px 10px; border:1px solid var(--border-strong); border-radius:999px; cursor:pointer; }
.fb-kinds label.on { background:var(--accent-soft); border-color:var(--accent); font-weight:700; }
.fb-kinds input { display:none; }
.fb-panel textarea { width:100%; box-sizing:border-box; resize:vertical; }
.fb-thanks { margin:0; color:var(--accent); font-weight:600; }
.fb-text { min-width:260px; max-width:520px; white-space:pre-wrap; }
.fb-done { display:grid; gap:6px; border:0; padding:0; margin:0; min-width:220px; }
@media print { .fb { display:none; } }
/* Test copy banner (App:TestBanner). */
.test-banner { margin:0 0 12px; padding:9px 16px; border-radius:var(--radius-md, 10px); background:#fff1c2; color:#5c4300; border:1px solid #e9c46a; font-weight:700; font-size:13px; text-align:center; }

/* Sub-tabs (Production: DWO/SWO/XWO/FWO; SFG WH rack pages): show which page you are on. */
.sub-nav { flex-wrap: wrap; gap: 8px; }
.sub-nav .btn.active { background: var(--accent); color: var(--accent-ink, #fff); border-color: var(--accent); }
.sub-nav .btn.active:hover { filter: brightness(1.05); }

/* Analysis: AV spread bar (old app's "Sebaran" column) */
.ana-av-track{position:relative;height:16px;background:var(--surface-alt,#f1f4ee);border-radius:4px;}
.ana-av-range{position:absolute;top:7px;height:2px;background:#9aa58f;}
.ana-av-avg{position:absolute;top:3px;left:0;height:10px;opacity:.75;border-radius:3px;}
.ana-av-spec{position:absolute;top:0;bottom:0;width:2px;background:#c62828;}
.report-analysis .ana-chart h3{color:var(--text-primary);}
@media print{.report-analysis .ana-sec,.report-analysis .ana-banner,.report-analysis .ana-kpi,.report-analysis .ana-dot,.report-analysis .ana-av-track div{-webkit-print-color-adjust:exact;print-color-adjust:exact}.report-analysis .ana-chart{break-inside:avoid}}
