/* Shared visual contract. Load after module styles; keep module layout rules local. */
:root {
  --radius-control: 8px;
  --radius-panel: 12px;
  --space-panel: 24px;
  --font-body: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  --brand: #e30613;
  --brand-hover: #c9000c;
  --blue: var(--brand);
  --focus-ring: #1769a0;
  font-family: var(--font-body);
}
body { line-height: 1.5; }
[hidden] { display: none !important; }
.btn, .workspace-report, .workspace-options summary {
  min-height: 44px; border-radius: var(--radius-control); font-size: 13px;
  font-weight: 650; padding: 10px 14px; text-decoration: none; box-shadow: none;
}
.btn-primary { background: var(--brand); border-color: var(--brand); color: white; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
button:disabled, .btn:disabled { opacity: .55; cursor: not-allowed; }
:is(button,a,input,select,textarea,summary):focus-visible {
  outline: 3px solid var(--focus-ring); outline-offset: 3px;
}
.input, .select, textarea, .workspace-search {
  border-radius: var(--radius-control); min-height: 44px; font-size: 14px;
  border-color: #bdc9d0; color: var(--ink); background: var(--paper);
}
.field label, .settings-form>label, .template-settings label,
.forklift-fields label, .racking-toolbar label { font-size: 13px; font-weight: 650; }
.headline, .workspace-page-header { margin-bottom: 24px; gap: 20px; }
.headline h1, .workspace-page-header h1, .portal-welcome h1 {
  color: var(--navy); font-size: clamp(25px, 2.5vw, 30px); line-height: 1.25;
  letter-spacing: -.035em; margin-top: 0;
}
.lead, .workspace-page-header p, .panel-copy { font-size: 14px; line-height: 1.6; color: var(--muted); }
.panel, .form-card, .module-card, .workspace-location-card, .workspace-metrics,
.kpi, .dispatch-day { border-radius: var(--radius-panel); border-color: var(--line); box-shadow: var(--shadow); }
.panel-head, #admin-workspace .panel-head { padding: 20px var(--space-panel); gap: 16px; }
.panel-title, #admin-workspace .panel-title { font-size: 16px; font-weight: 700; }
.form-card-head, .form-body { padding: var(--space-panel); }
.workspace-tabs { gap: 8px; }
.workspace-tabs button,
:is(#admin-workspace,#forklift-administration-tabs,#collections-workspace,#racking-workspace) .admin-section-tabs button {
  padding: 14px 18px; min-height: 48px; font-size: 13px; font-weight: 650;
}
.workspace-tabs button[aria-selected=true],
:is(#admin-workspace,#forklift-administration-tabs,#collections-workspace,#racking-workspace) .admin-section-tabs button[aria-selected=true] {
  color: var(--navy); border-bottom-color: var(--brand);
}
th { font-size: 12px; line-height: 1.5; background: #f7f9fa; }
td { font-size: 14px; line-height: 1.5; }
.status, .role-badge, .racking-badge, .queue-status { font-size: 12px; font-weight: 650; }
.login-page { overflow: auto; }
.login-card-inner { border-radius: var(--radius-panel); }
.login-form label { font-size: 13px; font-weight: 650; }
.login-form .input { font-size: 16px; }
.login-error { overflow-wrap: anywhere; }
.security-settings { margin-top: 24px; }
.security-form { display: grid; gap: 16px; margin-top: 20px; max-width: 420px; }
.security-form label { display: grid; gap: 7px; font-size: 13px; font-weight: 650; }
.security-form .btn { justify-self: start; }
.security-qr { width: 220px; max-width: 100%; height: auto; }
.security-key { display: block; overflow-wrap: anywhere; padding: 12px 0; }
.security-recovery { padding: 18px; background: var(--wash); line-height: 1.8; overflow-x: auto; }
.security-message { color: var(--red); }
@media(max-width:900px) {
  :root { --space-panel: 18px; }
  .input, .select, textarea, .workspace-search { font-size: 16px; }
  .panel-head, #admin-workspace .panel-head { flex-wrap: wrap; }
}
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Page composition: one header, summary strip, register and editor across modules. */
.workspace-page-header {
  display:flex; align-items:center; justify-content:space-between; gap:24px;
  margin:0 0 24px; min-width:0;
}
.workspace-page-header>div:first-child { min-width:0; }
.workspace-page-header h1 { margin:8px 0; font-size:28px; line-height:1.25; letter-spacing:-.035em; }
.workspace-page-header p { margin:0; font-size:14px; line-height:1.6; }
.workspace-page-header>.btn { flex-shrink:0; }
.workspace-header-actions,.workspace-page-header>div+div { display:flex; gap:10px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.workspace-breadcrumb { font-size:11px; letter-spacing:.07em; color:var(--muted); line-height:1.5; }
.workspace-tabs { margin:0 0 24px; overflow-x:auto; white-space:nowrap; }
.workspace-metrics { grid-template-columns:repeat(var(--metric-count,4),minmax(0,1fr)); margin-bottom:24px; box-shadow:none; }
.workspace-metric { padding:20px 24px; gap:10px; }
.workspace-metric strong { font-size:30px; font-weight:650; }
.workspace-metric small { color:var(--muted); font-size:12px; line-height:1.5; }
.workspace-register-list { background:var(--paper); border:1px solid var(--line); border-radius:12px; box-shadow:none; }
.workspace-register-list.forklift-daily-list { display:block; }
.workspace-row { padding:20px 24px; gap:22px; grid-template-columns:minmax(0,1fr) 160px auto; }
.workspace-row-identity { min-width:0; }
.workspace-row h3 { font-size:19px; font-weight:650; line-height:1.35; margin:4px 0 6px; }
.workspace-row p { font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
.workspace-row-meta { display:flex; gap:6px 16px; flex-wrap:wrap; margin-top:10px; color:var(--muted); font-size:12px; }
.workspace-row-status>span:last-child { font-size:12px; }
.workspace-row-actions { flex-wrap:wrap; }
.workspace-row-overdue { box-shadow:inset 3px 0 var(--red); }
.panel>.workspace-register-list { border:0; border-radius:0 0 12px 12px; }
.workspace-list-toolbar { margin:0 0 16px; gap:18px; }
.workspace-list-title h2 { font-size:18px; font-weight:650; margin:0 0 5px; }
.workspace-list-title>span { font-size:12px; }
.workspace-filters>.select { width:160px; }
.workspace-empty,.empty { padding:40px 24px; text-align:center; color:var(--muted); font-size:14px; }
.workspace-empty h3,.empty strong { display:block; color:var(--navy); font-size:17px; font-weight:650; margin:0 0 8px; }
.workspace-empty p { font-size:14px; margin:0; }
.form-shell { display:grid; grid-template-columns:minmax(0,1fr); gap:20px; max-width:960px; margin-inline:auto; }
.form-shell .steps { position:static; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); padding:8px; gap:8px; }
.form-shell .step { min-width:0; padding:12px; }
.workspace-editor,.forklift-card-flow,.racking-question-flow { max-width:960px; margin-inline:auto; }
.form-card,.forklift-card,.racking-card { border-radius:12px; box-shadow:none; }
.form-card-head h2 { font-size:20px; font-weight:650; line-height:1.35; }
.form-card-head p { font-size:14px; line-height:1.6; color:var(--muted); }
.form-actions,.forklift-card-navigation,.racking-flow-actions { padding:20px 24px; gap:12px; border-top:1px solid var(--line); }
.segmented { display:flex; gap:8px; border:0; padding:0; background:none; }
.segmented button { min-height:48px; min-width:74px; border:1px solid #cbd4df; border-radius:8px; font-size:14px; background:var(--wash); }
.check-row { padding:20px 24px; }
.check-text { font-size:14px; line-height:1.6; }
#movement-form,.return-form-card { max-width:960px; margin-inline:auto; }
.workspace-tabs { scrollbar-width:thin; }
.workspace-row-kicker { text-transform:uppercase; }
.segmented button.sel-pass { background:#e0f3e8; border-color:#16633b; color:#16633b; }
.segmented button.sel-fail { background:#fce5e6; border-color:#a41c2d; color:#a41c2d; }
.segmented button.sel-na { background:#e7edf4; border-color:#435268; color:#435268; }
.racking-card-navigation { padding:20px 24px; gap:12px; border-top:1px solid var(--line); }
.workspace-register-list .status,.workspace-register-list .role-badge,
.workspace-register-list .forklift-status,.workspace-register-list .racking-badge {
  display:inline-flex; align-items:center; gap:6px; border-radius:6px;
  padding:5px 8px; font-size:12px; line-height:1.5; font-weight:650;
}
@media print {
  .workspace-page-header .btn,.workspace-tabs { display:none!important; }
}
@media(max-width:1100px) {
  .workspace-row { grid-template-columns:minmax(0,1fr) 140px; gap:16px; }
  .workspace-row-actions { grid-column:1/-1; justify-content:flex-start; }
}
@media(max-width:760px) {
  .workspace-page-header { flex-direction:column; align-items:flex-start; gap:16px; }
  .workspace-page-header h1 { font-size:25px; }
  .workspace-header-actions,.workspace-page-header>div+div { justify-content:flex-start; max-width:100%; }
  .workspace-page-header .inline-create { flex-wrap:wrap; }
  .workspace-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .workspace-metric { padding:16px; border-bottom:1px solid var(--line); }
  .workspace-metric:nth-child(2n) { border-right:0; }
  .workspace-metric:nth-child(3) { border-bottom:1px solid var(--line); }
  .workspace-metric:last-child { border-bottom:0; }
  .workspace-row { padding:18px 16px; grid-template-columns:minmax(0,1fr) 110px; gap:14px; }
  .workspace-row h3 { font-size:18px; }
  .workspace-row-actions .btn { min-height:44px; }
  .workspace-row-meta { gap:5px 12px; }
  .workspace-list-toolbar { align-items:flex-start; flex-direction:column; }
  .workspace-filters { width:100%; flex-wrap:wrap; justify-content:flex-start; }
  .workspace-filters>.select { flex:1; min-width:130px; }
  .form-shell .step { padding:10px 5px; }
  .form-actions,.forklift-card-navigation,.racking-flow-actions,.check-row { padding:18px; }
}
.settings-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;align-items:start}
.settings-grid>.panel{margin:0;max-width:none;min-width:0}
.settings-grid .panel-head{padding:24px;border-bottom:1px solid var(--line)}
.settings-grid .form-body{padding:24px}
.settings-grid .module-check{padding:18px 0;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;align-items:start}
.settings-grid .module-check:first-child{padding-top:0}
.settings-grid .module-check:last-child{border-bottom:0;padding-bottom:0}
.settings-grid .module-check small{display:block;margin-top:6px;line-height:1.6}
.settings-grid .form-actions{justify-content:flex-end}
.settings-grid .security-form{max-width:none}
.settings-grid .security-form label{display:grid;gap:8px}
.settings-grid .security-settings .lead{font-size:14px;line-height:1.65;margin-bottom:24px}
.security-reminder{position:fixed;right:24px;bottom:24px;z-index:90;max-width:460px;width:calc(100% - 48px);padding:22px;background:var(--surface,#fff);color:var(--ink,#17212b);border:1px solid var(--line,#ddd);border-top:3px solid var(--red,#e4002b);border-radius:12px;box-shadow:0 12px 36px #17212b26}
.security-reminder strong{font-size:16px}.security-reminder p{font-size:14px;line-height:1.6;margin:8px 0 18px}.security-reminder-actions{display:flex;gap:10px;flex-wrap:wrap}
@media(max-width:900px){.settings-grid{grid-template-columns:1fr}}
@media(max-width:600px){.settings-grid{gap:18px}.settings-grid .panel-head,.settings-grid .form-body{padding:18px}.security-reminder{right:12px;bottom:84px;width:calc(100% - 24px);padding:18px}.security-reminder-actions .btn{flex:1}}

.history-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;padding:24px}.history-filters label{display:grid;gap:7px;font-size:13px;font-weight:600;min-width:0}.history-filter-actions{grid-column:1/-1;display:flex;gap:10px;flex-wrap:wrap}.history-pages{display:flex;justify-content:space-between;align-items:center;gap:14px;margin-top:24px}.history-pages span{font-size:13px}.history-pages button:disabled{opacity:.45;cursor:default}@media(max-width:700px){.history-filters{grid-template-columns:repeat(2,minmax(0,1fr));padding:18px}.history-pages{flex-wrap:wrap}.history-pages span{order:3;width:100%;text-align:center}}@media(max-width:420px){.history-filters{grid-template-columns:1fr}}

.history-filter-panel{margin-bottom:20px}.history-filter-panel>summary{display:flex;align-items:center;gap:16px;padding:14px 18px;cursor:pointer;list-style:none}.history-filter-panel>summary::-webkit-details-marker{display:none}.history-filter-panel>summary:focus-visible{outline:2px solid var(--focus-ring);outline-offset:3px;border-radius:12px}.history-filter-toggle{font-size:14px;font-weight:650}.history-filter-summary{font-size:13px;color:#607380;overflow-wrap:anywhere}.history-filter-chevron{margin-left:auto;font-size:20px}.history-filter-panel[open] .history-filter-chevron{transform:rotate(45deg)}.history-filter-panel[open]>summary{border-bottom:1px solid var(--line)}.history-export-note{font-size:12px;line-height:1.6;color:#607380;margin:0;padding:0 24px 20px}@media(max-width:700px){.history-filter-panel>summary{gap:12px;padding:14px}.history-filter-summary{font-size:12px}.history-export-note{padding:0 18px 18px}}
