/* Print Your Brand ERP — Nehir layout and design language (warm paper, Baloo headings, mono labels, 12-column blocks)
   with two looks: data-look="glass" (default, frosted surfaces over a soft aurora) and data-look="flat" (Nehir, calm).
   Loaded after app.css: the legacy variable names used by every screen are mapped onto the Nehir tokens below. */

.nx-side { --fg: var(--side-fg); --fg-2: var(--side-fg-2); --fg-3: var(--side-fg-3); --surface-2: var(--side-hover); --border: var(--side-line); --accent-text: var(--side-active); }
.nx-top { --fg: var(--top-fg); --fg-2: var(--top-fg-2); --fg-3: var(--top-fg-3); --surface-2: var(--top-hover); --border: var(--top-line); --accent-text: var(--top-active); }
:is(.nx-top, .nx-side) :is(.nx-pop, .ac-list) { --fg: var(--page-fg); --fg-2: var(--page-fg-2); --fg-3: var(--page-fg-3); --surface-2: var(--page-surface-2);
  --border: var(--page-border); --accent-text: var(--page-accent-text); }
:root[data-top-dark="1"] .nx-logo img { background: rgba(255,255,255,.92); border-radius: 8px; padding: 4px 6px; }


/* ---------- top bar ---------- */
.nx-top { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: grid; grid-template-columns: var(--side-w) auto minmax(180px, 440px) 1fr auto auto;
  align-items: center; gap: 18px; padding-right: 18px; background: var(--top-bg); color: var(--fg); border-bottom: 1px solid var(--border); }
.nx-brand { height: var(--top-h); display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-right: 1px solid var(--border); min-width: 0; }
.nx-logo img { display: block; height: 46px; width: auto; max-width: 180px; object-fit: contain; }
:root[data-theme="dark"] .nx-logo img { background: rgba(255,255,255,.92); border-radius: 8px; padding: 4px 6px; }
.nx-burger { display: none; }
.nx-co-menu.from-burger { position: fixed; right: auto; z-index: 90; }
body:has(.nx-co-menu.from-burger:not([hidden])) .nx-top { z-index: 95; }
.tf { display: flex; flex-direction: column; gap: 10px; } .tf-l { display: flex; flex-direction: column; gap: 4px; font-size: 13px; } .tf-qr { align-self: center; padding: 8px; border-radius: 10px; background: #fff; image-rendering: pixelated; max-width: 100%; } .tf-key { font-size: 13px; overflow-wrap: anywhere; user-select: all; } .tf-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; margin: 0; padding: 10px; list-style: none; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.page-export { flex: none; align-self: flex-start; margin-left: auto; }
.stm-box { margin-top: 14px; } .stm-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; } .stm-tools input { width: auto; } .stm-sum td { background: var(--surface-2); } .stm-d { display: block; font-size: 11px; color: var(--fg-3); }
.cari-sum table.lines th:last-child, .cari-sum table.lines td:last-child { padding-left: 22px; white-space: nowrap; }
.st-late { background: rgba(185, 28, 28, .12); color: #b91c1c; }
.pk-list { display: grid; gap: 10px; } .pk-row { display: grid; grid-template-columns: minmax(180px, 2fr) repeat(2, minmax(80px, 1fr)) 100px minmax(80px, 1fr) minmax(120px, 1.4fr); align-items: end; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); } .pk-row:last-child { border-bottom: 0; } .pk-row label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--fg-3); } .pk-row input { width: 100%; font: inherit; font-size: 13px; padding: 6px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--fg); } .pk-name { font-size: 13px; } .pk-name small { display: block; font-size: 11px; } .pk-total { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--fg-3); } .pk-total b { font-size: 14px; color: var(--fg); padding: 6px 0; }
@media (max-width: 1100px) { .pk-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pk-name, .pk-note { grid-column: 1 / -1; } }
.login-link { align-self: center; padding: 4px; border: 0; background: none; color: var(--accent-text); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.nx-back { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--fg-2); font-size: 13px; font-weight: 600; }
.nx-back svg { width: 16px; height: 16px; }
.nx-back:hover { background: var(--surface-2); color: var(--fg); }
.nx-back[hidden] { display: none; }
.nx-search { position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: var(--radius); background: var(--surface-2);
  border: 1px solid transparent; color: var(--fg-3); min-width: 0; grid-column: 3; }
.nx-search:focus-within { border-color: var(--border-strong); background: var(--surface); }
.nx-search .ic { width: 15px; height: 15px; }
.nx-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 13px; color: var(--fg); }
.nx-search input::-webkit-search-cancel-button { display: none; }
.nx-search kbd { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); background: var(--bg); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border); }
.nx-search .ac-list { top: calc(100% + 6px); min-width: 360px; }
.nx-clock { grid-column: 5; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 3px; height: 50px; padding: 0 16px;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border); min-width: 150px; }
.nx-clock .t { font-family: var(--font-mono); font-size: 16px; font-weight: 500; line-height: 1; }
.nx-clock .d { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); line-height: 1; white-space: nowrap; }
.nx-actions { grid-column: 6; display: flex; align-items: center; gap: 6px; position: relative; }
.nx-adm { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius-sm); font-size: 12px; color: var(--fg-2);
  font-family: var(--font-mono); border: 1px solid var(--border); }
.nx-adm .ic { width: 14px; height: 14px; color: var(--accent-text); }
.nx-adm:hover { background: var(--surface-2); }
.nx-lang { height: 34px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--fg); font: inherit; font-size: 12px; padding: 0 6px; }
.icon-btn { width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center; position: relative; background: transparent;
  border: 1px solid transparent; color: var(--fg-2); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--fg); transform: none; }
.icon-btn .ic { width: 17px; height: 17px; }
.icon-btn .badge-dot { position: absolute; top: 7px; right: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); border: 1.5px solid var(--surface); }
.user-chip { width: 34px; height: 34px; border-radius: 50%; background: var(--fg); color: var(--bg); font-weight: 700; font-size: 12px; margin-left: 4px; }
.nx-user { position: relative; }
.nx-pop { position: absolute; z-index: 60; background: var(--overlay); color: var(--fg); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.nx-menu { right: 0; top: calc(100% + 8px); width: 240px; padding: 6px; display: flex; flex-direction: column; }
.nx-menu .who { padding: 10px 10px 8px; display: flex; flex-direction: column; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.nx-menu .who span { color: var(--fg-3); font-size: 12px; }
.nx-menu a, .nx-menu button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; color: var(--fg-2); text-align: left; }
.nx-menu a:hover, .nx-menu button:hover { background: var(--surface-2); color: var(--fg); }
.nx-menu .ic { width: 16px; height: 16px; }
.nx-notes { right: 44px; top: calc(100% + 8px); width: 340px; max-height: 420px; overflow: auto; padding: 10px; }
.nx-notes h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); padding: 4px 6px 8px; }
.nx-notes a { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; padding: 8px; border-radius: var(--radius-sm); font-size: 13px; }
.nx-notes a small { grid-column: 1 / -1; color: var(--fg-3); font-size: 11px; font-family: var(--font-mono); }
.nx-notes a:hover { background: var(--surface-2); }

/* ---------- body: sidebar + content ---------- */
.nx-body { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - var(--top-h)); }
.nx-side { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; display: flex; flex-direction: column; gap: 2px;
  padding: 18px 12px 12px; background: var(--side-bg); color: var(--fg); border-right: 1px solid var(--border); scrollbar-width: thin; }
.nx-nav { display: flex; flex-direction: column; gap: 2px; }
.nx-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px; border-radius: var(--radius-sm); color: var(--fg-2);
  font-size: 13.5px; font-weight: 500; text-align: left; transition: background .12s, color .12s; }
.nx-item .ic { width: 17px; height: 17px; color: var(--fg-3); flex: none; }
.nx-item:hover { background: var(--surface-2); color: var(--fg); }
.nx-item.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.nx-item.active .ic { color: var(--accent-text); }
.nx-badge { margin-left: auto; font-style: normal; font-family: var(--font-mono); font-size: 11px; padding: 1px 7px; border-radius: 20px; background: var(--surface-2); color: var(--fg-2); }
.nx-item.active .nx-badge { background: var(--accent); color: var(--accent-fg); }
.nx-badge[hidden] { display: none; }
.nx-look { margin-top: auto; }
.nx-foot { display: flex; justify-content: space-between; padding: 12px 10px 2px; margin-top: 6px; border-top: 1px solid var(--border); font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }
.nx-foot .live { color: var(--ok); }
.nx-content { padding: 26px 32px 64px; min-width: 0; max-width: 1560px; width: 100%; }
.nx-scrim-side { display: none; }

/* ---------- page head + module tabs ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-family: var(--font-serif); font-weight: 500; font-size: 36px; letter-spacing: -.4px; line-height: 1.08; color: var(--fg); }
.page-head h1 em { font-style: normal; color: var(--accent-text); }
.page-sub { margin-top: 5px; color: var(--fg-3); font-size: 12.5px; font-family: var(--font-mono); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mod-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: -4px 0 18px; padding: 4px; border-radius: var(--radius); background: var(--surface-2); width: fit-content; max-width: 100%; }
.mod-tabs[hidden] { display: none; }
.mod-tabs a { padding: 7px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; color: var(--fg-2); white-space: nowrap; }
.mod-tabs a:hover { color: var(--fg); background: var(--surface); }
.mod-tabs a.on { background: var(--surface-3); color: var(--fg); box-shadow: var(--shadow-sm), inset 0 -2px 0 var(--accent); }
:root:not([data-look="glass"]) .mod-tabs a.on { background: var(--surface); }
.page { gap: 16px; }

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  background: var(--surface); color: var(--fg); border: 1px solid var(--border-strong); box-shadow: none; white-space: nowrap; transition: background .12s, opacity .12s; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); box-shadow: none; }
.btn.primary:hover { opacity: .92; background: var(--accent); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn .ic { width: 15px; height: 15px; }
.seg { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; }
.seg button { border-radius: calc(var(--radius-sm) - 2px); font-family: var(--font-mono); font-size: 11.5px; }
.seg button.on { background: var(--accent); color: var(--accent-fg); }
.fld label, .lines-edit th { font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; color: var(--fg-3); }
.fld input, .fld select, .fld textarea, .lines-edit input, .lines-edit select, .pr input, .modal input:not([type=checkbox]):not([type=range]):not([type=color]), .card-pad input:not([type=checkbox]), .card-pad select, .filters-bar input {
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg); }
:root[data-look="glass"] :is(.fld input, .fld select, .fld textarea, .lines-edit input, .lines-edit select) { background: var(--surface-3); }
.fld input:focus, .fld select:focus, .fld textarea:focus, .lines-edit input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- lists / grids (King columns, Nehir look) ---------- */
.grid-card { min-height: 0; border-radius: var(--radius-lg); }
.grid-card .grid-scroll { max-height: calc(100vh - 300px); }
.toolbar { padding: 10px 12px; gap: 6px; border-bottom: 1px solid var(--border); }
.grid-tools { border-bottom: 1px solid var(--border); }
.king-grid { font-size: 13px; }
.king-grid th { background: var(--surface-2); color: var(--fg-3); font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 1px solid var(--border-strong); backdrop-filter: none; -webkit-backdrop-filter: none; }
:root[data-look="glass"] .king-grid th, :root[data-look="glass"] .king-grid tfoot td { background: var(--surface-solid); }
.king-grid td { border-bottom: 1px solid var(--border); }
.king-grid tbody tr:hover td { background: var(--accent-soft); }
.king-grid tbody tr.sel td { background: var(--accent); color: var(--accent-fg); }
.king-grid tfoot td { background: var(--surface-2); }
.cb.on { background-color: var(--accent); border-color: var(--accent); }
.status-panel { background: var(--surface-2); border-top: 1px solid var(--border); }
.filters-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.filters-bar input[type=date] { width: auto; padding: 5px 8px; font: inherit; font-size: 12.5px; }
.filter-chip { padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border-strong); background: transparent; font-size: 12.5px; color: var(--fg-2); }
.filter-chip:hover { background: var(--surface-2); }
.filter-chip.active { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; font-weight: 700; }
.filter-count { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }
.pill { background: var(--accent-soft); color: var(--accent-text); font-family: var(--font-mono); font-weight: 500; }
.neg { color: var(--err) !important; }

/* ---------- modal, toast, drawer ---------- */
.modal-back { background: rgba(20, 18, 14, .32); }
.modal { background: var(--overlay); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: 0 30px 80px -30px rgba(0,0,0,.45); }
.modal header { border-bottom: 1px solid var(--border); }
.modal header h2 { font-family: var(--font-serif); font-weight: 500; font-size: 22px; letter-spacing: -.2px; }
.toast { background: var(--overlay); border: 1px solid var(--border-strong); border-left: 4px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); }
.ac-list, .col-chooser, .menu-drop { background: var(--overlay); border: 1px solid var(--border-strong); }


/* ---------- pano (Nehir lego blocks) ---------- */
.widgets-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; position: relative; min-width: 0;
  box-shadow: var(--shadow-sm); animation: fadeUp .4s cubic-bezier(.2,.8,.2,1) both; }
:root[data-look="glass"] .widget { box-shadow: var(--shadow); }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.widget-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; min-height: 22px; }
.widget-title { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); font-weight: 500; }
.w-tools { display: flex; gap: 4px; }
.w-tools button { font-family: var(--font-mono); font-size: 11px; padding: 2px 8px; border-radius: 20px; border: 1px solid var(--border-strong); background: var(--surface); }
.w-tools button:last-child { color: var(--err); }
.widgets-grid.editing .widget { cursor: grab; outline: 1.5px dashed var(--border-strong); outline-offset: 3px; }
.widget.drag { opacity: .4; }
.w-load { height: 44px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.kpi-w { display: flex; flex-direction: column; gap: 4px; margin: -4px 0; }
.kpi-l { display: none; }
.kpi-v { font-family: var(--font-serif); font-size: 34px; font-weight: 500; line-height: 1.1; letter-spacing: -.5px; color: var(--fg); }
.kpi-s { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-3); }
.kpi-w.attn .kpi-v { color: var(--accent-text); } .kpi-w.warn .kpi-s { color: var(--warn); }
.w-list { display: flex; flex-direction: column; }
.w-list a { display: grid; grid-template-columns: 10px auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 6px; border-radius: var(--radius-sm); font-size: 13px; }
.w-list a + a { border-top: 1px solid var(--border); }
.w-list a:hover { background: var(--surface-2); }
.w-list b { font-family: var(--font-mono); font-weight: 500; }
.w-list span:not(.dot) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-2); }
.w-list em { font-style: normal; font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-4); }
.dot.orange { background: var(--accent-2); } .dot.blue { background: var(--info); } .dot.green { background: var(--ok); }
.w-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.w-table td { padding: 7px 6px; border-top: 1px solid var(--border); white-space: nowrap; }
.w-table tr:first-child td { border-top: 0; }
.w-table tr[data-href] { cursor: pointer; }
.w-table tr[data-href]:hover td { background: var(--surface-2); }
.w-table td:nth-child(2) { white-space: normal; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.steps { display: flex; gap: 3px; align-items: center; }
.steps i { width: 10px; height: 10px; border-radius: 3px; background: var(--surface-3); border: 1px solid var(--border-strong); }
.steps i.on { background: var(--accent); border-color: var(--accent); }
.pct { font-family: var(--font-mono); font-size: 12px; padding: 2px 8px; border-radius: 20px; background: var(--surface-2); }
.pct.good { background: rgba(21, 128, 61, .12); color: var(--ok); } .pct.mid { background: rgba(180, 83, 9, .12); color: var(--warn); } .pct.bad { background: rgba(185, 28, 28, .12); color: var(--err); }
.w-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.add-widget-card { border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); padding: 26px; color: var(--fg-3); font-weight: 600; background: transparent; }
.add-widget-card:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.widget-picker-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.widget-picker-item { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--surface); }
.widget-picker-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.widget-picker-item.added { opacity: .45; pointer-events: none; }
.wp-title { font-weight: 700; font-size: 13px; } .wp-desc { font-family: var(--font-mono); font-size: 11px; color: var(--fg-3); }

/* ---------- order detail (head strip + sub tabs) ---------- */
.od-head { display: grid; grid-template-columns: minmax(200px, auto) 1fr auto; align-items: center; gap: 18px; padding: 14px 18px; margin-bottom: 12px; }
.od-who { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.od-num { font-size: 20px; font-weight: 500; color: var(--accent-text); }
.od-who b { font-family: var(--font-serif); font-size: 20px; font-weight: 500; }
.od-steps { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; justify-content: center; flex-wrap: wrap; }
.od-steps li { display: flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 20px; font-size: 11.5px; color: var(--fg-3); background: var(--surface-2); }
.od-steps li i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--fg-4); }
.od-steps li.on { color: var(--fg); background: var(--accent-soft); }
.od-steps li.on i { background: var(--accent); border-color: var(--accent); }
.od-total { text-align: right; display: flex; flex-direction: column; }
.od-total b { font-size: 20px; font-weight: 500; }
.sub-tabs { display: flex; gap: 2px; margin: 0 0 12px; border-bottom: 1px solid var(--border-strong); }
.sub-tabs button { padding: 9px 16px; font-size: 13.5px; font-weight: 600; color: var(--fg-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.sub-tabs button:hover { color: var(--fg); }
.sub-tabs button.on { color: var(--fg); border-bottom-color: var(--accent); }
.order-form { padding: 18px 20px; }
.od-pane[hidden], .order-form[hidden] { display: none; }
.proof-box, .ap-box, .docs-box { border-color: var(--border-strong); border-radius: var(--radius); }
.proof-box:first-child { margin-top: 0; }

/* ---------- kostprijs & marge ---------- */
.m-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.m-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.m-card span { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-3); }
.m-card b { font-size: 21px; font-weight: 500; }
.m-card.strong { border-color: rgba(var(--accent-rgb), .35); }
.m-sec { margin-top: 14px; }
.m-sec header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.m-sec h3 { font-family: var(--font-serif); font-weight: 500; font-size: 18px; }
.m-tab td small { display: block; }

/* ---------- density ---------- */
:root[data-density="compact"] { --top-h: 64px; }
:root[data-density="compact"] .king-grid td { padding: 4px 8px; }
:root[data-density="compact"] .widget { padding: 14px 16px; }
:root[data-density="compact"] .nx-item { padding: 7px 10px; }
:root[data-density="compact"] .page-head h1 { font-size: 30px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .nx-clock { display: none; }
  .nx-top { grid-template-columns: var(--side-w) auto minmax(160px, 1fr) auto; }
  .nx-actions { grid-column: 4; }
  .span-3 { grid-column: span 6; } .m-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .od-head { grid-template-columns: 1fr auto; } .od-steps { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
}
@media (max-width: 900px) {
  :root { --side-w: 260px; --top-h: 60px; }
  .nx-top { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding-right: 10px; }
  .nx-brand { border-right: 0; padding: 6px 8px; }
  .nx-logo img { height: 34px; }
  .nx-burger { display: grid; }
  .nx-back span { display: none; }
  .nx-search { grid-column: 2; }
  .nx-search kbd, .nx-adm, .nx-lang { display: none; }
  .nx-actions { grid-column: 3; }
  .nx-body { grid-template-columns: 1fr; }
  .nx-side { position: fixed; z-index: 40; top: var(--top-h); left: 0; bottom: 0; height: auto; width: var(--side-w); transform: translateX(-105%); transition: transform .25s; box-shadow: var(--shadow); }
  body.nav-open .nx-side { transform: none; }
  body.nav-open .nx-scrim-side { display: block; position: fixed; inset: var(--top-h) 0 0 0; z-index: 35; background: rgba(20, 18, 14, .3); }
  .nx-content { padding: 18px 16px 48px; }
  .page-head h1 { font-size: 28px; }
  .span-4, .span-6, .span-8 { grid-column: span 12; } .span-3 { grid-column: span 6; }
  .kpi-v { font-size: 26px; }
  .m-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nx-notes { right: -40px; width: min(340px, 92vw); }
}
@media (max-width: 520px) {
  .nx-search { display: none; }
  .mod-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
}

/* first paint while the session loads */
.boot { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.boot img { width: 150px; opacity: .9; animation: breathe 1.4s ease-in-out infinite alternate; }
@keyframes breathe { from { opacity: .35; transform: scale(.98); } to { opacity: .95; transform: none; } }

/* ---------- accordion list (Nehir orders) ---------- */
.acc-list { display: flex; flex-direction: column; gap: 8px; }
.acc-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: visible; transition: border-color .15s, box-shadow .15s; }
.acc-row:hover { border-color: var(--border-strong); }
.acc-row.open { border-color: rgba(var(--accent-rgb), .55); box-shadow: 0 4px 18px -8px rgba(var(--accent-rgb), .35); }
.acc-head { display: grid; grid-template-columns: 16px 118px minmax(0, 1fr) 96px 120px 230px 96px; align-items: center; gap: 14px; padding: 11px 16px; cursor: pointer; border-radius: var(--radius); }
.acc-head:hover { background: var(--surface-2); }
.acc-row.open .acc-head { border-radius: var(--radius) var(--radius) 0 0; }
.acc-chev { color: var(--fg-3); font-size: 18px; transition: transform .2s; line-height: 1; }
.acc-row.open .acc-chev { transform: rotate(90deg); color: var(--accent-text); }
.acc-no { display: flex; flex-direction: column; gap: 1px; }
.acc-no .num:first-child { font-size: 14px; font-weight: 500; color: var(--accent-text); }
.acc-no small, .acc-qty small, .acc-amount small, .acc-date small { display: block; font-size: 10.5px; color: var(--fg-3); }
.acc-main { min-width: 0; }
.acc-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-sub { font-size: 12px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acc-qty, .acc-amount, .acc-date { text-align: right; font-size: 13px; }
.acc-amount { font-weight: 600; }
.acc-status { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.tag-s { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 20px; background: var(--surface-2); color: var(--fg-2); margin: 1px 4px 1px 0; }
.tag-s.portal { background: rgba(217, 98, 43, .14); color: var(--accent-2); width: fit-content; }
.tag-s.file { padding: 4px 10px; }
.st-pill { font-size: 12px; font-weight: 700; padding: 4px 11px; border-radius: 20px; border: 1px solid transparent; background: var(--surface-2); color: var(--fg-2); white-space: nowrap; }
.st-pill:hover { border-color: var(--border-strong); }
.st-new { background: rgba(29, 78, 216, .10); color: var(--info); }
.st-approved, .st-released_picklist, .st-picklist_printed, .st-picklist_processed { background: rgba(180, 83, 9, .12); color: var(--warn); }
.st-released_delivery { background: rgba(var(--accent-rgb), .12); color: var(--accent-text); }
.st-released_invoice { background: rgba(21, 128, 61, .12); color: var(--ok); }
.steps i.na { opacity: .25; }
.st-menu { width: 280px; padding: 6px; display: flex; flex-direction: column; z-index: 80; }
.st-menu button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; text-align: left; }
.st-menu button:hover:not(:disabled) { background: var(--surface-2); }
.st-menu button.on { font-weight: 700; }
.st-menu button:disabled { opacity: .35; }
.st-menu p { padding: 6px 10px 4px; }
.acc-body { padding: 16px 18px 14px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--fg) 3%, transparent); border-radius: 0 0 var(--radius) var(--radius); }
.acc-grid { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 18px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 0; }
.kv div { min-width: 0; }
.kv dt { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--fg-3); }
.kv dd { margin: 1px 0 0; font-size: 13px; overflow-wrap: anywhere; }
.acc-lines { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 10px; }
.pack-t { display: block; font-size: 11px; color: var(--fg-3); margin-top: 2px; white-space: normal; }
.acc-note { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); white-space: pre-wrap; font-size: 13px; }
.acc-sec { margin-top: 12px; }
.acc-sec .proof-box { margin-top: 0; background: var(--surface); }
.acc-fold { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 12px; }
.acc-fold > summary { cursor: pointer; list-style: none; padding: 10px 0; font-family: var(--font-serif); font-size: 16px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.acc-fold > summary::before { content: '›'; transition: transform .2s; color: var(--fg-3); font-size: 18px; }
.acc-fold[open] > summary::before { transform: rotate(90deg); }
.acc-fold > summary::-webkit-details-marker { display: none; }
.acc-fold[open] { padding-bottom: 12px; }
.acc-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 14px; }
.acc-actions .spacer { flex: 1; }
.empty.glass { padding: 40px; text-align: center; color: var(--fg-3); }
.nx-flt { min-width: 220px; flex: 1; max-width: 340px; }
.nx-flt input { width: 100%; }
.filter-chip i { font-style: normal; font-family: var(--font-mono); font-size: 10.5px; opacity: .7; margin-left: 3px; }

/* gallery */
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.gal-img { margin: 0; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border-strong); background: #fff; position: relative; cursor: zoom-in; }
.gal-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gal-img figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px; font-size: 10.5px; background: rgba(0,0,0,.55); color: #fff; }
.gal-add { aspect-ratio: 1; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; color: var(--fg-3); text-align: center; padding: 6px; }
.gal-add span { font-size: 26px; line-height: 1; }
.gal-add small { font-size: 11px; }
.gal-add select { font-size: 10.5px; max-width: 100%; padding: 2px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg); }
.gal-add:hover, .gal-add.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.gal-files { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

@media (max-width: 1280px) {
  .acc-head { grid-template-columns: 16px 104px minmax(0, 1fr) 110px 200px; }
  .acc-qty, .acc-date { display: none; }
  .acc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .acc-head { grid-template-columns: 14px minmax(0, 1fr) auto; gap: 8px; padding: 10px 12px; }
  .acc-no { grid-column: 2; grid-row: 1; flex-direction: row; gap: 8px; align-items: baseline; }
  .acc-main { grid-column: 2 / 4; grid-row: 2; }
  .acc-amount { grid-column: 3; grid-row: 1; }
  .acc-status { grid-column: 2 / 4; grid-row: 3; flex-direction: row; justify-content: space-between; }
  .kv { grid-template-columns: 1fr 1fr; }
}

/* order page: accordion sections */
.od-sec { margin-bottom: 12px; padding: 0 18px; }
.od-sec > summary { cursor: pointer; list-style: none; padding: 14px 0; font-family: var(--font-serif); font-size: 19px; font-weight: 500; display: flex; align-items: center; gap: 10px; }
.od-sec > summary::-webkit-details-marker { display: none; }
.od-sec > summary::before { content: '›'; font-size: 22px; color: var(--fg-3); transition: transform .2s; width: 14px; }
.od-sec[open] > summary::before { transform: rotate(90deg); color: var(--accent-text); }
.od-sec[open] { padding-bottom: 16px; }
.od-sec .order-form { padding: 0; }
.od-total .pct { margin-top: 4px; align-self: flex-end; }
.new-files { margin-top: 16px; }
.new-files h3 { font-family: var(--font-serif); font-weight: 500; font-size: 18px; }
.gal-img.pending { cursor: default; }
.gal-doc { display: grid; place-items: center; height: 100%; font-size: 40px; }
.gal-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 14px; line-height: 1; }
.m-tab td:last-child { white-space: nowrap; }

/* portal access */
.pa-form { margin-top: 14px; padding: 12px 16px; }
.pa-form h4 { font-family: var(--font-serif); font-weight: 500; font-size: 17px; margin-bottom: 4px; }
.pa-done { margin-bottom: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(21, 128, 61, .10); border: 1px solid rgba(21, 128, 61, .3); }
.pa-done pre { margin: 6px 0; white-space: pre-wrap; font-size: 12.5px; }
.hist-bar .btn.primary { margin-left: auto; }
.flag { font-size: 20px; line-height: 1; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.flag.none { opacity: .3; font-size: 16px; }
.flag-img { width: 22px; height: 16.5px; border-radius: 3px; object-fit: cover; vertical-align: -3px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.acc-name .flag-img { margin-right: 6px; }

/* reports */
.rep-filters { gap: 6px; }
.rep-range { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; }
.rep-group { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; color: var(--fg-3); margin-left: auto; }
.rep-group select { font: inherit; text-transform: none; font-size: 12.5px; padding: 4px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg); }
.rep-sec { margin-top: 14px; }
.rep-sec h3 { font-family: var(--font-serif); font-weight: 500; font-size: 19px; margin-bottom: 8px; }
.rep-cards .m-card small { font-family: var(--font-mono); font-size: 11px; }
.rep-chart { width: 100%; height: auto; display: block; }
.rep-chart .gl { stroke: var(--border-strong); stroke-width: 1; }
.rep-chart .ax { fill: var(--fg-3); font-family: var(--font-mono); font-size: 10.5px; }
.rep-chart .b-rev { fill: var(--accent); }
.rep-chart .b-buy { fill: var(--accent-2); opacity: .8; }
.rep-chart .l-mar { fill: none; stroke: var(--ok); stroke-width: 2.2; }
.rep-chart .d-mar { fill: var(--surface); stroke: var(--ok); stroke-width: 2; }
.rep-legend { display: flex; gap: 6px 14px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--fg-2); margin-top: 6px; }
.rep-legend .k { width: 12px; height: 12px; border-radius: 3px; display: inline-block; margin-left: 8px; }
.rep-legend .k.rev { background: var(--accent); } .rep-legend .k.buy { background: var(--accent-2); } .rep-legend .k.mar { background: var(--ok); border-radius: 50%; }
.rep-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rep-two h3 { font-family: var(--font-serif); font-weight: 500; font-size: 18px; margin-bottom: 10px; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hb { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.hb-bar { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.hb-bar i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.hb-v small { display: block; font-size: 10.5px; color: var(--fg-3); text-align: right; }
.rep-cross td small { font-size: 11px; }
.rep-hint { margin-bottom: 10px; }
@media (max-width: 900px) { .rep-two { grid-template-columns: 1fr; } .rep-group { margin-left: 0; } }

/* portal inboxes: order requests and price requests */
.rq-hint { margin: -6px 0 12px; }
.rq-head { grid-template-columns: 18px 128px minmax(0, 1fr) minmax(0, 220px) 96px 120px 128px; }
.pr-head { grid-template-columns: 16px 128px minmax(0, 1fr) minmax(0, 220px) 120px 128px; }
.rq-pick { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.rq-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; min-width: 0; }
.rq-tags .tag-s { margin: 0; }
.tag-s.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.tag-s.warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.st-rejected, .pr-declined { background: color-mix(in srgb, var(--err) 12%, transparent); color: var(--err); }
.pr-new { background: rgba(29, 78, 216, .10); color: var(--info); }
.pr-in_progress { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.pr-quoted { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.acc-status .btn.sm { margin-top: 2px; }
.rq-auto { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--fg-2); cursor: pointer; }
.rq-auto input { accent-color: var(--accent); width: 15px; height: 15px; }
.kv .wide { grid-column: 1 / -1; }
.kv .pre { white-space: pre-wrap; }
.prq-note { margin-top: 12px; }
.prq-note textarea { width: 100%; padding: 8px 10px; font: inherit; }
@media (max-width: 1280px) {
  .rq-head, .pr-head { grid-template-columns: 18px 110px minmax(0, 1fr) 110px 128px; }
  .rq-head .rq-tags, .pr-head .rq-tags, .rq-head .acc-qty { display: none; }
}
@media (max-width: 760px) {
  .rq-head, .pr-head { grid-template-columns: 18px minmax(0, 1fr) auto; }
  .rq-head .acc-status, .pr-head .acc-status { grid-column: 2 / 4; grid-row: 3; flex-direction: row; justify-content: space-between; align-items: center; }
}

/* dosya arşivi */
.ar-bar { gap: 6px; }
.ar-sel { font: inherit; font-size: 12.5px; padding: 5px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--fg); }
.seg button.on { background: var(--accent); color: var(--accent-fg); }
.seg button { padding: 4px 10px; }
.ar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.ar-card { margin: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: var(--radius); }
.ar-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; background: color-mix(in srgb, var(--fg) 4%, transparent); border-bottom: 1px solid var(--border); overflow: hidden; }
.ar-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.ar-ext { font-family: var(--font-mono); font-weight: 700; font-size: 20px; color: var(--accent-text); padding: 14px 18px; border: 2px solid currentColor; border-radius: 8px; opacity: .7; }
.ar-card figcaption { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 4px; min-width: 0; }
.ar-card figcaption b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-link { font-size: 12px; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-link a { color: var(--accent-text); font-weight: 600; }
.ar-card small { font-size: 11px; color: var(--fg-3); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ar-acts { display: flex; gap: 6px; padding: 6px 12px 12px; margin-top: auto; }

/* activiteit */
.act-list { display: flex; flex-direction: column; gap: 6px; }
.act-day { font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); margin: 14px 0 2px; }
.act-day:first-child { margin-top: 0; }
.act-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 14px; border-radius: var(--radius); }
.act-av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--accent-soft); color: var(--accent-text); }
.act-av.portal { background: color-mix(in srgb, var(--accent-2) 18%, transparent); color: var(--accent-2); }
.act-av.system { background: var(--surface-2); color: var(--fg-3); }
.act-main { min-width: 0; font-size: 13px; }
.act-what { color: var(--fg-2); }
.act-main small { display: block; font-size: 12px; color: var(--fg-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-main small a { color: var(--accent-text); font-weight: 600; }
.act-row time { font-size: 12px; color: var(--fg-3); }
.act-more { display: flex; justify-content: center; margin-top: 12px; }
.act-main small .flag-img, .ar-link .flag-img, .ar-card .flag-img { margin: 0 4px 0 2px; }

/* company logo (bedrijfsgegevens, new administration) */
.logo-card { margin-bottom: 14px; }
.logo-card h3 { font-family: var(--font-serif); font-weight: 500; font-size: 18px; margin-bottom: 10px; }
.logo-pick { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 12px; }
.logo-pick .fld { display: flex; flex-direction: column; gap: 6px; max-width: 360px; }
.logo-prev { width: 180px; height: 72px; display: grid; place-items: center; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm);
  background: #fff; color: #86847e; font-size: 12px; overflow: hidden; }
.logo-prev img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 6px; }
.nx-logo:empty { display: none; }

/* company + fiscal year switcher (top bar) and companies screen */
.nx-co { position: relative; }
button.nx-adm { cursor: pointer; background: transparent; }
.nx-caret { font-style: normal; font-size: 10px; color: var(--fg-3); margin-left: 2px; }
.nx-co-menu { right: 0; top: calc(100% + 8px); width: 360px; max-height: 70vh; overflow: auto; padding: 8px; }
.nx-co-menu h4 { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-3); font-weight: 500; padding: 4px 6px 8px; }
.co-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 6px; border-radius: var(--radius-sm); }
.co-row.on { background: var(--accent-soft); }
.co-row + .co-row { border-top: 1px solid var(--border); }
.co-main { min-width: 0; flex: 1; font-size: 13px; }
.co-main span { color: var(--fg-2); }
.co-logo { width: 54px; height: 30px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px 4px; border: 1px solid var(--border); flex: none; }
.co-logo.lg { width: 84px; height: 40px; }
.co-logo.none { display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: #86847e; }
.co-years { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.co-y { font-family: var(--font-mono); font-size: 12px; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--fg-2); cursor: pointer; }
.co-y:hover { border-color: var(--accent); color: var(--accent-text); }
.co-y.on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.co-y.closed { opacity: .65; }
.co-y.add { border-style: dashed; }
.co-manage { display: block; padding: 10px 6px 4px; margin-top: 4px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--accent-text); font-weight: 600; }
.co-head { grid-template-columns: 16px auto minmax(0, 1fr) auto; }
.co-head .co-years { margin-top: 0; justify-content: flex-end; }
.co-sub { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-3); font-weight: 500; margin-bottom: 6px; }
.co-yt { max-width: 520px; }

/* print designs (article card) */
.dz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.dz-card { margin: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: var(--radius); }
.dz-card.off { opacity: .55; }
.dz-img { aspect-ratio: 4 / 3; display: grid; place-items: center; background: #fff; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.dz-img img { width: 100%; height: 100%; object-fit: contain; }
.dz-card figcaption { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.dz-card figcaption span { color: var(--fg-2); }
.dz-card figcaption small { color: var(--fg-3); font-size: 11px; }
.dz-new { padding: 12px 14px; border-radius: var(--radius); }
.dz-new h4 { font-family: var(--font-serif); font-weight: 500; font-size: 16px; margin-bottom: 8px; }
.design-t { color: #c0127a; }
:root[data-theme="dark"] .design-t { color: #ff7ac8; }

/* product photos */
.art-th { width: 38px; height: 38px; border-radius: 8px; object-fit: cover; display: block; background: #fff; border: 1px solid var(--border); }
.art-th.none { display: grid; place-items: center; font-size: 15px; opacity: .45; background: var(--surface-2); }
.king-grid td:has(> .art-th) { padding-top: 3px; padding-bottom: 3px; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 10px; }
.ph-card { position: relative; margin: 0; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: #fff; border: 1.5px solid var(--border-strong); }
.ph-card.main { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ph-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-badge { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: var(--accent); color: var(--accent-fg); }
.ph-acts { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; gap: 6px; justify-content: flex-end; }
.ph-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; background: transparent; border-style: dashed; color: var(--fg-3); text-align: center; padding: 8px; }
.ph-add span { font-size: 30px; line-height: 1; }
.ph-add:hover, .ph-add.over { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.design-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 0 6px; }
.design-info select { font: inherit; font-size: 12.5px; padding: 4px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--fg); }
.design-th { width: 54px; height: 40px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--border); cursor: zoom-in; }
.cmyk-tag { font-size: 9.5px; font-weight: 800; letter-spacing: .08em; padding: 2px 7px; border-radius: 99px; color: #c0127a;
  background: linear-gradient(90deg, rgba(0,174,239,.16), rgba(236,0,140,.16), rgba(255,212,0,.2)); border: 1px solid rgba(236,0,140,.3); }
.od-accept { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: 12px; border-left: 4px solid var(--warn); }
.od-accept p { margin: 2px 0 0; }
.od-accept.rejected { border-left-color: var(--err); }
.pc-table { margin: 8px 0; }
.pc-table tr.pc-diff td { background: color-mix(in srgb, var(--warn) 10%, transparent); }
.pc-table td small { display: block; font-size: 10.5px; }
.pp-line { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px 10px; margin: 10px 0; }
.pp-line legend { padding: 0 6px; font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pp-quotes { width: 100%; border-collapse: collapse; font-size: 13px; }
.pp-quotes td { padding: 5px 6px; border-top: 1px solid var(--border); }
.pp-quotes tr:first-child td { border-top: 0; }
.pp-quotes tr.best td { background: color-mix(in srgb, var(--ok) 8%, transparent); }
.pp-quotes label { cursor: pointer; }
.pp-quotes small { display: block; font-size: 10.5px; }
.pp-manual { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pp-manual select, .pp-manual input { font: inherit; font-size: 13px; padding: 5px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-solid); color: var(--fg); }
.pp-sum { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }

/* order page: purchase orders with status and receive button; direct delivery in the receipt modal */
.order-meta .po-chip{display:inline-flex;align-items:center;gap:6px;padding:3px 4px 3px 10px;border:1px solid var(--line, rgba(127,127,127,.25));border-radius:999px;background:var(--surface-solid, transparent)}
.order-meta .po-chip a{color:inherit;text-decoration:none;font-size:12.5px}
.order-meta .po-chip.po-closed{opacity:.75}
.order-meta .po-chip.po-partial .tag-s{background:color-mix(in srgb, orange 22%, transparent)}
.direct-box{padding:10px 12px;border-radius:10px;background:color-mix(in srgb, var(--accent, #3b82f6) 10%, transparent);display:flex;flex-direction:column;gap:4px}

/* pick lists: every choice opens a list (search on top), nothing is typed into the field itself */
.ac.pick { position: relative; }
.ac.pick > input[data-label] { cursor: pointer; padding-right: 54px; caret-color: transparent; text-overflow: ellipsis; }
.ac.pick::after { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -6px; border-right: 2px solid var(--fg-3, #888);
  border-bottom: 2px solid var(--fg-3, #888); transform: rotate(45deg); pointer-events: none; transition: transform .15s; }
.ac.pick.open::after { transform: rotate(-135deg); margin-top: -2px; }
.ac.pick.open > input[data-label] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.ac-clear { position: absolute; right: 28px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--fg-3, #888); font-size: 16px; line-height: 1; cursor: pointer; padding: 2px 4px; }
.ac-clear:hover { color: var(--fg, inherit); }
.ac.pick .ac-list { min-width: max(100%, 280px); max-height: 340px; display: flex; flex-direction: column; padding: 6px; overflow: hidden; }
.ac.pick .ac-list[hidden] { display: none; }
.ac-q { margin-bottom: 6px; }
.ac-items { overflow: auto; max-height: 280px; }
.ac-item.sel { font-weight: 600; }
.ac-item.sel::after { content: "✓"; margin-left: auto; color: var(--accent); }
.ac-item.add { color: var(--accent); font-weight: 600; }
.ac-empty { padding: 8px 10px; color: var(--fg-3, #888); font-size: 13px; }
td .ac.pick .ac-list { min-width: 360px; }

/* saved notes next to note fields */
.nt-bar { position: relative; display: flex; gap: 6px; margin-top: 4px; }
.nt-bar .btn.xs { padding: 2px 8px; font-size: 12px; min-height: 0; }
.nt-bar .btn.ghost { background: none; border-color: transparent; color: var(--fg-3, #888); }
.nt-bar.saved [data-nt-save] { color: var(--ok, #16a34a); }
.nt-list { position: absolute; z-index: 75; left: 0; top: calc(100% + 4px); min-width: 320px; max-width: 520px; max-height: 260px; overflow: auto; padding: 4px; border-radius: 10px;
  background: var(--overlay); border: 1px solid var(--border-strong); }
.nt-item { display: flex; gap: 8px; align-items: flex-start; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; white-space: pre-wrap; }
.nt-item:hover { background: var(--accent-soft); }
.nt-item span { flex: 1; }
.nt-x { border: 0; background: none; color: var(--fg-3, #888); cursor: pointer; font-size: 15px; line-height: 1; }
.nt-x:hover { color: var(--danger, #dc2626); }

/* klantspecifiek on an order line: the customer's own article number / note */
.cust-info { display: block; margin-top: 3px; font-size: 11.5px; color: var(--accent); }

/* jaarafsluiting */
.ye-checks { list-style: none; padding: 0; margin: 8px 0 14px; display: grid; gap: 4px; font-size: 13px; }
.ye-checks .block { color: var(--danger, #dc2626); font-weight: 600; }
.ye-checks .warn { color: var(--warn, #d97706); }
.ye-steps { display: grid; gap: 12px; }
.ye-steps > div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2, rgba(127,127,127,.08)); }
.ye-steps p { margin: 4px 0 8px; }

/* inkomende e-mail */
.inbox-mail .mail-body { white-space: pre-wrap; max-height: 320px; overflow: auto; padding: 10px 12px; border-radius: 10px; background: var(--surface-2, rgba(127,127,127,.08)); font: inherit; font-size: 13px; }
.inbox-mail .mail-att { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }

/* ---------- every window fits the device (0.29, loads last so it wins) ---------- */
.modal-back { padding: 16px; overflow: hidden; }
.modal { max-height: calc(100dvh - 32px); min-height: 0; max-width: 100%; overflow: hidden; }
.modal header { flex: 0 0 auto; gap: 12px; position: relative; z-index: 3; }
.modal header h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { min-height: 0; flex: 1 1 auto; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 16px 20px 18px; }
.modal-body > form .actions:last-child, .modal-body > .actions:last-child { position: sticky; bottom: -18px; margin: 14px -20px -18px; padding: 12px 20px; background: var(--overlay); border-top: 1px solid var(--border); z-index: 2; justify-content: flex-end; flex-wrap: wrap; }
.tbl-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.tbl-scroll > table { min-width: 100%; }
.tbl-scroll > table.lines-edit { min-width: 760px; }
.lines-edit th { white-space: nowrap; }
.lines-edit thead th { position: sticky; top: 0; background: var(--overlay); z-index: 1; }
.lines-edit tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.nx-drawer { max-width: 100vw; height: 100dvh; }
.nx-drawer > :not(header):not(footer) { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.nx-drawer header, .nx-drawer footer { flex: 0 0 auto; }
.nx-pop, .ac-list, .col-chooser, .st-menu { max-width: calc(100vw - 16px); }
.nx-notes, .st-menu { max-height: calc(100dvh - 80px); overflow: auto; }
.col-chooser { max-height: min(60vh, calc(100dvh - 24px)); }
.ac-list { max-height: min(280px, 45dvh); }
#toasts { left: auto; max-width: min(420px, calc(100vw - 24px)); }
.toast { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .modal-back { padding: 0; place-items: end stretch; }
  .modal, .modal.wide { width: 100%; max-height: calc(100dvh - 12px); border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom: 0; }
  .modal header { padding: 12px 14px; }
  .modal header h2 { font-size: 19px; }
  .modal-body { padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); }
  .modal-body > form .actions:last-child, .modal-body > .actions:last-child { bottom: calc(-14px - env(safe-area-inset-bottom)); margin: 12px -14px calc(-14px - env(safe-area-inset-bottom)); padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); }
  .modal-body > form .actions:last-child > *, .modal-body > .actions:last-child > * { flex: 1 1 auto; }
  .modal .form-grid { grid-template-columns: 1fr; } .modal .form-grid > * { grid-column: auto; }
  .nx-search .ac-list, .search .ac-list, td .ac.pick .ac-list { min-width: 0; }
  #toasts { right: 12px; bottom: 12px; }
}

/* 0.46 — one standard window: compact, actions always visible, content scrolls inside */
.modal { width: min(520px, 100%); max-height: min(86dvh, 820px); }
.modal.wide { width: min(860px, 100%); }
.modal header { padding: 11px 16px; }
.modal header h2 { font-size: 16px; }
.modal-body { padding: 12px 16px 14px; font-size: 13px; }
.modal-body .actions:last-child { position: sticky; bottom: -14px; margin: 10px -16px -14px; padding: 10px 16px; background: var(--overlay, var(--glass-strong)); border-top: 1px solid var(--line); z-index: 2; }
.modal .form-grid { gap: 8px 10px; }
.modal textarea { min-height: 0; }
.modal fieldset { min-width: 0; }
.modal .pp-line { margin: 0 0 8px; padding: 6px 10px; }
.modal .pp-quotes td { padding: 3px 6px; }
@media (max-width: 700px) { .modal, .modal.wide { width: 100%; max-height: 92dvh; } }

.flow-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.flow-b { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 92px; padding: 10px; text-align: left; font-size: 12.5px; border: 1px solid var(--line, var(--border)); border-radius: 12px; background: var(--glass-strong, transparent); color: inherit; cursor: pointer; min-width: 0; overflow-wrap: anywhere; transition: transform .15s, background .25s; }
.flow-b:hover { transform: translateY(-2px); }
.flow-b small { font-size: 11px; line-height: 1.3; }
.flow-n { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 700; background: color-mix(in srgb, currentColor 12%, transparent); }
.flow-b.done { background: color-mix(in srgb, #16a34a 16%, transparent); border-color: #16a34a; }
.flow-b.done .flow-n { background: #16a34a; color: #fff; }
.flow-b.wait { background: color-mix(in srgb, #f59e0b 13%, transparent); border-color: #f59e0b; }
.flow-b.bad { background: color-mix(in srgb, #dc2626 12%, transparent); border-color: #dc2626; }
.flow-how { display: flex; flex-wrap: wrap; gap: 8px; } .flow-ev { color: #16a34a; font-size: 12px; }
.acc-fold.flow-old > summary { font-size: 12px; }
/* Above block 4: wide screen in its column, three columns a full row right above blocks 4-6 */
.flow-send { justify-content: center; white-space: normal; line-height: 1.2; min-height: 30px; }
@media (min-width: 1001px) { .flow-grid.has-send > .flow-send { grid-column: 4; grid-row: 1; } .flow-grid.has-send > .flow-b { grid-row: 2; } }
@media (max-width: 1000px) { .flow-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .flow-send { grid-column: 1 / -1; } }
@media (max-width: 520px) { .flow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.design-chip { display: inline-block; margin-top: 3px; padding: 2px 7px; font-size: 11px; border: 1px solid var(--line, var(--border)); border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.design-chip:hover { border-color: var(--accent); }
.design-pop { position: fixed; z-index: 90; width: 280px; height: 260px; padding: 6px; pointer-events: none; display: grid; place-items: center; border-radius: 12px; background: var(--overlay, #fff); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.design-pop img { max-width: 100%; max-height: 100%; }
.gal-img { transition: transform .15s; } .gal-img:hover { transform: scale(1.04); }

.g-chev { width: 18px; color: var(--text-3, #888); transition: transform .15s; } tr.g-open > .g-chev { transform: rotate(90deg); }
.g-detail > td { padding: 10px 14px !important; background: var(--glass-strong, rgba(127,127,127,.05)); white-space: normal; }
.g-body { display: grid; gap: 10px; min-width: 0; animation: fade .18s; position: sticky; left: 0; }
.g-body .kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; }
.g-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.st-bar { width: 22%; } .st-bar i { display: block; height: 8px; border-radius: 4px; background: var(--accent); animation: grow-x .6s ease-out; transform-origin: left; }
@keyframes grow-x { from { transform: scaleX(0); } }
.inv-wait { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 12px; border-radius: 14px; color: inherit; text-decoration: none; }
.inv-wait b { font-size: 24px; color: var(--accent); } .inv-wait em { margin-left: auto; font-style: normal; font-weight: 600; }
#od-flow { padding: 12px; }

/* 0.46 — Overview: figures that move */
.p-board { display: grid; gap: 14px; }
.p-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); grid-auto-rows: 1fr; grid-auto-flow: dense; gap: 12px; }
.p-tile.sz-w { grid-column: span 2; } .p-tile.sz-l { grid-column: span 2; grid-row: span 2; } .p-tile.sz-l b { font-size: 34px; } .p-tile.sz-l .p-l { font-size: 14px; } .p-tile.sz-l small { font-size: 13px; }
.p-tile { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; padding: 14px 14px 46px; text-align: left; color: inherit; cursor: pointer; border: 1px solid var(--line, var(--border)); border-radius: 16px; background: var(--glass-strong, var(--overlay)); transition: transform .2s, border-color .2s, box-shadow .2s; }
.anim .p-tile { animation: p-rise .5s both; animation-delay: var(--d); }
@keyframes p-rise { from { opacity: 0; transform: translateY(12px); } }
.p-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0, 0, 0, .18); }
.p-tile.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.p-glow { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .25s; background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%); }
.p-tile:hover .p-glow { opacity: 1; }
.p-l { font-size: 12px; font-weight: 600; opacity: .75; } .p-tile b { font-size: 22px; line-height: 1.15; overflow-wrap: anywhere; } .p-tile small { font-size: 11px; opacity: .75; }
.p-spark { position: absolute; left: 14px; right: 14px; bottom: 10px; height: 28px; display: flex; align-items: flex-end; gap: 3px; }
.p-tile.sz-l .p-spark { height: 45%; }
.p-spark i { flex: 1; height: var(--h); min-width: 2px; border-radius: 2px 2px 0 0; background: color-mix(in srgb, var(--accent) 45%, transparent); transform-origin: bottom; transition: background .2s; }
.p-tile:hover .p-spark i, .p-tile.on .p-spark i { background: var(--accent); }
.p-tile:hover .p-spark i { animation: p-up .45s both; animation-delay: var(--d); }
.anim .p-spark i { animation: p-up .6s both; animation-delay: var(--d); }
@keyframes p-up { from { transform: scaleY(0); } }
.p-detail { padding: 16px; border-radius: 16px; min-width: 0; animation: p-rise .35s both; } .p-detail.swap { animation: p-rise .35s both; }
.p-detail h3 { font-size: 13px; margin: 0 0 12px; }
.p-two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 22px; }
.p-cols { display: flex; align-items: flex-end; gap: 6px; height: 220px; }
.p-col { position: relative; flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.p-col i { display: block; width: 100%; max-width: 38px; height: var(--h); min-height: 2px; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 45%, transparent)); transform-origin: bottom; animation: p-up .7s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d); transition: filter .15s; }
.p-col:hover i { filter: brightness(1.25); } .p-col small { font-size: 10px; opacity: .7; }
.p-val { font-size: 10px; opacity: 0; transform: translateY(4px); transition: .15s; white-space: nowrap; } .p-col:hover .p-val { opacity: 1; transform: none; }
.p-ranks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.p-ranks li { position: relative; display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px; font-size: 12.5px; min-width: 0; } .p-ranks span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-ranks i { position: absolute; left: 0; bottom: 0; height: 5px; width: var(--w); border-radius: 3px; background: var(--c); transform-origin: left; animation: grow-x .8s cubic-bezier(.2, .8, .2, 1) both; animation-delay: var(--d); }
.p-donut { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; } .p-donut svg { width: 170px; height: 170px; transform: rotate(-90deg); flex: none; }
.p-ring, .p-slice { fill: none; stroke-width: 13; } .p-ring { stroke: color-mix(in srgb, currentColor 10%, transparent); }
.p-slice { stroke-dasharray: var(--len) var(--c); stroke-dashoffset: var(--off); animation: p-draw .9s ease-out both; animation-delay: var(--d); }
@keyframes p-draw { from { stroke-dasharray: 0 var(--c); } }
.p-center { transform: rotate(90deg); transform-origin: 55px 55px; font-size: 11px; font-weight: 700; fill: currentColor; }
.p-donut ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 12.5px; min-width: 130px; flex: 1; } .p-donut li { display: flex; align-items: center; gap: 7px; } .p-donut li i { width: 10px; height: 10px; border-radius: 3px; } .p-donut li b { margin-left: auto; }
@media (max-width: 800px) { .p-cols { height: 170px; } }
/* the chosen card's charts; the time chart takes the room it needs */
.p-blocks { display: flex; flex-wrap: wrap; gap: 22px; }
.p-block { flex: 1 1 220px; min-width: 0; } .p-block.wide { flex: 2 1 380px; }
/* arranging the board on a computer: drag, or the arrows */
.p-todo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 14px; border: 1px solid #f59e0b; border-radius: var(--radius); background: color-mix(in srgb, #f59e0b 12%, transparent); } .p-todo b { display: block; font-size: 14px; } .p-todo small { font-size: 12px; opacity: .8; } .p-todo-list { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.p-bar { display: flex; justify-content: flex-end; align-items: center; gap: 8px; min-height: 30px; }
.p-bar .p-edit svg { width: 15px; height: 15px; margin-right: 5px; vertical-align: -3px; }
.p-bar .muted { margin-right: auto; }
.p-drag { cursor: grab; padding-top: 42px; } .p-drag.moving { opacity: .45; } .p-drag.over { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.p-drag .p-ic, .p-drag .p-spark { display: none; }
.pn-size { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 3px; }
.pn-size button { flex: 1; min-width: 0; padding: 4px 2px; border: 1px solid var(--line, var(--border)); border-radius: 7px; background: var(--surface, #fff); color: inherit; font: inherit; font-size: 11px; cursor: pointer; } .pn-size button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.pn-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.pn-tools button { width: 26px; height: 26px; border: 1px solid var(--line, var(--border)); border-radius: 8px; background: var(--surface, #fff); color: inherit; font-size: 15px; line-height: 1; cursor: pointer; }
.pn-tools button:disabled { opacity: .35; cursor: default; } .pn-tools .del:hover { background: var(--err, #b91c1c); border-color: transparent; color: #fff; }
.p-add { align-items: center; justify-content: center; min-height: 130px; padding: 14px; border-style: dashed; background: transparent; } .p-add b { font-size: 26px; }
.pn-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pn-picker h4 { display: flex; align-items: center; gap: 7px; margin: 0 0 6px; font-size: 13px; } .pn-picker h4 svg { width: 16px; height: 16px; }
.pn-pick { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .p-board *, .p-board { animation: none !important; transition: none !important; } }

/* 0.48 */
.nx-side { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.35) transparent; }
.nx-side > * { flex-shrink: 0; }
.nx-side::-webkit-scrollbar { width: 8px; } .nx-side::-webkit-scrollbar-thumb { background: rgba(255,255,255,.3); border-radius: 4px; }
.g-extra .mail-body { max-height: 260px; overflow: auto; white-space: pre-wrap; margin: 0; font: inherit; }

.doc-view { height: min(68dvh, 700px); display: grid; place-items: center; background: rgba(127,127,127,.12); border-radius: 8px; overflow: auto; }
.doc-view iframe { width: 100%; height: 100%; border: 0; } .doc-view img { max-width: 100%; max-height: 100%; }
.art-link { cursor: pointer; } #lines tr[data-i] td:first-child { cursor: pointer; }

.work-st { display: block; max-width: 100%; margin-top: 4px; padding: 3px 6px; font-size: 11.5px; border: 1px solid var(--border-strong, var(--line)); border-radius: 8px; background: var(--surface, transparent); color: inherit; }
.filters-bar .work-st { display: inline-block; margin: 0; width: auto; }
.work-st.ws-in_production { border-color: #8b5cf6; } .work-st.ws-in_warehouse { border-color: #06b6d4; } .work-st.ws-in_transit { border-color: #f59e0b; } .work-st.ws-at_customs { border-color: #ef4444; } .work-st.ws-ready_to_ship { border-color: #16a34a; } .work-st.ws-on_hold { border-color: #9ca3af; }
.od-ws { min-width: 150px; }

.doc-list { display: flex; flex-wrap: wrap; gap: 6px; } .doc-prev { margin-top: 10px; }
.doc-prev iframe { width: 100%; height: min(70vh, 720px); border: 1px solid var(--border, var(--line)); border-radius: 8px; background: #fff; display: block; } .doc-prev img { max-width: 100%; max-height: 70vh; display: block; }

.nx-notes .nf-new { font-weight: 600; border-left: 3px solid var(--accent); } .nx-notes .nf-read { opacity: .7; }

.flow { display: grid; gap: 12px; } .flow-line { display: grid; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line, var(--border)); } .flow-line:last-child { border-bottom: 0; padding-bottom: 0; }
.flow-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px; font-size: 13px; } .flow-head > div { min-width: 0; } .flow-sup { display: block; opacity: .8; } .flow-head .work-st { margin: 0; width: auto; min-width: 150px; }

.page-box { display: contents; }

/* e-mail window: address chips, CC/BCC, extra files */
.rc-group { border: 1px solid var(--border); border-radius: var(--radius); }
.rc-row { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 6px 10px; border-top: 1px solid var(--border); }
.rc-row:first-child { border-top: 0; } .rc-row[hidden] { display: none; }
.rc-row > label { flex: none; width: 44px; padding-top: 7px; color: var(--fg-3); font-size: 12.5px; font-weight: 600; }
.rc-box { position: relative; flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 32px; cursor: text; }
.rc-chips { display: contents; }
.rc-chip { max-width: 100%; padding: 3px 10px; border: 0; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); font: inherit; font-size: 13px; overflow-wrap: anywhere; text-align: left; cursor: pointer; }
.rc-chip.bad { background: color-mix(in srgb, var(--err) 16%, transparent); color: var(--err); }
.rc-in { flex: 1 1 120px; min-width: 100px; height: 30px; padding: 0 4px; border: 0 !important; background: transparent !important; box-shadow: none !important; outline: 0; font: inherit; color: var(--fg); }
.rc-ac { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; max-height: 220px; overflow: auto; border-radius: var(--radius-sm); background: var(--overlay); box-shadow: var(--shadow); }
.rc-ac .ac-item { display: block; width: 100%; padding: 8px 10px; border: 0; background: none; color: var(--fg); text-align: left; font: inherit; cursor: pointer; } .rc-ac .ac-item:hover { background: var(--surface-2); } .rc-ac small { display: block; color: var(--fg-3); }
.rc-more { flex: none; padding: 6px 4px; border: 0; background: none; color: var(--accent-text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; } .rc-more[hidden] { display: none; }
.att-new { margin-top: 6px; } .att-list { list-style: none; margin: 0 0 6px; padding: 0; }
.att-list li { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 4px; font-size: 13px; }
.att-list li span { flex: 1; min-width: 0; overflow-wrap: anywhere; } .att-list small { flex: none; color: var(--fg-3); } .att-list button { flex: none; width: 26px; height: 26px; border: 0; border-radius: 50%; background: none; color: var(--fg-2); cursor: pointer; font-size: 16px; }
.att-add { cursor: pointer; } .att-hint { margin-left: 8px; } form.drop { outline: 2px dashed var(--accent); outline-offset: 4px; }
/* the papers of an order step */
.fd-sec { margin: 10px 0 14px; } .fd-sec h3 { margin: 0 0 6px; font-size: 13.5px; font-weight: 700; }
.fd-list { list-style: none; margin: 0 0 6px; padding: 0; }
.fd-list li { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; border-radius: var(--radius-sm); background: var(--surface-2); }
.fd-open { flex: 1; min-width: 0; display: grid; padding: 8px 10px; border: 0; background: none; color: var(--fg); text-align: left; font: inherit; cursor: pointer; } .fd-open b { font-weight: 600; overflow-wrap: anywhere; } .fd-open small { color: var(--fg-3); font-size: 11.5px; }
.fd-del { flex: none; width: 34px; height: 34px; border: 0; background: none; color: var(--fg-3); font-size: 18px; cursor: pointer; }
.fd-add { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); cursor: pointer; } .fd-add:hover { border-color: var(--accent); background: var(--accent-soft); }
.fd-add input { display: none; } .fd-add b { display: block; font-size: 14px; } .fd-add small { color: var(--fg-3); font-size: 12px; }
.fd-plus { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-fg, #fff); font-size: 18px; }
.flow-clip { display: block; color: var(--fg-2); }
/* foot of every page */
.nx-page-foot { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding: 14px 0 4px; border-top: 1px solid var(--border); color: var(--fg-3); font-size: 12.5px; }
.nx-page-foot img { height: 26px; width: auto; } .nx-page-foot span { display: grid; line-height: 1.3; } .nx-page-foot b { color: var(--fg-2); font-weight: 600; }
.nx-to-top { margin-left: auto; padding: 6px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--fg-2); font: inherit; font-size: 12.5px; cursor: pointer; } .nx-to-top:hover { background: var(--surface-2); }

.rc-chip.unknown { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.rc-groups { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } .rc-groups[hidden] { display: none; }
.rc-depts { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 4px; } .rc-dept { padding: 3px 10px; border: 1px solid var(--border); border-radius: 14px; background: none; color: var(--fg-3); font: inherit; font-size: 12px; cursor: pointer; } .rc-dept.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; } .rc-dept-note { flex: 1 1 100%; margin: 0; }
.rc-grp { padding: 4px 10px; border: 1px dashed var(--border-strong); border-radius: 14px; background: none; color: var(--fg-2); font: inherit; font-size: 12.5px; cursor: pointer; } .rc-grp:hover { border-color: var(--accent); color: var(--accent-text); }
.rc-unknown { margin: 8px 0 12px; padding: 0; list-style: none; } .rc-unknown li { padding: 6px 10px; margin-bottom: 4px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); font-weight: 600; overflow-wrap: anywhere; }
.sent-file { border: 0; font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; } .sent-file:hover { background: var(--accent-soft); color: var(--accent-text); }

/* 0.76 — large window (portal access): same look as the screens behind it; the list is open, nothing is cut off */
.modal.large { width: min(1080px, 100%); }
.modal.large header { padding: 14px 20px; }
.modal.large header h2 { font-size: 18px; }
.modal.large .modal-body { padding: 18px 20px 16px; }
.modal.large .modal-body .actions:last-child { bottom: -16px; margin: 16px -20px -16px; padding: 12px 20px; }
.pa-roomy { font-size: 14px; }
.pa-roomy input:not([type=checkbox]), .pa-roomy select { min-height: 42px; font-size: 14px; }
.pa-roomy .fld > label:not(.chk) { font-size: 12px; margin-bottom: 5px; }
.pa-roomy .form-grid { gap: 14px 16px; padding: 8px 0 12px; }
.pa-roomy label.chk { display: flex; align-items: center; gap: 9px; min-height: 30px; font: inherit; letter-spacing: 0; text-transform: none; color: inherit; }
.pa-roomy .king-grid { font-size: 14px; width: 100%; }
.pa-roomy .king-grid td { padding: 10px 12px; }
.pa-roomy .king-grid th { padding: 9px 12px; }
.pa-roomy .pa-form { margin-top: 20px; padding: 0; background: none; border: 0; box-shadow: none; border-radius: 0; }
.pa-roomy .pa-form h4 { font-size: 16px; margin-bottom: 6px; }
.pa-pick > p { margin: 0 0 12px; }
.pa-list { height: min(58dvh, 520px); margin-top: 12px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pa-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 200px) 18px; align-items: center; gap: 14px; width: 100%; min-height: 48px; padding: 8px 14px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.pa-row:last-child { border-bottom: 0; }
.pa-row:hover, .pa-row.on { background: var(--surface-2); }
.pa-row b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-go { color: var(--fg-3); font-size: 18px; line-height: 1; text-align: right; }
@media (max-width: 760px) {
  .modal.large .modal-body .actions:last-child { margin-left: 0; margin-right: 0; }
  .pa-list { height: 58dvh; }
  .pa-row { grid-template-columns: minmax(0, 1fr) 18px; gap: 2px 10px; padding: 10px 12px; min-height: 58px; }
  .pa-row .num { grid-column: 1; font-size: 12px; color: var(--fg-3); }
  .pa-row b { grid-column: 1; }
  .pa-row small { display: none; }
  .pa-go { grid-column: 2; grid-row: 1 / span 2; }
}

/* 0.77 — every list is an accordion: the same rows as Orders and Quotes */
.g-acc { max-height: none !important; overflow: visible !important; padding: 0 12px 12px; outline: none; }
.g-hd, .g-line, .g-foot { display: grid; grid-template-columns: var(--g-cols); gap: 12px; align-items: center; padding: 0 14px; }
.g-hd { padding-top: 8px; padding-bottom: 8px; color: var(--fg-3); font-family: var(--font-mono); font-size: 11px; letter-spacing: .03em; text-transform: uppercase; }
.g-hd > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-hd [data-sort] { cursor: pointer; user-select: none; } .g-hd [data-sort]:hover { color: var(--fg); }
.g-hd .r, .g-c.r { text-align: right; } .g-hd .c, .g-c.c { text-align: center; }
.g-rows { display: flex; flex-direction: column; gap: 6px; }
.g-rows > .empty { padding: 28px; text-align: center; color: var(--fg-3); }
.g-line { min-height: 46px; padding-top: 7px; padding-bottom: 7px; cursor: pointer; font-size: 13.5px; border-radius: var(--radius); }
.g-line:hover { background: var(--surface-2); }
.g-c { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-c:has(> .art-th) { overflow: visible; }
.g-line > .g-c:nth-child(2):not(.num):not(.c) { font-weight: 500; }
.g-row.sel { border-color: rgba(var(--accent-rgb), .55); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.g-row.open > .g-line { border-radius: var(--radius) var(--radius) 0 0; }
.g-row.open > .g-line .acc-chev { transform: rotate(90deg); color: var(--accent-text); }
.g-row.muted { opacity: .62; } .g-row.unread > .g-line { font-weight: 700; }
.g-row.late > .g-line { color: #b86a14; } .g-row.late2 > .g-line, .g-row.credit > .g-line { color: var(--danger); }
.g-row.warn > .g-line { color: var(--warn); } .g-row.matched { box-shadow: inset 3px 0 0 var(--ok); }
.g-detail { padding: 12px 14px 14px; border-top: 1px solid var(--border); }
.g-detail .g-body { position: static; width: auto !important; }
.g-detail .kv dd { overflow-wrap: anywhere; }
.g-extra:empty { display: none; }
.g-actions { display: flex; justify-content: flex-end; gap: 8px; }
.g-foot { margin-top: 8px; padding-top: 10px; padding-bottom: 10px; border-top: 1px solid var(--border-strong); font-size: 13.5px; }
.modal .g-acc { padding: 0; }
@media (max-width: 760px) {
  .g-acc { padding: 0; }
  .g-line { grid-template-columns: auto minmax(0, 1fr) auto 12px; gap: 10px; padding: 12px 14px; min-height: 62px; }
  .g-line:not(:has(.g-m-img)) { grid-template-columns: minmax(0, 1fr) auto 12px; }
  .g-line:not(:has(.g-m-amt)):not(:has(.g-m-img)) { grid-template-columns: minmax(0, 1fr) 12px; }
  .g-line:has(.g-m-img):not(:has(.g-m-amt)) { grid-template-columns: auto minmax(0, 1fr) 12px; }
  .g-m-img .art-th { width: 46px; height: 46px; }
  .g-m-main { min-width: 0; }
  .g-m-top { font-size: 12px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .g-m-name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .g-m-sub { font-size: 12.5px; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .g-m-amt { font-size: 15px; font-weight: 700; white-space: nowrap; }
  .g-rows { gap: 10px; }
  .g-row .acc-chev { display: inline; }
  .g-foot.m { display: block; } .g-foot.m > div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
}

/* 0.78 — statements as accordion: headings between the rows and the result under the list */
.g-group { margin: 10px 2px 0; color: var(--fg-3); font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .03em; text-transform: uppercase; }
.g-group:first-child { margin-top: 2px; }
.g-sum { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 10px 12px 4px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 14px; }
.g-sum b { font-size: 16px; }
#vr > h3 { margin: 22px 12px 6px; }
@media (max-width: 760px) { .g-sum { margin: 10px 0 4px; } #vr > h3 { margin-left: 0; } }
:is(.card-pad, .modal) .grid-tools .search input { border: 0; background: transparent; box-shadow: none; }

/* cost window: every invoice line its own block, so it fits a phone too */
.cost-line { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 8px 0; }
.fld.cost-split { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 6px; grid-column: 1 / -1; }
.fld.cost-split .btn { width: auto; }
.qs-box .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qs-box .fld.s4, .qs-box .fld.s2 { grid-column: 1 / -1; }
.cost-split [data-splits] { flex: 1 1 100%; }
.split-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto; gap: 6px; margin-bottom: 6px; align-items: center; }
.qs-box { border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
tr.cost-replaced td { color: var(--text-2); text-decoration: line-through; }
tr.cost-replaced td:last-child, tr.cost-replaced .pill, tr.cost-replaced .tag-s { text-decoration: none; }
@media (max-width: 520px) { .split-row { grid-template-columns: minmax(0, 1fr) 90px auto; } }

.split-row [data-sp-rep] { grid-column: 1 / -1; }
.release-row { grid-template-columns: minmax(0, 1fr) auto; margin-top: 6px; }
.warn-list { margin: 0 0 8px; padding-left: 18px; }
.warn-list li { margin-bottom: 6px; }

/* the sticky button bar always runs exactly edge to edge of its window, whatever padding the window has at this width */
.modal .modal-body { --mb-x: 16px; padding-left: var(--mb-x); padding-right: var(--mb-x); }
.modal.large .modal-body { --mb-x: 20px; }
.modal .modal-body .actions:last-child { margin-left: calc(var(--mb-x) * -1); margin-right: calc(var(--mb-x) * -1); padding-left: var(--mb-x); padding-right: var(--mb-x); }

/* 0.81 — packing list: adds up as you type, one save */
.pk-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.pk-sum { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; font-size: 14px; } .pk-sum > span { color: var(--fg-3); }
.pk-total small { display: block; font-size: 11.5px; }
@media (max-width: 760px) { .pk-foot .spacer { display: none; } .pk-foot .btn { flex: 1 1 40%; } .pk-sum { flex: 1 1 100%; } }

/* article picker: photo, name, what identifies it for this customer or supplier */
.ac-item .ac-th { width: 32px; height: 32px; flex: none; object-fit: cover; border-radius: 6px; background: var(--bg-2, rgba(0, 0, 0, .05)); }
.ac-item .ac-meta { display: block; flex-basis: 100%; color: var(--fg-3); font-size: 11.5px; }
.ac-items .ac-item { flex-wrap: wrap; justify-content: flex-start; }
.ac-items .ac-item > small:not(.ac-meta) { margin-left: auto; }
/* order line: where the price comes from, what applies now */
.lines-edit .price-src, .lines-edit .price-hint { display: block; margin-top: 2px; font-size: 11px; text-align: right; white-space: normal; }
.lines-edit .price-hint .btn { margin-top: 2px; }
.lines-edit .line-acts { white-space: nowrap; }
/* variant card: the main article's value under an empty field */
.fld .inh { display: block; margin-top: 3px; color: var(--fg-2); font-size: 11.5px; overflow-wrap: anywhere; }
.variant-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 13px; }
.variant-banner span { flex: 1 1 240px; }
.variant-note { margin: 2px 0 8px; }
.pk-measure { grid-column: 1 / -1; } .pk-measure:empty { display: none; }
.pp-qty { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 8px; } .pp-qty input { width: 110px; }
@media (max-width: 760px) {
  .variant-banner .btn { flex: 1 1 100%; min-height: 44px; }
  .ac-item .ac-th { width: 40px; height: 40px; }
  .lines-edit .line-acts .icon-btn { min-width: 40px; min-height: 40px; }
}
/* line editor: columns never crushed; the table scrolls inside its box when the window is narrow */
.lines-edit input[data-k="description"] { min-width: 130px; }
.lines-edit input[data-k="qty"], .lines-edit input[data-k="unit_price"], .lines-edit input[data-k="grammage_gsm"] { min-width: 72px; }
.lines-edit input[data-k="discount_pct"] { min-width: 56px; } .lines-edit select[data-k="vat_rate"] { min-width: 64px; }
.lines-edit .ac { min-width: 150px; }
