/* SublimeMIS design system — refined industrial "instrument panel" */
:root {
  --bg: #eef1f6;
  --surface: #ffffff;
  --surface-2: #eef1f6;
  --ink: #14213d;
  --text: #1d2738;
  --text-2: #5a6678;
  --text-3: #8b95a6;
  --border: #e3e7ee;
  --border-2: #cbd3df;

  --primary: #1f5fd6;
  --primary-bg: #e7f0fd;
  --primary-text: #163f93;

  --success: #1f9d57;
  --success-bg: #e6f6ec;
  --success-text: #136f3c;

  --danger: #db3b3b;
  --danger-bg: #fcebeb;
  --danger-text: #ad2424;

  --warning: #c9791a;
  --warning-bg: #fcf0db;
  --warning-text: #8f560d;

  /* Rework / catch-up sub-jobs — violet, used nowhere else so it reads as "sub-job" at a glance */
  --rework: #7c3aed;
  --rework-bg: #f0ebfe;
  --rework-text: #5b21b6;
  --rework-border: #d6c8fb;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 1px 1px rgba(20, 33, 61, .04);

  --font-sans: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Sora", var(--font-sans);
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Code", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-text); }

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ---- app shell + top bar ---- */
.sm-shell { min-height: 100vh; }

.sm-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; background: var(--surface);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20;
}
.sm-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.sm-brand .dot { width: 27px; height: 27px; border-radius: 7px; background: var(--ink); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; font-weight: 700; }

.sm-personas { display: flex; gap: 8px; flex-wrap: wrap; }
.sm-persona {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: var(--radius);
  border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2);
  font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.sm-persona:hover { background: var(--surface-2); }
.sm-persona.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---- signed-in user (topbar) ---- */
.sm-user { display: flex; align-items: center; gap: 10px; }
.sm-user-info { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.sm-user-name { font-size: 13px; font-weight: 600; color: var(--text); display: inline-flex; gap: 6px; align-items: center; }
.sm-user-role { font-size: 11px; color: var(--text-2); }
.sm-logout { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius); border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 15px; }
.sm-logout:hover { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger-bg); }

/* Tablet / iPad-portrait shell: brand + user share row 1, persona nav fills row 2 */
@media (max-width: 1024px) {
  .sm-topbar { flex-wrap: wrap; row-gap: 10px; padding: 10px 18px; }
  .sm-topbar > .sm-brand { order: 1; }
  .sm-topbar > .sm-user  { order: 2; }
  .sm-topbar > .sm-personas {
    order: 3; flex-basis: 100%; width: 100%; justify-content: flex-start; gap: 8px;
  }
  .sm-personas .sm-persona { flex: 1 1 auto; justify-content: center; min-width: 0; }
}

/* ---- login screen ---- */
.login-wrap { min-height: calc(100vh - 48px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 18px 50px rgba(20, 33, 61, .10); padding: 30px 28px; }
.login-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -.01em; }
.login-brand .dot { width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; }
.login-sub { color: var(--text-2); font-size: 14px; margin: 6px 0 22px; }
.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.login-field input { width: 100%; padding: 11px 12px; border: 1px solid var(--border-2); border-radius: var(--radius); font-size: 15px; }
.login-field input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
.login-error { display: flex; gap: 8px; align-items: center; background: var(--danger-bg); color: var(--danger-text); border-radius: var(--radius); padding: 9px 12px; font-size: 13px; margin-bottom: 14px; }
.login-go { width: 100%; justify-content: center; padding: 12px; font-size: 15px; margin-top: 4px; }
.login-go[disabled] { opacity: .85; }
.login-wrap.busy, .login-wrap.busy * { cursor: wait; }
.login-spinner { width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: login-spin .6s linear infinite; }
@keyframes login-spin { to { transform: rotate(360deg); } }

/* ---- order wizard ---- */
.ow-steps { display: flex; gap: 6px; padding: 12px 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--surface-2); }
.ow-step { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-3); padding: 4px 11px; border-radius: 999px; }
.ow-step.on { color: var(--primary-text); background: var(--primary-bg); }
.ow-step.done { color: var(--success-text); }
.ow-step-n { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border-2); font-size: 11px; }
.ow-step.on .ow-step-n { background: var(--primary); color: #fff; border-color: var(--primary); }
.ow-step.done .ow-step-n { background: var(--success-text); color: #fff; border-color: var(--success-text); }
.ow-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ow-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px 10px; background: var(--surface); border: 1.5px solid var(--border-2); border-radius: var(--radius-lg); cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); transition: border-color .12s, background .12s; text-align: center; }
.ow-tile i { font-size: 24px; color: var(--text-3); }
.ow-tile:hover { border-color: var(--primary); }
.ow-tile.on { border-color: var(--primary); background: var(--primary-bg); color: var(--primary-text); }
.ow-tile.on i { color: var(--primary); }

/* ---- audit trail ---- */
.audit-row { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); align-items: flex-start; }
.audit-row:last-child { border-bottom: 0; }
.audit-ico { font-size: 16px; flex: none; margin-top: 1px; }
.audit-meta { text-align: right; flex: none; min-width: 92px; }
.audit-summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--primary-text); list-style: none; display: inline-flex; align-items: center; gap: 5px; }
.audit-summary::-webkit-details-marker { display: none; }
.audit-summary::before { content: "▸"; font-size: 10px; transition: transform .15s; }
details[open] > .audit-summary::before { transform: rotate(90deg); }
.audit-detail { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: 12px; white-space: pre-wrap; word-break: break-word; margin: 5px 0 0; font-family: var(--font-sans); color: var(--text-2); }
.login-demo { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 16px; }
.login-demo-h { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); margin-bottom: 10px; }
.login-demo-h span { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-3); }
.login-demo-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1px 10px; width: 100%; text-align: left; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 8px 11px; margin-bottom: 7px; cursor: pointer; }
.login-demo-row:hover { border-color: var(--primary); }
.ld-name { font-weight: 600; font-size: 13px; }
.ld-role { grid-row: 1 / span 2; align-self: center; font-size: 11px; color: var(--primary-text); background: var(--primary-bg); padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.ld-cred { font-size: 11px; color: var(--text-2); }

.sm-main { padding: 24px; max-width: 1120px; margin: 0 auto; }

/* ---- generic ---- */
.sm-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.sm-muted { color: var(--text-2); }
.sm-h { font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.sm-row { display: flex; align-items: center; }
.sm-between { display: flex; align-items: center; justify-content: space-between; }
.sm-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; padding: 3px 9px; border-radius: var(--radius); }
.pill-rush { background: var(--danger-bg); color: var(--danger-text); }
.pill-standard { background: var(--surface-2); color: var(--text-2); }
.pill-rework { background: var(--rework-bg); color: var(--rework-text); }

/* ---- sub-jobs (rework / catch-up) ---- */
.sm-subrow { margin-left: 30px; background: var(--rework-bg); border-left: 3px solid var(--rework); border-radius: var(--radius); }
.sm-subrow .sm-muted { color: var(--rework-text); opacity: .8; }
.sj-bar { height: 7px; background: var(--rework-border); border-radius: 6px; overflow: hidden; }
.sj-bar > span { display: block; height: 100%; border-radius: 6px;
  background: repeating-linear-gradient(45deg, var(--rework), var(--rework) 6px, #9a6cf0 6px, #9a6cf0 12px); }
.kds-tile.k-rework { background: var(--rework-bg); border-color: var(--rework-border); }
.kds-tile.k-rework .kds-th { background: var(--rework-bg); color: var(--rework-text); }
.kds-tile.k-rework .tk { color: var(--rework-text); }
.sj-parent { font-size: 11px; color: var(--rework-text); font-weight: 600; }

/* ---- floor hero: ticket + spec cards on one line ---- */
.pos-idrow { display: flex; align-items: stretch; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pos-idmain { flex: 1 1 240px; min-width: 0; }

/* material + modifications spec cards — gold fill, red trim */
.hero-specs { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; }
.hero-spec {
  flex: 1 1 170px; min-width: 160px; border-radius: var(--radius-lg); padding: 11px 15px;
  display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(135deg, #fbeaa8, #f3cf52); border: 2.5px solid #c0392b; box-shadow: var(--shadow);
}
.hero-spec .hs-k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: #9a3412; display: flex; align-items: center; gap: 7px; }
.hero-spec .hs-v { font-size: 19px; font-weight: 700; color: #3d2b00; margin-top: 3px; line-height: 1.2; }

/* ---- compact Parts-QA matrix (part × fit/size, fits without horizontal scroll) ---- */
.qa-grid { width: 100%; border-collapse: collapse; margin: 6px 0 2px; table-layout: fixed; }
.qa-grid th { font-size: 11px; line-height: 1.15; color: var(--text-2); font-weight: 600; padding: 3px 2px; text-align: center; }
.qa-grid th:first-child { text-align: left; width: 80px; }
.qa-grid td { padding: 3px 2px; text-align: center; }
.qa-grid .qa-part { font-weight: 600; font-size: 12.5px; text-align: left; white-space: normal; line-height: 1.15; }
.qa-grid .qa-c { vertical-align: top; }
.qa-ord { display: block; font-size: 10px; color: var(--text-3); line-height: 1; margin-bottom: 2px; }
.qa-cell { width: 100%; min-width: 32px; padding: 7px 1px; border: 1px solid var(--border-2); border-radius: 6px; background: var(--surface); font-family: var(--font-mono); font-weight: 600; font-size: 14px; cursor: pointer; color: var(--text); }
.qa-cell:active { transform: scale(.96); }
.qa-cell.qa-ok { background: var(--success-bg); border-color: #cfe9d8; color: var(--success-text); }
.qa-cell.qa-short { background: var(--danger-bg); border-color: #f3c9c9; color: var(--danger-text); }
.qa-ref { opacity: .65; }
.qa-ref .qa-ord { font-size: 12px; color: var(--text-2); font-weight: 600; }
/* Parts-QA catch-up adjustment + held panels */
.pill-short { background: var(--danger-bg); color: var(--danger-text); }
.qa-adjust { margin-top: 12px; border: 1px solid var(--rework-border); background: var(--rework-bg); border-radius: var(--radius); padding: 12px 14px; }
.qa-adjust-h { font-size: 13px; font-weight: 700; color: var(--rework-text); display: flex; align-items: center; gap: 7px; margin-bottom: 10px; }
.qa-deficit-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; flex-wrap: wrap; border-top: 1px solid var(--rework-border); }
.qa-deficit-row:first-of-type { border-top: 0; }
.qa-def-part { font-size: 13px; font-weight: 600; flex: 1; min-width: 130px; }
.qa-reason { padding: 6px 9px; border: 1px solid var(--border-2); border-radius: var(--radius); font-family: inherit; font-size: 13px; background: var(--surface); color: var(--text); min-width: 150px; }
.qa-disp { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; flex-wrap: wrap; }
.qa-disp-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); margin-right: 4px; }
.qa-held { display: flex; flex-direction: column; gap: 10px; margin: 8px 0 4px; }
.qa-held-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qa-held-bar { flex: 1; min-width: 90px; height: 7px; background: var(--rework-border); border-radius: 6px; overflow: hidden; }
.qa-held-bar > span { display: block; height: 100%; background: var(--rework); border-radius: 6px; }
/* two-person authenticated sign-off */
.dsg { border: 1px solid var(--border-2); border-radius: var(--radius); padding: 10px 12px; margin: 12px 0 4px; background: var(--surface-2); }
.dsg-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.dsg-slot { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.dsg-num { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border-2); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text-2); flex: none; }
.dsg-slot.ok .dsg-num { background: var(--success); border-color: var(--success); color: #fff; }
.dsg-in { flex: 1; min-width: 120px; padding: 7px 9px; border: 1px solid var(--border-2); border-radius: var(--radius); font-family: inherit; font-size: 14px; background: var(--surface); color: var(--text); }
.dsg-name { flex: 1; font-weight: 600; font-size: 14px; color: var(--success-text); display: inline-flex; align-items: center; gap: 6px; }
.dsg-err { display: flex; align-items: center; gap: 7px; color: var(--danger-text); background: var(--danger-bg); border-radius: var(--radius); padding: 7px 10px; font-size: 12.5px; font-weight: 600; margin-top: 8px; }

/* ---- Start tile accent + Start/Complete confirmation dialog ---- */
.pos-tile.t-start { background: var(--success-bg); border-color: #cfe9d8; color: var(--success-text); }
.pos-confirm { background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 24px 60px rgba(20, 33, 61, .3); padding: 26px 28px; max-width: 380px; width: 100%; text-align: center; animation: sm-rise .2s ease both; }
.pos-confirm .pc-icon { font-size: 40px; color: var(--primary); line-height: 1; }
.pos-confirm .pc-title { font-size: 20px; font-weight: 700; margin-top: 8px; }
.pos-confirm .pc-sub { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.pos-confirm .pc-actions { display: flex; gap: 10px; margin-top: 20px; }
.pos-confirm .pc-actions > button { flex: 1; min-height: 54px; font-size: 16px; font-weight: 600; border-radius: var(--radius); cursor: pointer; font-family: inherit; }
.pc-go { border: none; background: var(--success); color: #fff; }
.pc-go.pc-start { background: var(--primary); }
.pc-cancel { background: var(--surface); border: 1px solid var(--border-2); color: var(--text); }

/* ---- compact parts breakdown (order-review dialog) — fits without horizontal scroll ---- */
.pb-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pb-grid th { font-size: 10.5px; line-height: 1.15; font-weight: 600; color: var(--text-2); padding: 3px 2px; text-align: center; }
.pb-grid th:first-child { text-align: left; width: 74px; }
.pb-grid td { font-family: var(--font-mono); font-size: 12.5px; padding: 4px 2px; text-align: center; }
.pb-grid .pb-part { font-family: var(--font-sans); font-weight: 600; text-align: left; white-space: normal; line-height: 1.12; }
.pb-grid .pb-zero { color: var(--text-3); }
.pb-grid .pb-tot { font-weight: 700; }
.pb-grid .pb-bind { background: var(--surface-2); border-top: 2px solid var(--border-2); }
/* catch-up sub-order block in the order-review dialog (a divider below the original order) */
.cu-block { margin-top: 18px; border-top: 2px solid var(--rework-border); padding-top: 16px; }

/* ---- products inventory (master / detail) ---- */
.prod-layout { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 16px; align-items: start; }
.prod-list { padding: 0; overflow: hidden; }
.prod-item { display: block; width: 100%; text-align: left; padding: 10px 14px; border: none; border-bottom: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-family: inherit; transition: background .12s; }
.prod-item:hover { background: var(--surface-2); }
.prod-item.on { background: var(--primary-bg); box-shadow: inset 3px 0 0 var(--primary); }
.prod-detail { padding: 16px 18px; }
@media (max-width: 900px) { .prod-layout { grid-template-columns: 1fr; } }

/* ---- order builder: product tabs, big size/option buttons, fit-coloured quantities ---- */
.ow-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.ow-ptab { display: flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); border-bottom: none;
  border-radius: 8px 8px 0 0; background: var(--surface-2); color: var(--text-2); cursor: pointer; font-family: inherit; font-size: 14px; }
.ow-ptab.on { background: var(--primary-bg); color: var(--primary-text); border-color: var(--primary); font-weight: 500; }
.ow-sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.ow-sizebtn { padding: 16px 6px; text-align: center; border: 1px solid var(--border-2); border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer; font-size: 15px; font-family: inherit; transition: border-color .12s, background .12s; }
.ow-sizebtn:hover { border-color: var(--primary); }
.ow-sizebtn.on { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.ow-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.ow-optbtn { padding: 10px 14px; border: 1px solid var(--border-2); border-radius: var(--radius); background: var(--surface-2);
  cursor: pointer; font-size: 14px; font-family: inherit; }
.ow-optbtn.on { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 500; }

/* ---- image loading spinner (artwork previews while they fetch) ---- */
.img-frame { position: relative; display: block; min-height: 64px; }
.img-frame .img-load { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-3); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius); }
.img-frame .img-load i { animation: sm-spin 0.8s linear infinite; font-size: 20px; }
@keyframes sm-spin { to { transform: rotate(360deg); } }

/* ---- customers (list / detail) — stacks on tablet-portrait & narrow screens ---- */
.cust-layout { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.cust-list { overflow: hidden; }
@media (max-width: 900px) {
  .cust-layout { grid-template-columns: 1fr; }
  .cust-list { max-height: 340px; overflow-y: auto; }
}

/* ---- forecast charts (CSS bars) ---- */
.bar-chart { display: flex; gap: 12px; align-items: flex-end; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.bar-val { font-size: 11px; font-weight: 600; margin-bottom: 4px; }
.bar-track { width: 100%; max-width: 44px; height: 130px; display: flex; align-items: flex-end; }
.bar-fill { width: 100%; border-radius: 5px 5px 0 0; min-height: 3px; transition: height .2s ease; }
.bar-lbl { font-size: 10px; color: var(--text-2); margin-top: 6px; white-space: nowrap; }
.stack-chart { display: flex; gap: 14px; align-items: flex-end; justify-content: space-around; }
.stack-col { display: flex; flex-direction: column; align-items: center; }
.stack-track { width: 100%; max-width: 54px; height: 140px; display: flex; flex-direction: column-reverse; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.stack-track > div { transition: height .2s ease; }

/* ---- order form (3-section dialog) ---- */
.of-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.of-grid > div { min-width: 0; }
.of-sec { font-family: var(--font-display); font-weight: 600; font-size: 15px; padding-bottom: 8px; margin-bottom: 12px; border-bottom: 2px solid var(--border-2); }
@media (max-width: 900px) { .of-grid { grid-template-columns: 1fr; } }

/* ---- big floor buttons ---- */
.sm-bigbtn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.sm-bigbtn {
  display: flex; flex-direction: column; gap: 6px; justify-content: center; min-height: 124px; padding: 20px 22px;
  border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; text-align: left; font-family: inherit; transition: filter .12s, transform .05s;
}
.sm-bigbtn:hover { filter: brightness(.97); }
.sm-bigbtn:active { transform: scale(.99); }
.sm-bigbtn .ic { font-size: 30px; }
.sm-bigbtn .lbl { font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.sm-bigbtn .sub { font-size: 14px; opacity: .9; }
.bb-start { background: var(--primary); border-color: var(--primary); color: #fff; }
.bb-complete { background: var(--success); border-color: var(--success); color: #fff; }
.bb-issue { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---- stage pills ---- */
.sm-stages { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.sm-stage { display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: var(--radius); font-size: 13px; font-weight: 500; }
.st-complete { background: var(--success-bg); color: var(--success-text); }
.st-current { background: var(--primary-bg); color: var(--primary-text); }
.st-pending { background: var(--surface-2); color: var(--text-3); }

/* ---- chips ---- */
.sm-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sm-chip { display: inline-flex; align-items: center; gap: 7px; padding: 11px 15px; border-radius: var(--radius); border: 1px solid var(--border-2); background: var(--surface); font-size: 14px; cursor: pointer; font-family: inherit; color: var(--text); }
.sm-chip:hover { background: var(--surface-2); }

/* ---- metric cards ---- */
.sm-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.sm-metric { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.sm-metric .k { font-size: 13px; color: var(--text-2); }
.sm-metric .v { font-family: var(--font-display); font-size: 27px; font-weight: 600; margin-top: 3px; letter-spacing: -0.02em; }

/* ---- banners ---- */
.sm-banner { display: flex; align-items: center; gap: 12px; border-radius: var(--radius-lg); padding: 14px 16px; }
.banner-warn { background: var(--warning-bg); border: 1px solid #f0d49a; color: var(--warning-text); }

/* ---- pipeline ---- */
.sm-seg-track { display: flex; gap: 4px; }
.sm-seg { height: 9px; flex: 1; border-radius: 3px; background: var(--border); }
.seg-complete { background: var(--success); }
.seg-current { background: var(--primary); }
.seg-current-risk { background: var(--warning); }
.sm-jobrow { display: flex; align-items: center; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.sm-jobrow:last-child { border-bottom: none; }

/* ---- job pipeline row (two-line: identity on top, progress below) ---- */
.sm-pipe-row { padding: 13px 4px; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: var(--radius); transition: background .1s; }
.sm-pipe-row:last-child { border-bottom: none; }
.sm-pipe-row:hover { background: var(--surface-2); }
.pr-top { display: flex; align-items: center; gap: 9px; }
.pr-id { font-weight: 600; flex: 0 0 auto; }
.pr-client { font-weight: 500; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-desc { color: var(--text-2); font-size: 13px; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-right { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.pr-status { font-size: 12px; font-weight: 600; white-space: nowrap; }
.pr-bot { display: flex; align-items: center; gap: 12px; margin-top: 9px; }
.pr-bar { width: 300px; flex: 0 0 auto; }
.pr-stage { font-size: 12px; color: var(--text-2); white-space: nowrap; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; }
.pr-eta { margin-left: auto; font-weight: 600; white-space: nowrap; flex: 0 0 auto; }
@media (max-width: 760px) {
  .pr-bar { width: auto; flex: 1 1 auto; }
  .pr-client { max-width: 42%; }
}

/* ---- station: collapsible "Available jobs" picker (sits under the nav + station description) ---- */
.stn-picker { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden; }
.stn-picker-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: none; border: none; cursor: pointer; font-family: inherit; text-align: left; color: var(--text); }
.stn-picker-head:disabled { cursor: default; }
.stn-picker-ic { color: var(--text-2); font-size: 16px; }
.stn-picker-title { font-weight: 650; font-size: 14.5px; }
.stn-picker-count { background: var(--primary-bg); color: var(--primary-text); font-weight: 700; font-size: 12px; border-radius: 999px; padding: 1px 9px; min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.stn-picker-hint { color: var(--text-2); font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stn-picker-chev { margin-left: auto; color: var(--text-2); font-size: 13px; }
.stn-picker.open .stn-picker-head { border-bottom: 1px solid var(--border); }
.jpl-flush { display: flex; flex-direction: column; }
.jpl-flush .sm-pipe-row { padding: 12px 16px; border-radius: 0; }
.sm-pipe-row.is-active { background: var(--primary-bg); box-shadow: inset 3px 0 0 var(--primary); }
.sm-pipe-row.is-active:hover { background: var(--primary-bg); }

/* ---- buttons ---- */
.sm-btn { padding: 9px 16px; border-radius: var(--radius); border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font-size: 14px; cursor: pointer; font-family: inherit; }
.sm-btn:hover { background: var(--surface-2); }
.sm-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.sm-btn-primary:hover { filter: brightness(.96); background: var(--primary); }
.sm-btn-lg { width: 100%; min-height: 54px; font-size: 18px; font-weight: 600; border-radius: var(--radius-lg); font-family: var(--font-display); }

/* ---- portal order builder ---- */
.sm-grid-portal { display: grid; grid-template-columns: 1fr 260px; gap: 18px; align-items: start; }
.sm-step-label { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
.sm-dropzone { border: 1.5px dashed var(--border-2); border-radius: var(--radius-lg); padding: 26px; text-align: center; background: var(--surface-2); }
.sm-prods { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.sm-prod { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; text-align: center; cursor: pointer; background: var(--surface); }
.sm-prod:hover { background: var(--surface-2); }
.sm-prod.sel { border: 2px solid var(--primary); background: var(--primary-bg); }
.sm-prod .ic { font-size: 30px; color: var(--text-2); }
.sm-prod.sel .ic { color: var(--primary-text); }
.sm-seg-toggle { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.sm-toggle { padding: 9px 16px; border-radius: var(--radius); border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; font-family: inherit; font-size: 14px; color: var(--text-2); text-decoration: none; }
.sm-toggle.on { background: var(--primary-bg); color: var(--primary-text); border-color: var(--primary); }
.sm-sizes { display: flex; flex-wrap: wrap; gap: 12px; }
.sm-size { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.sm-size span { font-size: 12px; color: var(--text-2); }
.sm-size input { width: 58px; text-align: center; padding: 8px; border: 1px solid var(--border-2); border-radius: var(--radius); font-family: var(--font-mono); font-size: 15px; }
.sm-quote-line { display: flex; justify-content: space-between; font-size: 14px; margin-top: 8px; }
.sm-quote-total { display: flex; justify-content: space-between; font-weight: 600; font-size: 19px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-family: var(--font-display); }

/* ---- analytics & reports ---- */
.sm-grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 14px; }
.sm-bar-track { height: 8px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.sm-bar-track > span { display: block; height: 100%; border-radius: 6px; background: var(--primary); }
.sm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sm-table th { text-align: left; font-weight: 500; color: var(--text-2); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.sm-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); }
.sm-table tr:last-child td { border-bottom: none; }
.sm-heat { display: grid; grid-template-columns: 120px repeat(4, 1fr); gap: 6px; align-items: center; }
.sm-heat .cell { border-radius: var(--radius); padding: 12px 8px; text-align: center; font-family: var(--font-mono); font-size: 14px; font-weight: 600; }
.sm-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-lg); border: 1px solid var(--border); border-left-width: 4px; background: var(--surface); }
.sm-alert .ic { font-size: 20px; line-height: 1.3; }
.al-danger { border-left-color: var(--danger); } .al-danger .ic { color: var(--danger); }
.al-warning { border-left-color: var(--warning); } .al-warning .ic { color: var(--warning); }
.al-info { border-left-color: var(--primary); } .al-info .ic { color: var(--primary); }
.al-success { border-left-color: var(--success); } .al-success .ic { color: var(--success); }
.sm-scenario { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; }
.sm-field { display: flex; flex-direction: column; gap: 5px; }
.sm-field label { font-size: 12px; color: var(--text-2); }
.sm-field select, .sm-field input { padding: 9px 11px; border: 1px solid var(--border-2); border-radius: var(--radius); font-family: inherit; font-size: 14px; background: var(--surface); }

/* ---- modal ---- */
.sm-modal-overlay { position: fixed; inset: 0; background: rgba(20, 33, 61, .45); display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; z-index: 50; overflow: auto; }
.sm-modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 24px 60px rgba(20, 33, 61, .3); width: 100%; max-width: 560px; animation: sm-rise .2s ease both; }

/* ---- number pad (floor entry) ---- */
.sm-numpad { background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 24px 60px rgba(20, 33, 61, .35); width: 300px; padding: 18px; animation: sm-rise .15s ease both; }
.np-label { font-size: 13px; color: var(--text-2); text-align: center; }
.np-value { font-family: var(--font-mono); font-size: 36px; font-weight: 600; text-align: center; min-height: 48px; padding: 4px 0 10px; border-bottom: 2px solid var(--border); margin-bottom: 14px; }
.np-value.np-over { color: var(--danger-text); border-bottom-color: var(--danger); }
.np-value .np-max { font-size: 18px; color: var(--text-3); font-weight: 500; }
.np-warn { display: flex; align-items: center; gap: 7px; background: var(--danger-bg); color: var(--danger-text); border-radius: var(--radius); padding: 8px 11px; font-size: 12.5px; font-weight: 600; margin-bottom: 12px; }
.np-done[disabled] { background: var(--border-2); color: var(--surface); cursor: not-allowed; }
.np-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.np-key { font-family: var(--font-display); font-size: 24px; font-weight: 600; padding: 18px 0; border-radius: var(--radius); border: 1px solid var(--border-2); background: var(--surface); color: var(--text); cursor: pointer; }
.np-key:active { transform: scale(.97); background: var(--surface-2); }
.np-fn { color: var(--text-2); font-size: 19px; }
.np-done { width: 100%; margin-top: 12px; min-height: 54px; border: none; border-radius: var(--radius); background: var(--primary); color: #fff; font-size: 18px; font-weight: 600; cursor: pointer; }
.np-done:active { transform: scale(.99); }
.np-quick { display: flex; gap: 8px; margin-bottom: 12px; }
.np-chip { flex: 1; padding: 11px 0; border-radius: var(--radius); border: 1px solid var(--border-2); background: var(--surface-2); font-family: var(--font-mono); font-weight: 600; font-size: 15px; color: var(--text); cursor: pointer; }
.np-chip:active { transform: scale(.95); background: var(--primary-bg); color: var(--primary-text); }

/* ---- reusable touch quantity control (QuantityInput) ----
   Full mode: a padded pill enclosing − / number / + tiles.
   Compact mode: a single tappable tile for dense grids (tap → keypad). */
.qi { display: inline-flex; align-items: center; gap: 0; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 16px; padding: 5px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 1px 2px rgba(20, 33, 61, .05); }
.qi-btn { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font-size: 27px; line-height: 1; cursor: pointer; display: grid; place-items: center; box-shadow: 0 1px 0 rgba(0, 0, 0, .05); -webkit-tap-highlight-color: transparent; transition: transform .07s ease, background .12s; }
.qi-btn:active { transform: scale(.9); background: var(--primary-bg); }
.qi-btn:disabled { opacity: .35; cursor: default; box-shadow: none; }
.qi-plus { color: var(--primary); }
.qi-num { min-width: 82px; height: 52px; padding: 0 12px; border: 0; background: transparent; color: var(--text); font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 29px; font-weight: 700; letter-spacing: -.01em; cursor: pointer; display: inline-grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.qi-num[data-empty="true"] { color: var(--text-3); font-weight: 500; }
.qi-num:disabled { cursor: default; }
.qi-num:focus-visible, .qi-btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* Compact tile — standalone, sits inside a size-grid cell. */
.qi-compact { background: transparent; border: 0; padding: 0; box-shadow: none; }
.qi-compact .qi-num { width: 62px; min-width: 0; height: 52px; padding: 0 6px; border: 1.5px solid var(--border-2); border-radius: 12px; background: var(--surface-2); font-size: 21px; box-shadow: 0 1px 2px rgba(20, 33, 61, .05); transition: transform .1s ease, background .12s, border-color .12s, box-shadow .12s, color .12s; }
.qi-compact .qi-num[data-empty="true"] { background: var(--surface); box-shadow: none; }              /* empty: quiet, ghosted */
.qi-compact .qi-num:not([data-empty="true"]) { border-color: var(--primary); background: var(--primary-bg); color: var(--primary-text); }  /* filled: brand tint (fit accent overrides inline) */
.qi-compact .qi-num:active { transform: scale(.94); }
.qi-compact .qi-num:disabled { opacity: .5; box-shadow: none; }

/* ---- toggle switch (settings) ---- */
.sm-switch { position: relative; width: 46px; height: 26px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface-2); cursor: pointer; padding: 0; flex-shrink: 0; transition: background .15s, border-color .15s; -webkit-tap-highlight-color: transparent; }
.sm-switch.on { background: var(--primary); border-color: var(--primary); }
.sm-switch-knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(20, 33, 61, .25); transition: transform .16s cubic-bezier(.3, 1, .4, 1); }
.sm-switch.on .sm-switch-knob { transform: translateX(20px); }
.sm-switch:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

/* ---- reprint grid cell ---- */
.rp-cell { width: 100%; min-height: 52px; border: 1px solid var(--border-2); border-radius: var(--radius); background: var(--surface); font-family: var(--font-mono); font-size: 20px; font-weight: 600; cursor: pointer; color: var(--text); }
.rp-cell.has { background: var(--primary-bg); border-color: var(--primary); color: var(--primary-text); }
.rp-cell:active { transform: scale(.98); }
.rp-part { padding: 10px 14px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); font-size: 14px; cursor: pointer; color: var(--text); }
.rp-part.on { background: var(--primary-bg); border-color: var(--primary); color: var(--primary-text); }
.rp-whole { width: 100%; text-align: left; padding: 14px 16px; border-radius: var(--radius); border: 1.5px solid var(--border-2); background: var(--surface); cursor: pointer; font-size: 15px; color: var(--text); }
.rp-whole.on { background: var(--danger-bg); border: 2px solid var(--danger); color: var(--danger-text); }

/* ============================================================
   Floor: POS station + KDS board (touch-first, glanceable)
   ============================================================ */
.floor-switch { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.floor-switch .sm-toggle { font-weight: 500; }

/* --- KDS board --- */
.kds-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.kds-summary { display: flex; gap: 8px; flex-wrap: wrap; }
.kds-stat { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 999px;
  border: 1.5px solid transparent; font-family: inherit; cursor: pointer; transition: box-shadow .12s ease, opacity .12s ease; }
.kds-stat:hover { box-shadow: var(--shadow); }
.kds-stat.on { border-color: currentColor; }
.kds-stat.dim { opacity: .45; }
.kds-stat .dotc { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.kds-ok-c { background: var(--success-bg); color: var(--success-text); } .kds-ok-c .dotc { background: var(--success); }
.kds-soon-c { background: var(--warning-bg); color: var(--warning-text); } .kds-soon-c .dotc { background: var(--warning); }
.kds-late-c { background: var(--danger-bg); color: var(--danger-text); } .kds-late-c .dotc { background: var(--danger); }

.kds-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.kds-tile { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; text-align: left; font-family: inherit; color: var(--text); padding: 0; transition: transform .08s, filter .12s; animation: sm-rise .4s ease both; }
.kds-tile:hover { filter: brightness(.985); transform: translateY(-2px); }
.kds-tile:active { transform: scale(.99); }
.kds-art { display: block; width: 100%; height: 78px; object-fit: cover; border-radius: 8px; margin: 2px 0 9px; border: 1px solid var(--border); background: var(--surface-2); }
/* status + rush badges sit in the white strip at the top of the card; the tinted band below is reserved for the job name (≤2 lines) */
.kds-badges-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 11px 13px 8px; }
.kds-th { display: block; padding: 6px 13px 10px; }
.kds-th .tk { font-family: var(--font-sans); font-weight: 700; font-size: 16px; line-height: 1.2; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kds-rush { display: inline-flex; align-items: center; gap: 3px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.kds-status { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.kds-status-ok { background: var(--success-bg); color: var(--success-text); }
.kds-status-soon { background: var(--warning-bg); color: var(--warning-text); }
.kds-status-late { background: var(--danger-bg); color: var(--danger-text); }
.kds-status-rework { background: var(--rework-bg); color: var(--rework-text); }
.kds-bd { padding: 12px 13px 14px; }
.kds-bd .cust { font-weight: 600; font-size: 14px; }
.kds-bd .prod { color: var(--text-2); font-size: 12px; margin-top: 2px; line-height: 1.35; }
.kds-foot { display: flex; align-items: center; flex-wrap: wrap; margin-top: 12px; gap: 6px; }
.kds-stn { font-size: 11px; font-weight: 600; color: var(--text-2); background: var(--surface-2); padding: 3px 9px; border-radius: var(--radius); white-space: nowrap; }
.kds-alloc { font-size: 11px; font-weight: 600; color: var(--primary-text); white-space: nowrap; }
.kds-alloc i { font-size: 12px; }

/* --- manager alerts inbox --- */
.al-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 13px 16px; margin-bottom: 10px; cursor: pointer; font-family: inherit; color: var(--text); box-shadow: var(--shadow); transition: filter .12s, transform .05s; }
.al-row:hover { background: var(--surface-2); }
.al-row:active { transform: scale(.997); }
.al-ic { font-size: 20px; flex-shrink: 0; }
.kds-eta { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-family: var(--font-mono); font-size: 15px; font-weight: 600; white-space: nowrap; }
.kds-eta i { font-size: 13px; color: var(--text-2); }
.k-late .kds-th { background: var(--danger-bg); color: var(--danger-text); } .k-late { border-color: #f1c9c9; }
.k-soon .kds-th { background: var(--warning-bg); color: var(--warning-text); } .k-soon { border-color: #f0d8a6; }
.k-ok   .kds-th { background: var(--success-bg); color: var(--success-text); } .k-ok { border-color: #cfe9d8; }

/* --- POS station --- */
.pos-hero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 22px 24px; animation: sm-rise .42s ease both; }
.pos-htop { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pos-stn { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 7px; }
.pos-ticket { font-family: var(--font-sans); font-size: 46px; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; margin-top: 8px; }
.pos-sub { color: var(--text-2); font-size: 16px; margin-top: 2px; }
.pos-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 18px; }
.pos-stat { background: var(--surface-2); border-radius: var(--radius); padding: 13px 15px; }
.pos-stat .k { font-size: 12px; color: var(--text-2); }
.pos-stat .v { font-family: var(--font-display); font-size: 23px; font-weight: 600; margin-top: 2px; letter-spacing: -.01em; }
.pos-stat.is-late { background: var(--danger-bg); } .pos-stat.is-late .k, .pos-stat.is-late .v { color: var(--danger-text); }
.pos-stat.is-soon { background: var(--warning-bg); } .pos-stat.is-soon .k, .pos-stat.is-soon .v { color: var(--warning-text); }
.pos-primary { width: 100%; min-height: 68px; margin-top: 16px; border: none; border-radius: var(--radius-lg); background: var(--success); color: #fff; font-family: var(--font-display); font-size: 22px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 10px; transition: filter .12s, transform .05s; }
.pos-primary:hover { filter: brightness(.97); } .pos-primary:active { transform: scale(.995); }
.pos-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.pos-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 94px; padding: 14px; border-radius: var(--radius-lg); border: 1px solid var(--border-2); background: var(--surface); color: var(--text); cursor: pointer; font-family: inherit; transition: filter .12s, transform .05s; }
.pos-tile:hover { background: var(--surface-2); } .pos-tile:active { transform: scale(.98); }
.pos-tile .ic { font-size: 27px; } .pos-tile .lbl { font-size: 14px; font-weight: 600; }
.pos-tile.t-issue { background: var(--danger-bg); border-color: #f1c9c9; color: var(--danger-text); }
.pos-tile.t-voice { background: var(--primary-bg); border-color: #cfe0fb; color: var(--primary-text); }
.pos-tile.t-voice.speaking { filter: brightness(.96); }
.sm-speak .sm-speak-controls { display: flex; gap: 12px; align-items: center; justify-content: center; }
.sm-speak-btn { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 999px; border: 1px solid var(--primary); background: var(--surface); color: var(--primary-text); cursor: pointer; font-size: 20px; transition: filter .12s, transform .05s; }
.sm-speak-btn:hover:not(:disabled) { filter: brightness(.97); }
.sm-speak-btn:active:not(:disabled) { transform: scale(.94); }
.sm-speak-btn:disabled { opacity: .45; cursor: default; border-color: var(--border-2); color: var(--text-2); }

/* --- allocated-time countdown chip --- */
.pos-timerwrap { display: inline-flex; align-items: center; gap: 6px; }
.pos-timerwrap > i { font-size: 16px; color: var(--text-2); }
.pos-timer { font-family: var(--font-mono); font-weight: 600; font-size: 15px; padding: 6px 12px; border-radius: var(--radius); background: var(--primary-bg); color: var(--primary-text); white-space: nowrap; }
.pos-timer[data-over="1"] { background: var(--danger-bg); color: var(--danger-text); }

/* --- station gates (printing colour profile · cutting count/sign-off) --- */
.pos-gate { margin-top: 14px; border-radius: var(--radius-lg); padding: 16px 18px; border: 1px solid var(--border-2); }
.pos-gate.g-todo { background: var(--warning-bg); border-color: #f0d8a6; }
.pos-gate.g-done { background: var(--success-bg); border-color: #cfe9d8; }
.g-head { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.g-todo .g-head { color: var(--warning-text); } .g-done .g-head { color: var(--success-text); }
.g-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.g-chip { padding: 13px 18px; border-radius: var(--radius); border: 1px solid var(--border-2); background: var(--surface); font-size: 15px; font-weight: 500; cursor: pointer; font-family: inherit; color: var(--text); min-height: 50px; }
.g-chip:hover { background: var(--surface-2); } .g-chip:active { transform: scale(.98); }
.g-saved { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; color: var(--success-text); }
.g-change { margin-left: auto; padding: 7px 13px; border-radius: var(--radius); border: 1px solid var(--border-2); background: var(--surface); font-size: 13px; cursor: pointer; font-family: inherit; color: var(--text-2); }
.g-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
.g-stat, .g-count { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; text-align: left; }
.g-count { cursor: pointer; font-family: inherit; color: var(--text); } .g-count:active { transform: scale(.98); }
.g-stat .k, .g-count .k { font-size: 12px; color: var(--text-2); }
.g-stat .v, .g-count .v { font-family: var(--font-mono); font-size: 22px; font-weight: 600; margin-top: 2px; }
.g-stat.ok .v { color: var(--success-text); } .g-stat.short .v { color: var(--danger-text); }
.g-sign input { width: 100%; padding: 12px 14px; border: 1px solid var(--border-2); border-radius: var(--radius); font-family: inherit; font-size: 15px; background: var(--surface); }
.g-input { width: 100%; margin-top: 5px; padding: 9px 11px; border: 1px solid var(--border-2); border-radius: var(--radius); font-family: inherit; font-size: 14px; background: var(--surface); }
.g-parts { font-size: 13px; color: var(--text-2); margin-top: 10px; }
.g-mini { padding: 8px 12px; border-radius: var(--radius); border: 1px solid var(--border-2); background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; color: var(--text); }
.g-mini.on { background: var(--primary-bg); border-color: var(--primary); color: var(--primary-text); }
.g-chip.on { background: var(--primary-bg); border-color: var(--primary); color: var(--primary-text); }
/* two-step colour-profile picker (RGB source row + rendering-intent row) */
.g-profrow { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.g-proflbl { flex: 0 0 108px; font-size: 11px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
.g-profrow .g-chips { flex: 1; }
.g-toggle { padding: 13px 15px; border-radius: var(--radius); border: 1px solid var(--border-2); background: var(--surface); font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; color: var(--text-2); text-align: left; }
.g-toggle.on { background: var(--success-bg); border-color: #cfe9d8; color: var(--success-text); }
/* stitching contractor-assignment chips (floor station) */
.g-asg { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.g-asg-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; background: var(--surface); border: 1px solid var(--border-2); border-radius: 999px; padding: 5px 12px; color: var(--text); }
.g-asg-chip .num { color: var(--primary-text); }
.g-asg-chip.tentative { border-style: dashed; color: var(--rework-text); background: var(--rework-bg); border-color: var(--rework-border); }
.g-asg-chip.tentative .num { color: var(--rework-text); }
.pos-primary[disabled] { background: var(--border-2); cursor: not-allowed; }

/* --- press material flash (non-normal fabric) --- */
.flash-banner { display: flex; align-items: center; gap: 12px; border-radius: var(--radius-lg); padding: 14px 18px; margin-top: 14px; background: var(--warning-bg); border: 1px solid #f0d8a6; color: var(--warning-text); font-weight: 600; font-size: 15px; animation: flash-pulse 1.1s ease-in-out infinite; }
.flash-banner i { font-size: 20px; }
@keyframes flash-pulse { 0%, 100% { background: var(--warning-bg); } 50% { background: #fbe4b6; } }
@media (prefers-reduced-motion: reduce) { .flash-banner { animation: none; } }

/* ---- entrance motion ---- */
@keyframes sm-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sm-card, .sm-metric { animation: sm-rise .42s ease both; }
.sm-metrics .sm-metric:nth-child(2) { animation-delay: .05s; }
.sm-metrics .sm-metric:nth-child(3) { animation-delay: .1s; }
.sm-metrics .sm-metric:nth-child(4) { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) { .sm-card, .sm-metric { animation: none; } }

@media (max-width: 760px) {
  .sm-bigbtn-grid { grid-template-columns: 1fr; }
  .sm-grid-portal { grid-template-columns: 1fr; }
  .sm-heat { grid-template-columns: 90px repeat(4, 1fr); }
  .pos-ticket { font-size: 38px; }
  .pos-hero { padding: 18px 18px; }
  .kds-board { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .kds-th { padding: 8px 10px; }
  .kds-th .tk { font-size: 14px; }
  .kds-th .st { font-size: 10px; }
  .kds-bd { padding: 10px 11px 12px; }
  .kds-eta { font-size: 14px; }
}

/* ============================================================
   Customer portal theme — warm "made-to-order studio"
   Scoped under .portal so the internal ops UI is untouched.
   ============================================================ */
.portal {
  --p-ink: #1b1726;
  --p-coral: #ff5b41;
  --p-tang: #ff8a3d;
  --p-teal: #0fb5a6;
  --p-line: #efe7dc;
  --p-soft: #fff6f1;
  /* Pin the base tokens light so the customer portal keeps its warm identity
     no matter which floor theme (control / steel) staff have switched on. */
  --bg: #f5f2ec; --surface: #ffffff; --surface-2: #f1ede6;
  --ink: #1b1726; --text: #2a2436; --text-2: #6a6478; --text-3: #9a93a6;
  --border: #efe7dc; --border-2: #e2d8cb;
  --shadow: 0 8px 24px rgba(27, 23, 38, .06);
  font-family: "Plus Jakarta Sans", var(--font-sans);
  color: var(--p-ink);
}
.portal ::selection { background: #ffd9cf; }

.portal-hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 36px 34px 28px;
  background: linear-gradient(135deg, #241d33 0%, #15121d 70%);
  color: #fbf7f1;
  animation: sm-rise .5s ease both;
}
.portal-hero::after {
  content: "";
  position: absolute; right: -60px; top: -70px;
  width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(circle, var(--p-coral), transparent 68%);
  opacity: .55;
}
.portal-brand { position: relative; font-family: "Bricolage Grotesque", var(--font-display); font-weight: 700; letter-spacing: -.01em; font-size: 15px; opacity: .9; }
.portal-brand span { color: var(--p-tang); }
.portal-hero h1 { position: relative; font-family: "Bricolage Grotesque", var(--font-display); font-weight: 800; font-size: 42px; line-height: 1.02; letter-spacing: -.025em; margin: 16px 0 8px; }
.portal-hero p { position: relative; margin: 0; color: #d8cdc2; font-size: 16px; max-width: 540px; line-height: 1.55; }
.portal-tabs { position: relative; display: flex; gap: 10px; margin-top: 22px; }
.portal-tabs a { padding: 10px 20px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14px; background: rgba(255,255,255,.1); color: #fbf7f1; transition: background .15s, transform .1s; }
.portal-tabs a:hover { background: rgba(255,255,255,.18); }
.portal-tabs a.on { background: linear-gradient(135deg, var(--p-coral), var(--p-tang)); color: #fff; box-shadow: 0 6px 16px rgba(255,91,65,.4); }
.portal-body { margin-top: 24px; }

.portal .sm-h { font-family: "Bricolage Grotesque", var(--font-display); font-weight: 700; letter-spacing: -.01em; }
.portal .sm-step-label { font-weight: 700; color: var(--p-ink); }
.portal .sm-card { border-radius: 18px; border: 1px solid var(--p-line); box-shadow: 0 8px 24px rgba(27,23,38,.06); animation: sm-rise .5s ease both; }

.portal .sm-dropzone { border: 2px dashed #f3c4b4; border-radius: 18px; background: var(--p-soft); transition: border-color .15s, background .15s; }
.portal .sm-dropzone:hover { border-color: var(--p-coral); background: #fff0e9; }

.portal .sm-prod { border: 1.5px solid var(--p-line); border-radius: 18px; padding: 22px 16px; background: #fff; transition: transform .16s, box-shadow .16s, border-color .16s; }
.portal .sm-prod:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(27,23,38,.12); background: #fff; }
.portal .sm-prod .ic { font-size: 34px; color: var(--p-ink); transition: color .16s; }
.portal .sm-prod.sel { border: 2px solid var(--p-coral); background: #fff; box-shadow: 0 14px 30px rgba(255,91,65,.2); }
.portal .sm-prod.sel .ic { color: var(--p-coral); }

.portal .sm-seg-toggle .sm-toggle { border-radius: 999px; }
.portal .sm-toggle.on { background: var(--p-soft); color: #c2381f; border-color: var(--p-coral); }
.portal .sm-size input { border-radius: 11px; }
.portal .sm-size input:focus { outline: none; border-color: var(--p-coral); box-shadow: 0 0 0 3px rgba(255,91,65,.15); }

.portal .sm-btn-primary { background: linear-gradient(135deg, var(--p-coral), var(--p-tang)); border: none; color: #fff; box-shadow: 0 10px 22px rgba(255,91,65,.3); }
.portal .sm-btn-primary:hover { filter: brightness(1.04); background: linear-gradient(135deg, var(--p-coral), var(--p-tang)); }
.portal .sm-btn-lg { border-radius: 14px; }
.portal .sm-quote-total { font-family: "Bricolage Grotesque", var(--font-display); }

.portal .seg-complete { background: var(--p-teal); }
.portal .seg-current { background: var(--p-coral); }

/* ============================================================
   Alternate floor themes — switched from the top-bar theme
   control and persisted per-browser (see sublime.js sublimeTheme).
   The default (no data-theme attribute) is the light "instrument
   panel". Both alternates run a dark-surface / light-text palette,
   so every card, table, button and chip re-themes with no per-
   component work. Steel differs only in that its page GROUND is
   light — handled by the custom-property cascade below.
   ============================================================ */

/* ---- 1. Control — full dark command deck ---- */
:root[data-theme="control"] {
  --bg:        #0e1420;
  --surface:   #16202f;
  --surface-2: #1e2a3d;
  --ink:       #3aa0ff;   /* emphasis blocks carry #fff text → keep it a saturated colour */
  --text:      #eaf1fb;
  --text-2:    #9fb0c9;
  --text-3:    #6b7c96;
  --border:    #223148;
  --border-2:  #33455f;

  --primary:      #3aa0ff;
  --primary-bg:   #152a44;
  --primary-text: #a9d0ff;

  --success: #2fd27a; --success-bg: #123524; --success-text: #67e0a1;
  --danger:  #ff5a72; --danger-bg:  #3a1a22; --danger-text:  #ff9fb0;
  --warning: #ffb020; --warning-bg: #352712; --warning-text: #ffcd81;

  --rework: #a78bfa; --rework-bg: #241b3b; --rework-text: #c9b6fd; --rework-border: #3d2f63;

  --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 1px 1px rgba(0, 0, 0, .4);
}

/* ---- 2. Steel — dark slate cards floating on a light steel ground ---- */
/* Strategy: everything INSIDE a surface is dark-themed (dark fills, dark tints,
   light text) exactly like Control, so nothing light ever clashes on a dark card.
   Only the page GROUND is light, and the bare headings/labels on it are dark. The
   :root palette is therefore the dark in-card palette + a light --bg + dark ground
   text; the surface block below just flips the neutral text/borders back to light. */
:root[data-theme="steel"] {
  --bg:        #ccd2dc;   /* light steel ground — cards pop against it */
  --surface:   #172231;   /* dark slate card */
  --surface-2: #212d3f;   /* dark inset within a card (tiles, tracks, wells) */
  --ink:       #16202f;   /* on-ground emphasis block (dark navy, white text) */

  /* Ground text: dark, so headings/labels on the light ground read cleanly. */
  --text:      #1c2637;
  --text-2:    #46536a;
  --text-3:    #68758a;
  --border:    #b1bbca;   /* dividers between light ground elements */
  --border-2:  #9fabbc;

  /* Semantics = the dark-theme pairs (dark tint + light text). Used together, so
     they stay self-consistent whether on the ground or inside a card. */
  --primary:      #3aa0ff;
  --primary-bg:   #16273c;
  --primary-text: #a9d0ff;
  --success: #2fd27a; --success-bg: #12301f; --success-text: #6ee0a4;
  --danger:  #ff5a72; --danger-bg:  #331a20; --danger-text:  #ff9fb0;
  --warning: #ffb020; --warning-bg: #33280f; --warning-text: #ffce85;
  --rework:  #a78bfa; --rework-bg:  #241b3b; --rework-text:  #c9b6fd; --rework-border: #3d2f63;

  --shadow: 0 16px 30px -16px rgba(15, 23, 42, .55), 0 4px 10px -4px rgba(15, 23, 42, .3);
}
/* Inside the dark surfaces, flip the NEUTRAL text + dividers to light (the tinted
   semantics are already dark-on-light-text at the root, so they need no override).
   Custom properties inherit, so listing each top-level dark surface re-themes its
   whole subtree — including the station hero, its stat tiles, action tiles and gates. */
:root[data-theme="steel"] .sm-card,
:root[data-theme="steel"] .sm-topbar,
:root[data-theme="steel"] .sm-metric,
:root[data-theme="steel"] .pos-hero,
:root[data-theme="steel"] .pos-tile,
:root[data-theme="steel"] .pos-gate,
:root[data-theme="steel"] .sm-banner,
:root[data-theme="steel"] .pos-confirm,
:root[data-theme="steel"] .login-card,
:root[data-theme="steel"] .sm-btn {
  color: var(--text);
  --text:      #eaf1fb;
  --text-2:    #9fb0c9;
  --text-3:    #6b7c96;
  --border:    #26344a;
  --border-2:  #35475f;
  --ink:       #3aa0ff;   /* emphasis blocks (active persona, brand dot) go blue on dark */
}
/* Tinted surfaces ship hard-coded pale pastel borders (built for the light theme) —
   neutralise them on BOTH dark decks so they don't ring dark chips with a bright edge. */
:root[data-theme="control"] .pos-tile,
:root[data-theme="control"] .pos-gate,
:root[data-theme="control"] .qa-cell,
:root[data-theme="control"] .g-toggle,
:root[data-theme="steel"] .pos-tile,
:root[data-theme="steel"] .pos-gate,
:root[data-theme="steel"] .qa-cell,
:root[data-theme="steel"] .g-toggle {
  border-color: var(--border-2);
}

/* Native form controls default to a white box — theme them on the dark decks so
   they don't punch a bright hole in a card. (Steel: only inside dark surfaces.) */
:root[data-theme="control"] input:not([type=checkbox]):not([type=radio]):not([type=range]),
:root[data-theme="control"] select,
:root[data-theme="control"] textarea,
:root[data-theme="steel"] .sm-card input:not([type=checkbox]):not([type=radio]):not([type=range]),
:root[data-theme="steel"] .sm-card select,
:root[data-theme="steel"] .sm-card textarea,
:root[data-theme="steel"] .sm-topbar input,
:root[data-theme="steel"] .pos-confirm input,
:root[data-theme="steel"] .pos-confirm select {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-2);
}

/* ---- top-bar theme switch (segmented control) ---- */
.sm-themesw { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface-2); }
.sm-themesw button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; background: none; cursor: pointer; color: var(--text-2);
  font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1;
  padding: 6px 10px; border-radius: 999px; transition: background .12s, color .12s;
}
.sm-themesw button i { font-size: 13px; }
.sm-themesw button:hover { color: var(--text); }
.sm-themesw button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.sm-themesw button .lbl { display: none; }
@media (min-width: 1180px) { .sm-themesw button.on .lbl { display: inline; } }

/* ============================================================
   Stitching capacity board — two-mode autofit, forecast (yellow)
   vs firm (blue) work, per-day fill, and an expandable per-
   contractor queue with reorder / lock / confirm controls.
   ============================================================ */

/* segmented control (horizon 7/14/30, autofit modes) */
.sm-segctl { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: var(--radius); border: 1px solid var(--border-2); background: var(--surface-2); }
.sm-segctl button { border: none; background: none; cursor: pointer; color: var(--text-2); font-family: inherit; font-size: 12.5px; font-weight: 600; line-height: 1; padding: 6px 11px; border-radius: 6px; transition: background .12s, color .12s; }
.sm-segctl button:hover { color: var(--text); }
.sm-segctl button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* stage chips on the assignment table */
.cap-stage { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.cap-stage.at { background: var(--primary-bg); color: var(--primary-text); }
.cap-stage.up { background: var(--warning-bg); color: var(--warning-text); }
.cap-stage.design { background: var(--surface-2); color: var(--text-3); }
.cap-tent-dot { color: var(--warning); font-size: 9px; vertical-align: middle; }

/* per-day fill: firm (blue) stacked with tentative/forecast (amber) */
.cap-day { display: flex; height: 22px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.cap-firm { height: 100%; background: var(--primary); }
.cap-tent { height: 100%; background: var(--warning); opacity: .9; }

/* utilization mini-bar */
.cap-util { display: flex; align-items: center; gap: 7px; }
.cap-util .bar { flex: 1; min-width: 42px; height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.cap-util .bar > span { display: block; height: 100%; border-radius: 4px; background: var(--success); }
.cap-util.warn .bar > span { background: var(--warning); }
.cap-util.over .bar > span { background: var(--danger); }
.cap-util .pct { font-family: var(--font-mono); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* contractor row: clickable to expand */
.cap-row { cursor: pointer; transition: background .1s; }
.cap-row:hover { background: var(--surface-2); }
.cap-row .caret { transition: transform .15s; display: inline-block; color: var(--text-3); }
.cap-row.open .caret { transform: rotate(90deg); }
.cap-risk { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; color: var(--danger-text); background: var(--danger-bg); padding: 2px 7px; border-radius: 999px; }

/* expanded queue detail */
.cap-detail td { background: var(--surface-2); padding: 0 !important; }
.cap-queue { padding: 6px 10px 12px; }
.cap-qhead { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); padding: 8px 4px 6px; }
.cap-qrow { display: grid; grid-template-columns: auto 1fr auto auto auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); margin-bottom: 6px; }
.cap-qrow.tent { border-left: 3px solid var(--warning); }
.cap-qrow.firm { border-left: 3px solid var(--primary); }
.cap-qrow.risk { box-shadow: inset 0 0 0 1px var(--danger); }
.cap-qmove { display: flex; flex-direction: column; gap: 1px; }
.cap-qmove button, .cap-qbtn { border: 1px solid var(--border-2); background: var(--surface); color: var(--text-2); cursor: pointer; border-radius: 6px; width: 26px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; padding: 0; }
.cap-qmove button:hover, .cap-qbtn:hover { color: var(--text); border-color: var(--primary); }
.cap-qmove button:disabled { opacity: .35; cursor: default; }
.cap-qbtn { width: 30px; height: 28px; font-size: 13px; }
.cap-qbtn.on { background: var(--primary-bg); color: var(--primary-text); border-color: var(--primary); }
.cap-qbtn.confirm { color: var(--success-text); }
.cap-qmeta { font-size: 11.5px; color: var(--text-2); }
.cap-qmeta .ready { color: var(--warning-text); }
.cap-qmeta .over { color: var(--danger-text); font-weight: 600; }

/* ---- contractor Gantt (per-job time bars in the expanded queue) ---- */
.cap-gantt { margin: 2px 2px 14px; }
.cap-gantt-axis { position: relative; height: 14px; margin-bottom: 5px; }
.cap-gantt-tick { position: absolute; font-size: 10px; color: var(--text-3); white-space: nowrap; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.cap-gantt-lane { position: relative; height: 32px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; overflow: hidden; }
.cap-gantt-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); opacity: .7; }
.cap-gantt-bar { position: absolute; top: 5px; height: 22px; min-width: 6px; border-radius: 5px; display: flex; align-items: center; padding: 0 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); transition: left .28s cubic-bezier(.3, 1, .4, 1), width .28s cubic-bezier(.3, 1, .4, 1); }
.cap-gantt-bar.firm { background: var(--primary); color: #fff; }
.cap-gantt-bar.tent { background: repeating-linear-gradient(45deg, var(--warning), var(--warning) 7px, #e69a12 7px, #e69a12 14px); color: #3a2a06; }
.cap-gantt-bar.risk { box-shadow: 0 0 0 2px var(--danger), 0 1px 3px rgba(15, 23, 42, .3); }
.cap-gantt-bar .lbl { font-family: var(--font-mono); font-size: 11px; font-weight: 600; white-space: nowrap; text-shadow: 0 1px 1px rgba(0, 0, 0, .18); }
.cap-gantt-legend { display: flex; align-items: center; gap: 14px; margin-top: 6px; font-size: 11px; color: var(--text-2); }
.cap-gantt-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }
.cap-gantt-legend .dot.firm { background: var(--primary); }
.cap-gantt-legend .dot.tent { background: repeating-linear-gradient(45deg, var(--warning), var(--warning) 3px, #e69a12 3px, #e69a12 6px); }
.cap-gantt-legend .dot.risk { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--danger); }

/* ---- multi-resource schedule Gantt (Manager → Schedule) ---- */
.gnt-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 2px 2px 0; font-size: 12px; color: var(--text-2); }
.gnt-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.gnt-sw-risk { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--danger); }
.gnt-sw-tent { background: repeating-linear-gradient(45deg, var(--text-3), var(--text-3) 3px, transparent 3px, transparent 6px); }
.gnt { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.gnt-head, .gnt-row { display: flex; align-items: stretch; }
.gnt-row { border-top: 1px solid var(--border); }
.gnt-rowlabel { flex: 0 0 148px; width: 148px; padding: 8px 12px; display: flex; flex-direction: column; justify-content: center; gap: 2px; background: var(--surface-2); border-right: 1px solid var(--border); }
.gnt-rowlabel .lab { font-weight: 600; font-size: 13px; line-height: 1.15; }
.gnt-rowlabel .sub { font-size: 11px; color: var(--text-3); }
.gnt-corner { background: var(--surface); }
.gnt-axis { position: relative; flex: 1; height: 30px; }
.gnt-tick { position: absolute; top: 9px; font-size: 10px; color: var(--text-3); white-space: nowrap; font-family: var(--font-mono); font-variant-numeric: tabular-nums; transform: translateX(-1px); }
.gnt-track { position: relative; flex: 1; min-height: 40px; }
.gnt-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); opacity: .55; }
.gnt-today { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--danger); z-index: 4; }
.gnt-axis .gnt-today::after { content: "today"; position: absolute; top: -2px; left: 3px; font-size: 9px; font-weight: 700; color: var(--danger-text); letter-spacing: .02em; }
.gnt-bar { position: absolute; height: 26px; min-width: 8px; border-radius: 6px; display: flex; align-items: center; padding: 0 7px; cursor: pointer; color: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .28); }
.gnt-bar .gnt-lbl { font-family: var(--font-mono); font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 1px rgba(0, 0, 0, .3); }
.gnt-bar.tent { opacity: .82; background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .28) 0 5px, transparent 5px 10px); }
.gnt-bar.risk { box-shadow: 0 0 0 2px var(--danger), 0 1px 3px rgba(15, 23, 42, .3); }
.gnt-bar:hover { filter: brightness(1.06); z-index: 40; }
.gnt-tip { display: none; position: absolute; bottom: 30px; left: 0; min-width: 180px; max-width: 250px; background: var(--ink); color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 11px; line-height: 1.4; z-index: 50; box-shadow: 0 8px 22px rgba(0, 0, 0, .3); pointer-events: none; white-space: normal; }
.gnt-bar:hover .gnt-tip { display: block; }
.gnt-tip .tip-h { font-weight: 700; margin-bottom: 2px; }
.gnt-tip-img { display: block; width: 100%; max-height: 120px; object-fit: cover; border-radius: 6px; margin: 5px 0; border: 1px solid rgba(255, 255, 255, .15); }
.gnt-tip .tip-late { color: #fca5a5; font-weight: 700; margin-top: 3px; }
.gnt-empty { padding: 22px; color: var(--text-3); font-size: 13px; }
.gnt-bar[draggable="true"] { cursor: grab; }
.gnt-bar[draggable="true"]:active { cursor: grabbing; }
.gnt-row.drop-hover { background: var(--primary-bg); box-shadow: inset 0 0 0 2px var(--primary); }
.gnt-due { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--warning); z-index: 3; }
.gnt-axis .gnt-due::after { content: "due"; position: absolute; top: -2px; left: 3px; font-size: 9px; font-weight: 700; color: var(--warning-text); }
.gnt-compact .gnt-rowlabel { flex-basis: 122px; width: 122px; padding: 6px 10px; }
.gnt-compact .gnt-rowlabel .lab { font-size: 12.5px; }
.gnt-compact .gnt-bar { height: 22px; }
.gnt-compact .gnt-track { min-height: 32px; }
.gnt-row.hl .gnt-rowlabel { background: var(--primary-bg); box-shadow: inset 3px 0 0 var(--primary); }
.gnt-row.hl .gnt-rowlabel .lab { color: var(--primary-text); }

/* ---- Design station panel ---- */
.dz-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.dz-lbl { font-size: 12px; color: var(--text-2); font-weight: 600; }
.dz-sel { padding: 7px 9px; border: 1px solid var(--border-2); border-radius: var(--radius); font-family: inherit; font-size: 14px; min-width: 180px; background: var(--surface); color: var(--text); }
.dz-opts { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.dz-opt { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-2); border-radius: var(--radius); background: var(--surface); }
.dz-opt.chosen { border-color: var(--success); box-shadow: inset 0 0 0 1px var(--success); }
.dz-thumb { width: 42px; height: 42px; border-radius: 7px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; }
.dz-noimg { display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); background: var(--surface-2); }
.dz-win { color: var(--success-text); font-weight: 700; font-size: 13px; display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.dz-add { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding-top: 4px; }
.dz-in { padding: 7px 9px; border: 1px solid var(--border-2); border-radius: var(--radius); font-family: inherit; font-size: 13px; flex: 1; min-width: 120px; background: var(--surface); color: var(--text); }
.dz-up { padding: 6px 10px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.dz-sizes { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 10px; }
.dz-sizes-head { font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dz-nosize { color: var(--danger-text); font-weight: 600; }
.dz-grid { border-collapse: collapse; margin-top: 8px; }
.dz-grid th, .dz-grid td { border: 1px solid var(--border); padding: 4px 6px; text-align: center; font-size: 13px; }
.dz-grid th { background: var(--surface-2); font-weight: 600; }
.dz-szlbl { font-weight: 600; background: var(--surface-2); }
.dz-qty { width: 60px; text-align: center; padding: 6px; border: 1px solid var(--border-2); border-radius: 6px; }

/* ---- order form: per-fit size columns (kids run a different size scale) ---- */
.ow-fitcols { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.ow-fitcol { flex: 1 1 150px; min-width: 140px; border: 1px solid var(--border-2); border-radius: var(--radius-lg); padding: 10px 10px 8px; background: var(--surface); }
.ow-fitcol.kids { background: var(--warning-bg); border-color: var(--warning); }
.ow-fitcol-h { text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 15px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border-2); }
.ow-fitcell { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.ow-fitcell-sz { flex: 0 0 40px; font-weight: 600; font-size: 14px; }
.ow-fitcell > :last-child { flex: 1; min-width: 0; }
.ow-fitcol-tot { text-align: right; font-size: 11px; color: var(--text-2); margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border-2); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
/* split adult/kids sizes-as-rows grid (kids run their own size scale) */
.ow-splitgrid-kids { border-left: 3px solid var(--warning); }
.ow-splitgrid-kids thead th { background: var(--warning-bg); }

/* ---- analytics dashboard ---- */
.an-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.an-bar-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 13px; }
.an-bar-lbl { flex: 0 0 92px; }
.an-bar { flex: 1; height: 8px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.an-bar > span { display: block; height: 100%; border-radius: 5px; background: var(--danger); min-width: 3px; }

/* ---- job timeline (vertical event stream on the job detail) ---- */
.jt-wrap { margin: 4px 0 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 10px 14px; background: var(--surface-2); }
.jt-toggle { cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: 14px; list-style: none; display: inline-flex; align-items: center; gap: 7px; }
.jt-toggle::-webkit-details-marker { display: none; }
.jt-timeline { position: relative; margin: 10px 0 2px; }
.jt-event { position: relative; display: flex; gap: 12px; padding: 3px 0 12px; }
.jt-event::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: -3px; width: 2px; background: var(--border-2); }
.jt-event:last-child::before { display: none; }
.jt-dot { flex: none; width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; background: var(--surface); color: var(--text-3); border: 1px solid var(--border-2); z-index: 1; }
.jt-event.jt-started .jt-dot { background: var(--primary-bg); color: var(--primary-text); border-color: var(--primary); }
.jt-event.jt-completed .jt-dot { background: var(--success-bg); color: var(--success-text); border-color: var(--success); }
.jt-event.jt-spoilage .jt-dot { background: var(--danger-bg); color: var(--danger-text); border-color: var(--danger); }
.jt-event.jt-comment .jt-dot { background: var(--warning-bg); color: var(--warning-text); }
.jt-event.jt-created .jt-dot, .jt-event.jt-shipped .jt-dot, .jt-event.jt-file .jt-dot { background: var(--primary-bg); color: var(--primary-text); }
.jt-body { flex: 1; min-width: 0; padding-top: 2px; }
.jt-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.jt-summary { font-weight: 600; font-size: 14px; }
.jt-dur { font-family: var(--font-mono); font-size: 11px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); padding: 0 7px; border-radius: 999px; }
.jt-detail { font-size: 12.5px; color: var(--text-2); margin-top: 2px; }
.jt-meta { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
