:root {
  --ink: #20272d;
  --ink-soft: #3f4a53;
  --canvas: #f4f6f7;
  --paper: #ffffff;
  --line: #d8dee2;
  --line-strong: #acb7bf;
  --muted: #68747d;
  --blue: #3167c8;
  --blue-soft: #eef4ff;
  --green: #2d7b4d;
  --green-soft: #eaf4ed;
  --amber: #d57400;
  --amber-soft: #fff6e8;
  --danger: #b54242;
  --danger-soft: #fff0f0;
  --shadow: 0 12px 34px rgba(26, 35, 41, 0.12);
  --sidebar: 232px;
  --radius: 6px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(49, 103, 200, .23); outline-offset: 1px; }
.icon { width: 19px; height: 19px; flex: 0 0 auto; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; z-index: 30; display: flex; flex-direction: column; padding: 22px 14px 16px; background: var(--ink); color: #fff; }
.brand { min-height: 76px; padding: 7px 8px 25px; border: 0; background: transparent; color: #fff; display: flex; align-items: center; gap: 10px; text-align: left; }
.brand-mark { width: 44px; height: 44px; border: 2px solid #fff; display: grid; place-items: center; flex: 0 0 auto; }
.brand-mark .icon { width: 27px; height: 27px; }
.brand-name { display: grid; min-width: 0; font-size: 17px; font-weight: 750; letter-spacing: 0; line-height: 1.04; }
.brand-name small { margin-bottom: 4px; font-size: 9px; font-weight: 700; letter-spacing: .11em; }
.nav { display: grid; gap: 4px; }
.nav-button { min-height: 44px; padding: 0 12px; border: 1px solid transparent; border-radius: 4px; color: #f7f8f8; background: transparent; display: flex; gap: 12px; align-items: center; text-align: left; font-size: 14px; }
.nav-button:hover, .nav-button.active { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.08); }
.nav-button .icon { width: 19px; height: 19px; }
.sidebar-bottom { margin-top: auto; padding: 16px 12px 2px; border-top: 1px solid rgba(255,255,255,.12); display: grid; gap: 5px; font-size: 11px; }
.sidebar-bottom small { color: rgba(255,255,255,.6); }

.main { min-width: 0; min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.topbar { min-height: 78px; position: sticky; top: 0; z-index: 20; padding: 16px 30px; border-bottom: 1px solid var(--line); background: var(--paper); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-title > .icon { width: 25px; height: 25px; }
.topbar h1 { margin: 0; font-size: 24px; line-height: 1; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.sync-state { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.sync-state > span:last-child { margin-left: -2px; }
.mobile-menu { display: none; width: 40px; height: 40px; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: 4px; }
.screen { width: 100%; max-width: 1680px; padding: 28px 30px 44px; margin: 0 auto; }
.statusbar { min-height: 52px; padding: 10px 30px; border-top: 1px solid var(--line); background: #fff; color: var(--ink-soft); display: flex; align-items: center; justify-content: flex-end; gap: 36px; font-size: 12px; }
.statusbar span { display: inline-flex; align-items: center; gap: 8px; }
.statusbar .icon { width: 17px; height: 17px; }

.primary, .secondary, .text-button, .icon-button, .danger-button { min-height: 38px; border-radius: var(--radius); padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 720; font-size: 13px; }
.primary { border: 1px solid var(--ink); background: var(--ink); color: #fff; }
.primary:hover { background: #080b0d; }
.primary.outline-blue { border-color: var(--ink); background: var(--ink); color: #fff; }
.primary.outline-blue:hover { background: #080b0d; }
.secondary { border: 1px solid var(--line-strong); background: #fff; color: var(--ink); }
.secondary:hover { background: #f5f7f8; }
.secondary.compact { min-height: 35px; padding: 0 11px; font-size: 12px; }
.secondary.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.secondary:disabled, .primary:disabled { opacity: .42; cursor: not-allowed; }
.text-button { min-height: 32px; padding: 0; border: 0; background: transparent; color: var(--blue); }
.text-button:hover { text-decoration: underline; }
.icon-button { width: 38px; padding: 0; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.danger-button { border: 1px solid #dda2a2; background: #fff; color: var(--danger); }
.danger-button:hover { background: var(--danger-soft); }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; background: var(--blue); }
.dot.info { background: var(--blue); }
.dot.success { background: #41a65a; }
.dot.warning { background: #f09a28; }
.dot.danger { background: #e43f3f; }

.metrics { min-height: 76px; margin-bottom: 14px; border: 1px solid var(--line); background: #fff; display: grid; grid-template-columns: repeat(4, 1fr); }
.metrics > div { min-width: 0; padding: 10px 24px; position: relative; display: grid; place-content: center; text-align: center; }
.metrics > div:not(:last-child)::after { content: ''; position: absolute; right: 0; top: 16px; bottom: 16px; width: 1px; background: var(--line); }
.metrics strong { font-size: 27px; line-height: 1; letter-spacing: -.04em; }
.metrics span { margin-top: 6px; color: var(--ink-soft); font-size: 12px; }
.metrics .warning strong, .metrics .warning span { color: var(--amber); }
.metrics .danger strong, .metrics .danger span { color: #e2382f; }

.factory-mode-bar { min-height: 68px; margin-bottom: 14px; padding: 10px 14px 10px 18px; border: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.factory-mode-bar h2 { margin: 0; font-size: 16px; }
.factory-mode-bar p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.view-switcher { display: flex; align-items: center; gap: 5px; }
.view-switcher .icon-button { width: auto; min-width: 42px; padding: 0 10px; gap: 6px; color: var(--ink-soft); }
.view-switcher .icon-button span { font-size: 11px; font-weight: 720; }
.view-switcher .icon-button.active { border-color: var(--blue); background: var(--blue); color: #fff; }

.department-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.department-card { min-width: 0; border: 1px solid var(--line); background: #fff; overflow: hidden; }
.department-card header { min-height: 64px; padding: 11px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.department-card header span { color: var(--muted); font-size: 10px; font-weight: 760; text-transform: uppercase; letter-spacing: .04em; }
.department-card h3 { margin: 4px 0 0; font-size: 13px; }
.department-card header > strong { min-width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid #8cb3f7; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 13px; }
.department-lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.department-lanes > section { min-width: 0; padding: 10px; }
.department-lanes > section + section { border-left: 1px solid var(--line); background: #fafbfc; }
.department-lanes h4 { margin: 0 0 8px; color: var(--ink-soft); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.zone-work-list { display: grid; gap: 7px; }
.zone-work-item { min-height: 80px; padding: 8px; border: 1px solid var(--line); border-left: 3px solid var(--blue); background: #fff; color: var(--ink); display: grid; align-content: start; gap: 4px; text-align: left; }
.zone-work-item:hover { background: #f7f9fa; }
.zone-work-item.waiting { border-left-color: #b6c0c8; }
.zone-work-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.zone-work-top strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.zone-work-product { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 720; }
.zone-work-item small { color: var(--muted); display: grid; gap: 1px; font-size: 9px; line-height: 1.28; }
.zone-work-item small b { color: var(--ink-soft); font-weight: 650; }
.department-empty { min-height: 80px; margin: 0; padding: 9px 2px; color: var(--muted); font-size: 11px; line-height: 1.4; }

.scan-card { width: min(100%, 640px); margin: 0 auto; border: 1px solid var(--line); background: #fff; }
.scan-card header { padding: 18px; border-bottom: 1px solid var(--line); }
.scan-card header > span { color: var(--muted); font-size: 10px; font-weight: 760; letter-spacing: .07em; text-transform: uppercase; }
.scan-card h2 { margin: 6px 0 5px; font-size: 21px; }
.scan-card header p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.4; }
.scan-card dl { margin: 0; }
.scan-card dl div { min-height: 52px; padding: 10px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.scan-card dt { color: var(--muted); font-size: 12px; }
.scan-card dd { margin: 0; text-align: right; font-size: 13px; font-weight: 720; }
.scan-card .detail-warning { margin: 14px 18px; }
.scan-route { margin-top: 14px; padding: 0 18px; }
.scan-route h3 { margin: 0 0 8px; font-size: 14px; }
.scan-route span { min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-bottom: 0; display: block; color: var(--muted); font-size: 12px; }
.scan-route span:last-child { border-bottom: 1px solid var(--line); }
.scan-route span.done { background: var(--green-soft); color: var(--green); }
.scan-route span.current { border-left: 4px solid var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 720; }
.scan-card > .primary { width: calc(100% - 36px); margin: 18px; }
.scan-card > .text-button { margin: 0 18px 18px; font-size: 12px; }
.operator-step { margin: 14px 18px; padding: 13px; border: 1px solid #8cb3f7; background: var(--blue-soft); }
.operator-step h3 { margin: 0; font-size: 14px; }
.operator-step p { margin: 6px 0 11px; color: var(--ink-soft); font-size: 12px; line-height: 1.4; }
.operator-step .primary { width: 100%; }
.print-traveler { width: calc(100% - 36px); margin: 18px; }
.scanner-modal { width: min(500px, 100%); }
.scanner-content { padding: 18px; display: grid; gap: 12px; }
.scanner-content > .primary { width: 100%; }
.scanner-content form { display: grid; gap: 9px; }
.scanner-content label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 720; }
.scanner-content input { min-height: 44px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 3px; font-size: 14px; }
.scanner-or { margin: 0; color: var(--muted); text-align: center; font-size: 12px; }
.scanner-help { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.scanner-content video { width: 100%; max-height: 55vh; border: 1px solid var(--line-strong); background: #101417; object-fit: cover; }
.operator-button { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.google-access { margin: 0; text-decoration: none; }
.google-access.secondary { text-decoration: none; }
.google-access button { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operator-modal { width: min(540px, 100%); }
.operator-content { padding: 18px; display: grid; gap: 13px; }
.operator-list { display: grid; gap: 7px; }
.operator-choice { min-height: 52px; padding: 9px 11px; border: 1px solid var(--line); background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; }
.operator-choice.selected { border-left: 4px solid var(--blue); background: var(--blue-soft); }
.operator-choice strong { font-size: 13px; }
.operator-choice span { color: var(--muted); font-size: 11px; }
.operator-content form { display: grid; gap: 9px; }
.operator-content label { display: grid; gap: 6px; color: var(--ink-soft); font-size: 12px; font-weight: 720; }
.operator-content input { min-height: 46px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 3px; font-size: 16px; }
.people-list { display: grid; }
.people-list article { min-height: 64px; padding: 11px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.people-list article.inactive { background: #f7f8f9; opacity: .78; }
.people-list article > div { min-width: 0; display: grid; gap: 4px; }
.people-list strong { font-size: 13px; }
.people-list span, .people-list small { color: var(--muted); font-size: 11px; }
.people-list b { color: var(--amber); font-size: 11px; text-align: right; }
.people-list b.success { color: var(--green); }
.user-contact { flex: 1; }
.user-actions { display: flex !important; grid-auto-flow: column; align-items: center; gap: 6px; }
.danger-button.compact { min-height: 35px; padding: 0 11px; font-size: 12px; }
.scan-job { margin: 18px; border-top: 1px solid var(--line); }
.scan-job h3 { margin: 14px 0 8px; font-size: 14px; }
.scan-job h4 { margin: 16px 0 7px; color: var(--ink-soft); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.scan-job dl { border: 1px solid var(--line); }
.scan-job dl div { min-height: 41px; padding: 7px 10px; }
.scan-job-line { width: 100%; min-height: 53px; padding: 8px 10px; border: 1px solid var(--line); border-bottom: 0; background: #fff; color: var(--ink); display: grid; gap: 3px; text-align: left; }
.scan-job-line:last-child { border-bottom: 1px solid var(--line); }
.scan-job-line.current { border-left: 4px solid var(--blue); background: var(--blue-soft); }
.scan-job-line strong { font-size: 12px; }
.scan-job-line span { color: var(--muted); font-size: 11px; }

.dashboard-layout { display: grid; grid-template-columns: minmax(0, 1fr) 314px; gap: 16px; align-items: start; }
.dashboard-main { min-width: 0; display: grid; gap: 16px; }
.right-rail { display: grid; gap: 14px; position: sticky; top: 88px; }
.table-panel, .calendar-panel, .rail-panel, .zone-card, .admin-menu, .admin-content, .admin-version { background: #fff; border: 1px solid var(--line); }
.panel-heading { min-height: 54px; padding: 12px 17px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.panel-heading h2, .rail-panel h2 { margin: 0; font-size: 15px; letter-spacing: -.01em; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }

.filters { padding: 10px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(125px, .8fr)) auto; gap: 9px; align-items: center; }
.filters select, .search-field { width: 100%; min-width: 0; height: 35px; border: 1px solid var(--line-strong); border-radius: 3px; background: #fff; color: var(--ink); }
.filters select { padding: 0 29px 0 9px; font-size: 12px; }
.search-field { display: flex; align-items: center; gap: 8px; padding: 0 9px; }
.search-field .icon { width: 16px; height: 16px; color: var(--ink-soft); }
.search-field input { min-width: 0; width: 100%; height: 32px; border: 0; outline: 0; background: transparent; font-size: 12px; }

.production-table { min-width: 780px; }
.production-head, .production-row { display: grid; grid-template-columns: minmax(180px, 1.35fr) minmax(130px, 1fr) 90px minmax(95px, .8fr) minmax(95px, .8fr) minmax(110px, .95fr) 65px; column-gap: 5px; align-items: center; }
.compact-table { min-width: 680px; }
.compact-table .production-head, .compact-table .production-row { grid-template-columns: minmax(145px, 1.2fr) 112px 72px 86px 88px minmax(92px, .85fr) 54px; }
.production-head { min-height: 36px; padding: 0 14px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; font-weight: 730; }
.production-row { width: 100%; min-height: 50px; padding: 0 14px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); text-align: left; font-size: 12px; }
.production-row:hover { background: #f7f9fa; }
.production-row.selected { background: var(--blue-soft); box-shadow: inset 3px 0 var(--blue); }
.production-row > span { min-width: 0; padding-right: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-cell { display: grid; gap: 2px; }
.project-cell strong { font-size: 12px; }
.project-cell small { color: var(--ink-soft); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.situation-cell, .quality-cell { display: flex; align-items: center; gap: 7px; }
.situation-cell > span, .quality-cell > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block-cell { color: var(--ink-soft); }
.remaining-cell { text-align: right; font-variant-numeric: tabular-nums; }
.table-count { min-height: 28px; padding: 6px 14px; color: var(--muted); font-size: 11px; }
.empty-state { min-height: 180px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.table-panel { overflow: hidden; }
.table-panel .production-table { overflow-x: auto; }

.rail-panel { padding: 0 13px 12px; }
.rail-panel > h2 { padding: 14px 0 10px; }
.alerts { display: grid; gap: 7px; }
.alert-item { position: relative; min-height: 77px; padding: 10px 36px 9px 11px; border: 1px solid var(--line); border-left: 4px solid var(--blue); background: #fff; display: grid; gap: 3px; color: var(--ink); text-align: left; }
.alert-item.warning { border-left-color: #f09a28; }
.alert-item.danger { border-left-color: #ef3d37; }
.alert-item.success { border-left-color: #41a65a; }
.alert-item:hover { background: #f8fafb; }
.alert-item strong { font-size: 11px; }
.alert-item span { font-size: 11px; line-height: 1.35; }
.alert-item small { position: absolute; right: 9px; bottom: 9px; color: var(--danger); font-weight: 760; }
.rail-panel > .text-button { margin-top: 4px; font-size: 11px; }
.next-steps { display: grid; }
.next-steps button { min-height: 44px; padding: 0; border: 0; background: transparent; display: grid; grid-template-columns: 40px 10px minmax(0,1fr); align-items: center; gap: 8px; text-align: left; color: var(--ink); }
.next-steps button:hover strong { color: var(--blue); }
.next-steps time { font-size: 10px; font-weight: 720; }
.next-steps span { min-width: 0; display: grid; gap: 2px; }
.next-steps strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.next-steps small { color: var(--muted); font-size: 10px; }

.calendar-panel { min-width: 0; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.calendar-actions { display: flex; gap: 6px; }
.calendar-grid { display: grid; grid-template-columns: 120px repeat(var(--days), minmax(115px, 1fr)); min-width: 750px; }
.calendar-corner, .day-head { min-height: 43px; border-bottom: 1px solid var(--line); }
.day-head { padding: 7px 6px; border-left: 1px solid var(--line); display: grid; place-content: center; text-align: center; }
.day-head strong { text-transform: capitalize; font-size: 10px; }
.day-head span { color: var(--ink-soft); font-size: 10px; }
.calendar-line-label { min-height: 40px; padding: 5px 8px; border: 0; border-bottom: 1px solid var(--line); background: #fff; display: flex; align-items: center; gap: 4px; text-align: left; color: var(--ink); }
.calendar-line-label:hover { background: #f7f9fa; }
.calendar-line-label > .icon { display: none; width: 13px; height: 13px; }
.full-calendar .calendar-line-label > .icon { display: block; }
.calendar-line-label span { min-width: 0; display: grid; gap: 1px; }
.calendar-line-label strong { font-size: 10px; }
.calendar-line-label small { color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-cell { min-height: 40px; padding: 4px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.calendar-bar { width: 100%; height: 30px; padding: 0 5px; border-radius: 3px; border: 1px solid #8cb3f7; background: var(--blue-soft); color: var(--ink); font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar-bar.warning { border-color: #f4b66e; background: var(--amber-soft); }
.calendar-bar.danger { border-color: #e9a2a2; background: var(--danger-soft); }
.calendar-bar.success { border-color: #99cda8; background: var(--green-soft); }
.calendar-bar.draft { border-style: dashed; background: #fff; }
.calendar-bar .icon { width: 10px; height: 10px; margin-left: 3px; vertical-align: middle; }
.full-calendar .calendar-grid { grid-template-columns: 185px repeat(var(--days), minmax(155px, 1fr)); min-width: 1000px; }
.full-calendar .calendar-line-label, .full-calendar .calendar-cell { min-height: 52px; }
.full-calendar .calendar-bar { height: 40px; font-size: 10px; }
.route-label { min-height: 35px; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #f8fafb; color: var(--muted); font-size: 10px; }
.route-steps { min-height: 35px; padding: 6px 9px; border-bottom: 1px solid var(--line); background: #f8fafb; display: flex; gap: 5px; flex-wrap: wrap; }
.route-steps span { padding: 4px 7px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 9px; }
.route-steps span.done { border-color: #a7cfb2; background: var(--green-soft); color: var(--green); }
.route-steps span.current { border-color: #8cb3f7; background: var(--blue-soft); color: var(--blue); font-weight: 700; }
.rotated { transform: rotate(90deg); }

.selected-detail { padding-bottom: 14px; }
.selected-detail-head { min-height: 60px; margin: 0 -1px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.selected-detail-head span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.selected-detail-head h2 { margin-top: 3px; font-size: 16px; }
.selected-detail .detail-project { display: block; font-size: 13px; }
.selected-detail > p { margin: 4px 0 12px; color: var(--muted); font-size: 11px; }
.selected-detail dl { margin: 0; border-top: 1px solid var(--line); }
.selected-detail dl div { min-height: 36px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; }
.selected-detail dt { color: var(--muted); }
.selected-detail dd { margin: 0; text-align: right; font-weight: 700; }
.detail-warning { margin-top: 10px; padding: 10px; border-left: 3px solid var(--amber); background: var(--amber-soft); display: grid; gap: 3px; font-size: 11px; }
.detail-warning.danger { border-left-color: var(--danger); background: var(--danger-soft); }
.detail-actions { margin-top: 11px; display: grid; gap: 7px; }
.detail-actions .primary, .detail-actions .secondary { width: 100%; }
.line-detail-wide { width: min(100%, 420px); margin-top: 14px; }
.large-panel { overflow-x: auto; }
.large-panel .production-row { min-height: 58px; }

.page-intro { margin-bottom: 14px; padding: 0 2px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.page-intro h2 { margin: 0; font-size: 18px; }
.page-intro p { max-width: 800px; margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.release-page { display: grid; gap: 14px; }
.release-summary { min-height: 72px; border: 1px solid var(--line); background: #fff; display: flex; align-items: stretch; }
.release-summary > div { min-width: 130px; padding: 11px 20px; border-right: 1px solid var(--line); display: grid; place-content: center; text-align: center; }
.release-summary strong { font-size: 25px; line-height: 1; }
.release-summary span { margin-top: 5px; color: var(--muted); font-size: 11px; }
.release-summary p { margin: 0; padding: 13px 18px; align-self: center; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.release-toolbar { min-height: 64px; padding: 10px 13px; border: 1px solid var(--line); background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.release-view-switch { display: inline-flex; align-self: stretch; }
.release-view-switch button { padding: 0 12px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); font-size: 12px; font-weight: 720; }
.release-view-switch button + button { margin-left: -1px; }
.release-view-switch button.active { position: relative; z-index: 1; border-color: var(--ink); background: var(--ink); color: #fff; }
.release-view-switch button:disabled { cursor: not-allowed; color: #98a1a7; background: #f7f8f9; }
.release-assign { display: flex; align-items: end; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.release-assign label { display: grid; gap: 4px; color: var(--ink-soft); font-size: 10px; font-weight: 720; }
.release-assign select { min-width: 170px; height: 38px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 3px; background: #fff; color: var(--ink); font-size: 12px; }
.release-list { display: grid; gap: 12px; }
.release-project { border: 1px solid var(--line); background: #fff; overflow: hidden; }
.release-project.is-ready { border-left: 4px solid var(--green); }
.release-project > header { min-height: 66px; padding: 11px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.release-project-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.release-project h3 { margin: 0; font-size: 15px; }
.release-project header p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.release-project header > small { color: var(--muted); font-size: 10px; text-align: right; }
.release-status { padding: 4px 7px; border: 1px solid var(--line-strong); font-size: 10px; font-weight: 760; white-space: nowrap; }
.release-status.ready { border-color: #9bc5a7; background: var(--green-soft); color: var(--green); }
.release-status.pending { border-color: #e0c17d; background: #fff8e7; color: #84651f; }
.release-status.imported { background: #f3f6f8; color: var(--ink-soft); }
.release-reasons { margin: 0; padding: 8px 16px; border-bottom: 1px solid var(--line); color: #84651f; background: #fffaf0; font-size: 11px; }
.release-lines { overflow-x: auto; }
.release-line-head, .release-line { min-width: 650px; display: grid; grid-template-columns: 32px minmax(260px, 1fr) 110px 185px; align-items: center; gap: 12px; }
.release-line-head { min-height: 32px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); background: #f8fafb; font-size: 10px; font-weight: 760; text-transform: uppercase; letter-spacing: .03em; }
.release-line { min-height: 54px; padding: 7px 16px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; }
.release-line:last-child { border-bottom: 0; }
.release-line:not(.disabled) { cursor: pointer; }
.release-line:not(.disabled):hover { background: #f7f9fa; }
.release-line.disabled { background: #fafbfc; color: var(--muted); }
.release-line input { width: 18px; height: 18px; accent-color: var(--blue); }
.release-line span:nth-child(2) { display: grid; gap: 2px; color: var(--ink); }
.release-line strong { font-size: 12px; }
.release-line small { color: var(--muted); font-size: 11px; }
.release-error { padding: 11px 14px; border-left: 4px solid #e2382f; background: #fff2f1; color: #942b24; font-size: 12px; }
.info-note, .warning-note { min-height: 32px; padding: 7px 10px; border-left: 3px solid var(--blue); background: var(--blue-soft); color: var(--blue); font-size: 11px; }
.warning-note { border-left-color: var(--amber); background: var(--amber-soft); color: #985400; }

.zones-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.zone-card { min-width: 0; }
.zone-card header { min-height: 70px; padding: 13px 15px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.zone-card header span { color: var(--muted); font-size: 11px; font-weight: 720; text-transform: uppercase; }
.zone-card h3 { margin: 4px 0 0; font-size: 14px; }
.zone-card header > strong { white-space: nowrap; font-size: 17px; }
.zone-machine-list { display: grid; }
.zone-machine-list > div { min-height: 60px; padding: 9px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(160px,1fr) 150px 70px; align-items: center; gap: 12px; }
.zone-machine-list > div:last-child { border-bottom: 0; }
.zone-machine-list > div > span { min-width: 0; display: grid; gap: 2px; }
.zone-machine-list strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.zone-machine-list small { color: var(--muted); font-size: 10px; }
.zone-machine-list label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10px; }
.zone-machine-list input[type="number"] { width: 68px; height: 32px; border: 1px solid var(--line-strong); border-radius: 3px; padding: 0 6px; text-align: right; }
.zone-machine-list .switch { justify-self: end; display: grid; grid-template-columns: 18px auto; }
.zone-machine-list .switch input { width: 16px; height: 16px; }

.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr) 225px; gap: 14px; align-items: start; }
.admin-menu h2, .admin-version h2 { margin: 0; padding: 15px; border-bottom: 1px solid var(--line); font-size: 14px; }
.admin-menu { display: grid; }
.admin-menu button { min-height: 42px; padding: 0 12px; border: 0; border-left: 3px solid transparent; background: #fff; color: var(--ink); text-align: left; font-size: 12px; }
.admin-menu button.active { border-left-color: var(--ink); background: #f3f6f8; font-weight: 720; }
.admin-menu button:disabled { color: #9da5aa; cursor: not-allowed; }
.admin-content { min-width: 0; }
.status-chip { min-height: 28px; padding: 5px 8px; border: 1px solid var(--line-strong); background: #fff; color: var(--ink-soft); font-size: 11px; font-weight: 720; }
.status-chip.success { border-color: #9bc5a7; background: var(--green-soft); color: var(--green); }
.admin-section { padding: 16px; border-bottom: 1px solid var(--line); }
.admin-section h3 { margin: 0 0 9px; font-size: 13px; }
.admin-section > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.canonical-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); }
.canonical-grid > div { min-height: 82px; padding: 11px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: grid; align-content: center; gap: 4px; }
.canonical-grid > div:nth-child(2n) { border-right: 0; }
.canonical-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
.canonical-grid span { color: var(--muted); font-size: 10px; text-transform: uppercase; }
.canonical-grid strong { font-size: 12px; overflow-wrap: anywhere; }
.canonical-grid small { color: var(--muted); font-size: 10px; }
.sync-summary { margin-top: 12px; min-height: 62px; padding: 10px 14px; border: 1px solid var(--line); background: #f8fafb; display: flex; align-items: center; gap: 13px; }
.sync-summary strong { font-size: 25px; }
.sync-summary span { color: var(--ink-soft); font-size: 11px; }
.admin-actions { padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.file-button input { display: none; }
.admin-version dl { margin: 0; padding: 8px 14px; }
.admin-version dl div { min-height: 37px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.admin-version dt { color: var(--muted); font-size: 11px; }
.admin-version dd { margin: 0; font-weight: 760; }
.admin-version > p { margin: 0; padding: 12px 14px; color: var(--muted); font-size: 10px; line-height: 1.45; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 28px; background: rgba(15,20,24,.58); display: grid; place-items: center; }
.modal { width: min(760px, 100%); max-height: calc(100vh - 56px); overflow: auto; background: #fff; border: 1px solid #20272d; box-shadow: 0 24px 70px rgba(0,0,0,.24); }
.modal header { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.modal h2 { margin: 0; font-size: 18px; }
.modal header p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.form-grid { padding: 17px 18px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.form-grid label { display: grid; gap: 6px; font-size: 11px; font-weight: 720; }
.form-grid input, .form-grid select { width: 100%; min-height: 39px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 3px; background: #fff; color: var(--ink); font-size: 13px; }
.modal footer { padding: 13px 18px; border-top: 1px solid var(--line); background: #f8fafb; display: flex; justify-content: flex-end; gap: 8px; }

.toast { position: fixed; z-index: 150; right: 22px; bottom: 66px; max-width: 390px; padding: 12px 14px; border-left: 4px solid var(--green); background: var(--ink); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-size: 12px; line-height: 1.4; }
.loading, .fatal { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; }
.loading span { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.loading p, .fatal p { color: var(--muted); font-size: 13px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1260px) {
  :root { --sidebar: 205px; }
  .dashboard-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .filters { grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(110px, .75fr)); }
  .filters .secondary { grid-column: 1 / -1; justify-self: end; }
  .zones-grid { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 200px minmax(0,1fr); }
  .admin-version { grid-column: 2; }
  .department-board { grid-template-columns: 1fr; }
}

@media (max-width: 1180px) {
  :root { --sidebar: 224px; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-backdrop { position: fixed; inset: 0; z-index: 25; border: 0; background: rgba(15,20,24,.48); }
  .mobile-menu { display: grid; }
  .topbar { padding: 12px 18px; }
  .screen { padding: 16px; }
  .calendar-panel { width: 100%; max-width: calc(100vw - 32px); }
  .dashboard-layout { grid-template-columns: 1fr; }
  .right-rail { position: static; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .selected-detail { grid-column: 1 / -1; }
  .topbar-actions .sync-state span:last-child { display: none; }
  .primary, .secondary, .icon-button, .danger-button { min-height: 44px; }
  .mobile-menu, .icon-button { width: 44px; height: 44px; }
  .filters select, .search-field { height: 44px; }
  .search-field input { height: 41px; }
  .production-row { min-height: 58px; }
  .calendar-line-label, .calendar-cell { min-height: 48px; }
  .calendar-bar { height: 38px; }
  .form-grid input, .form-grid select { min-height: 46px; }
  .zone-machine-list input[type="number"] { height: 44px; }
  .zone-machine-list .switch input { width: 22px; height: 22px; }
  .admin-layout { grid-template-columns: 180px minmax(0,1fr); }
  .admin-version { grid-column: 1 / -1; }
  .factory-mode-bar { align-items: flex-start; flex-direction: column; }
  .release-toolbar { align-items: stretch; flex-direction: column; }
  .release-view-switch { min-height: 44px; }
  .release-assign { justify-content: stretch; }
  .release-assign label { flex: 1 1 180px; }
  .release-assign select { width: 100%; min-width: 0; height: 44px; }
}

@media (max-width: 820px) {
  .topbar h1 { font-size: 19px; }
  .topbar-title > .icon { display: none; }
  .topbar-actions { gap: 8px; }
  .sync-state { display: none; }
  .primary.outline-blue { padding: 0 10px; }
  .primary.outline-blue .icon { display: none; }
  .metrics { grid-template-columns: repeat(2,1fr); }
  .metrics > div:nth-child(2)::after { display: none; }
  .metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .filters { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .search-field { grid-column: 1 / -1; }
  .filters .secondary { grid-column: auto; justify-self: stretch; }
  .right-rail { grid-template-columns: 1fr; }
  .factory-mode-bar { padding: 12px; }
  .view-switcher { width: 100%; }
  .view-switcher .icon-button { flex: 1; min-width: 0; padding: 0 7px; }
  .view-switcher .icon-button span { display: none; }
  .department-lanes { grid-template-columns: 1fr; }
  .department-lanes > section + section { border-top: 1px solid var(--line); border-left: 0; }
  .calendar-grid { grid-template-columns: 110px repeat(var(--days), 120px); }
  .page-intro { align-items: start; flex-direction: column; }
  .release-summary { align-items: stretch; flex-wrap: wrap; }
  .release-summary > div { flex: 1 1 42%; min-width: 0; }
  .release-summary p { flex-basis: 100%; border-top: 1px solid var(--line); }
  .release-assign { align-items: stretch; display: grid; grid-template-columns: 1fr; }
  .release-assign .primary { width: 100%; }
  .release-project > header { align-items: start; flex-direction: column; }
  .release-project header > small { text-align: left; }
  .zone-machine-list > div { grid-template-columns: 1fr 135px; }
  .zone-machine-list .switch { grid-column: 1 / -1; justify-self: start; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-version { grid-column: auto; }
  .admin-menu { display: none; }
  .canonical-grid { grid-template-columns: 1fr; }
  .canonical-grid > div { border-right: 0; }
  .canonical-grid > div:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
  .canonical-grid > div:last-child { border-bottom: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 12px; }
  .people-list article { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .user-contact { flex-basis: 100%; }
  .user-actions { width: 100%; grid-auto-flow: initial; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .statusbar { justify-content: space-between; padding: 9px 14px; gap: 10px; }
  .statusbar span { font-size: 10px; }
}

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