/* =============================================================================
   Cell Lab Manager 2.0 - עיצוב אפליקציית המעבדה
   שפה עיצובית: לוח מעגל מודפס. מסכת הלחמה ירוקה כהה + ציפוי זהב (ENIG),
   כרטיסי תיקון בצורת תג שירות. טיפוגרפיה: IBM Plex Sans Hebrew + Plex Mono.
   ============================================================================= */
:root {
  --mask: #0c3b33;
  --mask-2: #135045;
  --mask-ink: #cfe3dc;
  --gold: #e2a93b;
  --gold-deep: #b9842a;
  --gold-ink: #2d2000;

  --bg: #edf0ed;
  --panel: #fbfcfa;
  --panel-2: #f3f6f3;
  --ink: #14211d;
  --muted: #566560;
  --line: #d8dfda;
  --line-2: #c5cfc9;
  --danger: #c2372f;
  --ok: #1e9e62;
  --shadow: 0 1px 0 rgba(12, 59, 51, .06), 0 6px 18px -8px rgba(12, 59, 51, .22);

  --st-received: #6b7a85;
  --st-in_progress: #2f6fde;
  --st-waiting_approval: #b97d00;
  --st-waiting_parts: #d2531f;
  --st-completed: #1e9e62;
  --st-delivered: #138a8a;
  --st-cancelled: #a8423c;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --font: "IBM Plex Sans Hebrew", "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --side: 236px;
}

:root[data-theme="dark"] {
  --bg: #0a1311;
  --panel: #101c19;
  --panel-2: #14231f;
  --ink: #e5eee9;
  --muted: #94a8a1;
  --line: #22352f;
  --line-2: #2e463f;
  --shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 8px 24px -10px rgba(0, 0, 0, .6);
  --mask: #08241f;
  --mask-2: #0f3a32;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body.clm-app {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 1;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--muted); }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: .01em; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ---------- מבנה ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--mask); color: var(--mask-ink);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.05) 1px, transparent 0); background-size: 14px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; }
.brand-name { font-weight: 600; color: #fff; line-height: 1.2; font-size: 15px; }
.brand-sub { font-size: 12px; color: #86ada2; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r-sm);
  color: var(--mask-ink); text-decoration: none; font-weight: 500; position: relative;
}
.nav a:hover { background: rgba(255,255,255,.07); }
.nav a[aria-current="page"] { background: var(--mask-2); color: #fff; }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 3px 3px 0; background: var(--gold);
}
.nav .count { margin-inline-start: auto; font-size: 12px; background: rgba(226,169,59,.18); color: var(--gold); padding: 0 7px; border-radius: 20px; font-family: var(--mono); }
.nav-sep { height: 1px; background: rgba(255,255,255,.1); margin: 10px 8px; }
.side-foot { margin-top: auto; padding: 10px 8px 0; font-size: 13px; color: #86ada2; }
.side-foot b { display: block; color: #fff; font-weight: 500; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.top h1 { font-size: 18px; margin: 0; font-weight: 600; }
.top .grow { flex: 1; }
.searchbtn {
  display: flex; align-items: center; gap: 8px; min-width: 260px; padding: 8px 12px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--line); color: var(--muted); cursor: pointer;
}
.searchbtn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.searchbtn kbd { margin-inline-start: auto; font-family: var(--mono); font-size: 11px; border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; }
.page { padding: 22px 24px 90px; max-width: 1480px; width: 100%; }

/* ---------- כפתורים ושדות ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 14px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-weight: 500; text-decoration: none; white-space: nowrap;
  min-height: 38px;
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--gold); border-color: var(--gold-deep); color: var(--gold-ink); font-weight: 600; }
.btn.primary:hover { background: #ecb84f; }
.btn.dark { background: var(--mask); border-color: var(--mask); color: #fff; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); border-color: var(--line); }
.btn.sm { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn.icon { padding: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl { font-size: 13px; font-weight: 500; color: var(--muted); }
.in, select.in, textarea.in {
  width: 100%; padding: 9px 11px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--panel); min-height: 40px;
}
textarea.in { min-height: 84px; resize: vertical; }
.in:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold-deep); }
.in.ltr { direction: ltr; text-align: right; font-family: var(--mono); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hint { font-size: 12.5px; color: var(--muted); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px 0; }
.card-h h2, .card-h h3 { margin: 0; font-size: 15px; font-weight: 600; }
.card-b { padding: 14px 18px 18px; }
.sec-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 10px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 20px; font-size: 12.5px; font-weight: 500;
  background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap;
}
.chip.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--muted)); }
.chip.warn { background: #fff4d6; border-color: #ecd28a; color: #6d4b00; }
.chip.bad { background: #fde6e4; border-color: #f0b8b3; color: #8f241d; }
.chip.good { background: #def5e8; border-color: #a6dcc0; color: #12633f; }
:root[data-theme="dark"] .chip.warn { background: #3b2e0c; border-color: #6b5518; color: #f0cf7a; }
:root[data-theme="dark"] .chip.bad { background: #3f1714; border-color: #74312c; color: #f4a8a1; }
:root[data-theme="dark"] .chip.good { background: #10311f; border-color: #1f5c3b; color: #8fdcb2; }
.tog { cursor: pointer; user-select: none; }
.tog[aria-pressed="true"] { background: var(--mask); color: #fff; border-color: var(--mask); }

/* ---------- דאשבורד ---------- */
.dash { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.dash > * { min-width: 0; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }

.pipe { padding: 18px; }
.pipe-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.pipe-head .big { font-size: 34px; font-weight: 300; line-height: 1; letter-spacing: -.02em; }
.pipe-bar { display: flex; height: 14px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--panel-2); }
.pipe-bar i { display: block; background: var(--c); min-width: 6px; }
.pipe-legend { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.pipe-legend a { text-decoration: none; padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); display: block; background: var(--panel); }
.pipe-legend a:hover { border-color: var(--ink); }
.pipe-legend b { font-size: 22px; font-weight: 500; display: block; line-height: 1.1; }
.pipe-legend span { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.pipe-legend span::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.kpi { padding: 14px 18px; border-inline-start: 1px solid var(--line); }
.kpi:first-child { border-inline-start: 0; }
.kpi .v { font-size: 24px; font-weight: 500; line-height: 1.15; }
.kpi .l { font-size: 12.5px; color: var(--muted); }
.kpi .d { font-size: 12px; margin-top: 2px; }
.kpi .d.up { color: var(--ok); } .kpi .d.down { color: var(--danger); }

.attn { list-style: none; margin: 0; padding: 0; }
.attn li { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line); cursor: pointer; }
.attn li:first-child { border-top: 0; }
.attn li:hover { background: var(--panel-2); }
.attn .ic-wrap { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--panel-2); flex: none; }
.attn .ic-wrap.bad { background: #fde6e4; color: var(--danger); } .attn .ic-wrap.warn { background: #fff4d6; color: #8a5d00; } .attn .ic-wrap.good { background: #def5e8; color: #12633f; }
.attn .t { font-weight: 500; line-height: 1.3; }
.attn .s { font-size: 12.5px; color: var(--muted); }
.attn .end { margin-inline-start: auto; text-align: end; font-size: 13px; }
.empty { padding: 26px 18px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--ink); margin-bottom: 2px; }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 230px; padding-top: 10px; }
.bars .b { flex: 1; background: var(--mask-2); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; opacity: .85; }
.bars .b.today { background: var(--gold); opacity: 1; }
.bars .b:hover { opacity: 1; outline: 2px solid var(--gold); }
.bars-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 6px; font-family: var(--mono); }

.feed { list-style: none; margin: 0; padding: 0 18px 8px; }
.feed li { padding: 9px 0; border-top: 1px dashed var(--line); font-size: 13.5px; }
.feed li:first-child { border-top: 0; }
.feed .m { color: var(--muted); font-size: 12px; }
.meter { height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--mask-2); }
.row-meter { display: grid; grid-template-columns: 120px 1fr 34px; gap: 10px; align-items: center; padding: 6px 0; font-size: 14px; }

/* ---------- לוח עבודה ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .in { width: auto; min-width: 150px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: transparent; padding: 7px 13px; cursor: pointer; font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--mask); color: #fff; }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(268px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 14px; align-items: start; scroll-snap-type: x proximity; }
.lane { background: color-mix(in srgb, var(--panel-2) 80%, transparent); border: 1px solid var(--line); border-radius: var(--r-lg); min-height: 220px; scroll-snap-align: start; }
.lane-h { display: flex; align-items: center; gap: 8px; margin: 0; padding: 11px 12px; border-bottom: 3px solid var(--c); font-weight: 600; font-size: 14px; }
.lane-h .n { margin-inline-start: auto; font-family: var(--mono); font-size: 12.5px; background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 0 8px; }
.lane-b { padding: 10px; display: grid; gap: 10px; }
.lane.over { outline: 2px dashed var(--gold); outline-offset: -4px; background: color-mix(in srgb, var(--gold) 10%, var(--panel-2)); }

/* תג שירות */
.tag {
  position: relative; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 14px 0; cursor: pointer;
  box-shadow: var(--shadow); display: block; width: 100%; text-align: start; overflow: hidden;
  border-inline-start: 5px solid var(--p, var(--line-2));
}
.tag:hover { border-color: var(--ink); }
.tag.dragging { opacity: .45; }
.tag::before {
  content: ""; position: absolute; top: 9px; inset-inline-end: 12px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); box-shadow: inset 0 1px 2px rgba(0,0,0,.35);
}
.tag-no { display: flex; justify-content: space-between; gap: 8px; padding-inline-end: 16px; font-size: 12px; color: var(--muted); }
.tag-no .mono { direction: ltr; }
.tag-dev { font-weight: 600; font-size: 15.5px; line-height: 1.3; margin: 2px 0 1px; padding-inline-end: 16px; }
.tag-cus { font-size: 13.5px; color: var(--muted); }
.tag-prob { font-size: 13px; margin: 8px 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 11px; }
.tag-foot {
  display: flex; align-items: center; gap: 8px; margin: 0 -14px; padding: 8px 14px; background: var(--panel-2); font-size: 13px;
  border-top: 2px dashed var(--line-2);
}
.tag-foot .price { margin-inline-start: auto; font-weight: 600; }
.tag-foot .tech { width: 22px; height: 22px; border-radius: 50%; background: var(--mask); color: #fff; font-size: 11px; display: grid; place-items: center; font-weight: 600; }
.pri-high { --p: var(--gold); } .pri-urgent { --p: var(--danger); }

/* ---------- טבלאות ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: start; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel-2); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--panel-2); }
.tbl .num { text-align: end; font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 14px; justify-content: space-between; border-top: 1px solid var(--line); }

/* ---------- מגירה ומודאל ---------- */
.scrim { position: fixed; inset: 0; background: rgba(6, 20, 17, .55); z-index: 60; animation: fade .15s ease-out; }
.drawer {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: min(760px, 100vw); background: var(--bg); z-index: 61; display: flex; flex-direction: column;
  box-shadow: 0 0 60px rgba(0,0,0,.35); animation: slide .2s ease-out;
}
.drawer-h { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.drawer-h h2 { margin: 0; font-size: 17px; }
.drawer-b { padding: 18px 20px 30px; overflow: auto; flex: 1; display: grid; gap: 14px; align-content: start; }
.drawer-f { padding: 12px 20px; background: var(--panel); border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.modal {
  position: fixed; z-index: 61; inset: 0; margin: auto; width: min(560px, calc(100vw - 24px)); height: fit-content; max-height: calc(100vh - 24px);
  background: var(--panel); border-radius: var(--r-lg); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.4);
}
.modal .drawer-b { background: var(--panel); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(-24px); opacity: 0; } }

.steps { display: flex; gap: 4px; flex-wrap: wrap; }
.steps button { flex: 1; min-width: 96px; padding: 8px 6px; border: 1px solid var(--line-2); background: var(--panel); border-radius: var(--r-sm); cursor: pointer; font-size: 13px; font-weight: 500; border-bottom: 3px solid var(--line-2); }
.steps button[aria-pressed="true"] { border-bottom-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--panel)); font-weight: 600; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.parts-row { display: grid; grid-template-columns: 1.6fr 70px 96px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.totals { display: grid; gap: 4px; margin-inline-start: auto; width: min(280px, 100%); font-size: 14px; }
.totals div { display: flex; justify-content: space-between; }
.totals .sum { border-top: 2px solid var(--ink); padding-top: 6px; font-weight: 600; font-size: 17px; }
.tl { list-style: none; margin: 0; padding: 0; position: relative; }
.tl::before { content: ""; position: absolute; inset-block: 6px; inset-inline-start: 5px; width: 2px; background: var(--line); }
.tl li { position: relative; padding: 0 22px 12px 0; padding-inline: 22px 0; }
.tl li::before { content: ""; position: absolute; inset-inline-start: 0; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--panel); border: 2px solid var(--mask-2); }
.tl li.pub::before { background: var(--gold); border-color: var(--gold-deep); }
.tl .m { font-size: 12px; color: var(--muted); }

/* ---------- קבלת מכשיר ---------- */
.intake { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.sec { margin-bottom: 16px; position: relative; }
.sec:first-child { z-index: 3; }
.sec .card-h { padding-bottom: 2px; }
.sec .num { width: 26px; height: 26px; border-radius: 50%; background: var(--mask); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; font-family: var(--mono); }
.types { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.types button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-size: 13px; font-weight: 500; }
.types button .ic { width: 24px; height: 24px; }
.types button[aria-pressed="true"] { background: var(--mask); color: #fff; border-color: var(--mask); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { cursor: pointer; padding: 5px 11px; font-size: 13.5px; }
.chips .chip[aria-pressed="true"] { background: var(--gold); border-color: var(--gold-deep); color: var(--gold-ink); }
.summary { position: sticky; top: 74px; }
.suggest { position: absolute; z-index: 10; inset-inline: 0; top: 100%; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.suggest button { display: flex; width: 100%; gap: 10px; padding: 9px 12px; border: 0; background: transparent; cursor: pointer; text-align: start; }
.suggest button:hover { background: var(--panel-2); }
.pill-ok { color: var(--ok); font-size: 13px; display: flex; align-items: center; gap: 6px; }

/* ---------- חיפוש מהיר ---------- */
.palette { position: fixed; z-index: 70; top: 12vh; inset-inline: 0; margin-inline: auto; width: min(640px, calc(100vw - 20px)); background: var(--panel); border-radius: var(--r-lg); box-shadow: 0 30px 90px rgba(0,0,0,.45); overflow: hidden; }
.palette input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; font-size: 17px; background: transparent; outline: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 52vh; overflow: auto; }
.palette li button { display: flex; gap: 12px; align-items: center; width: 100%; border: 0; background: transparent; padding: 9px 12px; border-radius: var(--r-sm); cursor: pointer; text-align: start; }
.palette li button:hover, .palette li button.act { background: var(--panel-2); }
.palette .ty { font-size: 11.5px; padding: 0 7px; border-radius: 4px; background: var(--mask); color: #fff; }

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 90; inset-block-start: 14px; inset-inline: 0; margin-inline: auto; width: min(420px, calc(100vw - 24px)); display: grid; gap: 8px; pointer-events: none; }
.toast { background: var(--mask); color: #fff; padding: 11px 16px; border-radius: var(--r); box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; animation: slide .2s ease-out; border-inline-start: 4px solid var(--gold); }
.toast.err { background: #5b1713; border-inline-start-color: #ff8d84; }

/* ---------- התחברות ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: var(--mask); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.07) 1px, transparent 0); background-size: 16px 16px; }
.login-art h1 { font-size: 40px; line-height: 1.15; font-weight: 300; margin: 0 0 14px; letter-spacing: -.01em; max-width: 14ch; }
.login-art p { color: #9fc4b9; max-width: 38ch; }
.login-form { display: grid; place-items: center; padding: 28px; background: var(--bg); }
.login-form form { width: min(380px, 100%); display: grid; gap: 14px; }
.err-msg { color: var(--danger); font-size: 14px; min-height: 20px; }

/* ---------- ניווט נייד ---------- */
.bottom { display: none; }

@media (max-width: 1100px) {
  .intake { grid-template-columns: 1fr; } .summary { position: static; }
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .pipe-legend { grid-template-columns: repeat(3, 1fr); }
  .kpis { grid-template-columns: repeat(2, 1fr); } .kpi:nth-child(3) { border-inline-start: 0; }
}
@media (max-width: 820px) {
  .shell { display: block; }
  .side { display: none; }
  .top { padding: 10px 14px; } .searchbtn { min-width: 0; flex: 1; } .top h1 { font-size: 16px; } .searchbtn kbd, .top .hide-m { display: none; }
  .page { padding: 14px 14px 100px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .types { grid-template-columns: repeat(4, 1fr); }
  .login { grid-template-columns: 1fr; } .login-art { display: none; }
  .bottom {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 30; background: var(--mask);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--mask-ink); text-decoration: none; font-size: 11.5px; padding: 4px 0; }
  .bottom a[aria-current="page"] { color: var(--gold); }
  .bottom .fab { margin-top: -22px; }
  .bottom .fab span.c { width: 52px; height: 52px; border-radius: 50%; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; box-shadow: 0 6px 16px rgba(0,0,0,.35); }
  .drawer { width: 100vw; }
  .board { grid-auto-columns: 84vw; }
  .parts-row { grid-template-columns: 1fr 60px 80px 32px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { body.clm-app > *:not(#print-root) { display: none !important; } }

/* תפריט נפתח בכפתורי המגירה */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; } .menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; inset-block-end: calc(100% + 6px); inset-inline-start: 0; background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: var(--shadow); padding: 4px; display: grid; min-width: 170px; z-index: 5; }
.menu-pop button { border: 0; background: transparent; padding: 9px 12px; text-align: start; border-radius: var(--r-sm); cursor: pointer; }
.menu-pop button:hover { background: var(--panel-2); }

/* ===================== גרסה 2.1 ===================== */
.parts-row.has-pb { grid-template-columns: 1.5fr 60px 88px 88px 32px; }
.profit { display: flex; justify-content: space-between; padding-top: 8px; margin-top: 6px; border-top: 1px dashed var(--line-2, var(--line)); font-weight: 600; color: var(--ok); }
.warn-t { color: var(--gold-deep); }
.chk { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.chip.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.pill-warn { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--gold) 20%, transparent); color: var(--gold-deep); font-weight: 500; }

.inp-btn { display: flex; gap: 6px; align-items: stretch; }
.inp-btn .in { flex: 1; min-width: 0; }

/* תמונות וחתימה */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.ph { position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph button { position: absolute; inset-block-start: 4px; inset-inline-start: 4px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.sigpad { display: block; width: 100%; height: 150px; background: #fff; border: 1.5px dashed var(--line-2, var(--line)); border-radius: var(--r); touch-action: none; cursor: crosshair; }
.sig-tools { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.sig-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-top: 1px dashed var(--line); padding-top: 12px; }
.sig-img { height: 54px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px 6px; }

/* טיימר */
.timer-b { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.timer-clock { font-size: 30px; font-weight: 500; letter-spacing: 1px; direction: ltr; }

/* שכבת על (סורק, תמונה, חתימה) */
.ov { position: fixed; inset: 0; z-index: 120; background: rgba(6, 18, 15, .72); display: grid; place-items: center; padding: 14px; }
.ov-box { background: var(--panel); color: var(--ink); border-radius: var(--r-lg); width: min(520px, 100%); max-height: 94vh; overflow: auto; box-shadow: var(--shadow); }
.ov-box .drawer-h { padding: 14px 18px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.ov-box .drawer-h h2 { margin: 0; font-size: 17px; }
.ov-box .drawer-b { padding: 16px 18px; }
.ov-box .drawer-f { padding: 12px 18px; display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.photo-box { width: min(760px, 100%); }
.big-ph { display: block; width: 100%; max-height: 72vh; object-fit: contain; background: #000; }
.ov-foot { display: flex; gap: 8px; padding: 12px 18px; flex-wrap: wrap; }
.scan { position: relative; border-radius: var(--r); overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-line { position: absolute; inset-inline: 8%; top: 50%; height: 2px; background: var(--gold); box-shadow: 0 0 12px var(--gold); animation: scanmove 2s ease-in-out infinite alternate; }
@keyframes scanmove { from { top: 22%; } to { top: 78%; } }
@media (prefers-reduced-motion: reduce) { .scan-line { animation: none; } }

/* פס מצב בדאשבורד */
.strip { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 16px; }
.strip-i { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-decoration: none; font: inherit; font-size: 13.5px; cursor: default; }
a.strip-i, button.strip-i { cursor: pointer; }
.strip-i.live { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.strip-i.live .ic { color: var(--ok); }
.strip-i.warn { background: color-mix(in srgb, var(--gold) 18%, transparent); border-color: color-mix(in srgb, var(--gold) 50%, transparent); }

/* קופה */
.pos { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 14px; align-items: start; }
.pos-res { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; max-height: 56vh; overflow: auto; }
.pos-item { display: grid; gap: 2px; text-align: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); color: var(--ink); cursor: pointer; font: inherit; }
.pos-item:hover, .pos-item:focus-visible { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 35%, transparent); }
.pos-item .price { font-weight: 600; color: var(--mask); }
[data-theme="dark"] .pos-item .price { color: var(--gold); }
.cart { position: sticky; inset-block-start: 76px; }
.cart-l { display: grid; grid-template-columns: 1fr auto 86px 32px; gap: 8px; align-items: center; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.cart-l select { margin-top: 4px; font-size: 12.5px; direction: ltr; }
.cart-q { display: inline-flex; gap: 4px; align-items: center; }
@media (max-width: 860px) { .pos { grid-template-columns: 1fr; } .cart { position: static; } .parts-row.has-pb { grid-template-columns: 1fr 52px 72px 72px 32px; } }
.prov[hidden], [hidden] { display: none !important; }

.warr { margin-bottom: 12px; padding: 10px 14px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); background: color-mix(in srgb, var(--gold) 16%, transparent); display: grid; gap: 4px; font-size: 13.5px; }
.warr.bad { border-color: color-mix(in srgb, var(--danger) 55%, transparent); background: color-mix(in srgb, var(--danger) 12%, transparent); }

#stabs{overflow-x:auto;max-width:100%;flex-wrap:nowrap}#stabs button{white-space:nowrap}
#bulkbar select.in{min-width:150px}

.hist{margin-top:8px;padding:9px 12px;border:1px solid var(--line);border-inline-start:3px solid var(--brand,#2563eb);border-radius:10px;background:var(--surface-2,#f6f8fb);font-size:13.5px;line-height:1.7}
.hist-t{font-weight:700;margin-inline-end:4px}
#rhist:empty{display:none}
#rhist{margin-bottom:12px}
.micwrap{position:relative}
.micwrap>textarea{padding-inline-end:40px}
.mic{position:absolute;inset-inline-end:8px;bottom:8px;width:30px;height:30px;border-radius:50%;border:1px solid var(--line);background:var(--surface,#fff);color:inherit;display:grid;place-items:center;cursor:pointer}
.mic.on{background:#dc2626;border-color:#dc2626;color:#fff;animation:micp 1.2s infinite}
@keyframes micp{0%,100%{box-shadow:0 0 0 0 rgba(220,38,38,.5)}50%{box-shadow:0 0 0 7px rgba(220,38,38,0)}}

.ph{position:relative}.stg{position:absolute;inset-inline-start:6px;bottom:6px;background:rgba(0,0,0,.62);color:#fff;font-size:11px;padding:1px 7px;border-radius:10px}.stg.af{background:#1e9e62}.ph.hid img{opacity:.45}
