:root {
  color-scheme: light;
  --ink: #18241f;
  --muted: #68756f;
  --line: #dce4df;
  --line-strong: #cbd6d0;
  --canvas: #f3f6f2;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --green-950: #0d2f25;
  --green-900: #123f32;
  --green-800: #195541;
  --green-100: #e3f1e9;
  --green-50: #f1f8f4;
  --gold: #e7b84b;
  --gold-soft: #fff4d4;
  --red: #a64031;
  --red-soft: #fbe9e5;
  --amber: #8c6200;
  --amber-soft: #fff2ce;
  --blue: #2c5f8d;
  --blue-soft: #e6f0f8;
  --shadow: 0 14px 38px rgba(23, 49, 38, 0.08);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); }
button, input, select { font: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
svg { display: block; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-140%);
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--green-950);
}
.skip-link:focus { transform: translateY(0); }

.app-shell { display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 25px 18px 18px;
  color: #edf6f1;
  background: linear-gradient(180deg, var(--green-900), var(--green-950));
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px; text-decoration: none; }
.brand__mark { width: 39px; height: 39px; color: #1c624a; }
.brand span { display: grid; gap: 2px; }
.brand strong { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.brand small { color: rgba(237, 246, 241, 0.67); font-size: 11px; }
.nav-list { margin-top: 37px; }
.nav-list__label { margin: 0 10px 8px; color: rgba(237, 246, 241, 0.48); font-size: 10px; font-weight: 700; letter-spacing: 0.13em; text-transform: uppercase; }
.nav-list__label--spaced { margin-top: 25px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 11px; min-height: 43px; padding: 10px 12px; border-radius: 10px; color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; }
.nav-item svg { width: 18px; height: 18px; fill: currentColor; }
.nav-item--muted { color: rgba(237, 246, 241, 0.67); cursor: default; }
.nav-item--active { background: rgba(255, 255, 255, 0.13); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.nav-item__dot { position: absolute; right: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(231, 184, 75, 0.15); }
.sidebar__foot { margin-top: auto; }
.plant-card { display: flex; align-items: center; gap: 10px; padding: 13px 10px 4px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.plant-card__icon { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 9px; color: var(--gold); font-size: 10px; font-weight: 800; }
.plant-card span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.plant-card strong { font-size: 11px; }
.plant-card small { color: rgba(237, 246, 241, 0.58); font-size: 10px; }
.plant-card__online { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: #69d195; box-shadow: 0 0 0 4px rgba(105, 209, 149, 0.12); }

.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 68px; padding: 0 32px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.91); backdrop-filter: blur(10px); }
.topbar__mobile-brand { display: none; }
.topbar__context { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.eyebrow { color: var(--green-800); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.topbar__separator { width: 1px; height: 16px; background: var(--line-strong); }
.topbar__actions { display: flex; align-items: center; gap: 13px; }
.demo-chip { padding: 6px 10px; border: 1px solid #eedb9f; border-radius: 999px; color: #765500; background: var(--gold-soft); font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.user-badge { display: flex; align-items: center; gap: 9px; }
.user-badge__avatar { display: grid; width: 33px; height: 33px; place-items: center; border-radius: 50%; color: #fff; background: var(--green-800); font-size: 10px; font-weight: 800; }
.user-badge__copy { display: grid; gap: 1px; }
.user-badge__copy strong { font-size: 11px; }
.user-badge__copy small { color: var(--muted); font-size: 9px; }
.icon-button { display: grid; width: 34px; height: 34px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; }
.icon-button:hover { background: var(--surface-soft); }
.icon-button svg { width: 17px; height: 17px; fill: currentColor; }

.page { max-width: 1530px; margin: 0 auto; padding: 31px 32px 24px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; }
.breadcrumb { display: flex; gap: 8px; margin-bottom: 10px; color: var(--muted); font-size: 11px; }
.breadcrumb span:last-child { color: var(--green-800); font-weight: 700; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(28px, 3vw, 37px); line-height: 1.05; letter-spacing: -0.035em; }
.page-heading p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.page-heading__status { display: flex; align-items: center; gap: 13px; padding-bottom: 3px; color: var(--muted); font-size: 10px; }
.live-indicator { display: inline-flex; align-items: center; gap: 7px; color: var(--green-800); font-weight: 700; }
.live-indicator i { width: 7px; height: 7px; border-radius: 50%; background: #2ea86b; box-shadow: 0 0 0 4px rgba(46, 168, 107, 0.12); }
html[data-realtime-state="connecting"] .plant-card__online, html[data-realtime-state="connecting"] .live-indicator i,
html[data-realtime-state="reconnecting"] .plant-card__online, html[data-realtime-state="reconnecting"] .live-indicator i { background: #d59a23; box-shadow: 0 0 0 4px rgba(213, 154, 35, 0.14); animation: status-pulse 1.4s ease-in-out infinite; }
html[data-realtime-state="connecting"] .live-indicator, html[data-realtime-state="reconnecting"] .live-indicator { color: #86600c; }
html[data-realtime-state="connected"] .plant-card__online, html[data-realtime-state="connected"] .live-indicator i { background: #2ea86b; box-shadow: 0 0 0 4px rgba(46, 168, 107, 0.12); }
html[data-realtime-state="manual"] .plant-card__online, html[data-realtime-state="manual"] .live-indicator i { background: #8d9993; box-shadow: 0 0 0 4px rgba(141, 153, 147, 0.13); }
html[data-realtime-state="manual"] .live-indicator { color: var(--muted); }
@keyframes status-pulse { 50% { opacity: 0.48; } }

.summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
.summary-card { display: flex; align-items: center; gap: 14px; min-height: 94px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 7px 22px rgba(24, 49, 39, 0.035); }
.summary-card__icon { display: grid; width: 43px; height: 43px; flex: 0 0 auto; place-items: center; border-radius: 12px; }
.summary-card__icon svg { width: 21px; height: 21px; fill: currentColor; }
.summary-card--jobs .summary-card__icon { color: var(--green-800); background: var(--green-100); }
.summary-card--units .summary-card__icon { color: var(--blue); background: var(--blue-soft); }
.summary-card--attention .summary-card__icon { color: var(--amber); background: var(--amber-soft); }
.summary-card > div:last-child { display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 12px; }
.summary-card span { grid-column: 1 / -1; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.summary-card strong { font-size: 26px; line-height: 1.1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.summary-card small { color: var(--muted); font-size: 10px; }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.75fr); align-items: start; gap: 17px; margin-top: 17px; }
.queue-card, .detail-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.queue-card { min-width: 0; overflow: hidden; }
.queue-card__header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 21px 15px; }
.section-title-row { display: flex; align-items: center; gap: 9px; }
.queue-card h2, .detail-card h2 { margin-bottom: 4px; font-size: 17px; letter-spacing: -0.02em; }
.queue-card__header p { margin-bottom: 0; color: var(--muted); font-size: 10px; }
.count-pill { padding: 3px 7px; border-radius: 999px; color: var(--green-800); background: var(--green-100); font-size: 9px; font-weight: 800; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 35px; padding: 7px 11px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface); font-size: 10px; font-weight: 700; cursor: pointer; }
.secondary-button:hover { border-color: #aabbb2; background: var(--surface-soft); }
.secondary-button svg { width: 14px; height: 14px; fill: currentColor; }
.queue-tools { display: grid; grid-template-columns: minmax(190px, 1fr) 170px; gap: 9px; padding: 0 21px 15px; border-bottom: 1px solid var(--line); }
.search-field, .select-field { position: relative; display: flex; align-items: center; }
.search-field > svg { position: absolute; left: 11px; width: 15px; height: 15px; fill: var(--muted); pointer-events: none; }
.search-field input, .select-field select { width: 100%; height: 37px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface-soft); outline: 0; }
.search-field input { padding: 0 12px 0 34px; font-size: 11px; }
.select-field select { appearance: none; padding: 0 31px 0 11px; font-size: 10px; cursor: pointer; }
.select-field svg { position: absolute; right: 9px; width: 16px; height: 16px; fill: var(--muted); pointer-events: none; }
.search-field input:focus, .select-field select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(44, 95, 141, 0.22); outline-offset: 2px; }

.table-wrap { overflow-x: auto; }
.jobs-table { width: 100%; min-width: 680px; border-collapse: collapse; table-layout: fixed; }
.jobs-table th:nth-child(1) { width: 11%; }
.jobs-table th:nth-child(2) { width: 23%; }
.jobs-table th:nth-child(3) { width: 14%; }
.jobs-table th:nth-child(4) { width: 21%; }
.jobs-table th:nth-child(5) { width: 18%; }
.jobs-table th:nth-child(6) { width: 13%; }
.jobs-table th { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--muted); background: var(--surface-soft); font-size: 9px; font-weight: 800; letter-spacing: 0.055em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.jobs-table th:first-child, .jobs-table td:first-child { padding-left: 21px; }
.jobs-table th:last-child, .jobs-table td:last-child { padding-right: 21px; }
.jobs-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 11px; }
.jobs-table tr:last-child td { border-bottom: 0; }
.jobs-table tbody tr { cursor: pointer; transition: background 140ms ease; }
.jobs-table tbody tr:hover { background: var(--green-50); }
.jobs-table tbody tr.is-selected { background: #eaf4ee; box-shadow: inset 3px 0 0 var(--green-800); }
.job-number { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 0; color: var(--green-800); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.job-number::before { width: 6px; height: 6px; border-radius: 50%; background: var(--status-color, var(--green-800)); content: ""; }
.cell-primary { display: block; color: var(--ink); font-weight: 700; line-height: 1.35; }
.cell-secondary { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.cell-nowrap { white-space: nowrap; }
.progress-copy { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.progress-copy strong { font-size: 11px; font-variant-numeric: tabular-nums; }
.progress-copy span { color: var(--muted); font-size: 9px; }
.progress-track { width: 100%; height: 5px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: #e7ece9; }
.progress-bar { height: 100%; border-radius: inherit; background: var(--green-800); }
.status-badge { --status-color: var(--green-800); display: inline-flex; align-items: center; gap: 6px; max-width: 145px; padding: 5px 8px; border-radius: 999px; color: var(--status-color); background: var(--status-bg, var(--green-100)); font-size: 9px; font-weight: 800; line-height: 1.2; }
.status-badge::before { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; content: ""; }
.status-material-hold, .status-qa-hold { --status-color: var(--red); --status-bg: var(--red-soft); }
.status-ready-unassigned, .status-released, .status-received, .status-queued, .status-setup, .status-paused { --status-color: var(--amber); --status-bg: var(--amber-soft); }
.status-part-transferred { --status-color: var(--blue); --status-bg: var(--blue-soft); }
.status-running, .status-completed { --status-color: #23734a; --status-bg: #e2f3e8; }
.status-returned-for-rework, .status-cancelled { --status-color: var(--red); --status-bg: var(--red-soft); }
.status-mixed-line-status { --status-color: var(--blue); --status-bg: var(--blue-soft); }
.risk-copy { color: var(--red); font-weight: 700; }

.mobile-job-list { display: none; padding: 9px; }
.mobile-job { width: 100%; margin: 0; padding: 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.mobile-job:last-child { border-bottom: 0; }
.mobile-job.is-selected { border-radius: 10px; background: var(--green-50); box-shadow: inset 3px 0 0 var(--green-800); }
.mobile-job__top, .mobile-job__meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mobile-job__top strong { font-size: 12px; }
.mobile-job__title { margin: 9px 0 5px; font-size: 12px; font-weight: 700; }
.mobile-job__customer, .mobile-job__meta { color: var(--muted); font-size: 10px; }

.detail-card { position: sticky; top: 18px; min-height: 470px; overflow: hidden; }
.detail-placeholder { display: grid; min-height: 470px; padding: 44px 27px; place-content: center; justify-items: center; text-align: center; }
.detail-placeholder__art { display: grid; width: 68px; gap: 7px; margin-bottom: 20px; }
.detail-placeholder__art span { height: 8px; border-radius: 999px; background: var(--green-100); }
.detail-placeholder__art span:nth-child(2) { width: 78%; }
.detail-placeholder__art span:nth-child(3) { width: 90%; }
.detail-placeholder p { max-width: 260px; margin-bottom: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.detail-head { padding: 20px 20px 17px; border-bottom: 1px solid var(--line); background: linear-gradient(145deg, #f9fbf8, #f2f7f4); }
.detail-head__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.detail-job-number { color: var(--green-800); font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.detail-head h2 { margin: 11px 0 5px; font-size: 21px; line-height: 1.2; }
.detail-customer { margin-bottom: 0; color: var(--muted); font-size: 11px; }
.detail-body { padding: 18px 20px 21px; }
.quantity-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.quantity-item { padding: 10px 8px; border-radius: 9px; background: var(--surface-soft); }
.quantity-item span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.quantity-item strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.attention-panel { margin-top: 15px; padding: 13px 14px; border-left: 3px solid var(--attention-color, var(--amber)); border-radius: 0 9px 9px 0; background: var(--attention-bg, var(--amber-soft)); }
.attention-panel--clear { --attention-color: #2b7d50; --attention-bg: #e6f4eb; }
.attention-panel strong { display: block; margin-bottom: 4px; color: var(--attention-color); font-size: 10px; }
.attention-panel p { margin-bottom: 0; color: #5d5131; font-size: 10px; line-height: 1.5; }
.attention-panel--clear p { color: #365c45; }
.detail-section { margin-top: 20px; }
.detail-section h3 { margin-bottom: 10px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: 0.075em; text-transform: uppercase; }
.detail-section__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.detail-section__head h3 { margin-bottom: 3px; }
.detail-section__head p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.add-line-button { display: inline-flex; min-height: 29px; flex: 0 0 auto; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid #b9cec3; border-radius: 8px; color: var(--green-800); background: var(--green-50); font-size: 9px; font-weight: 800; text-decoration: none; cursor: pointer; }
.add-line-button:hover { border-color: var(--green-800); background: var(--green-100); }
.add-line-button span { font-size: 15px; font-weight: 500; line-height: 0; }
.operation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.operation-item { padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.operation-item span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.operation-item strong { display: block; font-size: 10px; line-height: 1.35; }
.route-list { position: relative; display: grid; gap: 0; margin-left: 5px; }
.route-step { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 9px; min-height: 53px; }
.route-step::after { position: absolute; top: 14px; bottom: -2px; left: 5px; width: 2px; background: var(--line); content: ""; }
.route-step:last-child::after { display: none; }
.route-step__dot { position: relative; z-index: 1; width: 12px; height: 12px; margin-top: 3px; border: 3px solid var(--surface); border-radius: 50%; background: var(--line-strong); box-shadow: 0 0 0 1px var(--line-strong); }
.route-step--complete .route-step__dot { background: #2d8255; box-shadow: 0 0 0 1px #2d8255; }
.route-step--current .route-step__dot { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.route-step__copy strong { display: block; font-size: 10px; line-height: 1.3; }
.route-step__copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.line-table { width: 100%; border-collapse: collapse; }
.line-table th { padding: 6px 5px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 8px; font-weight: 800; text-align: right; text-transform: uppercase; }
.line-table th:first-child, .line-table td:first-child { padding-left: 0; text-align: left; }
.line-table th:last-child, .line-table td:last-child { padding-right: 0; }
.line-table td { padding: 8px 5px; border-bottom: 1px solid var(--line); font-size: 9px; text-align: right; font-variant-numeric: tabular-nums; }
.line-table td:first-child { max-width: 120px; font-weight: 700; font-variant-numeric: normal; }
.line-table tr:last-child td { border-bottom: 0; }
.line-unit { color: var(--muted); font-weight: 400; }
.line-status-pill { display: flex; width: max-content; max-width: 130px; align-items: center; gap: 4px; margin-top: 5px; padding: 3px 6px; border-radius: 999px; color: var(--status-color, var(--green-800)); background: var(--status-bg, var(--green-100)); font-size: 7px; font-weight: 800; line-height: 1.25; }
.line-status-pill::before { width: 5px; height: 5px; flex: 0 0 auto; border-radius: 50%; background: currentColor; content: ""; }
.line-actions { width: 168px; text-align: right; white-space: normal; }
.line-action { display: inline-flex; align-items: center; min-height: 24px; padding: 4px 6px; border: 0; border-radius: 5px; color: var(--green-800); background: transparent; font-size: 8px; font-weight: 800; line-height: 1.3; text-decoration: none; cursor: pointer; }
.line-action:hover { background: var(--green-100); }
.line-action--danger { color: var(--red); }
.line-action--danger:hover { background: var(--red-soft); }
.line-action--request { display: block; margin-top: 3px; color: var(--amber); }
.line-action--request:hover { background: var(--amber-soft); }
.line-action--status { display: block; margin: 0 0 3px auto; color: #fff; background: var(--green-800); }
.line-action--status:hover { color: #fff; background: var(--green-900); }
.line-actions__loading { color: var(--muted); font-size: 8px; font-weight: 500; }
.line-actions__complete { display: block; margin-bottom: 4px; color: var(--muted); font-size: 7px; font-weight: 700; }
.product-line-cards { display: none; }
.product-line-card { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.product-line-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.product-line-card__head > div:first-child { display: grid; gap: 2px; }
.product-line-card__head strong { font-size: 10px; }
.product-line-card__head span { color: var(--muted); font-size: 8px; }
.product-line-card__head .line-status-pill { flex: 0 0 auto; margin-top: 0; color: var(--status-color, var(--green-800)); font-size: 7px; }
.product-line-card__actions { display: flex; gap: 2px; }
.product-line-card__controls { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); }
.product-line-card__controls .line-action--request, .product-line-card__controls .line-action--status { display: inline-flex; margin: 0; }
.product-line-card dl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 11px 0 0; }
.product-line-card dl div { padding: 7px; border-radius: 7px; background: var(--surface); }
.product-line-card dt { color: var(--muted); font-size: 7px; font-weight: 800; text-transform: uppercase; }
.product-line-card dd { margin: 3px 0 0; font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.product-lines-empty { padding: 17px; border: 1px dashed var(--line-strong); border-radius: 10px; text-align: center; background: var(--surface-soft); }
.product-lines-empty strong { display: block; margin-bottom: 4px; font-size: 10px; }
.product-lines-empty p { margin-bottom: 6px; color: var(--muted); font-size: 9px; }
.product-lines-empty a { display: inline-flex; text-decoration: none; }
.spec-revision { display: block; color: var(--green-800); font-size: 8px; white-space: nowrap; }
.spec-hold { display: inline-flex; margin-top: 5px; padding: 3px 5px; border-radius: 5px; color: var(--amber); background: var(--amber-soft); font-size: 7px; font-weight: 800; text-transform: uppercase; }
.spec-batch-detail { display: block; max-width: 150px; margin-top: 4px; color: var(--muted); font-size: 7px; line-height: 1.35; text-transform: capitalize; }
.spec-impact-detail { display: block; max-width: 190px; margin-top: 5px; color: #725300; font-size: 7px; line-height: 1.4; }
.inline-error { display: grid; gap: 4px; padding: 12px; border-left: 3px solid var(--red); border-radius: 0 8px 8px 0; background: var(--red-soft); }
.inline-error strong { color: var(--red); font-size: 9px; }
.inline-error span { color: #744d47; font-size: 9px; line-height: 1.45; }
.inline-error .text-button { width: max-content; padding: 3px 0 0; color: var(--red); }

.modal { width: min(550px, calc(100vw - 28px)); max-height: calc(100vh - 34px); padding: 0; overflow: auto; border: 0; border-radius: 17px; color: var(--ink); background: var(--surface); box-shadow: 0 28px 80px rgba(10, 30, 23, 0.28); }
.modal::backdrop { background: rgba(8, 28, 21, 0.58); backdrop-filter: blur(3px); }
.modal[open] { animation: modal-in 160ms ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 21px 22px 17px; border-bottom: 1px solid var(--line); background: linear-gradient(145deg, #f9fbf8, #f2f7f4); }
.modal__eyebrow { display: block; margin-bottom: 6px; color: var(--green-800); font-size: 9px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.modal__head h2 { margin: 0 0 4px; font-size: 19px; letter-spacing: -0.025em; }
.modal__head p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.modal__close { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); font-size: 19px; line-height: 1; cursor: pointer; }
.modal__close:hover { color: var(--ink); background: var(--surface-soft); }
.modal__body { padding: 20px 22px 22px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 14px; }
.form-stack { display: grid; gap: 14px; }
.form-field { display: grid; gap: 6px; color: #45534c; font-size: 10px; font-weight: 750; }
.form-field--wide + .form-field--wide { margin-top: 14px; }
.form-field input { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--surface); outline: 0; }
.form-field input:focus { border-color: var(--green-800); box-shadow: 0 0 0 3px rgba(25, 85, 65, 0.12); }
.form-field input:invalid:not(:placeholder-shown) { border-color: #d58d82; }
.form-field textarea, .form-field select { width: 100%; padding: 10px 11px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--ink); background: var(--surface); font: inherit; font-size: 10px; line-height: 1.45; outline: 0; resize: vertical; }
.form-field textarea:focus, .form-field select:focus { border-color: var(--green-800); box-shadow: 0 0 0 3px rgba(25, 85, 65, 0.12); }
.form-field small { color: var(--muted); font-size: 8px; font-weight: 450; line-height: 1.45; }
.floor-status-modal { width: min(510px, calc(100vw - 28px)); }
.floor-status-current { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); }
.floor-status-current > span { color: var(--muted); font-size: 9px; font-weight: 750; }
.floor-status-current .line-status-pill { margin-top: 0; }
.floor-status-fields { gap: 15px; }
.quantity-preview { display: flex; align-items: baseline; gap: 6px; margin-top: 16px; padding: 11px 12px; border-radius: 9px; color: var(--green-800); background: var(--green-50); }
.quantity-preview span { margin-right: auto; color: var(--muted); font-size: 9px; font-weight: 700; }
.quantity-preview strong { font-size: 15px; }
.quantity-preview small { font-size: 9px; }
.quantity-preview.is-invalid { color: var(--red); background: var(--red-soft); }
.form-alert { margin-bottom: 14px; padding: 10px 11px; border-left: 3px solid var(--red); border-radius: 0 8px 8px 0; color: #7c3429; background: var(--red-soft); font-size: 9px; line-height: 1.5; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.modal__primary { min-height: 35px; margin: 0; padding: 7px 13px; border-radius: 9px; font-size: 10px; box-shadow: none; }
.button-spinner { display: none; width: 12px; height: 12px; margin-left: 7px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 600ms linear infinite; }
.is-saving .button-spinner { display: inline-block; }
button:disabled { cursor: wait; opacity: 0.68; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal--confirm { width: min(420px, calc(100vw - 28px)); }
.confirm-dialog { padding: 25px 24px 0; text-align: center; }
.confirm-dialog__icon { display: grid; width: 42px; height: 42px; margin: 0 auto 13px; place-items: center; border-radius: 50%; color: var(--red); background: var(--red-soft); font-size: 17px; font-weight: 850; }
.confirm-dialog h2 { margin-bottom: 7px; font-size: 19px; }
.confirm-dialog > p { margin: 0 auto 17px; max-width: 330px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.confirm-dialog__reason { text-align: left; }
.confirm-dialog .form-alert { margin-top: 13px; text-align: left; }
.modal__foot--center { justify-content: center; margin: 20px -24px 0; }
.danger-button { display: inline-flex; min-height: 35px; align-items: center; justify-content: center; padding: 7px 13px; border: 0; border-radius: 9px; color: #fff; background: var(--red); font-size: 10px; font-weight: 800; cursor: pointer; }
.danger-button:hover { background: #873326; }
.toast-region { position: fixed; z-index: 120; right: 22px; bottom: 22px; display: grid; width: min(390px, calc(100vw - 28px)); gap: 9px; pointer-events: none; }
.toast { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 13px 13px 13px 15px; border: 1px solid #b8dbc5; border-left: 4px solid #2b7d50; border-radius: 11px; color: var(--ink); background: #f5fbf7; box-shadow: 0 14px 35px rgba(18, 50, 38, 0.18); font-size: 10px; animation: toast-in 180ms ease-out; pointer-events: auto; }
.toast--success { color: #1d5737; background: #edf9f1; }
.toast--error { border-color: #e8c1ba; border-left-color: var(--red); color: #7c3429; background: #fff0ed; }
.toast--leaving { opacity: 0; transform: translateY(5px); transition: opacity 150ms ease, transform 150ms ease; }
.toast__copy { display: grid; min-width: 0; gap: 4px; }
.toast__eyebrow { color: var(--green-800); font-size: 8px; font-weight: 850; letter-spacing: 0.055em; text-transform: uppercase; }
.toast__title { color: inherit; font-size: 11px; line-height: 1.35; }
.toast__message, .toast__detail { margin: 0; overflow-wrap: anywhere; color: #506058; font-size: 9px; font-weight: 500; line-height: 1.45; }
.toast__detail { color: var(--muted); font-size: 8px; }
.toast__actions { display: flex; align-items: center; gap: 3px; }
.toast__action, .toast__dismiss { border: 0; color: var(--green-800); background: transparent; font: inherit; font-size: 9px; font-weight: 850; cursor: pointer; }
.toast__action { min-height: 30px; padding: 5px 7px; border-radius: 7px; white-space: nowrap; }
.toast__dismiss { display: grid; width: 27px; height: 27px; place-items: center; padding: 0; border-radius: 7px; color: var(--muted); font-size: 17px; line-height: 1; }
.toast__action:hover, .toast__dismiss:hover { background: rgba(25, 85, 65, 0.08); }
.toast__action:focus-visible, .toast__dismiss:focus-visible { outline: 2px solid var(--green-800); outline-offset: 1px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.realtime-diff { width: min(920px, calc(100vw - 28px)); max-height: min(820px, calc(100vh - 34px)); overflow: hidden; }
.realtime-diff[open] { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); }
.realtime-diff__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 22px 14px; background: linear-gradient(145deg, #f9fbf8, #f2f7f4); }
.realtime-diff__head h2 { margin: 0; font-size: 19px; line-height: 1.25; letter-spacing: -0.025em; }
.realtime-diff__description { margin: 0; padding: 0 22px 15px; border-bottom: 1px solid var(--line); color: var(--muted); background: linear-gradient(145deg, #f9fbf8, #f2f7f4); font-size: 10px; line-height: 1.5; }
.realtime-diff__meta { display: flex; flex-wrap: wrap; gap: 6px; padding: 11px 22px; border-bottom: 1px solid var(--line); background: var(--surface); }
.realtime-diff__fact { padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--surface-soft); font-size: 8px; font-weight: 700; }
.realtime-diff__loading, .realtime-diff__error { min-height: 250px; padding: 30px; place-content: center; justify-items: center; text-align: center; }
.realtime-diff__loading:not([hidden]), .realtime-diff__error:not([hidden]) { display: grid; }
.realtime-diff__loading { gap: 12px; color: var(--muted); font-size: 10px; }
.realtime-diff__loading > span { width: 27px; height: 27px; border: 3px solid #d9e5de; border-right-color: var(--green-800); border-radius: 50%; animation: spin 700ms linear infinite; }
.realtime-diff__error { gap: 8px; }
.realtime-diff__error strong { font-size: 14px; }
.realtime-diff__error p { margin: 0 0 6px; color: var(--muted); font-size: 10px; }
.realtime-diff__body { min-height: 0; padding: 16px 22px 22px; overflow: auto; background: #f6f8fa; }
.realtime-diff__files { display: grid; gap: 12px; }
.realtime-diff__file { overflow: hidden; border: 1px solid #d0d7de; border-radius: 9px; background: #fff; }
.realtime-diff__file-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 11px; border-bottom: 1px solid #d8dee4; background: #f6f8fa; }
.realtime-diff__file-head h3 { margin: 0; font-size: 10px; }
.realtime-diff__file-head span { color: #57606a; font-size: 8px; font-weight: 750; text-transform: uppercase; }
.realtime-diff__line { display: grid; grid-template-columns: 22px 48px minmax(0, 1fr); min-height: 27px; border-top: 1px solid rgba(27, 31, 36, 0.055); color: #24292f; }
.realtime-diff__file-head + .realtime-diff__line { border-top: 0; }
.realtime-diff__line--remove { background: #ffebe9; }
.realtime-diff__line--add { background: #dafbe1; }
.realtime-diff__line--context { background: #fff; }
.realtime-diff__sign { display: grid; place-items: start center; padding-top: 5px; color: #57606a; background: rgba(27, 31, 36, 0.045); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; font-weight: 800; user-select: none; }
.realtime-diff__line--remove .realtime-diff__sign { color: #cf222e; background: #ffd7d5; }
.realtime-diff__line--add .realtime-diff__sign { color: #1a7f37; background: #aceebb; }
.realtime-diff__line-label { padding: 6px 5px; color: #57606a; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.realtime-diff__code { min-width: 0; padding: 5px 8px; overflow-wrap: anywhere; color: inherit; background: transparent; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 10px; line-height: 1.55; white-space: pre-wrap; }
.realtime-diff__empty { margin: 0; padding: 25px; border: 1px dashed var(--line-strong); border-radius: 9px; color: var(--muted); background: var(--surface); font-size: 10px; text-align: center; }

.loading-state { display: grid; gap: 13px; padding: 21px; }
.skeleton { height: 42px; border-radius: 9px; background: linear-gradient(90deg, #eef2ef 25%, #f8faf8 50%, #eef2ef 75%); background-size: 220% 100%; animation: shimmer 1.35s infinite; }
.skeleton--wide { height: 28px; }
@keyframes shimmer { to { background-position: -220% 0; } }
.empty-state, .error-state { min-height: 310px; padding: 32px; place-content: center; text-align: center; }
.empty-state:not([hidden]) { display: grid; justify-items: center; }
.error-state:not([hidden]) { display: flex; align-items: center; justify-content: center; gap: 15px; text-align: left; }
.empty-state__icon { display: grid; width: 43px; height: 43px; margin-bottom: 13px; place-items: center; border-radius: 50%; color: var(--muted); background: var(--surface-soft); }
.empty-state__icon svg { width: 20px; height: 20px; fill: currentColor; }
.empty-state h3, .error-state h3 { margin-bottom: 5px; font-size: 14px; }
.empty-state p, .error-state p { margin-bottom: 13px; color: var(--muted); font-size: 10px; }
.text-button { border: 0; color: var(--green-800); background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }
.error-state__icon { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--red); background: var(--red-soft); font-weight: 800; }

.page-footer { display: flex; justify-content: space-between; gap: 18px; padding: 20px 3px 0; color: var(--muted); font-size: 9px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

.login-page { min-height: 100vh; background: #edf2ed; }
.login-layout { display: grid; grid-template-columns: minmax(330px, 0.85fr) minmax(480px, 1.15fr); min-height: 100vh; }
.login-panel { display: grid; align-content: center; padding: clamp(30px, 7vw, 90px); background: var(--surface); }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: clamp(42px, 8vh, 72px); text-decoration: none; }
.login-brand svg { width: 39px; height: 39px; color: #1c624a; }
.login-brand strong { display: block; font-size: 19px; }
.login-brand small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.login-copy { max-width: 390px; }
.login-copy .eyebrow { display: block; margin-bottom: 13px; font-size: 10px; }
.login-copy h1 { margin-bottom: 11px; font-size: clamp(30px, 4vw, 42px); }
.login-copy > p { margin-bottom: 28px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.login-alert { margin-bottom: 18px; padding: 11px 12px; border-left: 3px solid var(--red); border-radius: 0 8px 8px 0; color: var(--red); background: var(--red-soft); font-size: 10px; }
.login-alert--success { border-color: #2b7d50; color: #256341; background: #e6f4eb; }
.login-form { display: grid; gap: 15px; }
.login-field { display: grid; gap: 6px; color: #45534c; font-size: 10px; font-weight: 700; }
.login-field input { width: 100%; height: 45px; padding: 0 13px; border: 1px solid var(--line-strong); border-radius: 9px; color: var(--ink); background: var(--surface); outline: 0; }
.login-field input:focus { border-color: var(--green-800); box-shadow: 0 0 0 3px rgba(25, 85, 65, 0.12); }
.primary-button { display: inline-flex; min-height: 45px; align-items: center; justify-content: center; margin-top: 3px; padding: 10px 18px; border: 0; border-radius: 9px; color: #fff; background: var(--green-800); font-size: 11px; font-weight: 800; cursor: pointer; box-shadow: 0 9px 22px rgba(18, 63, 50, 0.18); }
.primary-button:hover { background: var(--green-900); }
.demo-access { margin-top: 22px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.demo-access strong { display: block; margin-bottom: 4px; color: var(--green-800); font-size: 10px; }
.demo-access p { margin-bottom: 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.login-version { margin-top: 27px; color: var(--muted); font-size: 9px; }
.login-visual { position: relative; display: grid; align-content: center; min-width: 0; overflow: hidden; padding: clamp(40px, 7vw, 90px); color: #fff; background: linear-gradient(145deg, #154735, #092b22); }
.login-visual::before, .login-visual::after { position: absolute; border-radius: 50%; content: ""; }
.login-visual::before { width: 420px; height: 420px; top: -180px; right: -130px; border: 1px solid rgba(255, 255, 255, 0.10); box-shadow: 0 0 0 80px rgba(255, 255, 255, 0.025), 0 0 0 160px rgba(255, 255, 255, 0.018); }
.login-visual::after { width: 260px; height: 260px; bottom: -130px; left: -90px; background: rgba(231, 184, 75, 0.08); }
.login-visual__content { position: relative; z-index: 1; max-width: 580px; }
.login-visual__kicker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 23px; color: #f2d88b; font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.login-visual__kicker::before { width: 22px; height: 1px; background: currentColor; content: ""; }
.login-visual h2 { max-width: 520px; margin-bottom: 19px; font-size: clamp(32px, 4.5vw, 57px); line-height: 1.03; letter-spacing: -0.045em; }
.login-visual p { max-width: 510px; color: rgba(255, 255, 255, 0.68); font-size: 13px; line-height: 1.7; }
.login-flow { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 38px; }
.login-flow span { padding: 7px 10px; border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 999px; color: rgba(255, 255, 255, 0.76); font-size: 9px; }
.login-flow i { align-self: center; color: rgba(255, 255, 255, 0.30); font-style: normal; }

@media (max-width: 1180px) {
  .workspace-grid { grid-template-columns: 1fr; }
  .detail-card { position: static; min-height: 0; }
  .detail-placeholder { min-height: 260px; }
  .detail-body { display: grid; grid-template-columns: minmax(260px, 0.7fr) minmax(330px, 1.3fr); gap: 0 24px; }
  .detail-body > .quantity-grid, .detail-body > .attention-panel { grid-column: 1; }
  .detail-body > .detail-section { grid-column: 2; }
  .detail-body > .detail-section:last-child { grid-column: 1; grid-row: 3; }
}

@media (max-width: 860px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { min-height: 62px; padding: 0 18px; }
  .topbar__mobile-brand { display: flex; align-items: center; gap: 8px; }
  .topbar__mobile-brand svg { width: 29px; height: 29px; fill: var(--green-800); }
  .topbar__context, .user-badge__copy { display: none; }
  .page { padding: 23px 18px 20px; }
  .login-layout { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; }
}

@media (max-width: 670px) {
  .demo-chip { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 14px; }
  .summary-grid { grid-template-columns: 1fr; gap: 9px; }
  .summary-card { min-height: 76px; padding: 13px 15px; }
  .summary-card__icon { width: 38px; height: 38px; }
  .summary-card strong { font-size: 22px; }
  .queue-card__header { padding: 17px 15px 13px; }
  .queue-tools { grid-template-columns: 1fr; padding: 0 15px 13px; }
  .table-wrap { display: none !important; }
  .product-line-cards { display: grid; gap: 8px; }
  .mobile-job-list:not([hidden]) { display: block; }
  .detail-body { display: block; padding: 16px; }
  .detail-head { padding: 17px 16px 15px; }
  .quantity-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-footer { flex-direction: column; gap: 5px; }
  .toast-region { right: 14px; bottom: 14px; }
  .toast { grid-template-columns: minmax(0, 1fr); }
  .toast__actions { justify-content: flex-end; }
  .realtime-diff { width: calc(100vw - 18px); max-height: calc(100vh - 18px); }
  .realtime-diff__head { padding: 16px 16px 12px; }
  .realtime-diff__description { padding: 0 16px 12px; }
  .realtime-diff__meta { padding: 9px 16px; }
  .realtime-diff__body { padding: 12px; }
  .realtime-diff__line { grid-template-columns: 20px 42px minmax(0, 1fr); }
}

@media (max-width: 390px) {
  .page { padding-inline: 11px; }
  .topbar { padding-inline: 11px; }
  .secondary-button { padding-inline: 9px; }
  .queue-card__header p { display: none; }
  .login-panel { padding: 28px 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
