:root{--bg:#eef1f5;--card:#fff;--ink:#16202b;--muted:#41506a;--line:#c2ccd9;--brand:#0b7d72;--brand2:#1d4ed8;--ok:#05663d;--okbg:#e7f7ee;--err:#a01410;--errbg:#fdeceb;--cancel:#c2670f;--hover-tint:#eef4ff;--current-tint:#eef4ff}
*{box-sizing:border-box}
body{margin:0;font-family:ui-sans-serif,system-ui,Segoe UI,Roboto,sans-serif;background:var(--bg);color:var(--ink)}
a{color:var(--brand2);text-decoration:none}a:hover{text-decoration:underline}
.topbar{display:flex;flex-direction:column;background:var(--card);border-bottom:1px solid var(--line)}
.topbar-top{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 20px}
.brand{font-weight:800;font-size:18px}.brand span{color:var(--brand)}
.topbar-nav{border-top:1px solid var(--line);background:var(--bg)}
.navgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(128px,1fr))}
.navgrid>a{display:flex;align-items:center;justify-content:center;text-align:center;font-weight:600;padding:10px 8px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-decoration:none;background:var(--card);transition:background .12s,color .12s}
.navgrid>a:hover{background:var(--hover-tint);text-decoration:none}
.navgrid>a.current{background:var(--current-tint);color:var(--brand2);box-shadow:inset 0 -3px 0 var(--brand2)}
.topbar .user{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:13px}
.logout{color:var(--err)}
/* 95% of viewport, fluid; floor at ~95% of a 1500px screen so it stays intact
   down to the 1500x800 design baseline (smaller screens scroll horizontally). */
.container{width:95%;max-width:95%;min-width:1425px;margin:24px auto;padding:0 6px;min-height:calc(100vh - 210px)}
h1{font-size:20px;margin:0 0 16px}
.flash{padding:10px 14px;border-radius:8px;margin-bottom:16px;font-size:14px}
.flash.ok{background:var(--okbg);color:var(--ok);border:1px solid #abefc6}
.flash.err{background:var(--errbg);color:var(--err);border:1px solid #fecdca}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:20px}
.card label{display:block;margin-bottom:14px;font-size:13px;color:var(--muted)}
.card input,.card select,.card textarea{display:block;width:100%;margin-top:4px;padding:9px 10px;border:1px solid var(--line);border-radius:8px;font-size:14px;color:var(--ink)}
.actions{display:flex;align-items:center;gap:14px;margin-top:8px}
.hint{color:var(--muted);font-size:12px;margin-top:14px}
button{cursor:pointer;border:0;border-radius:8px;padding:9px 16px;font-size:14px;font-weight:600;color:#fff;background:var(--brand)}
button:hover{filter:brightness(.95)}
.btn-link{color:var(--muted)}
.btn-ack{background:var(--brand2)}.btn-dispatch{background:var(--ok)}
.btn-reset{background:var(--muted)}
.btn-cancel{display:inline-block;background:var(--cancel);color:#fff;border-radius:8px;padding:9px 16px;font-weight:600;text-decoration:none;line-height:1.2;vertical-align:middle}
.btn-cancel:hover{filter:brightness(.95);color:#fff}
.grid{width:100%;border-collapse:collapse;background:var(--card);border:1px solid var(--line);border-radius:12px;overflow:hidden;font-size:14px}
.grid th,.grid td{text-align:left;padding:10px 12px;border-bottom:1px solid var(--line);vertical-align:top}
.grid th{background:#f8fafc;color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.3px}
/* min-height on a <td> itself is unreliable in table auto-layout (confirmed:
   the browser computes row height from cell CONTENT, not a cell's own
   min-height, in most cases) — anchor a row's minimum height with a normal
   block-level div instead, which reliably respects min-height. Used on the
   Utilizator column (always present, in every row) so rows with little/no
   content elsewhere (e.g. your own account row, missing the admin action
   buttons) don't collapse far shorter than their neighbors. */
.row-min-h{min-height:44px;display:flex;align-items:center}
.grid tr:last-child td{border-bottom:0}
.grid small{color:var(--muted)}
/* --- table polish (V1-inspired): zebra rows, hover, aligned numerics, sortable headers --- */
.grid th{border-bottom:2px solid var(--line)}
.grid:not(.lines) tbody tr:nth-child(even){background:#f7f9fb}
.grid:not(.lines) tbody tr:hover{background:#e9f4f1}
.grid .num{font-variant-numeric:tabular-nums}
.grid tbody a{font-weight:600}
.grid .money{color:var(--ok);font-weight:600}
.grid th.sortable-col{cursor:pointer;user-select:none}
.grid th.sortable-col:hover{color:var(--ink)}
.grid th .sort-ind{opacity:.4;font-size:10px;margin-left:4px}
.grid th.sort-asc .sort-ind,.grid th.sort-desc .sort-ind{opacity:1;color:var(--brand)}
.badge{text-transform:uppercase;letter-spacing:.04em}
.toolbar{display:flex;justify-content:flex-end;gap:10px;margin-bottom:12px}
.empty{color:var(--muted);text-align:center;padding:24px}
.row-actions form{margin:0}
.badge{font-size:12px;padding:2px 8px;border-radius:999px;background:#eef2f6;color:var(--muted)}
.badge.s-submitted{background:#fff7ed;color:#c2410c}
.badge.s-acknowledged{background:#eff6ff;color:#1d4ed8}
.badge.s-ready{background:#f5f3ff;color:#6d28d9}
.badge.s-dispatched{background:var(--okbg);color:var(--ok)}
.badge.s-cancelled{background:#f1f5f9;color:#64748b}
.badge.s-pending_approval{background:#fef3c7;color:#92400e}
.badge.s-returned{background:#fee2e2;color:#991b1b}
.badge.s-ok{background:var(--okbg);color:var(--ok)}

/* ---- "Componente Test" flag: a checkbox that must never blend into the rest of the form ---- */
.test-flag{flex:0 0 auto !important;align-self:flex-end;display:flex;align-items:center;gap:7px;padding:8px 12px;margin-bottom:8px;
    border:1px dashed #d97706;border-radius:8px;background:rgba(217,119,6,.06)}
.test-flag .test-pill{font-size:11px;font-weight:700;letter-spacing:.04em;color:#92400e;background:#fef3c7;padding:2px 7px;border-radius:999px}
:root[data-theme="dark"] .test-flag{border-color:#d99e5c;background:rgba(217,158,11,.08)}
:root[data-theme="dark"] .test-flag .test-pill{background:rgba(217,158,11,.20);color:#fcd34d}
.login-body{display:flex;flex-direction:column;min-height:100vh;align-items:center;justify-content:center;gap:14px;padding:24px;box-sizing:border-box}
.login-card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:28px;width:100%;max-width:340px;box-sizing:border-box;margin:0;box-shadow:0 8px 30px rgba(2,8,20,.06)}
.login-card h1{text-align:center}.login-card h1 span{color:var(--brand)}
.login-card label{display:block;font-size:13px;color:var(--muted);margin-bottom:14px}
.login-card input{display:block;width:100%;margin-top:4px;padding:10px;border:1px solid var(--line);border-radius:8px}
.login-card button{width:100%;margin-top:6px;padding:11px}

/* --- PO / receiving slice --- */
.btn-inline{display:inline-block;background:var(--brand2);color:#fff;padding:7px 12px;border-radius:8px;font-size:13px;font-weight:600}
.btn-inline:hover{text-decoration:none;filter:brightness(.95)}
.card.wide{max-width:100%}
.card .row{display:flex;gap:14px;flex-wrap:wrap;margin-bottom:8px}
.card .row label{flex:1;min-width:150px}
.supplier-picker{display:flex;gap:8px;align-items:center;margin-top:4px}
.supplier-picker select{flex:1;margin-top:0}
.supplier-picker .btn-inline{flex:0 0 auto;white-space:nowrap}
h2{font-size:15px;margin:18px 0 8px;color:var(--muted)}
.grid.lines td{padding:6px 8px}
.grid.lines input,.grid.lines select{width:100%;padding:7px 8px;border:1px solid var(--line);border-radius:6px;font-size:13px}
.meta{display:flex;gap:28px;flex-wrap:wrap;margin-bottom:16px;padding:14px 18px}
.meta div{display:flex;flex-direction:column;gap:3px}
.meta span{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.3px}
.meta.plain{box-shadow:none}
.btn-ack-link{background:var(--ok);color:#fff;padding:6px 10px;border-radius:7px;font-size:13px;font-weight:600}
.btn-ack-link:hover{text-decoration:none;filter:brightness(.95)}
.rm{color:var(--err);font-size:18px;line-height:1;background:none;padding:0}
.badge.s-ordered{background:#eff6ff;color:#1d4ed8}
.badge.s-open{background:#fff7ed;color:#c2410c}
.badge.s-partial{background:#fefce8;color:#a16207}
.badge.s-received{background:var(--okbg);color:var(--ok)}
.badge.s-draft{background:#f1f5f9;color:#64748b}

/* --- reports / periods slice --- */
.num{text-align:right}
.kpi{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:18px 20px;margin-bottom:18px;display:flex;flex-direction:column;gap:4px}
.kpi span{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.3px}
.kpi strong{font-size:26px}
.kpi.small{display:inline-flex;padding:10px 16px}
.kpi.small strong{font-size:18px}
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px;margin-bottom:8px}
.report-card{display:block;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:16px;color:inherit}
.report-card:hover{text-decoration:none;border-color:var(--brand2);box-shadow:0 4px 14px rgba(2,8,20,.05)}
.report-card h3{margin:0 0 6px;font-size:15px}
.report-card p{margin:0;color:var(--muted);font-size:13px}
.btn-close{background:var(--err)}
.muted-row td{color:var(--muted)}
.badge.s-closed{background:#e2e8f0;color:#475569}

/* --- corrections slice --- */
.badge.s-posted{background:var(--okbg);color:var(--ok)}
.badge.s-reversed{background:var(--errbg);color:var(--err)}
.badge.s-superseded{background:#e2e8f0;color:#475569}
.reason{max-width:260px;color:var(--muted);font-size:13px}
/* Deliberately NOT display:flex: that changes the <td>'s own display type away
   from table-cell, which breaks the browser's automatic stretch-to-row-height
   behavior for THIS cell only — its box then sizes to its content instead of
   the row's shared height, so its border-bottom lands a few px above every
   other column's in the same row. inline-block keeps the td a normal table
   cell (always exactly matching row height) while still laying the buttons
   out side by side. */
.row-actions.two form,.row-actions.two>button{display:inline-block;vertical-align:top;margin:0 8px 0 0}
.row-actions.two form:last-child,.row-actions.two>button:last-child{margin-right:0}

/* --- users / onboarding slice --- */
.checkbox{display:flex !important;align-items:center;gap:8px;flex-direction:row}
.checkbox input{width:auto !important;margin:0 !important}
.cred{max-width:560px}
.cred-grid{display:flex;gap:28px;flex-wrap:wrap;margin:8px 0 18px}
.cred-grid div{display:flex;flex-direction:column;gap:3px}
.cred-grid span{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.3px}
.mono{font-family:ui-monospace,monospace;font-size:20px;background:#f1f5f9;padding:4px 10px;border-radius:6px;display:inline-block}
.user a{color:var(--muted)}

/* --- master data slice --- */
.row-form{display:flex;flex-wrap:wrap;gap:10px;align-items:center;max-width:520px}
.row-form.wide{max-width:780px}
.row-form input{flex:1 1 160px;min-width:160px;padding:9px 10px;border:1px solid var(--line);border-radius:8px}
.row-form select{min-width:140px;max-width:240px}
.inline-edit{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.inline-edit input{padding:7px 9px;border:1px solid var(--line);border-radius:7px}
.inline-edit input[name=name]{flex:1;min-width:160px}
.inline-edit select{padding:7px 9px;border:1px solid var(--line);border-radius:7px}
.inline-edit .usage{color:var(--muted);font-size:12px;min-width:56px;text-align:right}
.card.merge{margin-top:18px;max-width:780px}
.card.merge .row{align-items:flex-end}
.eee{display:grid;grid-template-columns:1fr;gap:6px;margin-bottom:8px}
.eee .checkbox{align-items:flex-start}
.eee-help{margin:0 0 12px}
.eee-help summary{cursor:pointer;color:var(--brand);font-weight:600}
.eee-help-text{white-space:pre-wrap;font-family:inherit;background:var(--card,#fff);border:1px solid var(--line,#e5e7eb);border-radius:8px;padding:10px 12px;margin:8px 0 0}
.section-h{margin:22px 0 8px}
button.danger{background:var(--err,#b42318)}
.profile-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:18px;align-items:start}
@media (max-width:1100px){.profile-grid{grid-template-columns:1fr}}
.profile-grid .card h2{margin-top:0}
.profile-col-right{display:flex;flex-direction:column;gap:18px;min-width:0}
table.kv{width:100%;border-collapse:collapse}
table.kv th{text-align:left;color:var(--muted);font-weight:600;padding:5px 12px 5px 0;white-space:nowrap;vertical-align:top;width:1%}
table.kv td{padding:5px 0}
.profile-grid .desc{margin:12px 0 0;white-space:pre-line}
.grid.files .fname a{font-weight:600}
.grid.files .when{color:var(--muted);font-size:13px}
.upload-form{display:flex;flex-direction:column;align-items:flex-start;gap:12px;margin-top:14px}
.dropzone{position:relative;display:block;width:100%;box-sizing:border-box;border:2px dashed var(--line);border-radius:10px;padding:20px 16px;text-align:center;color:var(--muted);cursor:pointer;background:var(--bg);transition:border-color .15s,background .15s}
.dropzone:hover{border-color:var(--brand)}
.dropzone.dragover{border-color:var(--brand);background:var(--okbg);color:var(--ink)}
.dropzone .dz-input{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;clip:rect(0 0 0 0)}
.dz-text{font-size:15.5px}
.dz-icon{font-style:normal;margin-right:6px}
.dz-browse{color:var(--brand);text-decoration:underline}
.dz-list{list-style:none;margin:2px 0 0;padding:0;width:100%}
.dz-list li{font-size:14.5px;color:var(--ink);padding:3px 0;border-bottom:1px solid var(--line)}
.dropzone.uploading{border-color:var(--brand);opacity:.7;pointer-events:none}
.dz-progress{width:100%;display:flex;flex-direction:column;gap:6px}
.dz-bar{height:14px;background:var(--line);border-radius:7px;overflow:hidden}
.dz-bar-fill{display:block;height:100%;width:0;background:var(--brand);border-radius:7px;transition:width .12s linear}
.dz-progress-text{font-size:14px;color:var(--muted)}
th.attach,td.attach{width:1%;text-align:center;padding-left:6px;padding-right:6px;white-space:nowrap}
.grid .clip{color:var(--muted);display:inline-flex;vertical-align:middle}
.grid .clip:hover{color:var(--brand)}
.path-label{color:var(--muted);font-weight:600;margin:0 0 12px}
.kpi-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px;margin-bottom:18px}
.kpi{background:var(--card);border:1px solid var(--line);border-radius:10px;padding:12px 16px;display:flex;flex-direction:column;gap:2px}
.kpi-label{color:var(--muted);font-size:13.5px}
.kpi-val{font-size:23px;font-weight:700}
.kpi-val small{font-size:13px;font-weight:600;color:var(--muted)}
.kpi-sub{color:var(--muted);font-size:12.5px}

/* --- period drill-down slice --- */
.filters{display:flex;gap:10px;margin-bottom:12px}
.filters select{padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:var(--card)}
.num.neg{color:var(--err)}

/* --- serialized parts slice --- */
.mono-cell{font-family:ui-monospace,monospace;font-size:13px}
.grid.lines textarea{width:100%;padding:6px 8px;border:1px solid var(--line);border-radius:6px;font-size:12px;resize:vertical}

/* --- user admin actions slice --- */
.inline-edit .cp{display:flex;align-items:center;gap:5px;font-size:12px;color:var(--muted)}
.inline-edit .cp input{width:auto;margin:0}

/* --- projects management slice (drag-and-drop tree) --- */
.section-head{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin:22px 0 10px}
.section-head h2{margin:0}
.project-tree-wrap{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:12px 14px}
ul.project-tree{list-style:none;margin:0;padding-left:24px}
.project-tree-wrap>ul.project-tree{padding-left:0}
li.project-node{margin:5px 0}
.project-node-row{display:flex;align-items:center;gap:10px;padding:7px 10px;background:#f8fafc;border:1px solid var(--line);border-radius:8px}
.drag-handle{cursor:grab;color:var(--muted);font-size:16px;user-select:none;padding:0 2px}
.project-node-name{font-weight:600}
.project-node-actions{margin-left:auto;display:flex;gap:6px}
.pa-form{margin:0}
.action-btn{border:0;border-radius:6px;padding:4px 9px;font-size:12px;font-weight:600;color:#fff;cursor:pointer}
.action-btn.act{background:var(--brand2)} .action-btn.done{background:var(--ok)} .action-btn.arch{background:var(--err)}
.action-btn.nudge{background:var(--muted)}
.project-tree-wrap.is-dragging ul.project-tree{outline:1px dashed #cbd5e1;border-radius:6px;min-height:16px}
.project-tree-wrap.is-dragging ul.project-tree:empty{min-height:26px;background:#eff6ff}

/* --- incremental part search + footer + version (slice 13) --- */
.appfoot{display:flex;justify-content:space-between;align-items:center;gap:16px;
  max-width:95%;min-width:1425px;margin:8px auto 20px;padding:12px 6px;border-top:1px solid var(--line);
  color:var(--muted);font-size:12px}
.appfoot strong{color:var(--ink)}
.psearch,.usearch{position:relative;display:block}
.psearch .ps-input,.usearch .us-input{width:100%;padding:9px 10px;border:1px solid var(--line);border-radius:8px;font-size:14px}
.grid.lines .psearch .ps-input,.grid.lines .usearch .us-input{padding:7px 8px;border-radius:6px;font-size:13px}
.ps-menu,.us-menu{display:none;position:absolute;z-index:50;left:0;right:0;top:100%;margin-top:2px;
  background:var(--card);border:1px solid var(--line);border-radius:8px;box-shadow:0 8px 24px rgba(2,8,20,.10);
  max-height:280px;overflow:auto}
.ps-item,.us-item{padding:8px 10px;font-size:13px;cursor:pointer;border-bottom:1px solid #f1f5f9}
.ps-item:last-child,.us-item:last-child{border-bottom:0}
.ps-item:hover,.ps-item.is-active,.us-item:hover,.us-item.is-active{background:#eff6ff}
.ps-item em{color:var(--muted);font-style:normal;font-size:12px}
.ps-empty,.us-empty{padding:8px 10px;color:var(--muted);font-size:13px}
.ps-quickadd{padding:8px 10px;font-size:13px;cursor:pointer;color:var(--brand);font-weight:600;border-top:1px solid var(--line)}
.ps-quickadd:hover{background:#eff6ff}
/* line-item tables must not clip the part-search dropdown */
.grid.lines{overflow:visible}

/* Modal overlay (quick-add part, etc.) */
.modal-overlay{position:fixed;inset:0;background:rgba(15,23,42,.55);display:flex;align-items:center;justify-content:center;z-index:200;padding:20px}
.modal-overlay[hidden]{display:none}
.modal-box{max-width:420px;width:100%;max-height:90vh;overflow:auto;box-shadow:0 20px 50px rgba(2,8,20,.35)}
.modal-box h2{margin-top:0}
.modal-box.import-modal{max-width:880px}
.import-preview-wrap{overflow-x:auto;margin-bottom:14px}
#importPreviewTable{min-width:640px}
.imp-code.imp-warn{border-color:var(--err);background:var(--errbg)}
/* reservation multi-line info cells */
.grid.lines .ps-avail{font-weight:700}
.grid.lines .ps-dist,.grid.lines .ps-uom{color:var(--muted);font-size:13px}

/* =====================================================================
   ACCESSIBILITY PASS (slice 15): larger type + stronger contrast.
   Target audience 30–60; secondary/descriptive text was too small/faint.
   ===================================================================== */
body{font-size:16px;line-height:1.55}
small{font-size:13.5px}
h1{font-size:25px;margin:0 0 18px}
h2{font-size:18.5px}
p,label,td,th,li,div,span,a,input,select,textarea,button{} /* anchor for cascade */

/* secondary / descriptive text: bigger + the new darker --muted */
.hint{font-size:14.5px;line-height:1.55;color:var(--muted)}
.flash{font-size:15.5px}
.empty{font-size:15px}
.field-hint,.reason{font-size:14px}

/* top bar */
.topbar-top{padding:12px 22px}
.brand{font-size:20px}
.navgrid>a{font-size:15.5px;color:var(--ink)}
.navgrid>a:hover{color:var(--brand2)}
.topbar .user{font-size:14.5px}
.user a{font-size:14.5px}

/* forms */
.card label{font-size:14.5px;color:var(--ink)}
.card input,.card select,.card textarea{font-size:15.5px}
.row-form input{font-size:15.5px}
.inline-edit input,.inline-edit select{font-size:14.5px}
.filters select{font-size:15px}

/* buttons */
button{font-size:15px}
.btn-inline,.btn-ack-link,.action-btn{font-size:14.5px}

/* tables */
.grid{font-size:15.5px}
.grid th{font-size:13px;color:var(--muted)}
.grid small{font-size:13.5px}
.grid.lines td{font-size:14.5px}
.grid.lines input,.grid.lines select,.grid.lines textarea{font-size:14.5px}

/* badges, kpis, meta */
.badge{font-size:13px;font-weight:600}
.kpi span,.meta span,.cred-grid span{font-size:13px}
.kpi strong{font-size:28px}

/* part-search picker */
.ps-input,.us-input{font-size:15.5px}
.ps-item,.us-item{font-size:15px}
.ps-empty,.us-empty{font-size:14.5px}
.ps-item em{font-size:13px}

/* reports / projects / footer */
.report-card h3{font-size:16.5px}
.report-card p{font-size:14.5px}
.project-node-name{font-size:15.5px}
.appfoot{font-size:13.5px}
/* let the (now larger) top nav wrap instead of overflowing on narrower screens */
.topbar-top{flex-wrap:wrap;row-gap:6px}

/* === Receptions: serials on a full-width 2nd row, grouped with its line === */
.grid.lines tbody.line-item tr.line td{border-bottom:0}
.grid.lines tbody.line-item tr.line-serials td{border-bottom:2px solid var(--line);padding-top:0;padding-bottom:12px;background:#f6f8fb}
.serials-label{display:block;font-size:14px;color:var(--muted);margin-bottom:5px;font-weight:600}
.serials-box{width:100%;min-height:54px;padding:9px 11px;border:1px solid var(--line);border-radius:7px;font-size:16px;line-height:1.5;resize:vertical}

/* =====================================================================
   ACCESSIBILITY PASS 2 (slice 16): a further, larger font increase.
   Supersedes pass 1 — values are intentionally bigger again.
   ===================================================================== */
body{font-size:17.5px;line-height:1.6}
small{font-size:14.5px}
h1{font-size:29px;margin:0 0 18px}
h2{font-size:21px}
.hint{font-size:16px;line-height:1.6}
.flash{font-size:16.5px}
.empty{font-size:16.5px}
.field-hint,.reason{font-size:15px}

.topbar-top{padding:13px 22px}
.brand{font-size:22px}
.navgrid>a{font-size:17px}
.topbar .user{font-size:16px}
.user a{font-size:16px}

.card label{font-size:16px}
.card input,.card select,.card textarea{font-size:17px}
.row-form input{font-size:17px}
.inline-edit input,.inline-edit select{font-size:15.5px}
.filters select{font-size:16.5px}

button,.btn-cancel{font-size:16.5px}
.btn-inline,.btn-ack-link,.action-btn{font-size:15.5px}

.grid{font-size:17px}
.grid th{font-size:14px}
.grid small{font-size:14.5px}
.grid.lines td{font-size:16px}
.grid.lines input,.grid.lines select,.grid.lines textarea{font-size:16px}

.badge{font-size:14px}
.kpi span,.meta span,.cred-grid span{font-size:14px}
.kpi strong{font-size:32px}

.ps-input,.us-input{font-size:17px}
.ps-item,.us-item{font-size:16.5px}
.ps-empty,.us-empty{font-size:15.5px}
.ps-item em{font-size:14px}

.report-card h3{font-size:18.5px}
.report-card p{font-size:16px}
.project-node-name{font-size:17px}
.appfoot{font-size:14.5px}

/* --- components page incremental search bar (slice 17) --- */
.search-bar{display:flex;gap:12px;align-items:center;margin-bottom:14px;flex-wrap:wrap}
.search-bar input{flex:0 1 340px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;font-size:16px}
.search-bar select{padding:10px 12px;border:1px solid var(--line);border-radius:8px;font-size:15px;background:var(--card);color:var(--ink);cursor:pointer}
.search-bar .btn-inline{margin-left:auto}

/* --- admin hover menu + highlighted Aprobari (slice 19) --- */
.nav-menu{position:relative;display:flex;align-items:center;justify-content:center;border-right:1px solid var(--line);border-bottom:1px solid var(--line);background:var(--card)}
.nav-menu-btn{display:flex;align-items:center;justify-content:center;width:100%;height:100%;cursor:pointer;color:var(--ink);font-size:17px;font-weight:600;user-select:none;white-space:nowrap;padding:10px 8px;transition:background .12s,color .12s}
.nav-menu:hover .nav-menu-btn,.nav-menu:focus-within .nav-menu-btn{color:var(--brand2);background:var(--hover-tint)}
.nav-menu-btn.current{color:var(--brand2);background:var(--current-tint);box-shadow:inset 0 -3px 0 var(--brand2)}
.nav-menu-list a.current{color:var(--brand2);background:var(--current-tint)}
.nav-menu-list{display:none;position:absolute;top:100%;left:0;right:0;margin-top:0;min-width:200px;background:var(--card);
  border:1px solid var(--line);border-top:0;border-radius:0 0 10px 10px;box-shadow:0 12px 32px rgba(2,8,20,.16);padding:6px;z-index:70;text-align:left}
.nav-menu:hover .nav-menu-list,.nav-menu:focus-within .nav-menu-list{display:block}
.nav-menu-list a{display:block;padding:10px 16px;font-size:16px;color:var(--ink);border:0;text-align:left}
.nav-menu-list a:hover{background:var(--hover-tint);text-decoration:none}
/* invisible bridge so the menu doesn't close when moving cursor to the list */
.nav-menu::after{content:"";position:absolute;top:100%;left:0;right:0;height:10px}
/* nav alert items (picker queue, approvals): plain link until work is waiting,
   then they "light up" — filled box + glow + count badge — to draw the eye. */
.navgrid>a.nav-alert.lit{background:var(--brand);color:#fff;font-weight:700;animation:navpulse 1.9s ease-in-out infinite}
.navgrid>a.nav-alert.lit:hover{text-decoration:none;filter:brightness(1.08);background:var(--brand);color:#fff}
@keyframes navpulse{0%,100%{box-shadow:inset 0 0 0 999px rgba(0,0,0,0)}50%{box-shadow:inset 0 0 0 999px rgba(255,255,255,.10)}}
@media (prefers-reduced-motion: reduce){.navgrid>a.nav-alert.lit{animation:none}}
.nav-count{display:inline-block;background:var(--err);color:#fff;border-radius:999px;font-size:13px;font-weight:700;padding:0 7px;margin-left:5px;line-height:1.5}

/* --- user manual page (slice 20) --- */
.manual{max-width:1060px}
.manual .lead{font-size:18px;line-height:1.6;color:var(--ink);margin:0 0 18px}
.manual h2{font-size:22px;margin:30px 0 10px;color:var(--ink)}
.manual h3{font-size:18px;margin:20px 0 6px;color:var(--ink)}
.manual .card{max-width:none}
.manual-toc{max-width:none}
.manual-toc ol{margin:8px 0 0;padding-left:24px}
.manual-toc a{font-size:16.5px}
.manual-list{margin:6px 0 10px;padding-left:22px}
.manual-list li{margin:7px 0;line-height:1.55;font-size:16.5px}
.manual table.grid{margin:8px 0 6px;font-size:16px}
.r{display:inline-block;padding:1px 9px;border-radius:999px;font-size:13px;font-weight:700;color:#fff}
.r-e{background:#1d4ed8}.r-p{background:#0b7d72}.r-a{background:#b45309}.r-all{background:#475569}

/* ---- Reservation builder (per-project sections) ---- */
.rb-section-head { display:flex; align-items:flex-end; gap:18px; justify-content:space-between; margin-bottom:10px; }
.rb-section-head .rb-project { min-width:280px; }
.rb-section { border-left:4px solid var(--brand2); }
.tr-row-error .tr-to-select,.tr-row-error .tr-qty{border-color:var(--err);background:var(--errbg)}

/* ---- Reservation builder: cross-project raid picker (over-budget lines) ---- */
.rb-item-raid td{border-bottom:2px solid var(--line);padding-top:0;padding-bottom:12px;background:#fff7ed}
.raid-box{padding:2px 0}
.raid-msg{color:#9a5b12;margin:0 0 8px;font-weight:600}
.raid-source-row{display:flex;align-items:center;gap:8px;margin-bottom:6px}
.raid-source-row select{flex:1;min-width:220px}
.raid-source-row input{width:80px}
.raid-covered{display:block;margin-top:4px;font-weight:600}
:root[data-theme="dark"] .rb-item-raid td{background:rgba(217,138,79,.08)}
:root[data-theme="dark"] .raid-msg{color:#e0a15c}

/* ---- Picker queue: section line items (sub-table) ---- */
.section-items > td { padding:0 0 6px 18px; background:transparent; border-bottom:2px solid var(--line); }
.subgrid { width:auto; min-width:60%; margin:2px 0 4px; box-shadow:none; }
.subgrid th, .subgrid td { padding:4px 12px; }
.subgrid thead th { background:transparent; color:var(--muted); border-bottom:1px solid var(--line); }

/* ---- Manual: standard / technical version switch ---- */
.manual-switch { display:inline-flex; border:1px solid var(--line); border-radius:8px; overflow:hidden; margin-bottom:16px; }
.manual-switch button { border:0; background:var(--bg); color:var(--ink); padding:8px 18px; font-size:15.5px; cursor:pointer; }
.manual-switch button + button { border-left:1px solid var(--line); }
.manual-switch button.active { background:var(--brand2); color:#fff; font-weight:600; }

/* ---- Dashboard ---- */
a.brand { color:var(--ink); text-decoration:none; }
a.kpi.kpi-link { color:inherit; text-decoration:none; transition:border-color .15s, box-shadow .15s; }
a.kpi.kpi-link:hover { border-color:var(--brand); box-shadow:0 2px 8px rgba(0,0,0,.08); }
.kpi-val.warn { color:var(--cancel); }

/* ---- Physical inventory (stock counts) ---- */
.badge.s-approved { background:#e7f6ee; color:#0b7d43; }
.badge.s-rejected { background:#fdeaea; color:#b3261e; }

/* ---- Camera barcode scanner ---- */
.ps-scan { border:1px solid var(--line); background:var(--card); border-radius:8px; padding:4px 8px; margin-left:6px; cursor:pointer; font-size:15px; vertical-align:middle; }
.scan-overlay { display:none; position:fixed; inset:0; z-index:1000; background:rgba(0,0,0,.92); flex-direction:column; align-items:center; justify-content:center; gap:14px; }
.scan-overlay video { width:min(96vw,720px); max-height:70vh; border-radius:10px; }
.scan-frame { position:absolute; width:min(80vw,560px); height:160px; border:3px solid #4ade80; border-radius:12px; pointer-events:none; }
.scan-hint { color:#e2e8f0; font-size:15px; }
.scan-close { background:#fff; color:#16202b; border:0; border-radius:8px; padding:10px 22px; font-size:16px; cursor:pointer; }

/* ---- MOBILE / floor devices (phones & tablets) ----
   The desktop layout pins .container to min-width:1425px; below 1000px we go
   fully fluid so pickers can work on phones. Wide tables become horizontally
   scrollable instead of breaking the page. */
@media (max-width: 1000px) {
  .container, .appfoot { min-width:0; width:auto; max-width:none; margin:10px 8px; padding:0 4px; }
  .topbar-top { flex-wrap:wrap; padding:8px 10px; gap:6px; }
  .navgrid { grid-template-columns:repeat(auto-fit,minmax(96px,1fr)); }
  .navgrid>a { font-size:14px; padding:8px 5px; }
  .nav-menu-btn { font-size:14px; padding:8px 5px; }
  h1 { font-size:22px; margin:10px 0; }
  .grid { display:block; overflow-x:auto; -webkit-overflow-scrolling:touch; }
  .grid.subgrid { display:table; }
  .card { padding:12px; }
  .row-form { flex-direction:column; align-items:stretch; }
  .row-form input, .row-form select { max-width:none; width:auto; }
  .kpi-row { grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; }
  .kpi-val { font-size:19px; }
  .toolbar { flex-wrap:wrap; gap:8px; }
  .rb-section-head { flex-direction:column; align-items:stretch; gap:8px; }
  .actions { flex-wrap:wrap; gap:8px; }
  .actions button, .actions .btn-cancel { width:100%; text-align:center; }
  input, select, textarea, button { font-size:16px !important; } /* stop iOS zoom-on-focus */
}

/* ---- Editable document numbers (PO/GRN) ---- */
.docnum-note { font-size: 13.5px; margin-top: 3px; min-height: 0; }
.docnum-note.ok  { color: var(--ok); }
.docnum-note.bad { color: var(--err); font-weight: 600; }

/* ---- Login health strip (coarse self-report; unauthenticated page) ---- */
.health-strip { width: 100%; max-width: 340px; margin: 0; box-sizing: border-box; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; font-size: 14px; }
.health-strip .hs-overall { font-weight: 700; margin-bottom: 8px; }
.health-strip .hs-overall.hs-ok  { color: var(--ok); }
.health-strip .hs-overall.hs-err { color: var(--err); }
.health-strip ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.health-strip li { display: flex; align-items: center; gap: 7px; color: var(--muted); }
.health-strip li em { font-style: normal; margin-left: auto; color: var(--ink); }
.hs-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.hs-dot.hs-ok  { background: #22a565; box-shadow: 0 0 4px rgba(34,165,101,.55); }
.hs-dot.hs-err { background: #d64545; box-shadow: 0 0 4px rgba(214,69,69,.55); }
.hs-dot.hs-na  { background: #9aa7b8; }

/* ============================================================
   THEMING — light is the :root default; dark via [data-theme=dark].
   The pre-paint script in layout stamps a concrete data-theme; this
   media fallback only matters if JS is off AND the OS is dark.
   Login page is excluded (own inline theme + data-theme="light").
   ============================================================ */
html{color-scheme:light}
:root[data-theme="dark"]{color-scheme:dark}

@media (prefers-color-scheme: dark){
  :root:not([data-theme]){
    --bg:#0e1524;--card:#161f30;--ink:#e6eefb;--muted:#9aa8bd;--line:#2a3750;
    --brand:#2dd4bf;--brand2:#5b8cff;--ok:#34d399;--okbg:#12251c;--err:#f87171;--errbg:#2a1616;--cancel:#f0a35a;
  }
}

:root[data-theme="dark"]{
  --bg:#0e1524;--card:#161f30;--ink:#e6eefb;--muted:#9aa8bd;--line:#2a3750;
  --brand:#2dd4bf;--brand2:#5b8cff;--ok:#34d399;--okbg:#12251c;--err:#f87171;--errbg:#2a1616;--cancel:#f0a35a;
  --hover-tint:rgba(255,255,255,.06);--current-tint:rgba(91,140,255,.14);
}

/* Nav bar deliberately runs the OPPOSITE theme from the rest of the page —
   re-declares the same tokens locally on .topbar-nav with the other theme's
   values, so every rule inside it (cells, dropdowns, submenus, lit pulse,
   hover/current tints) inverts for free with no duplicated selectors. Scoped
   to .topbar-nav only — .topbar-top (logo + user block) is untouched. */
:root:not([data-theme="dark"]) .topbar-nav{
  --bg:#0e1524;--card:#161f30;--ink:#e6eefb;--muted:#9aa8bd;--line:#2a3750;
  --brand:#2dd4bf;--brand2:#8ab4ff;--err:#f87171;
  --hover-tint:rgba(138,180,255,.16);--current-tint:rgba(138,180,255,.22);
}
:root[data-theme="dark"] .topbar-nav{
  --bg:#eef1f5;--card:#fff;--ink:#16202b;--muted:#41506a;--line:#c2ccd9;
  --brand:#0b7d72;--brand2:#1d4ed8;--err:#a01410;
  --hover-tint:#eef4ff;--current-tint:#eef4ff;
}

/* form-control text stays light where a background is set explicitly */
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea{color:var(--ink)}

/* surfaces that used literal light colors */
:root[data-theme="dark"] .flash.ok{border-color:rgba(52,211,153,.35)}
:root[data-theme="dark"] .flash.err{border-color:rgba(248,113,113,.35)}
:root[data-theme="dark"] .grid th{background:rgba(255,255,255,.045)}
:root[data-theme="dark"] .grid:not(.lines) tbody tr:nth-child(even){background:rgba(255,255,255,.025)}
:root[data-theme="dark"] .grid:not(.lines) tbody tr:hover{background:rgba(45,212,191,.10)}
:root[data-theme="dark"] .grid.lines tbody.line-item tr.line-serials td{background:rgba(255,255,255,.03)}
:root[data-theme="dark"] .mono{background:rgba(255,255,255,.06)}
:root[data-theme="dark"] .project-node-row{background:rgba(255,255,255,.035)}
:root[data-theme="dark"] .project-tree-wrap.is-dragging ul.project-tree{outline-color:rgba(255,255,255,.25)}
:root[data-theme="dark"] .project-tree-wrap.is-dragging ul.project-tree:empty{background:rgba(91,140,255,.12)}
:root[data-theme="dark"] .ps-item,
:root[data-theme="dark"] .us-item{border-bottom-color:var(--line)}
:root[data-theme="dark"] .ps-item:hover,
:root[data-theme="dark"] .ps-item.is-active,
:root[data-theme="dark"] .us-item:hover,
:root[data-theme="dark"] .us-item.is-active{background:rgba(91,140,255,.14)}
:root[data-theme="dark"] .ps-quickadd:hover{background:rgba(91,140,255,.14)}
/* nav hover/current dark values now come from --hover-tint/--current-tint
   (see :root[data-theme="dark"] near the top) — no per-selector override needed. */

/* status badges — dark tints */
:root[data-theme="dark"] .badge{background:rgba(148,163,184,.16);color:#cbd5e1}
:root[data-theme="dark"] .badge.s-submitted,
:root[data-theme="dark"] .badge.s-open{background:rgba(251,146,60,.18);color:#fdba74}
:root[data-theme="dark"] .badge.s-partial{background:rgba(234,179,8,.18);color:#fcd34d}
:root[data-theme="dark"] .badge.s-acknowledged,
:root[data-theme="dark"] .badge.s-ordered{background:rgba(96,165,250,.18);color:#93c5fd}
:root[data-theme="dark"] .badge.s-ready{background:rgba(167,139,250,.18);color:#c4b5fd}
:root[data-theme="dark"] .badge.s-cancelled,
:root[data-theme="dark"] .badge.s-draft,
:root[data-theme="dark"] .badge.s-closed,
:root[data-theme="dark"] .badge.s-superseded{background:rgba(148,163,184,.16);color:#cbd5e1}
:root[data-theme="dark"] .badge.s-pending_approval{background:rgba(217,158,11,.20);color:#fcd34d}
:root[data-theme="dark"] .badge.s-returned{background:rgba(220,38,38,.20);color:#fca5a5}
:root[data-theme="dark"] .badge.s-approved,
:root[data-theme="dark"] .badge.s-received{background:rgba(52,211,153,.18);color:#6ee7b7}
:root[data-theme="dark"] .badge.s-rejected,
:root[data-theme="dark"] .badge.s-reversed{background:rgba(248,113,113,.18);color:#fca5a5}

/* header theme toggle */
.theme-toggle{background:transparent;border:1px solid var(--line);color:var(--ink);border-radius:8px;padding:3px 9px;font-size:15px;line-height:1.2;cursor:pointer}
.theme-toggle:hover{border-color:var(--brand)}
