@import url('/assets/fonts/noto-sans-tc.css?v=20260801mass1');

@font-face {
  font-family: 'Barlow Condensed';
  src: url('/assets/fonts/barlow-condensed-600.woff2') format('woff2');
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('/assets/fonts/barlow-condensed-700.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/assets/fonts/ibm-plex-mono-500.woff2') format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-hover: #f2f5f9;
  --ink: #172033;
  --muted: #6f7888;
  --subtle: #9aa3b2;
  --border: #e4e8ee;
  --border-strong: #d8dde6;
  --primary: #3958d5;
  --primary-dark: #2844bc;
  --primary-soft: #eef1ff;
  --teal: #247f7a;
  --teal-soft: #eaf7f5;
  --green: #23845b;
  --green-soft: #eaf7f0;
  --amber: #b87514;
  --amber-soft: #fff5e3;
  --red: #ca4d50;
  --red-soft: #fff0f0;
  --violet: #7450bf;
  --violet-soft: #f2edff;
  --shadow-sm: 0 1px 2px rgba(21, 32, 53, .05);
  --shadow-md: 0 12px 36px rgba(21, 32, 53, .10);
  --sidebar-w: 244px;
  --topbar-h: 72px;
  --radius: 14px;
  --radius-sm: 10px;
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}
* { box-sizing: border-box; }
html { height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100%; color: var(--ink); font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { color: inherit; }
svg { display: block; }
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 50;
  display: flex; flex-direction: column; padding: 18px 14px 14px;
  background: #172033; color: #f8fafc; border-right: 1px solid rgba(255,255,255,.05);
  transition: width .22s ease, transform .22s ease;
}
.brand { display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 0 8px 16px; }
.brand-mark { width: 35px; height: 35px; flex: 0 0 auto; display: grid; grid-template-columns: repeat(3,1fr); gap: 3px; padding: 7px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: rgba(255,255,255,.06); }
.brand-mark span { border-radius: 3px; background: #8fa2ff; }
.brand-mark span:nth-child(2) { transform: translateY(4px); background: #6ed3c6; }
.brand-mark span:nth-child(3) { transform: translateY(-2px); background: #f1c36d; }
.brand strong { display:block; font-size: 13px; letter-spacing: .13em; }
.brand small { display:block; margin-top: 3px; color: #9ca8bc; font-size: 9px; letter-spacing: .04em; white-space: nowrap; }
.factory-chip { display:flex; align-items:center; gap:10px; margin: 2px 0 14px; padding: 11px 10px; border:1px solid rgba(255,255,255,.09); border-radius: 12px; background:rgba(255,255,255,.045); }
.factory-icon { width:30px; height:30px; display:grid; place-items:center; flex:0 0 auto; border-radius:8px; background:#2b3851; color:#b9c5d8; font-size:12px; }
.factory-chip strong { display:block; font-size:12px; font-weight:600; white-space:nowrap; }
.factory-chip small { display:block; margin-top:4px; color:#8f9aad; font-size:10px; white-space:nowrap; }
.nav-list { display:flex; flex-direction:column; gap:4px; }
.nav-item { width:100%; height:43px; padding:0 10px; display:flex; align-items:center; gap:11px; border:0; border-radius:10px; color:#aeb8c9; background:transparent; cursor:pointer; text-align:left; transition:.18s ease; }
.nav-item:hover { color:#fff; background:rgba(255,255,255,.055); }
.nav-item.active { color:#fff; background:#2c3e72; box-shadow: inset 0 0 0 1px rgba(143,162,255,.18); }
.nav-icon { width:19px; height:19px; display:grid; place-items:center; flex:0 0 auto; }
.nav-icon svg { width:18px; height:18px; }
.nav-item > span:nth-child(2) { white-space:nowrap; }
.nav-count { margin-left:auto; min-width:22px; height:20px; padding:0 6px; display:grid; place-items:center; border-radius:999px; background:#463b48; color:#ffaaaa; font-size:11px; }
.nav-count.warning { color:#f5cf83; background:#423a2e; }
.sidebar-spacer { flex:1; }
.demo-status { margin:10px 4px 12px; padding:12px; border-radius:12px; background:rgba(255,255,255,.045); border:1px solid rgba(255,255,255,.07); }
.status-line { display:flex; align-items:center; gap:7px; color:#e9eef6; font-size:11px; }
.live-dot, .sync-dot { width:7px; height:7px; border-radius:50%; background:#5cd29e; box-shadow:0 0 0 4px rgba(92,210,158,.10); }
.demo-status small { display:block; margin:7px 0 9px; color:#8995a8; font-size:10px; }
.status-tags { display:flex; gap:6px; }
.status-tags span { padding:4px 6px; border-radius:6px; background:rgba(255,255,255,.06); color:#aeb8c8; font-size:9px; }
.collapse-button { height:38px; display:flex; align-items:center; gap:10px; padding:0 10px; border:0; border-radius:9px; color:#8995a8; background:transparent; cursor:pointer; }
.collapse-button:hover { background:rgba(255,255,255,.05); color:#fff; }
.collapse-button svg { width:16px; height:16px; }
body.sidebar-collapsed { --sidebar-w: 76px; }
body.sidebar-collapsed .brand > div:last-child,
body.sidebar-collapsed .factory-chip > div,
body.sidebar-collapsed .nav-item > span:nth-child(2),
body.sidebar-collapsed .nav-count,
body.sidebar-collapsed .demo-status,
body.sidebar-collapsed .collapse-label { display:none; }
body.sidebar-collapsed .brand { justify-content:center; padding-left:0; padding-right:0; }
body.sidebar-collapsed .factory-chip { justify-content:center; padding-left:0; padding-right:0; }
body.sidebar-collapsed .nav-item { justify-content:center; padding:0; }
body.sidebar-collapsed .collapse-button { justify-content:center; }
body.sidebar-collapsed .collapse-button svg { transform:rotate(180deg); }
.main-area { min-height:100vh; margin-left:var(--sidebar-w); transition:margin-left .22s ease; }
.topbar { height:var(--topbar-h); padding:0 28px; display:flex; align-items:center; justify-content:space-between; background:rgba(255,255,255,.92); border-bottom:1px solid var(--border); position:sticky; top:0; z-index:40; backdrop-filter:blur(14px); }
.mobile-heading { display:flex; align-items:center; gap:10px; }
.mobile-heading small { display:block; margin-bottom:4px; color:var(--subtle); font-size:10px; letter-spacing:.04em; text-transform:uppercase; }
.mobile-heading strong { font-size:17px; font-weight:700; }
.mobile-menu { display:none !important; }
.topbar-actions { min-width:0; flex:1; display:flex; align-items:center; justify-content:flex-end; gap:10px; }
.language-switcher { flex:0 0 auto; display:flex; align-items:center; gap:2px; padding:3px; border:1px solid var(--border); border-radius:4px; background:var(--surface-soft); }
.language-switcher button { min-height:36px; padding:0 10px; border:0; border-radius:2px; background:transparent; color:var(--muted); font-size:14px; font-weight:700; cursor:pointer; }
.language-switcher button.active { background:var(--ink); color:#fff; }
.language-switcher button:focus-visible { outline:3px solid rgba(40,79,91,.28); outline-offset:2px; }
.global-search { min-width:190px; width:290px; flex:1 1 290px; height:39px; display:flex; align-items:center; gap:8px; padding:0 10px; border:1px solid var(--border); border-radius:10px; background:var(--surface-soft); color:var(--muted); }
.global-search:focus-within { border-color:#aab8f2; box-shadow:0 0 0 3px rgba(57,88,213,.08); background:#fff; }
.global-search svg { width:16px; height:16px; flex:0 0 auto; }
.global-search input { flex:1; width:100%; border:0; outline:0; background:transparent; color:var(--ink); font-size:12px; }
.global-search kbd { padding:2px 5px; border:1px solid var(--border); border-bottom-width:2px; border-radius:5px; background:#fff; color:var(--subtle); font-size:9px; }
.sync-indicator { flex:0 1 170px; display:flex; align-items:center; gap:9px; min-width:126px; padding:0 5px; }
.sync-indicator strong { display:block; color:#3f4a5d; font-size:11px; font-weight:600; }
.sync-indicator small { display:block; margin-top:2px; color:var(--subtle); font-size:9px; }
.secondary-button, .filter-button { height:38px; display:inline-flex; align-items:center; justify-content:center; gap:7px; padding:0 12px; border:1px solid var(--border); border-radius:9px; background:#fff; color:#485368; font-weight:600; font-size:11px; cursor:pointer; box-shadow:var(--shadow-sm); }
.secondary-button:hover, .filter-button:hover { background:var(--surface-hover); border-color:var(--border-strong); }
.secondary-button svg, .filter-button svg { width:15px; height:15px; }
#export-btn, .avatar-button { flex:0 0 auto; }
#export-btn { white-space:nowrap; }
.avatar-button { width:36px; height:36px; border:0; border-radius:50%; background:#e9edff; color:#4059bd; font-size:11px; font-weight:700; cursor:pointer; }
.icon-button { width:36px; height:36px; display:grid; place-items:center; padding:0; border:1px solid var(--border); border-radius:9px; background:#fff; color:#687386; cursor:pointer; }
.icon-button:hover { background:var(--surface-hover); color:var(--ink); }
.icon-button svg { width:16px; height:16px; }
.page-toolbar { min-height:64px; padding:12px 28px; display:flex; align-items:center; justify-content:space-between; gap:18px; background:var(--bg); border-bottom:1px solid #e9edf2; position:sticky; top:var(--topbar-h); z-index:30; }
.period-control-group, .filter-control-group { display:flex; align-items:center; gap:10px; }
.segmented { display:flex; align-items:center; gap:3px; padding:3px; border:1px solid var(--border); border-radius:10px; background:#fff; box-shadow:var(--shadow-sm); }
.segmented button { min-width:40px; height:30px; padding:0 10px; border:0; border-radius:7px; background:transparent; color:var(--muted); font-size:11px; font-weight:600; cursor:pointer; }
.segmented button:hover { color:var(--ink); }
.segmented button.active { background:var(--ink); color:#fff; box-shadow:0 2px 7px rgba(23,32,51,.18); }
.period-nav { display:flex; align-items:center; gap:5px; }
.period-nav .icon-button { width:32px; height:32px; }
.period-label { min-width:142px; height:32px; padding:0 9px; border:0; background:transparent; color:#3a4558; font-size:12px; font-weight:650; cursor:default; }
.page-content { padding:0 28px 40px; max-width:1720px; margin:0 auto; }
.page-intro { display:flex; align-items:flex-end; justify-content:space-between; gap:20px; padding:26px 0 18px; }
.page-intro h1 { margin:0; font-size:24px; letter-spacing:-.02em; }
.page-intro p { margin:7px 0 0; color:var(--muted); font-size:12px; line-height:1.6; }
.page-intro-actions { display:flex; gap:8px; }
.primary-button { height:38px; padding:0 14px; display:inline-flex; align-items:center; gap:7px; border:0; border-radius:9px; background:var(--primary); color:#fff; font-size:11px; font-weight:650; cursor:pointer; box-shadow:0 5px 14px rgba(57,88,213,.20); }
.primary-button:hover { background:var(--primary-dark); }
.primary-button svg { width:15px; height:15px; }
.summary-card { position:relative; overflow:hidden; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:24px; align-items:center; margin-bottom:16px; padding:20px 22px; border:1px solid #dfe4f3; border-radius:var(--radius); background:linear-gradient(115deg,#ffffff 0%,#f7f8ff 68%,#f0f3ff 100%); box-shadow:var(--shadow-sm); }
.summary-card::after { content:""; position:absolute; right:-55px; top:-75px; width:190px; height:190px; border-radius:50%; border:30px solid rgba(57,88,213,.035); }
.summary-kicker { display:flex; align-items:center; gap:7px; color:var(--primary); font-size:10px; font-weight:800; letter-spacing:.08em; text-transform:uppercase; }
.summary-kicker svg { width:15px; height:15px; }
.summary-card h2 { max-width:980px; margin:9px 0 7px; font-size:16px; line-height:1.55; font-weight:660; letter-spacing:-.01em; }
.summary-card p { max-width:980px; margin:0; color:var(--muted); font-size:11px; line-height:1.65; }
.summary-side { position:relative; z-index:1; display:flex; align-items:center; gap:22px; padding-left:20px; border-left:1px solid #e3e7f1; }
.summary-stat strong { display:block; font-size:20px; letter-spacing:-.02em; }
.summary-stat small { display:block; margin-top:4px; color:var(--muted); font-size:9px; }
.kpi-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:12px; margin-bottom:16px; }
.kpi-card { min-width:0; padding:16px; border:1px solid var(--border); border-radius:var(--radius); background:#fff; box-shadow:var(--shadow-sm); cursor:pointer; transition:.18s ease; }
.kpi-card:hover { transform:translateY(-1px); border-color:#cfd7e4; box-shadow:0 9px 26px rgba(21,32,53,.07); }
.kpi-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.kpi-label { color:#667185; font-size:10px; font-weight:650; white-space:nowrap; }
.kpi-icon { width:28px; height:28px; display:grid; place-items:center; border-radius:8px; background:var(--surface-soft); color:var(--muted); }
.kpi-icon svg { width:14px; height:14px; }
.kpi-card.primary .kpi-icon { background:var(--primary-soft); color:var(--primary); }
.kpi-card.success .kpi-icon { background:var(--green-soft); color:var(--green); }
.kpi-card.warning .kpi-icon { background:var(--amber-soft); color:var(--amber); }
.kpi-card.danger .kpi-icon { background:var(--red-soft); color:var(--red); }
.kpi-value { display:flex; align-items:baseline; gap:4px; margin-top:12px; }
.kpi-value strong { font-size:25px; line-height:1; letter-spacing:-.035em; }
.kpi-value span { color:var(--muted); font-size:10px; }
.kpi-foot { min-height:28px; display:flex; align-items:flex-end; justify-content:space-between; gap:8px; margin-top:9px; }
.kpi-foot small { color:var(--subtle); font-size:9px; line-height:1.45; }
.trend-pill { display:inline-flex; align-items:center; gap:3px; color:var(--green); font-size:9px; font-weight:700; }
.trend-pill.down { color:var(--red); }
.mini-spark { width:62px; height:24px; }
.dashboard-grid { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:14px; margin-bottom:14px; }
.panel { min-width:0; border:1px solid var(--border); border-radius:var(--radius); background:#fff; box-shadow:var(--shadow-sm); }
.panel.span-8 { grid-column:span 8; }
.panel.span-7 { grid-column:span 7; }
.panel.span-6 { grid-column:span 6; }
.panel.span-5 { grid-column:span 5; }
.panel.span-4 { grid-column:span 4; }
.panel.span-12 { grid-column:span 12; }
.panel-header { min-height:58px; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 16px 10px; }
.panel-title h3 { margin:0; font-size:13px; letter-spacing:-.01em; }
.panel-title p { margin:4px 0 0; color:var(--subtle); font-size:9px; }
.panel-actions { display:flex; align-items:center; gap:6px; }
.metric-legend { display:flex; align-items:center; gap:12px; color:var(--muted); font-size:9px; }
.metric-legend span { display:flex; align-items:center; gap:5px; white-space:nowrap; }
.legend-dot { width:7px; height:7px; border-radius:50%; background:var(--primary); }
.legend-dot.secondary { background:var(--teal); }
.legend-dot.plan { background:#c4cad4; }
.panel-body { padding:0 16px 16px; }
.chart-host { width:100%; min-height:245px; position:relative; }
.chart-host.compact { min-height:205px; }
.chart-host svg { width:100%; height:auto; overflow:visible; }
.chart-empty { height:220px; display:grid; place-items:center; color:var(--subtle); font-size:11px; }
.chart-tooltip { position:fixed; z-index:100; pointer-events:none; transform:translate(-50%,calc(-100% - 10px)); padding:8px 9px; border-radius:8px; background:#172033; color:#fff; box-shadow:var(--shadow-md); font-size:10px; opacity:0; transition:opacity .12s ease; }
.chart-tooltip.show { opacity:1; }
.donut-layout { min-height:205px; display:grid; grid-template-columns:155px 1fr; align-items:center; gap:10px; }
.donut-wrap { position:relative; width:145px; height:145px; margin:auto; }
.donut-wrap svg { width:100%; height:100%; transform:rotate(-90deg); }
.donut-center { position:absolute; inset:0; display:grid; place-content:center; text-align:center; }
.donut-center strong { font-size:25px; line-height:1; }
.donut-center span { margin-top:5px; color:var(--muted); font-size:9px; }
.donut-legend { display:flex; flex-direction:column; gap:9px; }
.donut-item { display:grid; grid-template-columns:8px minmax(0,1fr) auto; align-items:center; gap:8px; color:#536075; font-size:10px; }
.donut-item .swatch { width:8px; height:8px; border-radius:3px; }
.donut-item b { color:var(--ink); font-size:10px; }
.bar-list { display:flex; flex-direction:column; gap:12px; padding-top:4px; }
.bar-row { display:grid; grid-template-columns:minmax(95px,1.25fr) 2.8fr auto; align-items:center; gap:10px; }
.bar-label { min-width:0; }
.bar-label strong { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; font-weight:650; }
.bar-label small { display:block; margin-top:3px; color:var(--subtle); font-size:8px; }
.bar-track { height:7px; overflow:hidden; border-radius:99px; background:#edf0f4; }
.bar-fill { height:100%; border-radius:inherit; background:linear-gradient(90deg,#5872dc,#3958d5); }
.bar-row:nth-child(even) .bar-fill { background:linear-gradient(90deg,#3c9e95,#247f7a); }
.bar-value { min-width:44px; text-align:right; color:#49556a; font-size:9px; font-weight:700; }
.line-load-list { display:flex; flex-direction:column; gap:12px; }
.line-load-card { padding:13px; border:1px solid var(--border); border-radius:11px; background:var(--surface-soft); }
.line-load-top { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; }
.line-load-name { display:flex; align-items:center; gap:9px; }
.line-badge { width:32px; height:32px; display:grid; place-items:center; border-radius:9px; background:var(--primary-soft); color:var(--primary); font-size:10px; font-weight:800; }
.line-badge.teal { background:var(--teal-soft); color:var(--teal); }
.line-load-name strong { display:block; font-size:11px; }
.line-load-name small { display:block; margin-top:3px; color:var(--muted); font-size:8px; }
.line-load-metric { text-align:right; }
.line-load-metric strong { font-size:18px; }
.line-load-metric small { display:block; margin-top:2px; color:var(--muted); font-size:8px; }
.progress-track { height:8px; overflow:hidden; margin-top:12px; border-radius:99px; background:#e7ebf0; }
.progress-fill { height:100%; border-radius:inherit; background:var(--primary); }
.progress-fill.teal { background:var(--teal); }
.line-load-foot { display:flex; justify-content:space-between; gap:10px; margin-top:9px; color:var(--muted); font-size:8px; }
.line-load-foot .alert-note { color:var(--amber); font-weight:650; }
.table-panel { overflow:hidden; }
.table-tools { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; border-top:1px solid var(--border); border-bottom:1px solid var(--border); background:var(--surface-soft); }
.table-filters { display:flex; gap:6px; overflow:auto; }
.table-filter { height:29px; padding:0 10px; border:1px solid transparent; border-radius:8px; background:transparent; color:var(--muted); font-size:9px; font-weight:650; cursor:pointer; white-space:nowrap; }
.table-filter:hover { background:#fff; }
.table-filter.active { border-color:var(--border); background:#fff; color:var(--ink); box-shadow:var(--shadow-sm); }
.table-search { width:220px; height:31px; display:flex; align-items:center; gap:7px; padding:0 9px; border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--subtle); }
.table-search svg { width:14px; height:14px; }
.table-search input { width:100%; border:0; outline:0; background:transparent; font-size:10px; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; }
th { height:38px; padding:0 12px; border-bottom:1px solid var(--border); color:#8b95a5; background:#fbfcfd; text-align:left; font-size:8px; font-weight:700; letter-spacing:.04em; white-space:nowrap; text-transform:uppercase; }
td { height:52px; padding:8px 12px; border-bottom:1px solid #edf0f3; color:#445067; font-size:10px; vertical-align:middle; white-space:nowrap; }
tbody tr { cursor:pointer; transition:.13s ease; }
tbody tr:hover { background:#fafbfe; }
tbody tr:last-child td { border-bottom:0; }
.order-id { color:var(--ink); font-weight:720; letter-spacing:.01em; }
.cell-primary { display:block; max-width:170px; overflow:hidden; text-overflow:ellipsis; color:#303b4f; font-weight:600; }
.cell-secondary { display:block; max-width:170px; overflow:hidden; text-overflow:ellipsis; margin-top:3px; color:var(--subtle); font-size:8px; }
.status-badge { display:inline-flex; align-items:center; gap:5px; height:23px; padding:0 8px; border-radius:999px; background:#f1f3f6; color:#647084; font-size:8px; font-weight:750; }
.status-badge::before { content:""; width:5px; height:5px; border-radius:50%; background:currentColor; opacity:.7; }
.status-badge.success { background:var(--green-soft); color:var(--green); }
.status-badge.primary { background:var(--primary-soft); color:var(--primary); }
.status-badge.warning { background:var(--amber-soft); color:var(--amber); }
.status-badge.danger { background:var(--red-soft); color:var(--red); }
.risk-indicator { display:inline-flex; align-items:center; gap:7px; font-size:9px; }
.risk-indicator span { width:7px; height:7px; border-radius:50%; background:#9aa3b2; }
.risk-indicator.high { color:var(--red); font-weight:700; }
.risk-indicator.high span { background:var(--red); box-shadow:0 0 0 4px var(--red-soft); }
.risk-indicator.medium { color:var(--amber); font-weight:700; }
.risk-indicator.medium span { background:var(--amber); }
.risk-indicator.low { color:var(--green); }
.risk-indicator.low span { background:var(--green); }
.inline-progress { width:96px; }
.inline-progress-top { display:flex; justify-content:space-between; margin-bottom:5px; color:var(--muted); font-size:8px; }
.inline-progress .progress-track { height:5px; margin:0; }
.table-action { width:28px; height:28px; border:0; border-radius:7px; background:transparent; color:var(--subtle); cursor:pointer; }
.table-action:hover { background:var(--surface-hover); color:var(--ink); }
.selection-button { height:29px; min-width:54px; padding:0 9px; border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--muted); font-size:9px; font-weight:650; cursor:pointer; }
.selection-button.selected { border-color:#aab8f2; background:var(--primary-soft); color:var(--primary); }
.bulk-bar { position:sticky; bottom:14px; z-index:12; display:flex; align-items:center; justify-content:space-between; gap:16px; width:min(760px,calc(100% - 30px)); margin:14px auto 0; padding:11px 13px; border:1px solid #cfd6e6; border-radius:12px; background:rgba(255,255,255,.95); box-shadow:0 14px 40px rgba(21,32,53,.16); backdrop-filter:blur(12px); }
.bulk-bar.hidden { display:none; }
.bulk-info { display:flex; align-items:center; gap:10px; }
.bulk-count { width:30px; height:30px; display:grid; place-items:center; border-radius:8px; background:var(--primary); color:#fff; font-size:11px; font-weight:750; }
.bulk-info strong { display:block; font-size:10px; }
.bulk-info small { display:block; margin-top:3px; color:var(--muted); font-size:8px; }
.bulk-actions { display:flex; gap:6px; }
.pagination { display:flex; align-items:center; justify-content:space-between; padding:11px 16px; border-top:1px solid var(--border); color:var(--muted); font-size:9px; }
.pagination-buttons { display:flex; gap:4px; }
.page-button { min-width:28px; height:28px; border:1px solid var(--border); border-radius:7px; background:#fff; color:var(--muted); font-size:9px; cursor:pointer; }
.page-button.active { border-color:var(--ink); background:var(--ink); color:#fff; }
.page-button:disabled { opacity:.45; cursor:not-allowed; }
.stat-strip { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; margin-bottom:14px; border:1px solid var(--border); border-radius:var(--radius); background:#fff; box-shadow:var(--shadow-sm); overflow:hidden; }
.stat-strip-item { padding:17px 18px; border-right:1px solid var(--border); }
.stat-strip-item:last-child { border-right:0; }
.stat-strip-item span { color:var(--muted); font-size:9px; }
.stat-strip-item strong { display:block; margin-top:8px; font-size:22px; }
.stat-strip-item small { display:block; margin-top:4px; color:var(--subtle); font-size:8px; }
.production-board { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.production-line-panel { padding:17px; border:1px solid var(--border); border-radius:var(--radius); background:#fff; box-shadow:var(--shadow-sm); }
.production-line-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.production-line-title { display:flex; gap:11px; }
.production-line-title .line-badge { width:38px; height:38px; }
.production-line-title h3 { margin:1px 0 4px; font-size:13px; }
.production-line-title p { margin:0; color:var(--muted); font-size:9px; }
.big-util { text-align:right; }
.big-util strong { display:block; font-size:26px; letter-spacing:-.04em; }
.big-util span { color:var(--muted); font-size:8px; }
.production-metrics { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:15px; }
.production-metric { padding:10px; border-radius:9px; background:var(--surface-soft); }
.production-metric span { color:var(--muted); font-size:8px; }
.production-metric strong { display:block; margin-top:5px; font-size:13px; }
.staff-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:8px; }
.staff-card { padding:11px; border:1px solid var(--border); border-radius:10px; background:#fff; }
.staff-avatar { width:30px; height:30px; display:grid; place-items:center; border-radius:9px; background:var(--primary-soft); color:var(--primary); font-size:9px; font-weight:750; }
.staff-card:nth-child(even) .staff-avatar { background:var(--teal-soft); color:var(--teal); }
.staff-card strong { display:block; margin-top:8px; font-size:9px; }
.staff-card span { display:block; margin-top:3px; color:var(--muted); font-size:8px; }
.staff-presence { display:flex; align-items:center; gap:5px; margin-top:7px !important; color:var(--green) !important; }
.staff-presence.off { color:var(--amber) !important; }
.staff-presence::before { content:""; width:5px; height:5px; border-radius:50%; background:currentColor; }
.inventory-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.inventory-card { padding:14px; border:1px solid var(--border); border-radius:12px; background:#fff; box-shadow:var(--shadow-sm); }
.inventory-card.critical { border-color:#f1c6c8; background:linear-gradient(180deg,#fff,#fffafa); }
.inventory-card.low { border-color:#f0d8ad; background:linear-gradient(180deg,#fff,#fffcf7); }
.inventory-card-head { display:flex; justify-content:space-between; gap:10px; }
.inventory-card h4 { margin:0; font-size:11px; }
.inventory-card p { margin:4px 0 0; color:var(--muted); font-size:8px; }
.stock-ratio { margin-top:13px; }
.stock-ratio-top { display:flex; justify-content:space-between; margin-bottom:6px; color:var(--muted); font-size:8px; }
.stock-ratio .progress-track { height:6px; margin:0; }
.stock-ratio .progress-fill { background:var(--amber); }
.inventory-card.critical .stock-ratio .progress-fill { background:var(--red); }
.stock-numbers { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:12px; }
.stock-numbers div { padding:8px; border-radius:8px; background:var(--surface-soft); }
.stock-numbers span { display:block; color:var(--subtle); font-size:7px; }
.stock-numbers strong { display:block; margin-top:4px; font-size:10px; }
.rule-list { display:flex; flex-direction:column; gap:10px; }
.rule-card { display:grid; grid-template-columns:38px minmax(0,1fr) auto; align-items:center; gap:12px; padding:13px; border:1px solid var(--border); border-radius:11px; background:#fff; }
.rule-number { width:38px; height:38px; display:grid; place-items:center; border-radius:10px; background:var(--surface-soft); color:var(--primary); font-size:11px; font-weight:800; }
.rule-card h4 { margin:0; font-size:10px; }
.rule-card p { margin:5px 0 0; color:var(--muted); font-size:8px; line-height:1.55; }
.rule-state { display:flex; align-items:center; gap:6px; color:var(--green); font-size:8px; font-weight:700; }
.rule-state::before { content:""; width:6px; height:6px; border-radius:50%; background:var(--green); }
.source-list { display:flex; flex-direction:column; }
.source-row { display:grid; grid-template-columns:1.25fr 1fr .8fr .7fr .8fr; align-items:center; gap:12px; min-height:54px; padding:8px 14px; border-bottom:1px solid var(--border); font-size:9px; }
.source-row:last-child { border-bottom:0; }
.source-row.header { min-height:35px; color:var(--subtle); background:var(--surface-soft); font-size:8px; font-weight:700; text-transform:uppercase; }
.source-name strong { display:block; font-size:10px; }
.source-name small { display:block; margin-top:3px; color:var(--subtle); font-size:8px; }
.drawer-backdrop { position:fixed; inset:0; z-index:80; background:rgba(17,25,39,.22); opacity:0; pointer-events:none; transition:.2s ease; }
.drawer-backdrop.open { opacity:1; pointer-events:auto; }
.detail-drawer { position:fixed; top:0; right:0; bottom:0; z-index:90; width:min(500px,100vw); background:#fff; box-shadow:-20px 0 55px rgba(21,32,53,.18); transform:translateX(102%); transition:transform .24s ease; }
.detail-drawer.open { transform:translateX(0); }
.drawer-header { height:78px; display:flex; align-items:center; justify-content:space-between; padding:0 20px; border-bottom:1px solid var(--border); }
.drawer-header small { color:var(--subtle); font-size:9px; }
.drawer-header h2 { margin:5px 0 0; font-size:18px; }
.drawer-content { height:calc(100% - 78px); overflow:auto; padding:20px; }
.drawer-summary { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px; border:1px solid var(--border); border-radius:12px; background:var(--surface-soft); }
.drawer-summary strong { display:block; font-size:13px; }
.drawer-summary span { display:block; margin-top:4px; color:var(--muted); font-size:9px; }
.drawer-section { margin-top:22px; }
.drawer-section h3 { margin:0 0 11px; font-size:11px; }
.detail-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
.detail-item { padding:10px; border-radius:9px; background:var(--surface-soft); }
.detail-item span { display:block; color:var(--subtle); font-size:8px; }
.detail-item strong { display:block; margin-top:5px; font-size:10px; }
.risk-list { display:flex; flex-direction:column; gap:7px; }
.risk-item { display:flex; align-items:flex-start; gap:8px; padding:9px 10px; border-radius:9px; background:var(--red-soft); color:#7f3f42; font-size:9px; line-height:1.45; }
.risk-item::before { content:"!"; width:17px; height:17px; display:grid; place-items:center; flex:0 0 auto; border-radius:50%; background:var(--red); color:#fff; font-size:9px; font-weight:800; }
.timeline { position:relative; display:flex; flex-direction:column; gap:0; }
.timeline-item { position:relative; display:grid; grid-template-columns:18px 1fr; gap:10px; min-height:51px; }
.timeline-item:not(:last-child)::before { content:""; position:absolute; left:7px; top:15px; bottom:-2px; width:1px; background:var(--border-strong); }
.timeline-dot { width:15px; height:15px; border:4px solid #fff; border-radius:50%; background:var(--green); box-shadow:0 0 0 1px #a7d9c1; z-index:1; }
.timeline-item.pending .timeline-dot { background:#fff; box-shadow:0 0 0 1px #c8ced8; }
.timeline-item.alert .timeline-dot { background:var(--red); box-shadow:0 0 0 1px #e5aeb0; }
.timeline-content strong { display:block; font-size:9px; }
.timeline-content span { display:block; margin-top:4px; color:var(--muted); font-size:8px; }
.drawer-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:22px; }
.drawer-actions a, .drawer-actions button { text-decoration:none; }
.dropdown-menu { position:fixed; z-index:110; min-width:190px; display:none; padding:6px; border:1px solid var(--border); border-radius:10px; background:#fff; box-shadow:var(--shadow-md); }
.dropdown-menu.open { display:block; }
.dropdown-option { width:100%; height:34px; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:0 9px; border:0; border-radius:7px; background:transparent; color:#536075; font-size:10px; cursor:pointer; }
.dropdown-option:hover { background:var(--surface-hover); color:var(--ink); }
.dropdown-option.active { background:var(--primary-soft); color:var(--primary); font-weight:700; }
.toast-container { position:fixed; right:18px; bottom:18px; z-index:130; display:flex; flex-direction:column; gap:8px; }
.toast { min-width:260px; max-width:380px; display:flex; align-items:flex-start; gap:9px; padding:11px 12px; border:1px solid var(--border); border-radius:10px; background:#fff; box-shadow:var(--shadow-md); animation:toast-in .22s ease; }
.toast-icon { width:25px; height:25px; display:grid; place-items:center; border-radius:8px; background:var(--green-soft); color:var(--green); }
.toast strong { display:block; font-size:10px; }
.toast span { display:block; margin-top:3px; color:var(--muted); font-size:8px; }
@keyframes toast-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
.empty-state { min-height:280px; display:grid; place-items:center; padding:30px; text-align:center; color:var(--muted); }
.empty-state strong { display:block; color:var(--ink); font-size:13px; }
.empty-state p { max-width:420px; margin:8px auto 0; font-size:10px; line-height:1.6; }
@media (max-width:1320px) {
  .kpi-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .panel.span-8, .panel.span-7 { grid-column:span 12; }
  .panel.span-4, .panel.span-5 { grid-column:span 6; }
  .staff-grid { grid-template-columns:repeat(5,1fr); }
}
@media (max-width:1024px) {
  :root { --sidebar-w:76px; }
  .brand > div:last-child, .factory-chip > div, .nav-item > span:nth-child(2), .nav-count, .demo-status, .collapse-label { display:none; }
  .brand, .factory-chip, .nav-item, .collapse-button { justify-content:center; padding-left:0; padding-right:0; }
  .global-search { width:220px; }
  .sync-indicator { display:none; }
  .summary-card { grid-template-columns:1fr; }
  .summary-side { padding:12px 0 0; border-left:0; border-top:1px solid #e3e7f1; }
  .production-board { grid-template-columns:1fr; }
  .inventory-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:760px) {
  :root { --sidebar-w:0px; --topbar-h:64px; }
  .sidebar { width:244px; transform:translateX(-102%); box-shadow:20px 0 50px rgba(0,0,0,.2); }
  .sidebar.mobile-open { transform:translateX(0); }
  .sidebar .brand > div:last-child, .sidebar .factory-chip > div, .sidebar .nav-item > span:nth-child(2), .sidebar .nav-count, .sidebar .demo-status, .sidebar .collapse-label { display:block; }
  .sidebar .brand, .sidebar .factory-chip, .sidebar .nav-item, .sidebar .collapse-button { justify-content:flex-start; padding-left:10px; padding-right:10px; }
  .mobile-menu { display:grid !important; }
  .topbar { padding:0 14px; }
  .global-search, .secondary-button, .avatar-button { display:none; }
  .language-switcher button { min-height:40px; padding:0 8px; }
  .page-toolbar { position:static; padding:10px 14px; align-items:flex-start; flex-direction:column; }
  .period-control-group, .filter-control-group { width:100%; justify-content:space-between; }
  .filter-control-group .filter-button { flex:1; }
  .page-content { padding:0 14px 30px; }
  .page-intro { align-items:flex-start; flex-direction:column; padding-top:18px; }
  .page-intro h1 { font-size:21px; }
  .summary-card { padding:17px; }
  .summary-side { gap:14px; }
  .kpi-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .dashboard-grid { gap:10px; }
  .panel.span-4, .panel.span-5, .panel.span-6 { grid-column:span 12; }
  .donut-layout { grid-template-columns:140px 1fr; }
  .stat-strip { grid-template-columns:repeat(2,1fr); }
  .stat-strip-item:nth-child(2) { border-right:0; }
  .stat-strip-item:nth-child(-n+2) { border-bottom:1px solid var(--border); }
  .staff-grid { grid-template-columns:repeat(2,1fr); }
  .inventory-grid { grid-template-columns:1fr; }
  .source-row { grid-template-columns:1.2fr .8fr .7fr; }
  .source-row > :nth-child(2), .source-row > :nth-child(5) { display:none; }
  .table-tools { align-items:flex-start; flex-direction:column; }
  .table-search { width:100%; }
  .bulk-bar { width:calc(100% - 10px); flex-direction:column; align-items:stretch; }
  .bulk-actions { justify-content:flex-end; }
}
@media (max-width:480px) {
  .kpi-grid { grid-template-columns:1fr 1fr; gap:9px; }
  .kpi-card { padding:13px; }
  .kpi-value strong { font-size:22px; }
  .segmented button { min-width:34px; padding:0 7px; }
  .period-label { min-width:122px; }
  .filter-control-group { gap:6px; }
  .filter-button { padding:0 8px; }
  .summary-side { flex-wrap:wrap; }
  .donut-layout { grid-template-columns:1fr; }
  .donut-wrap { width:132px; height:132px; }
  .production-metrics { grid-template-columns:1fr; }
  .detail-grid { grid-template-columns:1fr; }
}

/* ─────────────────────────────────────────────
   Order Capacity dashboard extensions
   ───────────────────────────────────────────── */
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(57,88,213,.18); outline-offset: 1px; }
.text-button { display:inline-flex; align-items:center; gap:5px; padding:0; border:0; background:transparent; color:var(--primary); font-size:10px; font-weight:700; cursor:pointer; }
.text-button svg { width:14px; height:14px; }
.secondary-button.danger-outline, .danger-outline { border-color:#efc9cb; color:var(--red); background:#fff; }
.secondary-button.danger-outline:hover, .danger-outline:hover { background:var(--red-soft); border-color:#e5aeb1; }
.period-label-wrap { position:relative; display:block; }
.period-label-wrap input { position:absolute; inset:0; width:100%; opacity:0; pointer-events:none; }
.period-label { cursor:pointer; }
.sidebar-backdrop { position:fixed; inset:0; z-index:45; background:rgba(17,25,39,.34); opacity:0; pointer-events:none; transition:.2s ease; }
.sidebar-backdrop.open { opacity:1; pointer-events:auto; }
.summary-card.success { border-color:#d7e9df; background:linear-gradient(115deg,#fff 0%,#f7fcf9 68%,#edf8f2 100%); }
.summary-card.warning { border-color:#eddcbf; background:linear-gradient(115deg,#fff 0%,#fffaf2 68%,#fff5e3 100%); }
.summary-card.danger { border-color:#efcfd0; background:linear-gradient(115deg,#fff 0%,#fff8f8 68%,#fff0f0 100%); }
.summary-card.warning .summary-kicker { color:var(--amber); }
.summary-card.danger .summary-kicker { color:var(--red); }
.summary-card.success .summary-kicker { color:var(--green); }
.kpi-card { text-align:left; }
.kpi-card:disabled { cursor:default; }
.metric-legend i { display:inline-block; }

.line-load-list { display:flex; flex-direction:column; gap:12px; }
.line-load-card { padding:14px; border:1px solid var(--border); border-radius:12px; background:var(--surface-soft); }
.line-load-card.warning { border-color:#efddbd; background:var(--amber-soft); }
.line-load-card.danger { border-color:#efc9cb; background:var(--red-soft); }
.line-load-head { display:grid; grid-template-columns:34px minmax(0,1fr) auto; gap:10px; align-items:center; }
.line-badge { width:34px; height:34px; display:grid; place-items:center; border-radius:9px; background:var(--primary-soft); color:var(--primary); font-weight:800; font-size:11px; font-style:normal; }
.line-load-card:nth-child(2) .line-badge, .production-line-panel:nth-child(2) .line-badge { background:var(--teal-soft); color:var(--teal); }
.line-load-head strong { display:block; font-size:10px; }
.line-load-head small { display:block; margin-top:3px; color:var(--muted); font-size:8px; }
.line-load-head b { font-size:17px; letter-spacing:-.03em; }
.progress-track { position:relative; height:7px; margin-top:12px; overflow:hidden; border-radius:999px; background:#e9edf2; }
.progress-track.large { height:8px; margin-top:16px; }
.progress-fill { display:block; height:100%; border-radius:inherit; background:var(--primary); }
.progress-fill.warning, .bar-fill.warning { background:var(--amber); }
.progress-fill.danger, .bar-fill.danger { background:var(--red); }
.progress-fill.success, .bar-fill.success { background:var(--green); }
.line-load-card:nth-child(2) .progress-fill { background:var(--teal); }
.line-load-card.warning .progress-fill { background:var(--amber); }
.line-load-card.danger .progress-fill { background:var(--red); }
.line-load-foot { display:flex; justify-content:space-between; margin-top:8px; color:var(--muted); font-size:8px; }
.bar-track { position:relative; height:8px; overflow:visible; border-radius:999px; background:#edf0f4; }
.bar-fill { display:block; height:100%; border-radius:999px; background:var(--primary); }
.threshold-mark { position:absolute; top:-3px; bottom:-3px; width:1px; background:var(--amber); opacity:.65; }
.bar-row > b { min-width:52px; color:#364157; font-size:9px; text-align:right; white-space:nowrap; }
.mini-empty { min-height:90px; display:grid; place-items:center; color:var(--subtle); font-size:10px; text-align:center; }
.mini-empty.tall { min-height:190px; }
.reason-text { display:block; max-width:270px; overflow:hidden; text-overflow:ellipsis; color:var(--muted); }
.line-pill { display:inline-grid; place-items:center; min-width:24px; height:22px; padding:0 7px; border-radius:7px; background:var(--primary-soft); color:var(--primary); font-size:8px; font-weight:800; font-style:normal; }
.clickable-row { cursor:pointer; }
.table-action { width:auto; display:inline-flex; align-items:center; gap:5px; padding:0 8px; }
.table-action svg { width:13px; height:13px; }

.shipping-pressure { min-height:215px; overflow:auto hidden; }
.pressure-chart { position:relative; min-width:max(100%,520px); height:205px; display:flex; align-items:flex-end; gap:7px; padding:22px 8px 25px; border-bottom:1px solid var(--border); }
.pressure-column { position:relative; flex:1 0 18px; min-width:18px; height:150px; display:flex; align-items:flex-end; justify-content:center; border:0; background:transparent; cursor:pointer; }
.pressure-column i { width:min(18px,78%); min-height:5px; border-radius:5px 5px 2px 2px; background:var(--primary); transition:.18s ease; }
.pressure-column.warning i { background:var(--amber); }
.pressure-column.danger i { background:var(--red); }
.pressure-column:hover i { filter:brightness(.92); transform:translateY(-2px); }
.pressure-column small { position:absolute; bottom:-20px; color:var(--subtle); font-size:8px; }
.pressure-value { position:absolute; bottom:calc(var(--bar-height, 0%) + 4px); top:-16px; color:var(--muted); font-size:7px; opacity:.8; }
.pressure-limit { position:absolute; left:0; right:0; border-top:1px dashed var(--amber); pointer-events:none; }
.pressure-limit span { position:absolute; right:0; top:-16px; padding-left:5px; background:#fff; color:var(--amber); font-size:8px; }

.order-controls { align-items:center; }
.risk-tabs { display:flex; align-items:center; gap:3px; padding:3px; border:1px solid var(--border); border-radius:9px; background:var(--surface-soft); }
.risk-tabs button { height:28px; padding:0 10px; border:0; border-radius:7px; background:transparent; color:var(--muted); font-size:9px; font-weight:700; cursor:pointer; }
.risk-tabs button.active { background:#fff; color:var(--ink); box-shadow:var(--shadow-sm); }
.table-search.compact { width:180px; }
.pagination > div { display:flex; align-items:center; gap:4px; }
.pagination button { min-width:28px; height:28px; display:grid; place-items:center; border:1px solid var(--border); border-radius:7px; background:#fff; color:var(--muted); font-size:9px; cursor:pointer; }
.pagination button.active { background:var(--ink); color:#fff; border-color:var(--ink); }
.pagination button:disabled { opacity:.4; cursor:not-allowed; }
.pagination button svg { width:13px; height:13px; }
.pagination > div > span { padding:0 3px; color:var(--subtle); }
.stat-strip-item strong small { display:inline; font-size:9px; font-weight:500; }

.production-board { margin-bottom:14px; }
.production-line-panel.warning { border-color:#ead9b9; background:linear-gradient(180deg,#fff,#fffaf3); }
.production-line-panel.danger { border-color:#efc7c9; background:linear-gradient(180deg,#fff,#fff8f8); }
.production-line-panel:nth-child(2) .progress-fill { background:var(--teal); }
.production-line-panel.warning .progress-fill { background:var(--amber); }
.production-line-panel.danger .progress-fill { background:var(--red); }
.line-verdict { margin-top:10px; color:var(--muted); font-size:9px; }
.compact-staff { grid-template-columns:repeat(2,minmax(0,1fr)); }
.inline-load { min-width:125px; }
.inline-load > span { display:block; margin-bottom:5px; color:var(--ink); font-weight:700; font-size:9px; }
.inline-load .progress-track { margin:0; height:5px; }

.trial-panel { margin-bottom:14px; }
.trial-list { display:flex; flex-direction:column; gap:9px; }
.trial-row { display:grid; grid-template-columns:34px minmax(190px,1.8fr) 100px 138px minmax(130px,1fr) 90px 36px; align-items:end; gap:9px; padding:12px; border:1px solid var(--border); border-radius:11px; background:var(--surface-soft); }
.trial-index { width:30px; height:30px; display:grid; place-items:center; align-self:center; border-radius:8px; background:#fff; color:var(--primary); font-size:9px; font-weight:800; box-shadow:var(--shadow-sm); }
.trial-row label small { display:block; margin-bottom:5px; color:var(--muted); font-size:8px; }
.trial-row input, .trial-row select { width:100%; height:36px; padding:0 9px; border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--ink); font-size:10px; }
.remove-trial { width:36px; height:36px; }
.trial-actions { display:flex; justify-content:flex-end; gap:8px; margin-top:14px; }
.trial-kpis { grid-template-columns:repeat(4,minmax(0,1fr)); }
.impact-list { display:flex; flex-direction:column; gap:13px; padding-top:2px; }
.impact-row { display:grid; grid-template-columns:minmax(120px,1fr) 2.8fr 58px; gap:12px; align-items:center; }
.impact-row > div:first-child strong { display:block; font-size:10px; }
.impact-row > div:first-child small { display:block; margin-top:3px; color:var(--muted); font-size:8px; }
.impact-bars { display:flex; flex-direction:column; gap:5px; }
.impact-bars > div { position:relative; height:16px; border-radius:5px; background:#edf0f4; overflow:hidden; }
.impact-bars i { display:block; height:100%; background:#b9c1cf; }
.impact-bars .after i { background:var(--primary); }
.impact-bars span { position:absolute; z-index:1; left:6px; top:2px; color:#fff; font-size:7px; font-weight:700; text-shadow:0 1px 2px rgba(0,0,0,.18); }
.impact-row > b { font-size:9px; color:var(--muted); text-align:right; }
.impact-row > b.up { color:var(--red); }

.product-layout { display:grid; grid-template-columns:minmax(300px,.8fr) minmax(440px,1.2fr); gap:14px; margin-bottom:14px; }
.product-list-panel, .recipe-panel { min-height:560px; }
.product-list { max-height:500px; overflow:auto; padding:0 10px 12px; }
.product-list-item { width:100%; display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:10px; padding:11px 9px; border:0; border-bottom:1px solid var(--border); background:transparent; color:inherit; text-align:left; cursor:pointer; }
.product-list-item:hover { background:var(--surface-hover); }
.product-list-item.active { border-radius:9px; background:var(--primary-soft); border-bottom-color:transparent; }
.product-code { color:var(--subtle); font-size:8px; font-weight:800; letter-spacing:.05em; }
.product-list-item strong { display:block; font-size:10px; }
.product-list-item small { display:block; margin-top:4px; color:var(--muted); font-size:8px; }
.recipe-editor { display:flex; flex-direction:column; gap:8px; }
.recipe-row { display:grid; grid-template-columns:28px minmax(180px,1fr) 90px 70px 36px; align-items:center; gap:9px; padding:9px; border:1px solid var(--border); border-radius:10px; background:var(--surface-soft); }
.recipe-row > span { color:var(--subtle); font-size:8px; font-weight:800; text-align:center; }
.recipe-row select, .recipe-row input, .table-number { width:100%; height:34px; padding:0 9px; border:1px solid var(--border); border-radius:8px; background:#fff; font-size:10px; }
.recipe-row em { color:var(--muted); font-size:8px; font-style:normal; }
.add-recipe { margin-top:12px; }
.capacity-settings { margin-bottom:22px; }
.table-number { width:110px; }

.upload-zone-panel .panel-body { padding:16px; }
.upload-zone { min-height:310px; display:grid; place-items:center; align-content:center; gap:9px; border:1.5px dashed #cbd3df; border-radius:14px; background:linear-gradient(180deg,#fff,#fafbfe); text-align:center; cursor:pointer; transition:.18s ease; }
.upload-zone:hover, .upload-zone.dragging { border-color:var(--primary); background:var(--primary-soft); }
.upload-zone input { display:none; }
.upload-icon { width:58px; height:58px; display:grid; place-items:center; border-radius:16px; background:var(--primary-soft); color:var(--primary); }
.upload-zone strong { font-size:14px; }
.upload-zone p { max-width:430px; margin:0; color:var(--muted); font-size:10px; line-height:1.6; }
.upload-zone em { color:var(--primary); font-size:9px; font-style:normal; font-weight:700; }
.data-metric-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.data-metric-grid div { padding:18px; border-radius:12px; background:var(--surface-soft); }
.data-metric-grid strong { display:block; font-size:28px; letter-spacing:-.04em; }
.data-metric-grid span { display:block; margin-top:5px; color:var(--muted); font-size:9px; }
.danger-actions { display:flex; flex-direction:column; gap:9px; }
.helper-text { margin:16px 0 0; color:var(--muted); font-size:9px; line-height:1.6; }

.settings-form { display:flex; flex-direction:column; gap:10px; }
.settings-form label { display:grid; grid-template-columns:120px minmax(0,1fr) 120px; align-items:center; gap:12px; padding:13px; border:1px solid var(--border); border-radius:11px; background:var(--surface-soft); }
.settings-form label > span { color:var(--ink); font-size:10px; font-weight:700; }
.settings-form label > strong { color:var(--muted); font-size:9px; font-weight:500; }
.settings-form label > div { display:flex; align-items:center; gap:6px; }
.settings-form input { width:78px; height:35px; padding:0 9px; border:1px solid var(--border); border-radius:8px; background:#fff; text-align:right; }
.settings-form em { color:var(--muted); font-size:9px; font-style:normal; }
.decision-rule-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin-top:18px; }
.decision-rule { display:grid; grid-template-columns:40px minmax(0,1fr); gap:10px; align-items:start; min-height:112px; padding:14px; border:1px solid var(--border); border-left-width:4px; border-radius:11px; background:#fff; }
.decision-rule-icon { display:grid; place-items:center; width:36px; height:36px; border-radius:9px; color:#fff; }
.decision-rule strong { display:block; color:var(--ink); font-size:15px; line-height:1.4; }
.decision-rule p { margin:5px 0 0; color:var(--muted); font-size:14px; line-height:1.55; }
.decision-rule.success { border-left-color:#16705a; }
.decision-rule.success .decision-rule-icon { background:#16705a; }
.decision-rule.warning { border-left-color:#a86b00; }
.decision-rule.warning .decision-rule-icon { background:#a86b00; }
.decision-rule.danger { border-left-color:#9f3c2f; }
.decision-rule.danger .decision-rule-icon { background:#9f3c2f; }
.line-select { min-width:92px; height:44px; padding:8px 30px 8px 12px; border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--ink); font:600 16px var(--font-sans); }
.panel-header [data-action="save-capacity"] { min-width:112px; white-space:nowrap; }
.factory-setting-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.factory-setting-grid > div { padding:15px; border:1px solid var(--border); border-radius:11px; background:var(--surface-soft); }
.factory-setting-grid span { display:block; color:var(--subtle); font-size:8px; }
.factory-setting-grid strong { display:block; margin-top:7px; font-size:12px; }
.factory-setting-grid small { display:block; margin-top:5px; color:var(--muted); font-size:8px; }

.drawer-recipe { display:flex; flex-direction:column; gap:8px; }
.drawer-recipe > div { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:4px 12px; padding:10px; border-radius:9px; background:var(--surface-soft); }
.drawer-recipe span { font-size:9px; font-weight:650; }
.drawer-recipe strong { font-size:10px; }
.drawer-recipe small { grid-column:1/-1; color:var(--muted); font-size:8px; }
.risk-item.safe { background:var(--green-soft); color:#28684e; }
.risk-item.safe::before { content:'✓'; background:var(--green); }

.modal-backdrop { position:fixed; inset:0; z-index:95; background:rgba(17,25,39,.28); opacity:0; pointer-events:none; transition:.2s ease; }
.modal-backdrop.open { opacity:1; pointer-events:auto; }
.modal { position:fixed; z-index:100; top:50%; left:50%; width:min(620px,calc(100vw - 28px)); max-height:calc(100vh - 40px); overflow:auto; border:1px solid var(--border); border-radius:16px; background:#fff; box-shadow:0 28px 80px rgba(21,32,53,.24); transform:translate(-50%,-46%) scale(.98); opacity:0; pointer-events:none; transition:.2s ease; }
.modal.open { transform:translate(-50%,-50%) scale(1); opacity:1; pointer-events:auto; }
.modal-header { height:72px; display:flex; align-items:center; justify-content:space-between; padding:0 20px; border-bottom:1px solid var(--border); }
.modal-header small { display:block; color:var(--subtle); font-size:8px; letter-spacing:.12em; }
.modal-header h2 { margin:5px 0 0; font-size:17px; }
.modal-body { padding:20px; }
.form-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
.field { display:flex; flex-direction:column; gap:6px; }
.field.span-2 { grid-column:span 2; }
.field > span { color:var(--muted); font-size:9px; font-weight:650; }
.field input, .field select { width:100%; height:40px; padding:0 11px; border:1px solid var(--border); border-radius:9px; background:#fff; color:var(--ink); font-size:11px; }
.modal-actions { display:grid; grid-template-columns:auto 1fr auto auto; gap:8px; align-items:center; margin-top:20px; padding-top:16px; border-top:1px solid var(--border); }
.toast.warning .toast-icon { background:var(--amber-soft); color:var(--amber); }

@media (max-width:1180px) {
  .trial-row { grid-template-columns:34px minmax(180px,1.6fr) 90px 130px minmax(120px,1fr) 80px 36px; }
  .product-layout { grid-template-columns:1fr; }
  .product-list-panel, .recipe-panel { min-height:auto; }
  .product-list { max-height:360px; }
}
@media (max-width:900px) {
  .trial-row { grid-template-columns:34px repeat(2,minmax(0,1fr)) 36px; align-items:end; }
  .trial-row label:nth-of-type(1) { grid-column:2/4; }
  .trial-row label:nth-of-type(4) { grid-column:2/4; }
  .trial-row .remove-trial { grid-column:4; grid-row:1; }
  .trial-kpis { grid-template-columns:repeat(2,1fr); }
  .factory-setting-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:760px) {
  .sidebar-backdrop { display:block; }
  .order-controls { align-items:stretch; flex-direction:column; }
  .risk-tabs { overflow:auto; }
  .risk-tabs button { flex:0 0 auto; }
  .trial-row { grid-template-columns:30px minmax(0,1fr) 34px; }
  .trial-row label { grid-column:2/3!important; }
  .trial-row .remove-trial { grid-column:3; grid-row:1; }
  .trial-index { grid-row:1; }
  .product-layout { display:block; }
  .recipe-panel { margin-top:12px; }
  .recipe-row { grid-template-columns:24px minmax(130px,1fr) 70px 34px; }
  .recipe-row em { display:none; }
  .settings-form label { grid-template-columns:1fr 100px; }
  .settings-form label > strong { grid-column:1/2; grid-row:2; }
  .settings-form label > div { grid-column:2; grid-row:1/3; }
  .factory-setting-grid { grid-template-columns:1fr 1fr; }
  .source-row { grid-template-columns:1.2fr .7fr .7fr; }
  .source-row > :nth-child(4), .source-row > :nth-child(5) { display:none; }
  .pressure-chart { min-width:580px; }
}
@media (max-width:480px) {
  .period-control-group { flex-direction:column; align-items:stretch; }
  .segmented { width:100%; }
  .segmented button { flex:1; }
  .period-nav { justify-content:space-between; }
  .trial-kpis { grid-template-columns:1fr 1fr; }
  .factory-setting-grid { grid-template-columns:1fr; }
  .form-grid { grid-template-columns:1fr; }
  .field.span-2 { grid-column:auto; }
  .modal-actions { grid-template-columns:1fr 1fr; }
  .modal-actions > span { display:none; }
  .modal-actions button { width:100%; }
  .summary-stat strong { font-size:16px; }
}

/* ─────────────────────────────────────────────
   MASS / 巨構運算語言 · Order / Light Section
   Monumental mass, mineral surfaces, precise scale marks.
   ───────────────────────────────────────────── */
:root {
  --mass-basalt: #191b18;
  --mass-carbon: #282b27;
  --mass-bone: #e8e4d9;
  --mass-paper: #f4f1e8;
  --mass-oxide: #b75c32;
  --mass-amber: #dba93f;
  --mass-signal: #385f74;
  --bg: var(--mass-bone);
  --surface: #f8f6ef;
  --surface-soft: #ede9df;
  --surface-hover: #e5e0d4;
  --ink: #1c201d;
  --muted: #666960;
  --subtle: #85877f;
  --border: #d1cbbd;
  --border-strong: #aaa698;
  --primary: var(--mass-signal);
  --primary-dark: #294958;
  --primary-soft: #dce5e6;
  --amber: #aa7118;
  --amber-soft: #f3e8ca;
  --red: #a94837;
  --red-soft: #f0ddd7;
  --green: #4f7259;
  --green-soft: #dce6dc;
  --radius: 5px;
  --radius-sm: 3px;
  --shadow-sm: 0 1px 0 rgba(25,27,24,.12);
  --shadow-md: 0 26px 70px rgba(25,27,24,.16);
  --font: 'Noto Sans TC', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Barlow Condensed', 'Noto Sans TC', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}
html { background:var(--mass-bone); }
body {
  background:
    linear-gradient(90deg, rgba(25,27,24,.035) 1px, transparent 1px) 0 0/64px 64px,
    linear-gradient(rgba(25,27,24,.025) 1px, transparent 1px) 0 0/64px 64px,
    var(--mass-bone);
}
.sidebar {
  background:
    linear-gradient(155deg, rgba(255,255,255,.035), transparent 42%),
    var(--mass-basalt);
  border-right:1px solid #080a08;
  box-shadow:8px 0 0 rgba(25,27,24,.09);
}
.sidebar::after {
  content:none;
}
.brand { min-height:55px; align-items:flex-start; }
.brand-mark {
  width:31px; height:47px; padding:0; display:block; overflow:hidden;
  border:1px solid rgba(244,241,232,.28); border-radius:1px; background:#090b09;
  transform:skewY(-7deg);
}
.brand-mark span { display:block; width:100%; height:8px; margin:0 0 4px; border-radius:0; background:var(--mass-amber); }
.brand-mark span:nth-child(2) { width:63%; height:18px; margin-left:auto; transform:none; background:#6e766c; }
.brand-mark span:nth-child(3) { width:38%; height:13px; transform:none; background:var(--mass-oxide); }
.brand strong,
.mobile-heading strong,
.page-intro h1,
.summary-card h2,
.kpi-value strong,
.data-metric-grid strong,
.big-util strong {
  font-family:var(--font-display);
  font-stretch:condensed;
}
.brand strong { color:var(--mass-paper); font-size:18px; line-height:.9; letter-spacing:.075em; }
.brand small { color:#848980; font-family:var(--font-mono); font-size:8px; letter-spacing:.08em; }
.factory-chip,
.demo-status { border-radius:2px; border-color:rgba(244,241,232,.12); background:rgba(244,241,232,.035); }
.nav-item { position:relative; height:46px; border-radius:1px; font-size:11px; letter-spacing:.02em; }
.nav-item::before { content:''; position:absolute; left:0; top:8px; bottom:8px; width:2px; background:transparent; }
.nav-item.active { background:#30352f; box-shadow:none; }
.nav-item.active::before { background:var(--mass-amber); }
.nav-count, .status-tags span { border-radius:1px; font-family:var(--font-mono); }
.main-area { position:relative; }
.topbar {
  background:rgba(244,241,232,.94); border-bottom-color:var(--border-strong);
  backdrop-filter:blur(12px) saturate(.65);
}
.mobile-heading small,
.engine-index,
.summary-kicker,
.panel-title p,
.kpi-label,
.cell-secondary,
.status-badge,
.line-pill,
.engine-state,
.causality-list > article > span {
  font-family:var(--font-mono);
  letter-spacing:.055em;
}
.page-toolbar { background:rgba(232,228,217,.91); border-bottom-color:var(--border); }
.segmented, .secondary-button, .filter-button, .icon-button, .global-search { border-radius:2px; box-shadow:none; }
.segmented button, .primary-button { border-radius:1px; }
.primary-button { background:var(--mass-basalt); box-shadow:5px 5px 0 rgba(25,27,24,.14); text-transform:uppercase; }
.primary-button:hover { background:var(--mass-carbon); transform:translate(-1px,-1px); }
.page-content { max-width:1660px; }
.page-intro { min-height:142px; position:relative; align-items:center; border-bottom:1px solid var(--border-strong); }
.page-intro::before { content:''; width:11px; height:72px; flex:0 0 auto; order:-1; background:var(--mass-basalt); box-shadow:18px 22px 0 var(--mass-oxide); }
.page-intro > div:first-of-type { margin-right:auto; }
.page-intro h1 { font-size:clamp(40px,4.5vw,72px); line-height:.82; letter-spacing:-.025em; text-transform:uppercase; }
.page-intro p { max-width:660px; margin-top:16px; color:#575b54; }
.panel,
.kpi-card,
.summary-card,
.production-line-panel,
.line-load-card,
.trial-row,
.upload-zone,
.settings-form label,
.factory-setting-grid > div { border-radius:3px; box-shadow:none; }
.panel { border-color:var(--border-strong); background:rgba(248,246,239,.88); }
.panel::before { content:''; display:block; height:3px; background:linear-gradient(90deg,var(--mass-basalt) 0 9%,transparent 9% 10%,var(--mass-oxide) 10% 13%,transparent 13%); }
.panel-header { min-height:69px; }
.kpi-card { min-height:152px; position:relative; overflow:hidden; border-color:var(--border-strong); background:rgba(248,246,239,.88); }
.kpi-value strong { font-size:38px; line-height:.9; letter-spacing:-.02em; }
.summary-card { min-height:190px; border-width:1px 1px 1px 12px; background:var(--mass-paper)!important; }
.summary-card::after { width:280px; height:280px; right:-130px; top:-150px; border-radius:50%; border:50px solid rgba(25,27,24,.04); background:transparent; }
.summary-card h2 { max-width:900px; font-size:clamp(25px,2.7vw,42px); line-height:1.05; }
.engine-strip {
  min-height:92px; margin:16px 0; padding:18px 22px; display:flex; align-items:center; justify-content:space-between; gap:20px;
  color:var(--mass-paper); background:var(--mass-basalt); border-left:12px solid var(--mass-amber);
  box-shadow:12px 12px 0 rgba(25,27,24,.11);
}
.engine-strip > div { display:grid; grid-template-columns:auto 1fr; gap:3px 18px; align-items:end; }
.engine-index { grid-row:1/3; align-self:stretch; padding-right:18px; display:flex; align-items:center; border-right:1px solid #555a52; color:var(--mass-amber); font-size:9px; }
.engine-strip strong { font:600 26px/.9 var(--font-display); letter-spacing:.03em; }
.engine-strip small { color:#9fa399; font-size:9px; }
.engine-state { padding:7px 9px; border:1px solid #656b62; color:#b4b8ae; font-size:8px; white-space:nowrap; }
.engine-state.verified { border-color:#728c70; color:#a9cea8; }
.engine-state.pending { animation:mass-pulse 1.6s steps(2,end) infinite; }
.engine-state.fallback { border-color:#956d42; color:#e1b678; }
.causality-panel { background:var(--mass-basalt); color:var(--mass-paper); }
.causality-panel::before { background:linear-gradient(90deg,var(--mass-amber) 0 16%,transparent 16%); }
.causality-panel .panel-header { border-color:#41463f; }
.causality-panel .panel-title p { color:#868b82; }
.causality-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.causality-list article { min-height:110px; padding:20px; display:grid; grid-template-columns:36px 1fr 6px; gap:15px; border-right:1px solid #41463f; border-bottom:1px solid #41463f; }
.causality-list article:only-child { grid-column:1/-1; border-right:0; }
.causality-list article > span { color:var(--mass-amber); font-size:9px; }
.causality-list strong { font-size:11px; }
.causality-list p { margin:8px 0 0; color:#b7bbb2; font-size:10px; line-height:1.65; }
.causality-list i { width:4px; height:100%; background:#728c70; }
.causality-list i.medium { background:var(--mass-amber); }
.causality-list i.high { background:var(--mass-oxide); }
.table-wrap table { font-variant-numeric:tabular-nums; }
thead { background:#ded9cd; }
tbody tr:hover { background:#ebe6da; }
.cell-primary { font-weight:700; }
.line-pill, .status-badge { border-radius:1px; }
.progress-track, .progress-fill, .bar-track, .bar-fill { border-radius:0; }
.trial-index, .product-code, .source-row, .pagination { font-family:var(--font-mono); }
@keyframes mass-pulse { 50% { opacity:.45; } }
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; }
}
@media (max-width:760px) {
  .page-intro { min-height:112px; }
  .page-intro::before { width:7px; height:52px; box-shadow:11px 16px 0 var(--mass-oxide); }
  .page-intro h1 { font-size:42px; }
  .engine-strip { align-items:flex-start; flex-direction:column; }
  .engine-strip > div { grid-template-columns:1fr; }
  .engine-index { grid-row:auto; padding:0 0 8px; border:0; }
  .causality-list { grid-template-columns:1fr; }
}

/* Ergonomic type baseline · comfortable at a 60cm office viewing distance */
:root {
  --type-body:16px;
  --type-secondary:14px;
  --type-micro:12px;
}
body { font-size:var(--type-body); line-height:1.55; }
.page-toolbar { align-items:flex-start; }
.period-control-group { align-items:center; flex-wrap:wrap; gap:12px; }
.segmented button { min-width:64px; min-height:44px; padding:0 14px; font-size:var(--type-secondary); }
.period-nav { flex-wrap:wrap; gap:8px; }
.period-nav .icon-button { width:44px; height:44px; }
.range-fields { display:flex; align-items:flex-end; gap:8px; }
.range-fields label { display:grid; gap:4px; color:var(--muted); font-size:var(--type-secondary); font-weight:700; }
.range-fields input { min-width:142px; height:44px; padding:0 10px; border:1px solid var(--border-strong); border-radius:4px; background:#fffdf8; color:var(--ink); font-size:var(--type-secondary); }
.range-fields input:focus { border-color:var(--primary); outline:2px solid rgba(57,88,213,.18); }
.range-separator { padding-bottom:11px; color:var(--muted); }
.period-label { min-width:auto; height:auto; padding:0 4px; color:var(--muted); font-size:var(--type-micro); }
.page-intro p,.panel-title p,.summary-card p,.empty-state p { font-size:var(--type-secondary); line-height:1.65; }
.primary-button,.secondary-button,.filter-button,.icon-button,.text-button,.pagination button { min-height:44px; font-size:var(--type-secondary); }
.kpi-label,.kpi-foot small,.summary-meta,.legend,.status-badge,.line-pill { font-size:var(--type-secondary); }
.capacity-list strong { font-size:var(--type-body); line-height:1.45; }
.capacity-list small { font-size:var(--type-secondary); line-height:1.5; }
.pressure-value { font-size:var(--type-micro); }
.pressure-column small { font-size:var(--type-micro); }
.hot-list strong,.hot-list small,.rank-list strong,.rank-list small { font-size:var(--type-body); }
.table-wrap th { font-size:var(--type-secondary); }
.table-wrap td { font-size:var(--type-body); line-height:1.55; }
.causality-list article>span { font-size:var(--type-micro); }
.causality-list strong { font-size:var(--type-body); }
.causality-list p { font-size:var(--type-secondary); }
.engine-index { font-size:var(--type-micro); }
.engine-strip small,.engine-state { font-size:var(--type-secondary); }
.form-group label,.field-label,.input-help { font-size:var(--type-secondary); }
input,select,textarea { font-size:var(--type-body); }

/* WCAG light-state guard：舊 MASS 微字與淡色不得覆蓋辦公閱讀基線。 */
:root {
  --muted:#4d544c;
  --subtle:#555b54;
  --primary:#284f5b;
  --primary-dark:#183d48;
  --teal:#255f5b;
  --green:#285c36;
  --amber:#6f4b00;
  --red:#8f2f1f;
}
small { color:var(--muted); font-size:var(--type-secondary); line-height:1.5; }
.mobile-heading small,.topbar-status small,.panel-title p,.kpi-foot small,.summary-meta,
.cell-secondary,.product-code,.source-row,.source-row.header,.helper-text,
.settings-form label>strong,.settings-form em,.factory-setting-grid small,.drawer-recipe small,.field>span {
  color:var(--muted); font-size:var(--type-secondary); line-height:1.5;
}
.global-search kbd { color:#3f4640; background:#fff; font-size:var(--type-micro); }
.range-fields label,.period-label { color:var(--muted); font-size:var(--type-secondary); }
.summary-kicker { color:var(--primary); font-size:var(--type-secondary); }
.kpi-label { color:var(--muted); }
.table-wrap th { color:#465047; background:#f0eee6; font-size:var(--type-secondary); }
.status-badge { min-height:26px; color:#3f4b43; background:#e7e8e3; font-size:var(--type-secondary); }
.status-badge.success { color:#285c36; background:#dcebdc; }
.status-badge.primary { color:#284f5b; background:#dce8eb; }
.status-badge.warning { color:#6f4b00; background:#f1dfb2; }
.status-badge.danger { color:#8f2f1f; background:#f1d5cd; }
.line-badge,.staff-avatar { color:#284f5b; background:#dce8eb; font-size:var(--type-secondary); }
.line-badge.teal,.staff-card:nth-child(even) .staff-avatar { color:#255f5b; background:#dcebea; }
.staff-presence,.staff-presence.off { font-size:var(--type-secondary); }
.impact-bars>div { min-height:26px; background:#e4e6e2; }
.impact-bars span {
  top:3px; left:5px; padding:1px 5px; color:#202620; background:rgba(255,255,255,.9);
  border-radius:2px; font-size:var(--type-micro); line-height:18px; text-shadow:none;
}
.impact-row>div:first-child strong,.impact-row>div:first-child small,.impact-row>b { font-size:var(--type-secondary); }
.pressure-value,.pressure-column small { color:#3f4640; font-size:var(--type-micro); }
.kpi-card::after { content:none; }
input::placeholder,textarea::placeholder { color:#5a625b; opacity:1; }
button:disabled,input:disabled,select:disabled,textarea:disabled { opacity:1; color:#454c46; background:#dedfd9; cursor:not-allowed; }
.primary-button:hover,.secondary-button:hover,.filter-button:hover,.text-button:hover { color:#fff; background:var(--primary); border-color:var(--primary); }
.primary-button:focus-visible,.secondary-button:focus-visible,.filter-button:focus-visible,.text-button:focus-visible,
input:focus-visible,select:focus-visible,textarea:focus-visible { outline:3px solid rgba(40,79,91,.28); outline-offset:2px; }

@media (max-width:900px) {
  .page-toolbar { gap:12px; }
  .period-control-group,.period-nav { width:100%; }
  .period-label { width:100%; order:4; }
}
@media (max-width:620px) {
  html,body { max-width:100%; overflow-x:hidden; }
  .main-area,.page-toolbar,.page-content,.period-control-group,.filter-control-group { min-width:0; max-width:100%; }
  .period-nav { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; align-items:end; width:100%; }
  #period-prev { grid-column:1; grid-row:2; }
  #period-next { grid-column:3; grid-row:2; }
  .range-fields { grid-column:1/-1; grid-row:1; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); width:100%; }
  .range-fields label { min-width:0; }
  .range-fields input { width:100%; min-width:0; }
  .range-separator { display:none; }
  .period-label { grid-column:2; grid-row:2; align-self:center; width:auto; margin:0; text-align:center; }
  .filter-control-group { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px; gap:8px; }
  .filter-control-group .filter-button { min-width:0; }
  .page-intro>div:first-of-type { min-width:0; }
  .page-intro h1 { font-size:38px; line-height:1.02; overflow-wrap:anywhere; }
  .page-intro p { max-width:100%; overflow-wrap:anywhere; }
  .summary-card { grid-template-columns:minmax(0,1fr); min-width:0; }
  .summary-card h2 { font-size:27px; overflow-wrap:anywhere; }
}

/* Full-site office readability gate · primary 16px / supporting notes 14px */
:root { --sidebar-w:280px; --topbar-h:80px; }

.sidebar :is(strong,small,span,button,b) {
  font-size:16px !important;
  line-height:1.5;
}
.nav-item {
  min-height:48px;
  height:auto;
  font-size:18px !important;
}
.nav-count { min-width:28px; min-height:28px; }
.brand strong { font-size:20px !important; line-height:1.1; }
.brand small,.factory-chip small,.demo-status small,.status-tags span {
  font-size:14px !important;
}
.factory-chip { min-height:68px; }
.factory-chip strong { white-space:normal; }
.collapse-button { min-height:44px; }

.topbar :is(strong,span,button,input) {
  font-size:16px !important;
  line-height:1.5;
}
.topbar :is(small,kbd) { font-size:14px !important; line-height:1.5; }
.global-search,.avatar-button { min-height:44px; }

.page-toolbar :is(button,input,select,label,span,output) {
  font-size:16px !important;
  line-height:1.5;
}
.page-toolbar :is(.period-label,.range-fields label) { font-size:14px !important; }

.page-content :is(p,span,label,strong,b,em,button,input,select,textarea,td,th) {
  font-size:16px !important;
  line-height:1.5;
}
.page-content :is(small,.helper-text,.cell-secondary,.summary-meta,.panel-title p,.kpi-foot small,.product-code,.source-row,.rule-state,.line-verdict,.drawer-recipe small) {
  font-size:14px !important;
  line-height:1.55;
}
.page-content :is(.panel-title h3,.production-line-title h3,.inventory-card h4,.rule-card h4,.drawer-section h3,.product-list-item strong) {
  font-size:18px !important;
  line-height:1.4;
}
.page-content :is(button,input,select,textarea) { min-height:44px; }
.topbar .global-search input { min-height:44px; }
.page-content :is(.status-badge,.line-pill,.rule-state,.trend-pill,.risk-indicator) {
  min-height:28px;
  font-size:14px !important;
}
.chart-host svg text { font-size:14px !important; }
.chart-tooltip,.dropdown-option,.toast :is(strong,span),.detail-drawer :is(strong,span,small,p) {
  font-size:14px !important;
  line-height:1.5;
}
.product-list-item { min-height:64px; }
.recipe-row { min-height:64px; }
.settings-form label { min-height:76px; }
.rule-card { min-height:104px; }
.factory-setting-grid > div { min-height:132px; }

.brand .brand-credit {
  display:block;
  margin-top:6px;
  color:#aeb5aa;
  font-family:var(--font-mono);
  font-size:14px !important;
  font-weight:600;
  line-height:1.35;
  letter-spacing:.035em;
  max-width:180px;
  white-space:normal;
  overflow-wrap:anywhere;
}
.capacity-value-summary { display:grid; gap:14px; }
.capacity-value-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:15px 0; border-bottom:1px solid #d9dde5; }
.capacity-value-row > div { display:grid; gap:4px; }
.capacity-value-row span { color:#172033; font-size:16px !important; font-weight:800; }
.capacity-value-row small { color:#677286; font-size:14px !important; line-height:1.5; }
.capacity-value-row strong { color:#247f7a; font-size:28px !important; line-height:1; white-space:nowrap; }
.capacity-value-row.pending strong { color:#677286; font-size:22px !important; }
.capacity-condition-note { margin:2px 0 0; padding:14px; border-left:4px solid #8b97a8; background:#f2f4f7; color:#4f5a6c; font-size:14px !important; line-height:1.55; }

@media (max-width:760px) {
  :root { --sidebar-w:min(320px,88vw); --topbar-h:72px; }
  .sidebar {
    width:var(--sidebar-w);
    max-width:88vw;
    transform:translateX(-100%);
    pointer-events:none;
  }
  .sidebar.mobile-open { transform:translateX(0); pointer-events:auto; }
  .main-area { width:100%; max-width:100%; margin-left:0 !important; }
  .mobile-menu { display:grid !important; flex:0 0 44px; }
  .sidebar-backdrop {
    position:fixed; inset:0; z-index:45; display:block;
    background:rgba(17,20,17,.42); opacity:0; pointer-events:none;
  }
  .sidebar-backdrop.open { opacity:1; pointer-events:auto; }
  .topbar {
    min-height:72px; height:auto; padding:12px 16px;
    display:grid; grid-template-columns:44px minmax(0,1fr); gap:12px;
  }
  .mobile-heading { display:contents; }
  .mobile-heading > div { display:none; }
  .topbar-actions { min-width:0; width:100%; }
  .topbar-actions .sync-indicator,
  .topbar-actions #export-btn,
  .topbar-actions .avatar-button { display:none; }
  .global-search { width:100%; min-width:0; }
  .page-toolbar { position:relative; top:auto; padding:12px 16px; }
  .page-content { padding-left:16px; padding-right:16px; }
  .decision-rule-grid { grid-template-columns:1fr; }
  .decision-rule { min-height:0; }
  .page-content :is(p,span,label,strong,b,em,button,input,select,textarea,td,th) { overflow-wrap:anywhere; }
}

/* Decision-first P1: direct date drilldown and trial day causality. */
.shipping-pressure { min-height:250px; }
.pressure-chart { height:238px; padding-bottom:54px; }
.pressure-column { min-width:44px; }
.pressure-column small { bottom:-24px; }
.pressure-column em {
  position:absolute; bottom:-47px; width:72px; color:var(--primary);
  font-size:12px !important; font-style:normal; font-weight:800; line-height:1.25 !important;
}
.trial-day-impact { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; }
.trial-day-impact article { padding:16px; border:1px solid var(--border); border-left:4px solid var(--green); border-radius:10px; background:#fbfcfa; }
.trial-day-impact article.warning { border-left-color:var(--amber); background:#fffaf0; }
.trial-day-impact article>div { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.trial-day-impact article>div span { color:var(--amber); font-size:14px !important; font-weight:800; text-align:right; }
.trial-day-impact article p { margin:12px 0 4px; color:var(--ink); font-size:18px !important; font-weight:800; }
.trial-day-impact article small { display:block; font-size:14px !important; }

@media (max-width:620px) {
  .pressure-chart { min-width:720px; }
  .trial-actions { align-items:stretch; flex-direction:column-reverse; }
  .trial-actions button { width:100%; }
  .trial-day-impact { grid-template-columns:1fr; }
}
