/* TechFab UI kit. Brand: navy #1f3a5f, accent #e08a1e. No build step. */
:root {
  --bg: #f4f5f7; --panel: #fff; --ink: #1c2430; --muted: #5d6878; --line: #dde1e7;
  --brand: #1f3a5f; --brand-2: #2e5eaa; --accent: #e08a1e;
  --ok: #1e7b4a; --ok-bg: #e3f4ea; --warn: #9a5b00; --warn-bg: #fdf0d9;
  --bad: #b3261e; --bad-bg: #fbe4e2; --idle: #6b7280; --idle-bg: #eef0f3;
  --radius: 8px; --sidebar: 244px; --sidebar-mini: 68px; --topbar: 56px;
  --touch: 44px;
}
* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
[hidden] { display: none !important; }  /* fields / buttons a script hides (e.g. an empty Sub-type) */
html { font-size: 15px; }
body { margin: 0; font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Noto Sans Devanagari", Arial, sans-serif;
       background: var(--bg); color: var(--ink); line-height: 1.4; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; vertical-align: middle; }

/* ------------------------------------------------------------------ shell: side menu + top bar */
.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: var(--brand); color: #d6e0ee; flex: none; position: sticky; top: 0;
           height: 100vh; overflow-y: auto; z-index: 30; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 14px; font-size: .95rem; height: var(--topbar); color: #fff; font-weight: 700;
         letter-spacing: .3px; white-space: nowrap; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand:hover { text-decoration: none; }
.brand-mark { background: var(--accent); color: #fff; border-radius: 6px; width: 34px; height: 34px; display: grid;
              place-items: center; font-size: .9rem; flex: none; }
.brand em { font-style: normal; color: var(--accent); }
.sidebar nav { padding: 8px 8px 24px; display: flex; flex-direction: column; gap: 2px; }
.nav-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .6px; color: #9fb1c9; padding: 14px 10px 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; color: #d6e0ee; padding: 0 12px; min-height: var(--touch);
            border-radius: 6px; border-left: 3px solid transparent; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; border-left-color: var(--accent); font-weight: 600; }
.nav-scrim { display: none; }

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--topbar); background: var(--panel); border-bottom: 1px solid var(--line); display: flex; align-items: center;
          gap: 12px; padding: 0 18px; position: sticky; top: 0; z-index: 20; }
.topbar-title { flex: 1; font-weight: 600; color: var(--brand); }
.topbar .menu-btn { display: none; }
.icon-btn { background: none; border: 0; color: inherit; width: var(--touch); height: var(--touch); display: grid;
            place-items: center; border-radius: 6px; cursor: pointer; }
.icon-btn:hover { background: var(--idle-bg); }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 6px; background: none; border: 1px solid var(--line); border-radius: 999px;
            padding: 6px 12px; min-height: 40px; font: inherit; color: var(--ink); cursor: pointer; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line);
            border-radius: var(--radius); box-shadow: 0 8px 24px rgba(20,30,50,.15); min-width: 230px; padding: 6px; z-index: 40; }
.dropdown-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 10px; border-radius: 6px; color: var(--ink);
            background: none; border: 0; font: inherit; cursor: pointer; }
.dropdown a:hover, .dropdown button:hover { background: var(--idle-bg); text-decoration: none; }
.dropdown form { margin: 0; }
.dropdown .lang { display: flex; gap: 6px; padding: 6px 10px 8px; }
.dropdown .lang button { width: auto; border: 1px solid var(--line); padding: 6px 12px; }
.dropdown .lang button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
/* row "Actions" menu (components/row_actions_open.html): fixed, so a scrolling table does not clip it */
.row-menu { display: inline-block; }
.row-menu .btn { display: inline-flex; align-items: center; gap: 4px; }
.dropdown.row-menu-list { position: fixed; top: auto; min-width: 160px; }
.dropdown.row-menu-list a { display: flex; align-items: center; gap: 8px; }

main { padding: 18px; width: 100%; max-width: 1500px; margin: 0 auto; }
main.auth { max-width: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
/* title side of the header; on a view page the "Back" button (components/back_button.html) comes first */
.page-lead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-title { min-width: 0; }
.back-btn { flex: none; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ------------------------------------------------------------------ panels & grids */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.panel > h2:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: block; color: inherit; }
.kpi:hover { text-decoration: none; border-color: var(--brand-2); }
.kpi .v { font-size: 1.7rem; font-weight: 700; }
.kpi .l { color: var(--muted); font-size: .85rem; }
.kpi.bad .v { color: var(--bad); }

/* ------------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink);
       padding: 8px 14px; min-height: 38px; border-radius: 6px; font: inherit; font-size: .95rem; cursor: pointer;
       white-space: nowrap; line-height: 1.2; }
.btn:hover { text-decoration: none; border-color: var(--brand-2); }
.btn-primary { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.btn-primary:hover { background: var(--brand); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-danger { color: var(--bad); }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-link { border-color: transparent; background: none; color: var(--brand-2); }
.btn-sm { padding: 4px 9px; min-height: 30px; font-size: .85rem; }
.btn-lg { padding: 12px 20px; min-height: var(--touch); font-size: 1.05rem; }
.inline-form { display: inline; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--panel); }
th, td { padding: 8px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #eef1f5; font-size: .8rem; text-transform: uppercase; letter-spacing: .3px; color: #3b4656; white-space: nowrap; position: sticky; top: 0; }
tbody tr:hover { background: #f8fafc; }
tfoot td { font-weight: 700; background: #f6f7f9; }
tr.clickable { cursor: pointer; }
.data-table { padding: 0; }
.data-table .toolbar { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.data-table #table-region { padding: 0 0 4px; }
.data-table .pagination { padding: 10px 14px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.toolbar .search { flex: 1 1 240px; position: relative; display: flex; align-items: center; margin: 0; }
.toolbar .search .icon { position: absolute; left: 10px; color: var(--muted); }
.toolbar .search input { padding-left: 36px; }
.toolbar-field { min-width: 150px; }
.toolbar-field label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.pagination { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); display: grid; justify-items: center; gap: 8px; }
.empty-title { font-weight: 600; color: var(--ink); font-size: 1.05rem; }

/* ------------------------------------------------------------------ status chips (unchanged colours) */
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.chip-done, .chip-completed { background: var(--ok-bg); color: var(--ok); }
.chip-in_progress, .chip-in_production { background: var(--warn-bg); color: var(--warn); }
.chip-pending, .chip-released, .chip-draft { background: var(--idle-bg); color: var(--idle); }
.chip-hold, .chip-cancelled { background: var(--bad-bg); color: var(--bad); }
.chip-skipped { background: transparent; color: var(--idle); border: 1px dashed #b5bcc7; }
.chip-active { background: var(--ok-bg); color: var(--ok); }
.chip-inactive { background: var(--idle-bg); color: var(--idle); }

/* order x stage grid cells */
.cell { min-width: 92px; font-size: .8rem; }
/* compact grid so a product type's whole route fits the page width (scrolls only on small screens) */
table.matrix th, table.matrix td { padding: 6px 5px; }
table.matrix th { letter-spacing: 0; font-size: .7rem; line-height: 1.2; }
table.matrix th.mx-stage { white-space: normal; overflow-wrap: anywhere; min-width: 66px; }
table.matrix th.mx-stage .muted { display: block; text-transform: none; font-weight: 400; }
table.matrix .mx-job { width: 1%; white-space: nowrap; }
table.matrix .mx-order { min-width: 130px; max-width: 200px; overflow-wrap: anywhere; }
table.matrix .mx-status { margin-top: 3px; }
table.matrix .mx-progress { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
table.matrix .mx-progress .progress { flex: 1; min-width: 50px; }
table.matrix .mx-qty { margin-top: 2px; font-size: .85rem; font-variant-numeric: tabular-nums; }
table.matrix .cell { min-width: 66px; font-size: .74rem; line-height: 1.25; }
.cell .bar { height: 6px; background: var(--idle-bg); border-radius: 3px; overflow: hidden; margin: 3px 0 2px; }
.cell .bar i { display: block; height: 100%; background: var(--warn); }
.cell.st-done .bar i { background: var(--ok); }
/* one tint per stage status, so a row reads at a glance: green done, amber in progress, white not started */
.cell.st-done { color: var(--ok); background: var(--ok-bg); }
.cell.st-in_progress { background: var(--warn-bg); }
.cell.st-pending { color: var(--idle); }
.cell.st-skipped { color: #a0a7b2; font-style: italic; }
.cell.st-none { background: var(--bg); }  /* stage not in this job's route (e.g. a BOPP stage on a Flexo job) */
.cell.current { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.cell .q { font-variant-numeric: tabular-nums; }
.cell .cell-state { font-weight: 700; }
.cell .cell-pending { color: var(--warn); }
.cell.st-pending .cell-pending { color: var(--idle); }
.cell .cell-now, .jc-stages .cell-now { display: inline-block; background: var(--accent); color: #fff; font-size: .65rem; font-weight: 700;
  border-radius: 3px; padding: 0 4px; margin-bottom: 2px; text-transform: uppercase; }
.chip-type { background: #e6edf7; color: var(--brand); margin-left: 4px; }
.matrix-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; padding: 8px 12px; color: var(--ink); }
.matrix-legend span { display: inline-flex; align-items: center; gap: 6px; }
.matrix-legend .sw { width: 16px; height: 12px; border-radius: 3px; border: 1px solid var(--line); background: var(--panel); }
.matrix-legend .sw.st-done { background: var(--ok-bg); border-color: var(--ok); }
.matrix-legend .sw.st-in_progress { background: var(--warn-bg); border-color: var(--warn); }
.matrix-legend .sw.st-none { background: var(--bg); }
.matrix-legend .sw.current { border: 2px solid var(--accent); }
.progress { height: 8px; background: var(--idle-bg); border-radius: 4px; overflow: hidden; min-width: 70px; }
.progress i { display: block; height: 100%; background: var(--brand-2); }

/* ------------------------------------------------------------------ forms */
.field { margin: 0 0 14px; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
.req { color: var(--bad); }
input[type=text], input[type=number], input[type=date], input[type=time], input[type=password], input[type=email],
input[type=tel], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 9px 10px; min-height: 40px; border: 1px solid #c8ced8; border-radius: 6px; font: inherit; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-2); outline-offset: -1px; border-color: var(--brand-2); }
.has-error input, .has-error select, .has-error textarea, .has-error .ts-control { border-color: var(--bad); background: #fffafa; }
/* Job card form: the Matching rule dropdown and the fields the picked rule has filled share the accent border */
.field.rule-picker input, .field.rule-picker select, .field.rule-picker .ts-wrapper .ts-control,
.field.rule-filled input:not([type=radio]):not([type=checkbox]), .field.rule-filled select,
.field.rule-filled .ts-wrapper .ts-control, .field.rule-filled.radios > label + div { border: 2px solid var(--accent); }
.field-highlight { background: #fff6e8; border: 2px solid var(--accent, #e08a1e); border-radius: 8px; padding: 10px 12px 0; margin: 0 0 14px; }
.field-highlight .field { margin-bottom: 10px; }
.field-error { color: var(--bad); font-size: .85rem; margin-top: 4px; font-weight: 600; }
.field input[readonly] { background: var(--bg); color: var(--muted); cursor: default; }  /* filled in by the form (e.g. No. of cylinders) */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 16px; }
.form-grid .wide { grid-column: 1 / -1; }
/* spec sections share one column grid, so fields line up from section to section and a short section stays compact */
.form-grid.cols { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
@media (min-width: 900px) { .form-grid.cols .span-2 { grid-column: span 2; } }
/* two fields side by side on a wide screen, stacked on a phone (job card: remarks | photos) */
@media (min-width: 900px) { .form-grid.notes-row { grid-template-columns: 1fr 1fr; } }
.form-grid.notes-row .field { grid-column: auto; }
.help, .helptext { display: block; color: var(--muted); font-size: .8rem; margin-top: 3px; font-weight: 400; }
.errorlist { color: var(--bad); margin: 4px 0; padding: 0; list-style: none; font-size: .85rem; }
.form-errors { background: var(--bad-bg); color: var(--bad); border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.form-section { border: 0; border-top: 1px solid var(--line); margin: 6px 0 0; padding: 14px 0 0; }
.form-section legend { font-weight: 700; color: var(--brand); padding: 0 8px 0 0; font-size: .95rem; margin-bottom: 8px; }
@media (min-width: 900px) { .form-grid .span-2 { grid-column: span 2; } }
/* two short fields always on one line (liner size | liner weight), also on a phone */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
label.check, .checks label { display: flex; gap: 8px; align-items: center; font-weight: 500; min-height: var(--touch); cursor: pointer; }
label.check input, .checks input { width: 20px; height: 20px; accent-color: var(--brand-2); }
.check-field { display: flex; flex-direction: column; justify-content: flex-end; }
.checks ul, ul.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0 18px; }
.checks > div { display: flex; flex-wrap: wrap; gap: 0 18px; }
/* Radio buttons (RadioSelect): one segmented control, as tall as an input; chosen = navy */
.radios > label + div { display: inline-flex; flex-wrap: wrap; border: 1px solid #c8ced8; border-radius: 6px; overflow: hidden; background: #fff; }
.radios > label + div > div { display: flex; }
.radios > label + div > div + div label { border-left: 1px solid #c8ced8; }
.radios > label + div label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 0 18px; min-height: 40px;
  font-weight: 500; cursor: pointer; transition: background .15s, color .15s; }
.radios > label + div label:hover { background: var(--idle-bg); }
.radios > label + div label:has(input:checked) { background: var(--brand); color: #fff; }
.radios > label + div input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.radios > label + div label:has(input:focus-visible) { outline: 2px solid var(--brand-2); outline-offset: -2px; }
.touch .radios > label + div label { min-height: var(--touch); }
.has-error .radios > label + div, .radios.has-error > label + div { border-color: var(--bad); }
.with-add { display: flex; gap: 6px; align-items: flex-start; }
.with-add > select, .with-add > .ts-wrapper { flex: 1; min-width: 0; }
.with-add .btn { min-height: 40px; }
.ts-wrapper .ts-control { min-height: 40px; border-color: #c8ced8; border-radius: 6px; font: inherit; }
.ts-dropdown { font: inherit; z-index: 60; }
.ts-dropdown .option { padding: 8px 10px; }
.ts-dropdown .ts-close { display: block; margin-left: auto; width: 40px; height: 32px; padding: 0; border: 0; background: none;
  font-size: 1.5rem; line-height: 1; color: var(--muted); cursor: pointer; }
.ts-dropdown .ts-close:hover { color: var(--ink); }
.touch .ts-dropdown .ts-close { width: 52px; height: 44px; }
.ts-wrapper.single.input-active.dropdown-active .ts-control > .item { display: none; }  /* only while the list is open, so a picked value shows straight away */
.ts-wrapper.single.has-items:not(.dropdown-active) .ts-control > input { position: absolute; width: 1px !important; min-width: 0 !important; opacity: 0; }  /* picked: keep the box one line high, the search box comes back when the list opens */

/* key/value spec */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: .92rem; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* tabs + history */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; color: var(--muted); border: 0; border-bottom: 3px solid transparent; background: none;
                        font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.tabs a.active, .tabs button.active { color: var(--brand); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--brand); }

/* Role permissions: module rows, one tick box column per action */
.perm-legend { margin: 0 0 14px; padding-left: 18px; }
.perm-table th:not(:first-child), .perm-table td:not(:first-child) { text-align: center; width: 92px; }
.perm-table input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--brand-2); cursor: pointer; vertical-align: middle; }
.perm-table input[type=checkbox]:disabled { cursor: not-allowed; opacity: .6; }
.perm-col { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
ul.changes { margin: 0; padding-left: 16px; }

/* ------------------------------------------------------------------ drawer, modal, confirm, toasts */
.overlay-backdrop { position: fixed; inset: 0; background: rgba(15,25,40,.45); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--panel); z-index: 55;
          box-shadow: -8px 0 24px rgba(15,25,40,.2); overflow-y: auto; padding: 18px 20px 28px; }
.drawer:has(.overlay-full) { width: 100vw; box-shadow: none; background: var(--bg); padding: 28px 24px 40px; }
/* full-screen drawer form (Product from the job card): a centred white card with room around the fields */
.overlay-full { max-width: 1240px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line);
                border-radius: 12px; box-shadow: 0 4px 18px rgba(15,25,40,.08); padding: 26px 32px 24px; }
.overlay-full > h2 { font-size: 1.35rem; margin: 0 44px 18px 0; padding-bottom: 14px; border-bottom: 2px solid var(--accent); }
.overlay-full .form-section { margin-top: 14px; padding-top: 18px; }
.overlay-full .form-section:first-of-type { border-top: 0; margin-top: 0; padding-top: 4px; }
.overlay-full .form-section legend { font-size: 1rem; margin-bottom: 12px; }
.overlay-full .form-grid { gap: 4px 20px; }
.overlay-full .form-actions { margin-top: 18px; padding-top: 18px; }
.drawer:has(.overlay-full) .drawer-close { top: 38px; right: max(36px, calc((100vw - 1240px) / 2 + 12px)); }
@media (max-width: 760px) {
  .drawer:has(.overlay-full) { padding: 12px 10px 24px; }
  .overlay-full { padding: 18px 16px; border-radius: 10px; }
  .drawer:has(.overlay-full) .drawer-close { top: 20px; right: 18px; }
}
.drawer-in { animation: slide-in .18s ease-out; }
.drawer-out { animation: slide-in .12s ease-in reverse; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-close { position: absolute; top: 10px; right: 10px; }
.drawer h2, .modal h2 { margin: 0 44px 14px 0; font-size: 1.25rem; }
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
/* the page behind a modal / drawer stays put; html only: overflow on body makes it the scroll container and un-sticks the sidebar and topbar */
html.overlay-open { overflow: hidden; }
.modal-box { position: relative; background: var(--panel); border-radius: 10px; width: min(560px, 100%); max-height: 90vh;
             overflow-y: auto; overscroll-behavior: contain; padding: 20px; box-shadow: 0 16px 40px rgba(15,25,40,.3); }
/* "Check the job card": order strip, variants, route tiles, spec cards in an even grid (orders/_jobcard_preview.html) */
/* production entry from the job card ("+ Entry"): compact, no help texts, so the whole form fits on a laptop screen
   (1366 x 768) without scrolling: a one-line job card strip, tight sections, the quantities and remarks on one row */
.modal-box:has(.entry-box) { width: min(1280px, 100%); max-height: 96vh; padding: 12px 18px 14px; }
.modal .entry-box > h2 { font-size: 1.1rem; margin-bottom: 8px; }
.modal .entry-box .help { display: none; }
.modal .entry-box .field { margin-bottom: 6px; }
.modal .entry-box label { font-size: .82rem; margin-bottom: 3px; }
.modal .entry-box input[type=text], .modal .entry-box input[type=number], .modal .entry-box input[type=date],
.modal .entry-box select, .modal .entry-box .ts-control { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.modal .entry-box .qty-big input { font-size: 1.05rem; }
.modal .entry-box .form-section { margin: 0; padding: 6px 0 0; }
.modal .entry-box .form-section legend { font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.modal .entry-box .jc-brief { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; margin-bottom: 6px; padding: 6px 12px; }
.modal .entry-box .jcb-head { order: 3; margin-left: auto; min-height: 0; }
.modal .entry-box .jcb-tag { display: none; }
.modal .entry-box .jcb-link { min-height: 30px; padding: 4px 10px; }
.modal .entry-box .jcb-title strong { font-size: 1.05rem; }
.modal .entry-box .jcb-facts { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.modal .entry-box .jc-brief dt { font-size: .7rem; }
.modal .entry-box .stage-info { margin-bottom: 6px; padding: 6px 12px; }
.modal .entry-box .si-value { font-size: 1.2rem; }
.modal .entry-box .entry-foot { margin-top: 4px; padding-top: 8px; }
.modal .entry-box .entry-foot label.check { min-height: 32px; }
.modal .entry-box .form-actions .btn-lg { min-height: 40px; padding: 8px 22px; font-size: 1rem; }
@media (min-width: 1100px) {
  .modal .entry-box .entry-grid-qty { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .modal .entry-box .entry-grid-qty .entry-remarks, .modal .entry-box .entry-grid-qty #wastage-reason[hidden] + .entry-remarks { grid-column: auto; }
}
.modal-box:has(.jc-preview) { width: min(1400px, 100%); max-height: 96vh; padding: 22px 28px 0; }
.jc-preview { display: flex; flex-direction: column; gap: 16px; font-size: 1rem; }
.jc-preview h2 { margin: 0 44px 2px 0; }
.jcp-head p { margin: 0; }
/* every block is the same card: a tinted title bar, then its content */
.jcp-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden;
            display: flex; flex-direction: column; min-width: 0; }
.jcp-card > h3 { margin: 0; padding: 9px 14px; display: flex; align-items: center; gap: 8px; background: #eef1f5;
                 border-bottom: 1px solid var(--line); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em;
                 color: var(--brand); }
.jcp-count { margin-left: auto; padding: 1px 9px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line);
             color: var(--muted); font-size: .78rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.jcp-empty { margin: 0; padding: 12px 14px; }
/* order: facts in equal columns, the total qty on the right */
.jcp-order { display: grid; grid-template-columns: minmax(0, 1fr) auto; border: 1px solid var(--line);
             border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--idle-bg); overflow: hidden; }
.jcp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 20px; margin: 0;
             padding: 14px 18px; }
.jcp-facts > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.jcp-facts dt { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.jcp-facts dd { margin: 0; font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.jcp-total { display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 2px;
             min-width: 190px; padding: 14px 20px; background: var(--brand); color: #fff; text-align: right; }
.jcp-total span { font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: #c9d6e8; }
.jcp-total strong { font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.jcp-total small { color: #c9d6e8; }
/* variants */
.jcp-table th { position: static; }
.jcp-table tbody tr:last-child td { border-bottom: 0; }
.jcp-table tfoot td { font-weight: 700; background: var(--idle-bg); border-top: 1px solid var(--line); border-bottom: 0; }
.jcp-table .jcp-no { width: 1%; color: var(--muted); text-align: center; }
/* route: equal tiles, in stage order */
.jcp-stages { list-style: none; margin: 0; padding: 12px 14px; display: grid; gap: 10px;
              grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.jcp-stages li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px;
                 align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius);
                 background: var(--panel); border-top: 3px solid var(--brand-2); }
.jcp-step { grid-row: span 3; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
            background: var(--idle-bg); color: var(--brand); font-weight: 700; font-size: .82rem; }
.jcp-stage { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.jcp-stage b { color: var(--brand); }
.jcp-stage span { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jcp-target { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.jcp-calc { grid-column: 2; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }  /* R2: qty x mm per bag */
/* the route, with the File Number's sample photo beside it */
.jcp-row { display: grid; gap: 14px; align-items: stretch; }
.jcp-row.with-sample { grid-template-columns: minmax(0, 1fr) 300px; }
.jcp-sample-img { flex: none; display: block; height: 180px; padding: 8px; background: var(--idle-bg);
                  border-bottom: 1px solid var(--line); }
.jcp-sample-img img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 6px; }
a.jcp-sample-img:hover img { opacity: .9; }
.jcp-noimg { display: grid; place-items: center; color: var(--muted); font-size: .9rem; }
/* spec: equal-width cards, the same height in a row; label left, value right, one line each */
.jcp-spec { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: stretch; }
.jcp-kv { margin: 0; padding: 4px 14px 8px; flex: 1; }
.jcp-card > .jcp-kv:not(:last-child) { flex: none; }  /* Notes: the thumbnails follow the rows */
.jcp-kv > div { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; align-items: baseline;
                padding: 7px 0; border-bottom: 1px dashed var(--line); }
.jcp-kv > div:last-child { border-bottom: 0; }
.jcp-kv dt { color: var(--muted); }
.jcp-kv dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.jcp-media { padding: 4px 14px 12px; }
.jcp-media-grid { display: grid; grid-template-columns: repeat(auto-fill, 84px); gap: 8px; }
.jcp-media-grid a { display: block; width: 84px; height: 84px; border: 1px solid var(--line); border-radius: 6px;
                    overflow: hidden; background: var(--idle-bg); position: relative; }
.jcp-media-grid img, .jcp-media-grid video { display: block; width: 100%; height: 100%; object-fit: cover; }
.jcp-media-grid .is-video::after { content: "\25B6"; position: absolute; inset: 0; display: grid; place-items: center;
                                   color: #fff; font-size: 1.3rem; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
/* Save / Back stay in view at the bottom of the modal while it scrolls */
.jc-preview .form-actions { position: sticky; bottom: 0; z-index: 1; margin: 0 -28px; padding: 12px 28px 16px;
                            background: var(--panel); box-shadow: 0 -6px 12px -8px rgba(15,25,40,.25); }
@media (max-width: 640px) {
  .modal-box:has(.jc-preview) { padding: 16px 16px 0; }
  .jcp-order { grid-template-columns: 1fr; }
  .jcp-row.with-sample { grid-template-columns: 1fr; }
  .jcp-total { align-items: flex-start; text-align: left; }
  .jc-preview .form-actions { margin: 0 -16px; padding: 12px 16px 16px; }
}
.modal .small-box { width: min(420px, 100%); text-align: center; }
.modal.confirm { background: rgba(15,25,40,.45); z-index: 80; }
.confirm-icon { color: var(--warn); }
.confirm-text { font-size: 1.05rem; margin: 8px 0 12px; }
.modal.confirm .form-actions { justify-content: center; border: 0; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 90; max-width: min(420px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 8px; background: var(--brand); color: #fff; box-shadow: 0 6px 20px rgba(15,25,40,.25);
         cursor: pointer; font-weight: 500; border-left: 5px solid var(--accent); }
.toast-success { background: #16603b; border-left-color: #7fd6a4; }
.toast-error { background: var(--bad); border-left-color: #ffb4ad; }
.toast-warning { background: var(--warn); }

.login-box { max-width: 380px; margin: 8vh auto; }

/* ------------------------------------------------------------------ shop floor: big touch targets */
.touch input, .touch select, .touch textarea, .touch .ts-control { min-height: 52px; font-size: 1.1rem; }
.touch label { font-size: .95rem; }
.touch .btn-lg { min-height: 56px; font-size: 1.15rem; padding: 14px 26px; }
.touch .form-grid { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
/* production entry form (shopfloor/_entry_form.html): job & stage, run, quantity; the picked stage's pending card */
.entry-sec { margin-top: 4px; }
.entry-sec legend .unit { font-weight: 600; }
@media (min-width: 900px) {
  .entry-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .entry-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .entry-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .entry-grid .entry-remarks { grid-column: span 2; }
  .entry-grid #wastage-reason[hidden] + .entry-remarks { grid-column: 1 / span 2; }
  .entry-grid-qty #wastage-reason[hidden] + .entry-remarks { grid-column: span 2; }
}
.stage-info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin: 0 0 14px; padding: 10px 14px;
  background: #fff6e8; border: 1px solid #f3d5a8; border-left: 4px solid var(--accent); border-radius: var(--radius); }
.si-main { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.si-label { color: var(--warn); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.si-value { font-size: 1.5rem; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.si-unit { color: var(--muted); font-weight: 600; }
.si-progress { flex: 1 1 220px; display: grid; gap: 4px; min-width: 0; }
.si-bar { height: 8px; background: rgba(0,0,0,.08); border-radius: 4px; overflow: hidden; }
.si-bar i { display: block; height: 100%; width: 0; background: var(--ok); }
.si-sub { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.qty-big input { font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.qty-main input { border-color: var(--brand-2); box-shadow: 0 0 0 1px var(--brand-2) inset; }
.qty-main label { color: var(--brand); }
/* worked out by the form (wastage, wastage %): looks like a read-only input */
.calc-value { display: flex; align-items: center; width: 100%; min-height: 40px; padding: 9px 10px; border: 1px solid #c8ced8;
  border-radius: 6px; background: var(--bg); font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.modal .entry-box .calc-value { min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: 1.05rem; }
.qty-calc input[readonly] { color: var(--ink); }
.entry-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.entry-foot > .field { margin: 0; }
.entry-foot .form-actions { margin: 0; padding: 0; border: 0; }
/* The picked job card's details at the top of the production entry form: read only, so tinted and plain text
   instead of boxes (nothing in it looks like a field) */
.jc-brief { background: var(--idle-bg); border: 1px solid var(--line); border-left: 4px solid var(--brand);
            border-radius: var(--radius); padding: 10px 14px 12px; margin: 0 0 18px; display: grid; gap: 8px;
            font-size: .93rem; }
.jcb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; }
.jcb-tag { color: var(--muted); font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.jcb-link { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; background: var(--panel); }
.touch .jcb-link { min-height: 36px; }
.jcb-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.jcb-title strong { font-size: 1.2rem; color: var(--brand); letter-spacing: .2px; }
.jcb-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 18px; margin: 0; }
.jcb-facts > div { display: flex; flex-direction: column; min-width: 0; }
.jc-brief dt { color: var(--muted); font-size: .76rem; }
.jc-brief dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ tablet: icon-only side menu */
@media (max-width: 1100px) {
  .sidebar { width: var(--sidebar-mini); }
  .brand-text, .nav-item span, .nav-group { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .brand { justify-content: center; padding: 0; }
  .shell.nav-open .sidebar { width: var(--sidebar); position: fixed; box-shadow: 8px 0 24px rgba(0,0,0,.25); }
  .shell.nav-open .brand-text, .shell.nav-open .nav-item span, .shell.nav-open .nav-group { display: initial; }
  .shell.nav-open .nav-item { justify-content: flex-start; padding: 0 12px; }
  .shell.nav-open .nav-scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(15,25,40,.35); }
  .topbar .menu-btn { display: grid; }
}

/* ------------------------------------------------------------------ phone: off-canvas side menu */
@media (max-width: 700px) {
  html { font-size: 16px; }
  main { padding: 12px; }
  .sidebar { position: fixed; left: 0; transform: translateX(-100%); transition: transform .18s; width: var(--sidebar); }
  .shell.nav-open .sidebar { transform: none; }
  .brand-text, .nav-item span, .nav-group { display: initial; }
  .nav-item { justify-content: flex-start; padding: 0 12px; }
  .user-name { display: none; }
  .btn-lg, .form-actions .btn { flex: 1 1 auto; justify-content: center; }
  .page-head .actions { width: 100%; }
  .kv { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------ photos / videos */
input[type=file][data-attach-preview] { width: 100%; min-height: var(--touch); padding: 10px; border: 2px dashed var(--line);
  border-radius: var(--radius); background: var(--bg); cursor: pointer; }
.attach-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.attach-preview .pick { width: 96px; font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; }
.attach-preview .pick img, .attach-preview .pick .vid { width: 96px; height: 72px; object-fit: cover; border-radius: 6px;
  background: var(--idle-bg); display: grid; place-items: center; }
.attach-preview .pick.too-big { color: var(--bad); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tile { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel);
  display: flex; flex-direction: column; }
/* Fixed square: the picture is out of the flow (absolute), so a tall photo can never stretch the tile. */
.tile-media { display: block; position: relative; width: 100%; aspect-ratio: 1 / 1; flex: none; min-height: 0; overflow: hidden; background: #10161f; }
.tile-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
video.tile-media { object-fit: contain; height: auto; }
.tile-file { display: grid; place-items: center; align-content: center; gap: 6px; color: #fff; text-align: center; padding: 8px; }
.tile figcaption { display: flex; flex-direction: column; flex: 1; }
.tile-remarks { border-top: 1px solid var(--line); background: var(--bg, #f6f8fa); padding: 6px 10px; height: 4.6em; overflow: hidden; }
.tile-remarks-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.tile-remarks-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tile-info { padding: 8px 10px; display: grid; gap: 3px; border-top: 1px solid var(--line); }
.tile figcaption .btn-link { padding: 0; min-height: 0; color: var(--bad); }
.att-count { color: var(--muted); white-space: nowrap; }
@media (max-width: 700px) { .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; } }

/* ------------------------------------------------------------------ print */
@media print {
  .sidebar, .topbar, .no-print, .toasts, .tabs, .toolbar, .pagination { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .panel { border: 0; padding: 0; }
  th { position: static; }
}

/* Product type form: stages in order */
/* a route as numbered steps (components/route_steps.html) */
.route-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 0; }
.route-steps li { display: flex; align-items: center; }
.route-step { display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border: 1px solid var(--line);
              border-radius: var(--radius); background: var(--panel); min-width: 150px; }
.route-no { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand);
            color: #fff; font-weight: 700; font-size: .85rem; flex: none; }
.route-step strong { display: block; color: var(--brand); line-height: 1.2; }
.route-step span.route-name { display: block; font-size: .85rem; color: var(--ink); white-space: nowrap; }
.route-unit { margin-left: auto; padding: 1px 7px; border-radius: 999px; background: var(--idle-bg); color: var(--muted);
              font-size: .75rem; font-weight: 600; }
.route-arrow { color: var(--accent); font-weight: 700; padding: 0 6px; }
.route-steps li:last-child .route-step { border-color: var(--accent); }
@media (max-width: 640px) { .route-steps { flex-direction: column; } .route-arrow { display: none; } .route-step { width: 100%; } }
.stage-order-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.stage-order-list li { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.stage-order-no { min-width: 1.6em; color: var(--muted, #667); text-align: right; }
.stage-order-actions { margin-left: auto; display: flex; }
.stage-order-add { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Features (masters.forms.FeatureChecks): tick boxes shown as chips; ticked = navy */
.feature-checks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.checks .feature-checks label.chip-check { min-height: 40px; padding: 0 14px 0 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); font-weight: 500; transition: background .15s, border-color .15s, color .15s; }
.checks .feature-checks label.chip-check:hover { border-color: var(--brand, #1f3a5f); }
.checks .feature-checks label.chip-check:has(input:checked) { background: var(--brand, #1f3a5f); border-color: var(--brand, #1f3a5f); color: #fff; }
.checks .feature-checks label.chip-check input { width: 18px; height: 18px; accent-color: var(--accent, #e08a1e); }
.feature-checks .feature-add { min-height: 40px; border-radius: 999px; border-style: dashed; }

/* job card list / dashboard grid: one table per product type */
.matrix-group { font-size: 1rem; margin: 18px 12px 8px; color: var(--brand); }
.matrix-group:first-child { margin-top: 6px; }

/* ------------------------------------------------------------------ variant rows (components/variant_rows.html) */
.rows-table th, .rows-table td { padding: 6px; vertical-align: top; }
.rows-table tbody tr:hover { background: none; }
.rows-table input, .rows-table textarea { width: 100%; min-width: 70px; }
.rows-table td.name { width: 30%; }
.rows-table td.name input { min-width: 160px; }
.rows-table td.description { width: 50%; }
.rows-table td.description textarea { min-width: 220px; resize: vertical; }
.rows-table td.row-remove { width: 1%; }
.rows-table tfoot td { text-align: right; }
.variant-rows [data-rows-add] { margin-top: 8px; }

/* variants on the job card page: one card per variant (name and description) */
.variant-list { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.variant-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.vc-desc { margin: 4px 0 0; }

/* job card page (orders/jobcard_detail.html): summary tiles, stages, the form's sections */
.jc-kpis .kpi:hover { border-color: var(--line); }
.kpi .kpi-text { font-size: 1.2rem; line-height: 1.35; overflow-wrap: anywhere; padding: 5px 0 3px; }
.kpi .progress { margin: 6px 0 4px; }
.jc-stages tr.is-current td { background: #fff6e8; }
.jc-stages tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.jc-stages tr.is-skipped td { color: #a0a7b2; }
.jc-stages .cell-now { margin: 0 0 0 4px; vertical-align: middle; }
.jc-spec { display: grid; grid-template-columns: minmax(0, 1fr); padding: 0; overflow: hidden; }
.jc-spec .spec-sec { padding: 14px 16px 16px; border-top: 1px solid var(--line); min-width: 0; }
.jc-spec .spec-sec:first-child { border-top: 0; }
.jc-spec .spec-sec > h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: var(--brand);
  margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.jc-spec .spec-sec > h2::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--accent); }
.spec-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px 18px; margin: 0; }
.spec-fields > div { min-width: 0; }
.spec-fields dt { color: var(--muted); font-size: .76rem; margin-bottom: 2px; }
.spec-fields dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.spec-fields dd a { font-weight: 600; }
.spec-fields .spec-sub { display: block; font-weight: 400; margin-top: 1px; }
.spec-fields .spec-full { grid-column: 1 / -1; }
.spec-fields .spec-full dd { font-weight: 500; }
@media (min-width: 900px) {
  .jc-spec { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .jc-spec .spec-wide { grid-column: 1 / -1; }
  .jc-spec .spec-sec:nth-child(3) { border-left: 1px solid var(--line); }  /* Printing, beside Bag Structure */
}
.feature-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.feature-chips .chip { margin: 0; font-size: .85rem; padding: 4px 10px; }

/* full-size photo viewer (opened from a gallery tile) */
.lightbox { position: fixed; inset: 0; z-index: 1000; background: rgba(8,12,18,.92); display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-close { position: fixed; top: 12px; right: 16px; color: #fff; background: rgba(255,255,255,.15); border: 0; border-radius: 999px;
  width: 40px; height: 40px; font-size: 1.5rem; line-height: 1; cursor: pointer; }

/* password eye toggle */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 42px; }
.pw-eye { position: absolute; right: 2px; top: 0; bottom: 0; width: 40px; border: 0; background: none; color: #667085; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pw-eye:hover { color: var(--brand-2); }
.pw-eye .pw-slash { display: none; }
.pw-eye.on .pw-slash { display: inline; }

/* Job Traceability (orders/jobcard_trace.html): one block per stage, its status colour down the left edge */
.trace-step { border-left: 5px solid var(--idle); }
.trace-step.trace-done { border-left-color: var(--ok); }
.trace-step.trace-in_progress { border-left-color: var(--warn); }
.trace-step.trace-skipped { border-left-style: dashed; opacity: .75; }
.trace-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.trace-head h2 { margin: 0; }
.trace-title { flex: 1; min-width: 160px; }
.trace-nums { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 0 0 12px;
              background: var(--bg); border-radius: var(--radius); padding: 10px 12px; }
.trace-nums dt { color: var(--muted); font-size: .8rem; }
.trace-nums dd { margin: 0; font-variant-numeric: tabular-nums; }
.trace-empty { margin: 0; }
