:root {
  /* Workfashion brand (workfashion.com): yellow #f1b828 on dark #1a1c24, neutral grays only (user rule 2026-11-06: no blue shades) */
  --bg: #f3f4f6; --card: #fff; --border: #dee2e6; --text: #1a1c24; --muted: #6c757d; --dark: #343a40;
  --accent: #f1b828; --accent-dark: #d9a21c; --accent-soft: #fdf3d2; --accent-ink: #1a1c24; --accent-text: #8a6300;
  --ok: #1f7a4d; --ok-soft: #e6f4ec; --warn: #a35a00; --warn-soft: #fbe9d3; --err: #b42318; --err-soft: #fde8e6;
  /* numbers, codes and dates: the same Inter with tabular figures (its zero is a plain oval; JetBrains Mono drew a dotted zero that read like an 8 - user 2026-11-07) */
  --mono: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 13.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01", "tnum"; }
h1, h2, h3 { letter-spacing: -0.01em; }
body { display: flex; flex-direction: column; min-height: 100vh; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.error { color: var(--err); background: var(--err-soft); padding: 8px 10px; border-radius: 7px; font-size: 13px; }
.notice { color: var(--ok); background: var(--ok-soft); padding: 8px 10px; border-radius: 7px; font-size: 13px; }

/* login */
.login-body { align-items: center; justify-content: center; padding: 16px; }
.login-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 28px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 10px; }
.login-card .brand { margin-bottom: 8px; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 24px; background: var(--card); border-top: 3px solid var(--accent); border-bottom: 1px solid var(--border); flex-wrap: wrap; box-shadow: var(--shadow); position: relative; z-index: 2; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { margin: 0; font-size: 16px; font-weight: 650; }
.brand small { color: var(--muted); font-size: 12px; }
.logo-img { height: 34px; width: auto; flex-shrink: 0; }
.login-card .logo-img { height: 44px; }
.logo { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 700; flex-shrink: 0; }
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 10px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; transition: background .12s, color .12s; }
.tabs button:hover { color: var(--text); }
.subtabs { margin: 0 0 12px; background: var(--card); border: 1px solid var(--border); }
.subtabs button { font-size: 13px; }
.tabs button.active { background: var(--card); color: var(--accent-text); box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 600; }
.userbox { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }

/* layout */
main { flex: 1; padding: 18px 24px 32px; }
.tab { display: none; }
.tab.active { display: block; }
.layout { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; }
.layout > * { min-width: 0; }
.layout.single { grid-template-columns: minmax(0, 1fr); }
.layout.settings { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 12px; font-size: 15px; font-weight: 650; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h3 { margin: 16px 0 6px; font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } }

/* forms */
label { display: block; margin-bottom: 10px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
label > input, label > select, label > textarea, .row > input, .row > select {
  display: block; width: 100%; margin-top: 4px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; font: inherit; color: var(--text); background: #fff;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { min-height: 120px; font-family: var(--mono); font-size: 12.5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.row { display: flex; gap: 6px; margin-top: 4px; align-items: center; flex-wrap: wrap; }
.row > input, .row > select { margin-top: 0; width: auto; flex: 1; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
button { font: inherit; font-weight: 500; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; transition: border-color .12s, background .12s; }
button:hover { border-color: var(--accent); background: #f8f9fa; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover { background: var(--accent-dark); }
button.danger { color: var(--err); border-color: var(--err); }
button.small { padding: 3px 8px; font-size: 12px; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.sortable.sorted::after { content: " ▲"; font-size: 9px; }
th.sortable.sorted[data-dir="desc"]::after { content: " ▼"; }
.small-text { font-size: 11px; margin-top: 3px; }
button.toggle.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }

/* tables */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; background: #f8f9fa; position: sticky; top: 0; z-index: 1; }
td { font-size: 13px; }
tbody tr:hover td { background: #f8f9fa; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: var(--accent-soft); }
tr.selected { background: var(--accent-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow: auto; max-height: 70vh; }

/* badges */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; background: var(--bg); color: var(--muted); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.info { background: var(--accent-soft); color: var(--accent-text); }
.badge.info.cur { outline: 2px solid var(--accent); }
.problems { margin: 6px 0; padding: 0; list-style: none; font-size: 12.5px; }
.problems li { padding: 3px 8px; border-radius: 6px; margin-bottom: 3px; }
.problems li.error { background: var(--err-soft); color: var(--err); }
.problems li.warn { background: var(--warn-soft); color: var(--warn); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; align-items: center; }
.filters select, .filters input { padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; font: inherit; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
pre.sql { background: #1a1c24; color: #dee2e6; padding: 12px; border-radius: 8px; overflow: auto; max-height: 50vh; font-size: 12px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal { background: var(--card); border-radius: 12px; padding: 18px; width: 100%; max-width: 900px; max-height: 90vh; overflow: auto; }
.stat { display: inline-block; margin-right: 14px; }
.stat b { font-size: 18px; }

/* production plan dashboard */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.kpi { background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.kpi b { display: block; font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi span { color: var(--muted); font-size: 12px; }
.kpi.late b { color: var(--err); }
.kpi.warn b { color: var(--warn); }
.bars { display: grid; gap: 6px; }
.bar { display: grid; grid-template-columns: 110px 1fr 70px; align-items: center; gap: 8px; font-size: 12.5px; }
.bar .track { height: 14px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.bar .fill { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.bar .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
tr.closed td { color: var(--err); }
#mn-table td { white-space: nowrap; } #mn-table td:nth-child(5) { white-space: normal; }
tr.planned td { color: var(--ok); }
.late-date { color: var(--err); font-weight: 600; }
td.date, #pl-table td.mono, #av-orders td.mono { white-space: nowrap; }
.money { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* plan list: all columns fit the screen, no side scroll */
.pl-wrap { overflow-x: hidden; }
#pl-table { table-layout: fixed; font-size: 12.5px; }
#pl-table td { font-size: 12.5px; padding: 5px 6px; overflow-wrap: anywhere; }
#pl-table th { padding: 6px 6px; font-size: 10.5px; letter-spacing: .04em; white-space: normal; }
#pl-table td.mono, #pl-table td.date { font-family: var(--mono); font-size: 12px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
#pl-table td.date, #pl-table td.num { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pl-table tr.pl-series td, #pl-table tr.pl-group td, #pl-table tr.pl-detail td { overflow-wrap: normal; }
#pl-table .pl-detail .pl-mat { white-space: normal; }
/* warehouse semaphore */
#wh-table { table-layout: fixed; font-size: 14px; }
#wh-table td { font-size: 14px; padding: 5px 8px; overflow-wrap: anywhere; }
.wh-wrap { overflow-x: hidden; }
tr.wh-section td { font-weight: 700; font-size: 15px; letter-spacing: .04em; padding: 12px 10px 8px; border-top: 14px solid var(--card); }
tr.wh-section.green td { color: var(--ok); background: var(--ok-soft); }
tr.wh-section.wait td { color: var(--err); background: var(--err-soft); }
tr.wh-plan-row td { background: var(--accent); color: var(--accent-ink); padding: 8px 10px; border-top: 10px solid var(--card); font-size: 14px; }
tr.wh-plan-row td .muted { color: var(--accent-text); }
tr.wh-order-row td { background: #eceef0; border-top: 2px solid #d6d8db; }
tr.wh-line td { border-left: 0; }
tr.wh-line .dot, .wh-legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; position: relative; top: 1px; }
tr.wh-line.green td { color: var(--ok); } tr.wh-line.green .dot, .dot.green { background: var(--ok); }
tr.wh-line.yellow td { color: var(--warn); } tr.wh-line.yellow .dot, .dot.yellow { background: var(--warn); }
tr.wh-line.red td { color: var(--err); } tr.wh-line.red .dot, .dot.red { background: var(--err); }
tr.wh-line td.num { font-weight: 600; font-variant-numeric: tabular-nums; }
tr.wh-line td.wh-docs { font-size: 12px; color: var(--muted); }
.wh-legend { margin: 0 10px 0 4px; white-space: nowrap; }
#tab-warehouse:fullscreen, #tab-missing:fullscreen { background: var(--card); overflow: auto; padding: 24px; }
#tab-warehouse:fullscreen table, #tab-warehouse:fullscreen td, #tab-missing:fullscreen table, #tab-missing:fullscreen td { font-size: 18px; }
#tab-warehouse:fullscreen .wh-wrap, #tab-missing:fullscreen .wh-wrap { max-height: none !important; }
#ms-table { table-layout: fixed; font-size: 14px; }
#ms-table td { font-size: 14px; padding: 5px 8px; overflow-wrap: anywhere; }
#se-table tr.se-first td { border-top: 2px solid #d6d8db; }
.pl-legend { font-size: 12px; margin: -4px 0 8px; display: flex; gap: 18px; flex-wrap: wrap; }
.tone-closed { color: var(--err); } .tone-planned { color: var(--ok); } .tone-black { color: var(--text); }

.order-chip { border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; background: #fff; display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.order-chip.blocked { opacity: .6; border-style: dashed; }
.order-chip.closed { opacity: .55; filter: grayscale(1); }
.dl-bar { height: 4px; background: #dee2e6; border-radius: 2px; overflow: hidden; margin: 4px 0 2px; }
.dl-bar div { height: 100%; background: var(--ok); }

/* full-page planning board with a side drawer */
#tab-board.active { display: flex; flex-direction: column; height: calc(100vh - 70px); }
.board-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 6px 0 8px; }
.board-bar select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; font: inherit; }
.board-tools { margin-left: auto; display: flex; gap: 6px; }
.board-tools button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.board-body { flex: 1; display: flex; min-height: 0; gap: 12px; }
.board-chart { flex: 1; overflow: auto; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 8px; }
.drawer { width: 440px; flex-shrink: 0; overflow: auto; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.drawer-panel { display: none; }
.drawer-panel.active { display: block; }
.order-chip.selected { outline: 2px solid var(--accent); }
.ctx-menu { position: fixed; z-index: 20; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.14); padding: 6px; min-width: 240px; font-size: 13px; }
.ctx-menu button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 7px; }
.ctx-menu button:hover { background: var(--accent-soft); }
.ctx-menu .ctx-title { font-weight: 600; padding: 4px 10px 6px; color: var(--muted); font-size: 12px; }

.board-one { margin-bottom: 10px; }
.board-one-title { padding: 2px 6px 4px; font-size: 13px; }

#bd-chart g[data-order]:hover rect[data-handle] { fill-opacity: .45; }
#bd-chart rect.insert-target { stroke: #1a1c24 !important; stroke-width: 3 !important; stroke-dasharray: 5 3; }
.board-svg { overflow-x: auto; overflow-y: hidden; }

.smv-bar { position: relative; height: 8px; background: #eceef0; border-radius: 4px; margin: 4px 0 2px; overflow: hidden; }
.smv-bar > div { height: 100%; border-radius: 4px; }
.smv-bar > span { position: absolute; right: 3px; top: -3px; font-size: 10px; color: #b42318; font-weight: 600; }

.env-banner { background: var(--warn-soft); color: var(--warn); border: 1px solid #e3bc8b; border-radius: 8px; padding: 6px 12px; margin-bottom: 10px; font-weight: 600; text-align: center; }
/* "view as user" (test environment): dark strip so the administrator never forgets whose eyes these are */
.view-as-banner { background: var(--dark); color: #fff; border-radius: 8px; padding: 6px 12px; margin-bottom: 10px; text-align: center; }
.view-as-banner button { margin-left: 10px; }
body.env-test .topbar { border-top: 4px solid #d0903d; }

tr.pl-series td { background: var(--accent); color: var(--accent-ink); font-size: 12.5px; padding-top: 8px; padding-bottom: 8px; border-top: 8px solid #fff; }
tr.pl-series td .muted { color: var(--accent-text); }
tr.pl-series td.num { color: var(--accent-ink); font-variant-numeric: tabular-nums; }
tr.pl-group td.num { font-variant-numeric: tabular-nums; }
tr.pl-group td { background: #eceef0; border-top: 2px solid #d6d8db; }
tr.pl-spacer td { height: 14px; padding: 0; border-bottom: none; background: var(--card); }
#pl-table.no-eb .col-eb { display: none; }
/* filter row under the plan list header: one field per column, sticky under the header */
#pl-table tr.pl-filters th { padding: 3px 3px 5px; }
#pl-table tr.pl-filters input { width: 100%; box-sizing: border-box; padding: 3px 5px; font: inherit; font-size: 12px; text-transform: none; letter-spacing: 0; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
#pl-table tr.pl-filters input.active { border-color: var(--accent); background: var(--accent-soft); }
#pl-table tr.pl-filters input::placeholder { color: #adb5bd; }
tr.pl-row.open td { background: var(--accent-soft); }
tr.pl-detail td { background: #e9ebee; border-top: none; padding: 10px 12px 12px; }
tr.pl-detail .pl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); grid-auto-flow: dense; gap: 10px 12px; align-items: start; }
/* the drill-down sections are cards; neutral grey shades plus the brand yellow for the dates (deadlines) and the notes */
.pl-sec { min-width: 0; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px 11px; box-shadow: var(--shadow); }
.pl-sec h4 { margin: 0 0 6px; padding-bottom: 5px; border-bottom: 1px solid rgba(26, 28, 36, .08); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pl-sec.order { background: #fff; }
.pl-sec.qty { background: #f8f9fa; }
.pl-sec.dates { background: #fdf7e3; border-color: #f0e3b4; }
.pl-sec.dates h4 { color: var(--accent-text); border-bottom-color: rgba(138, 99, 0, .15); }
.pl-sec.prices { background: #f3f4f6; }
.pl-sec.invoices { background: #eef0f2; }
.pl-sec.materials { background: #f8f9fa; }
.pl-sec.notes { background: #fffcf0; }
/* one invoice per line: number, date, invoiced quantity; the foot sums them against the ordered quantity */
.pl-inv { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#pl-table .pl-inv th, #pl-table .pl-inv td { padding: 3px 6px; border-bottom: 1px solid rgba(26, 28, 36, .08); background: transparent; font-size: 12px; }
.pl-inv th { position: static; text-transform: none; letter-spacing: 0; font-size: 11px; }
.pl-inv tbody tr:hover td { background: rgba(26, 28, 36, .04); }
#pl-table .pl-inv tfoot td { border-bottom: none; padding-top: 5px; }
.pl-inv td.num { font-variant-numeric: tabular-nums; }
.pl-sec .kv { font-size: 12.5px; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); }
.pl-sec .kv dt { max-width: 150px; }
.pl-sec .kv dd.nw { white-space: nowrap; }
.pl-sec .kv dd button.small { margin-top: 4px; }
.pl-sec.wide { grid-column: 1 / -1; }
.pl-sec.wide .kv { grid-template-columns: max-content minmax(0, 1fr); }
.pl-mat { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-mat + .pl-mat { margin-top: 2px; }

/* Personnel: 12-month calendar, colour-coded by absence kind */
.hr-cal { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px) { .hr-cal { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .hr-cal { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hr-cal .mo { border: 1px solid var(--border); border-radius: 10px; padding: 8px; }
.hr-cal .mo h4 { margin: 0 0 6px; font-size: 12.5px; font-weight: 650; }
.hr-cal .wk { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.hr-cal .wk span { font-size: 10px; color: var(--muted); text-align: center; }
.hr-cal .dd { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 11px; border-radius: 5px; background: #fff; border: 1px solid transparent; position: relative; }
.hr-cal .dd.we { background: var(--bg); color: var(--muted); }
.hr-cal .dd.hol { background: #eceef0; color: var(--muted); font-weight: 600; }
.hr-cal .dd.coll { background: #f7d47e; color: var(--accent-ink); }
.hr-cal .dd.leave { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.hr-cal .dd.sick { background: #d0903d; color: #fff; font-weight: 600; }
.hr-cal .dd.unpaid { background: #6c757d; color: #fff; }
.hr-cal .dd.other { background: #adb5bd; color: #1a1c24; }
.hr-cal .dd.pending { background: var(--accent-soft); border: 1px dashed var(--accent-dark); color: var(--accent-text); }
.hr-cal .dd.reported { background: #fbe9d3; border: 1px dashed #d0903d; color: #a35a00; }
.hr-cal .dd.today { outline: 2px solid var(--text); outline-offset: -2px; }
.hr-cal .dd.ot::after { content: ""; position: absolute; right: 2px; bottom: 2px; width: 5px; height: 5px; border-radius: 50%; background: #1a1c24; }
.hr-cal .dd.ot.sick::after, .hr-cal .dd.ot.unpaid::after { background: #fff; }
.hr-legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 0; font-size: 12px; color: var(--muted); }
.hr-legend span i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; border: 1px solid transparent; }

/* notifications */
.notif-btn { position: relative; }
.notif-btn #notif-count { position: absolute; top: -6px; right: -6px; background: var(--err); color: #fff; border-radius: 10px; font-size: 10px; padding: 1px 5px; font-weight: 700; }
.notif-panel { position: absolute; right: 24px; top: 58px; width: 380px; max-width: calc(100vw - 24px); max-height: 70vh; overflow: auto; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14); z-index: 20; }
.notif-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--card); }
.notif-head b { flex: 1; }
.notif-item { padding: 10px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:hover { background: var(--accent-soft); }
.notif-item.unread { border-left: 3px solid var(--accent); }
.notif-title { font-weight: 600; }
.notif-body { font-size: 12.5px; color: var(--text); }
.notif-toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 30; max-width: 360px; }
.notif-toast { background: var(--text); color: #fff; border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.25); cursor: pointer; font-size: 13px; }
.notif-toast b { display: block; margin-bottom: 2px; }

/* phones: one column, scrollable menus, bigger touch targets, no zoom on inputs */
@media (max-width: 700px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .brand small { display: none; }
  .brand h1 { font-size: 14px; }
  .logo-img { height: 26px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { white-space: nowrap; padding: 8px 12px; }
  .userbox { width: 100%; justify-content: space-between; }
  main { padding: 10px 12px 24px; }
  .card { padding: 12px 12px; border-radius: 10px; }
  .grid2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi b { font-size: 20px; }
  label > input, label > select, label > textarea, .row > input, .row > select, .filters select, .filters input { font-size: 16px; padding: 9px 10px; }
  button, button.small { min-height: 36px; }
  .filters { gap: 6px; }
  .filters select, .filters input { flex: 1 1 45%; }
  .modal { padding: 12px; max-height: 96vh; border-radius: 10px; }
  .modal-bg { padding: 6px; align-items: flex-start; }
  .table-wrap { max-height: none; }
  table { font-size: 12px; }
  th, td { padding: 6px 6px; }
  .notif-panel { right: 8px; left: 8px; top: 52px; width: auto; }
  .notif-toasts { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .hr-cal { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hr-cal .mo { padding: 6px; }
  .hr-cal .dd { font-size: 10px; }
  .row { flex-wrap: wrap; }
  .row > input, .row > select { min-width: 45%; }
}
@media (max-width: 420px) {
  .hr-cal { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
}
/* the order card (buttons, parts, description) and the invoice table (number · date · quantity) take two grid columns;
   the grid packs densely so the smaller cards fill the row. One column each on narrow screens. */
@media (min-width: 900px) { .pl-sec.order, .pl-sec.invoices:has(.pl-inv) { grid-column: span 2; } }
.pl-inv td.mono, .pl-inv td.date { white-space: nowrap; }
