/* dashboard.css — Light theme */

:root {
  --bg: oklch(0.973 0.004 260);
  --bg2: oklch(1 0 0);
  --bg3: oklch(0.983 0.003 260);
  --bg4: oklch(0.955 0.005 260);
  --border: oklch(0.90 0.006 260);
  --border2: oklch(0.84 0.008 260);
  --border-light: oklch(0.95 0.004 260);
  --text: oklch(0.27 0.01 260);
  --text2: oklch(0.45 0.01 260);
  /* מערכת עיצוב (שלב 3, docs/features/15-attention-first-ui.md). ניגודיות נמדדה (WCAG AA, 4.5:1 לפחות):
     --text3 5.06:1 על לבן ו-4.68:1 על --bg (היה 4.28/3.96). --accent-strong 5.10:1 מול לבן — לכפתור
     הראשי ולכל טקסט בזהב (הזהב עצמו, 3.39:1, נשאר לגבולות ולרקע של בחירה בלבד).
     צבעים סמנטיים רק לחריגים: אדום = באיחור/חוסר, כתום = מתקרב, ירוק = הושלם. אין כחול ואין טורקיז. */
  --text3: oklch(0.54 0.01 260);
  --gold: oklch(0.64 0.11 85);
  --gold2: oklch(0.74 0.12 85);
  --gold-dim: oklch(0.64 0.11 85 / 12%);
  --accent-strong: oklch(0.54 0.10 85);
  --accent-strong-hover: oklch(0.47 0.10 85);
  --green: oklch(0.53 0.13 149);
  --green-dim: oklch(0.53 0.13 149 / 10%);
  --red: oklch(0.56 0.19 27);
  --red-dim: oklch(0.56 0.19 27 / 8%);
  --amber: oklch(0.55 0.14 58);
  --amber-dim: oklch(0.55 0.14 58 / 10%);
  --focus: oklch(0.7 0.1 85);
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --font-primary: 'Assistant', 'Heebo', sans-serif;
  --shadow-sm: 0 1px 2px oklch(0.2 0.02 260 / 6%), 0 1px 1px oklch(0.2 0.02 260 / 4%);
  --shadow-md: 0 8px 24px oklch(0.2 0.02 260 / 10%), 0 2px 6px oklch(0.2 0.02 260 / 6%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.tnum {
  font-family: 'Heebo', sans-serif;
  font-variant-numeric: tabular-nums;
}

/* תג בטא (פיצ'ר 25) — ליד מסך או כפתור של פריט בבדיקה, רק אצל מפעל שהפריט נדלק אצלו */
.beta-tag {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: var(--amber-dim);
  color: var(--amber);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  vertical-align: middle;
  white-space: nowrap;
}

/* Layout */
.shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* פס הסביבה (פיצ'ר 22, js/lib/envBanner.js) — בפיתוח ובבדיקה בלבד, אף פעם לא בייצור.
   ה-shell תופס את כל גובה המסך, ולכן הפס מקטין אותו במקום לגרום לגלילה. */
.env-banner {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: oklch(0.25 0.04 70);
}
.env-banner--dev { background: oklch(0.90 0.13 95); }
.env-banner--staging { background: oklch(0.82 0.14 60); }
.env-banner--test { background: oklch(0.88 0.06 260); }
.has-env-banner .shell { height: calc(100vh - 28px); }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg2);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

.main {
  flex: 1;
  min-width: 0; /* בלי זה טבלה רחבה מותחת את כל הדף במקום להיגלל בתוך הכרטיס שלה */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Sidebar Branding & Nav */
.sb-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sb-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--accent-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #FFFFFF;
  flex-shrink: 0;
}

.sb-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.3px;
}

.sb-tag {
  font-size: 10px;
  color: var(--text3);
  margin-top: 2px;
}

.sb-nav {
  padding: 16px 12px;
  flex: 1;
}

.sb-section {
  font-size: 10px;
  color: var(--text3);
  font-weight: 700;
  letter-spacing: .08em;
  padding: 0 10px 6px;
  margin-top: 20px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text2);
  font-size: 13.5px;
  transition: background-color .15s ease, color .15s ease;
  margin-bottom: 3px;
  position: relative;
}

.nav-item:hover {
  background: var(--bg3);
  color: var(--text);
}

.nav-item.active {
  background: var(--gold-dim);
  color: var(--accent-strong);
  font-weight: 600;
}

.nav-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

.nav-item.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 50%;
  background: var(--gold);
  border-radius: 2px 0 0 2px;
}

/* אייקוני התפריט — 20px (היו 16; המפעיל, 2026-10-21: "קצת תגדיל"). ה-svg מגיע עם width/height=16
   ב-HTML, וכאן גוברים עליהם */
.nav-icon {
  width: 22px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text3);
}
.nav-icon svg {
  width: 20px;
  height: 20px;
}

/* תג בתפריט — רק חריגים: הזמנות באיחור, חוסרי מלאי. לכן תמיד אדום, ומוסתר כשאין */
.nav-badge {
  margin-right: auto;
  font-size: 11px;
  font-weight: 700;
  background: var(--red-dim);
  color: var(--red);
  border-radius: 12px;
  padding: 2px 7px;
  min-width: 20px;
  text-align: center;
}

.sb-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text3);
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg3);
}

.admin-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px oklch(0.63 0.17 149 / 15%);
  animation: pulse 2s infinite alternate;
}

@keyframes pulse {
  0% { opacity: 0.7; box-shadow: 0 0 0 2px oklch(0.63 0.17 149 / 10%); }
  100% { opacity: 1; box-shadow: 0 0 0 3px oklch(0.63 0.17 149 / 18%); }
}

/* Topbar */
.topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  z-index: 5;
}

.tb-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.2px;
}

.tb-sub {
  font-size: 12.5px;
  color: var(--text2);
  margin-top: 2px;
}

.tb-right {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--red-dim);
  border: 1px solid oklch(0.58 0.22 27 / 20%);
  color: var(--red);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.alert-chip:hover {
  background: oklch(0.58 0.22 27 / 12%);
}

/* Content Area */
.content {
  padding: 24px;
  flex: 1;
}

/* Pages */
.page {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.page.active {
  display: block;
}

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s ease;
  cursor: default;
}

.kpi-card:hover {
  border-color: var(--border2);
}

.kpi-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-label-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  flex-shrink: 0;
}

.kpi-val {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.kpi-delta {
  font-size: 12px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.up { color: var(--green); }
.dn { color: var(--red); }
.wn { color: var(--amber); }

/* Grid Layouts */
/* align-items:start — כל כרטיס בגובה התוכן שלו; עד שלב 3 הרשת מתחה כרטיס ריק לגובה השכן */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.g32 { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; margin-bottom: 16px; align-items: start; }
.g23 { display: grid; grid-template-columns: 2fr 3fr; gap: 16px; margin-bottom: 16px; align-items: start; }

.sec-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sec-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.sec-sub {
  font-size: 11px;
  color: var(--text3);
}

/* Cards & Panels */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--border2);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  gap: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title span {
  font-size: 12.5px;
  color: var(--text2);
  font-weight: 400;
}

/* Buttons */
.btn-sm {
  font-size: 13px;
  min-height: 34px;
  font-weight: 500;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text2);
  border-radius: var(--radius-sm);
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-primary);
}

.btn-sm:hover {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border2);
}

/* .btn-gold — מצב "נבחר" (מסנן פעיל, סטטוס נוכחי). הטקסט בזהב הכהה — הזהב הבהיר נכשל בניגודיות */
.btn-gold {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--accent-strong);
  font-weight: 600;
}

.btn-gold:hover {
  background: oklch(0.64 0.11 85 / 18%);
  border-color: var(--accent-strong);
  color: var(--accent-strong-hover);
}

/* כפתור ראשי — מלא, זהב כהה וטקסט לבן (5.10:1). "+ הזמנה חדשה" — פעם אחת, בכותרת */
.btn-primary {
  background: var(--accent-strong);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 13.5px;
  border: 1px solid var(--accent-strong);
  border-radius: var(--radius-sm);
  padding: 7px 18px;
  min-height: 36px;
  cursor: pointer;
  font-family: var(--font-primary);
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  background: var(--accent-strong-hover);
  border-color: var(--accent-strong-hover);
}

.btn-primary:focus-visible, .btn-sm:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* Forms & Inputs */
input, select, textarea {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-primary);
  outline: none;
  transition: all 0.2s ease;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  background: var(--bg2);
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

select option {
  background: #FFFFFF;
  color: var(--text);
}

/* Tables */
.tbl-wrap {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

/* טבלאות (שלב 3): שורה של כ-44px, קו אופקי דק בלבד, בלי פסים לסירוגין — הצל הפנימי של הפסים
   צויר לכל תא בנפרד ונראה כמו קווים אנכיים. */
th {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text2);
  text-align: right;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--bg3);
}

td {
  font-size: 14px;
  height: 44px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-align: right;
  vertical-align: middle;
  transition: background 0.15s ease;
}

tr:last-child td {
  border-bottom: none;
}

/* שורות לסירוגין — שורה רגילה ושורה עם רקע בהיר, כדי שהעין תעקוב אחרי שורה (בקשת המפעיל,
   2026-10-07). בשלב 3 הן הוסרו, כי הצל הפנימי שלהן צויר לכל תא בנפרד ונראה כמו קווים
   אנכיים. עכשיו — רקע בלבד, בלי צל. */
tbody tr:nth-child(even) td {
  background: var(--bg3);
}

tbody tr:hover td,
tbody tr:nth-child(even):hover td {
  background: var(--bg4);
}

/* שורה לחיצה — כל השורה פותחת את הפריט, גם מהמקלדת (tabindex + Enter, app.js) */
tr.row-link { cursor: pointer; }
tr.row-link:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* עמודת הפעולות — צמודה לקצה, ונשארת גלויה כשהטבלה נגללת לרוחב (במובייל) */
th.col-actions, td.col-actions {
  position: sticky;
  inset-inline-end: 0;
  width: 1%;
  white-space: nowrap;
  text-align: left;
  background: var(--bg2);
}
th.col-actions { background: var(--bg3); }
tbody tr:nth-child(even) td.col-actions { background: var(--bg3); }
tbody tr:hover td.col-actions { background: var(--bg4); }

.row-num {
  color: var(--text2);
  font-size: 12.5px;
  font-weight: 500;
}

/* Pills */
/* תגים (שלב 3): 12px לפחות. צבע רק לחריגים — אדום באיחור/חוסר, כתום מתקרב, ירוק הושלם.
   כל השאר ניטרלי; "דחוף" ו"בייצור" — ניטרלי מודגש. "רגיל"/"נמוכה" מוצגים בלי תג בכלל. */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.5;
}

.p-red { background: var(--red-dim); color: var(--red); border: 1px solid oklch(0.56 0.19 27 / 25%); }
.p-amber { background: var(--amber-dim); color: var(--amber); border: 1px solid oklch(0.55 0.14 58 / 25%); }
.p-green { background: var(--green-dim); color: var(--green); border: 1px solid oklch(0.53 0.13 149 / 25%); }
.p-gray { background: var(--bg4); color: var(--text2); border: 1px solid var(--border); }
.p-strong { background: var(--bg2); color: var(--text); border: 1px solid var(--text3); }
.p-draft { background: transparent; color: var(--text2); border: 1px dashed var(--text3); }
.p-cancelled { background: var(--bg4); color: var(--text2); border: 1px solid var(--border); text-decoration: line-through; }
.p-gold { background: var(--gold-dim); color: var(--accent-strong); border: 1px solid var(--gold); }

/* Inventory Progress Bars */
.inv-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.inv-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.inv-name {
  font-size: 13px;
  color: var(--text);
  min-width: 90px;
}

.bar-t {
  flex: 1;
  height: 6px;
  background: var(--bg4);
  border-radius: 3px;
  overflow: hidden;
}

.bar-f {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.inv-n {
  font-size: 12px;
  font-weight: 600;
  min-width: 50px;
  text-align: left;
}

/* Client Rows */
.client-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: var(--radius-sm);
}

.client-row:last-child {
  border-bottom: none;
}

.client-row:hover {
  background: var(--bg3);
  padding-right: 14px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.cname {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.cdetail {
  font-size: 11px;
  color: var(--text3);
  margin-top: 1px;
}

/* Profit lines */
.profit-line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.profit-line:last-child {
  border-bottom: none;
  font-weight: 600;
  font-size: 15px;
  padding-top: 12px;
  color: var(--gold);
}

.pl {
  color: var(--text2);
}

/* Product Ranking Row */
.prod-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.prod-row:last-child {
  border-bottom: none;
}

.prod-rank {
  font-size: 12px;
  color: var(--text3);
  font-weight: 700;
  min-width: 18px;
}

.prod-name {
  font-size: 13px;
  color: var(--text);
  flex: 1;
}

.prod-rev {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
}

.prod-margin {
  font-size: 11px;
  color: var(--text3);
  min-width: 36px;
  text-align: left;
}

/* Monthly Comparison Bar */
.month-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.month-label {
  font-size: 12px;
  color: var(--text2);
  min-width: 50px;
}

.month-bar {
  flex: 1;
  height: 8px;
  background: var(--bg4);
  border-radius: 4px;
  overflow: hidden;
}

.month-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.month-val {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  min-width: 44px;
  text-align: left;
}

.month-profit {
  font-size: 11px;
  color: var(--green);
  min-width: 44px;
  text-align: left;
}

/* Form overlay and modal */
.form-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease;
}

/* מסך ההתחברות ומסך "אין חיבור" מעל כל טופס. כל החלונות באותה שכבה, והאחרון ב-HTML מנצח —
   ולכן כשהחיבור פג באמצע עריכת הזמנה, מסך ההתחברות נפתח *מאחורי* הטופס ולא נראה
   (מקרי קצה, 2026-10-17; e2e/sessionExpiry.e2e.js) */
#login-overlay,
#connection-error-overlay {
  z-index: 300;
}

.form-overlay.open {
  display: flex;
}

.form-modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 500px;
  max-width: 95vw;
  box-shadow: var(--shadow-md);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.form-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full {
  grid-column: 1 / -1;
}

label {
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Status toggling */
.status-btn {
  cursor: pointer;
  transition: all 0.15s ease;
}

.status-btn:hover {
  opacity: 0.85;
  transform: scale(1.04);
}

/* Detail modal (פרטי הזמנה — פופ-אפ ממורכז, לא פאנל צד) — נשען על .form-overlay/.form-modal */
.detail-modal {
  width: 460px;
  max-height: 85vh;
  overflow-y: auto;
}

.detail-close {
  cursor: pointer;
  color: var(--text3);
  font-size: 20px;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.detail-close:hover {
  color: var(--text);
  background: var(--bg3);
}

/* Calendar (לוח שנה, ROADMAP 2.5) */
.cal-legend {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}

.cal-weekdays span {
  text-align: center;
  font-size: 11px;
  color: var(--text3);
  font-weight: 600;
  padding: 4px 0;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-cell {
  min-height: 92px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-cell:hover {
  border-color: var(--border2);
  box-shadow: var(--shadow-sm);
}

.cal-cell.other-month {
  opacity: 0.4;
}

.cal-cell.today {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}

.cal-day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
}

.cal-badges {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cal-badge {
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.cal-badge-in { background: var(--bg4); color: var(--text2); }
.cal-badge-out { background: var(--gold-dim); color: var(--accent-strong); }

/* Chart wraps */
.chart-wrap {
  position: relative;
  width: 100%;
}

/* Search bar custom styles */
.search-bar {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-primary);
  outline: none;
  transition: all 0.2s;
  width: 220px;
}

.search-bar:focus {
  border-color: var(--gold);
  background: var(--bg2);
  width: 260px;
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.search-bar::placeholder {
  color: var(--text3);
}

/* Custom Toast Notifications */
.notif {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-md);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: none;
  z-index: 200;
}

.notif.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.notif-icon {
  font-size: 18px;
}

/* Scrollbar styles */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text3);
}

/* Breakpoints & Responsive adaptation */
@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================================
   מובייל וטאבלט (שלב 3, docs/features/15-attention-first-ui.md) — מגירת תפריט.
   עד כאן, מתחת ל-900px הסיידבר הפך לפס של 70px, והחוק `.nav-item span { display:none }` הסתיר גם
   את האייקונים, התגים וכפתור ההתנתקות (כולם span) — נשארו ריבועים ריקים. עכשיו הסיידבר יוצא
   מהזרימה ונפתח כמגירה מכפתור ☰, עם השמות המלאים.
   ============================================================================ */
.menu-btn { display: none; }
.drawer-overlay { display: none; }

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    width: 260px;
    z-index: 60;
    transform: translateX(100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-md);
  }
  .shell.drawer-open .sidebar { transform: translateX(0); }
  .shell.drawer-open .drawer-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: oklch(0.2 0.02 260 / 35%);
    z-index: 50;
  }
  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg2);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
  }
  .g32, .g2, .g23 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
  }
  .tb-titles { flex: 1; min-width: 0; }
  .tb-right {
    width: 100%;
    margin-right: 0;
    gap: 8px;
  }
  .search-bar, .search-bar:focus {
    flex: 1;
    width: auto;
    min-width: 0;
  }
  .content {
    padding: 12px;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 12px;
  }
  .kpi-card, .card {
    padding: 14px;
  }
  .kpi-val { font-size: 24px; }
  .att-row { flex-wrap: wrap; gap: 4px 10px; }
  .att-main { flex-basis: 100%; white-space: normal; }
  .filter-row { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .filter-row .btn-sm { flex-shrink: 0; }
  .inv-row { flex-wrap: wrap; }
  .inv-row .bar-t { flex-basis: 100%; order: 5; }
  .detail-modal, .form-modal { max-width: calc(100vw - 24px); }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Planning & Forecasting Page Styles */
#page-planning input[type="range"] {
  width: 100%;
  height: 6px;
  background: var(--bg4);
  border-radius: 3px;
  outline: none;
  -webkit-appearance: none;
  margin: 10px 0;
}

#page-planning input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(184, 148, 46, 0.35);
  transition: transform 0.1s ease;
}

#page-planning input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

#page-planning select {
  margin-bottom: 4px;
}

/* Active filter button */
.filter-btn.active-filter {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--accent-strong);
  font-weight: 600;
}

/* Order form — extended modal */
.form-modal-lg {
  width: 800px;
  max-width: 96vw;
  max-height: 92vh;
  overflow-y: auto;
}

/* Combobox */
.combo {
  position: relative;
}

.combo-input {
  width: 100%;
}

.combo-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  max-height: 180px;
  overflow-y: auto;
  z-index: 50;
}

.combo-dropdown.open {
  display: block;
}

.combo-option {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}

.combo-option:hover,
.combo-option.highlighted {
  background: var(--bg3);
}

.combo-option.add-new {
  color: var(--gold);
  font-weight: 600;
  border-top: 1px solid var(--border);
}

.combo-option.empty {
  color: var(--text3);
  cursor: default;
  font-size: 12px;
}

/* Order lines table in form */
.lines-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.lines-table th {
  font-size: 10px;
  padding: 6px 8px;
  background: var(--bg3);
}

/* קבוצת עמודות "מידות עור" — כותרת-על + כותרות משנה (גובה/רוחב/עומק) */
.lines-table .th-group {
  text-align: center;
  background: var(--bg4);
}

.lines-table .th-sub {
  font-size: 9px;
  font-weight: 500;
  color: var(--text3);
  background: var(--bg4);
  padding: 4px 6px;
  text-align: center;
}

.lines-table .line-leather-h,
.lines-table .line-leather-w,
.lines-table .line-leather-d {
  width: 54px !important;
}

/* טבלת מידות קרטון — גלובלית להזמנה, בטופס המילוי */
.measure-table th {
  font-size: 10px;
  font-weight: 600;
  color: var(--text3);
  padding: 6px 8px;
  text-align: center;
  background: none;
}

.measure-table td {
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
}

.measure-table .measure-row-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  text-align: right;
  white-space: nowrap;
}

.measure-table input[type="number"] {
  width: 72px;
  padding: 6px 8px;
  font-size: 12px;
  text-align: center;
}

.lines-table td {
  padding: 6px 8px;
  vertical-align: middle;
}

.lines-table .combo-input,
.lines-table input[type="number"] {
  padding: 6px 8px;
  font-size: 12px;
}

.lines-table input[type="number"] {
  width: 70px;
  text-align: center;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text3);
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}

.btn-icon:hover {
  color: var(--red);
  background: var(--red-dim);
}

.lines-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

/* Detail lines mini table */
.detail-lines {
  margin: 12px 0;
  font-size: 12px;
}

.detail-lines table {
  width: 100%;
}

.detail-lines th,
.detail-lines td {
  padding: 6px 8px;
  font-size: 11px;
}

/* Print — work order sheet
   בהשראת הטופס האמיתי מהמפעל: מסמך אחד תחום עם סקשנים בנויים בבירור (פס כותרת, פס נתונים,
   טבלאות ממוסגרות), אבל בשפה עיצובית מודרנית — פינות מעוגלות, טיפוגרפיה נקייה, גוונים עדינים
   במקום שחור-לבן גס. */
#print-sheet {
  display: none;
}

@media print {
  body * {
    visibility: hidden;
  }

  #print-sheet,
  #print-sheet * {
    visibility: visible;
  }

  #print-sheet {
    display: block !important;
    position: absolute;
    right: 0;
    top: 0;
    width: 100%;
    padding: 26px 30px;
    font-family: var(--font-primary);
    color: #1A1D23;
    background: #fff;
  }

  .print-draft-badge {
    display: inline-block;
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
    border-radius: 999px;
    padding: 5px 16px;
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 12px;
  }
}

/* המסמך כולו — מסגרת אחת תוחמת את כל הטופס, כמו דף העבודה המקורי */
.print-doc {
  border: 1.5px solid #1A1D23;
  border-radius: 14px;
  overflow: hidden;
}

/* פס כותרת כהה — שם ומספר ההזמנה, בולט בראש הדף */
.print-band-title {
  background: #1A1D23;
  color: #fff;
  padding: 14px 22px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.print-band-title h1 {
  font-size: 19px;
  font-weight: 700;
  margin: 0;
}

.print-band-date {
  font-size: 12.5px;
  color: #D1D5DB;
}

/* פס נתונים — לקוח / מוצר / יעד / סה"כ, כל תא מופרד בקו דק (במקום רשימת meta שטוחה) */
.print-info-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  border-bottom: 1.5px solid #1A1D23;
}

.print-info-cell {
  padding: 10px 18px;
  border-inline-start: 1px solid #E4E7EC;
}

.print-info-cell:first-child {
  border-inline-start: none;
}

.print-info-cell .label {
  display: block;
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6B7280;
  margin-bottom: 3px;
}

.print-info-cell .value {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

/* תא "סה"כ יחידות" מודגש — כמו התא האפור הבולט בטופס המקורי */
.print-info-cell.print-info-highlight {
  background: #F3F4F6;
}

/* כל סקשן (פירוט ייצור / מידות קרטון) — כותרת-בד עדינה בגוון הזהב של המותג + תוכן ממוסגר */
.print-section {
  border-top: 1.5px solid #1A1D23;
}

.print-section-title {
  background: var(--gold-dim);
  color: #8A6A1E;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 7px 18px;
  border-bottom: 1px solid #E9DFC4;
}

.print-table {
  width: 100%;
  border-collapse: collapse;
}

.print-table th,
.print-table td {
  border: 1px solid #E4E7EC;
  padding: 7px 10px;
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.print-table th {
  background: #F9FAFB;
  font-weight: 600;
  color: #374151;
  font-size: 10.5px;
}

/* קבוצת "מידות עור" — כותרת-על + כותרות משנה */
.print-table .th-group {
  background: #F3F4F6;
}

.print-table .th-sub {
  font-size: 10px;
  font-weight: 500;
  color: #6B7280;
  background: #FCFCFD;
}

/* טבלת "מידות קרטון" — גלובלית להזמנה, בתוך סקשן משלה */
.print-measure-table {
  width: 100%;
  max-width: 420px;
  border-collapse: collapse;
}

.print-measure-table th,
.print-measure-table td {
  border: 1px solid #E4E7EC;
  padding: 7px 12px;
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.print-measure-table th {
  background: #F9FAFB;
  color: #6B7280;
  font-weight: 600;
  font-size: 10.5px;
}

.print-measure-table td:first-child {
  font-weight: 700;
  color: #374151;
  background: #FAFAFA;
}

.print-footer {
  padding: 12px 18px;
  border-top: 1.5px solid #1A1D23;
  font-size: 12px;
}

/* ============================================================================
   טופס הזמנה גרסה 2 + דף עבודה מודפס — עיצוב תואם ל-Claude Design
   (design_handoff_order_form/, מיובא ע"י המפעיל). מוגדר תחת .of2-scope
   (עוטף גם #add-form וגם #print-sheet כשמדובר בהזמנת גרסה 2) כדי לא לגעת
   בעיצוב שאר הדשבורד. טוקנים (צבעים/גופנים/מרווחים) זהים למקור, ראו
   docs/features/01-order-form.md ("עדכון — שדרוג מקיף").
   ============================================================================ */

.of2-scope {
  --of2-ink: oklch(0.24 0.008 260);
  --of2-muted: oklch(0.55 0.01 260);
  --of2-muted2: oklch(0.45 0.01 260);
  --of2-faint: oklch(0.6 0.01 260);
  --of2-faint2: oklch(0.72 0.01 260);
  /* היה כחול (hue 252). שלב 3 מוציא את הכחול מהמערכת — צבע מוביל אחד */
  --of2-accent: var(--accent-strong);
  --of2-accent-hover: var(--accent-strong-hover);
  --of2-focus: var(--focus);
  --of2-border-strong: oklch(0.88 0.008 260);
  --of2-border: oklch(0.9 0.008 260);
  --of2-border-light: oklch(0.95 0.005 260);
  --of2-underline: oklch(0.85 0.01 260);
  --of2-pill-border: oklch(0.86 0.01 260);
  --of2-tint: oklch(0.965 0.004 260);
  --of2-tint-light: oklch(0.978 0.004 260);
  --of2-tint-light2: oklch(0.985 0.004 260);
  --of2-tile: oklch(0.97 0.004 260);
  font-family: 'Assistant', 'Helvetica Neue', Helvetica, sans-serif;
  color: var(--of2-ink);
}

.of2-scope input, .of2-scope select, .of2-scope textarea {
  font-family: inherit;
  color: inherit;
  background: transparent;
  border-radius: 0;
  padding: 0;
  font-size: inherit;
  box-shadow: none;
}

/* כפתורי הפעולה בתחתית (ביטול/שמור/הדפס) נשארים בעיצוב הדשבורד הרגיל — לא חלק מה-override */
.of2-scope .form-actions button {
  font-family: var(--font-primary);
}

/* עוקף את input:focus/select:focus הגלובלי של הדשבורד (רקע לבן + מסגרת זהב) —
   בתוך .of2-scope רוצים קו-תחתי דק בלבד, כמו בעיצוב שהובא */
.of2-scope input:focus, .of2-scope select:focus, .of2-scope textarea:focus {
  background: transparent;
  box-shadow: none;
  outline: 2px solid var(--of2-focus);
  outline-offset: 1px;
}

.of2-scope select {
  cursor: pointer;
  border-bottom: 1px solid var(--of2-underline) !important;
  padding: 2px 0 3px !important;
  font-size: 15px;
}

.of2-num { font-family: 'Heebo', sans-serif; }

.of2-scope a { color: var(--of2-accent); text-decoration: none; }
.of2-scope a:hover { color: var(--of2-accent-hover); text-decoration: underline; }

/* ---- כותרת + עבור/שם הספר ---- */
.of2-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 2px solid var(--of2-ink);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.of2-h1 { font-family: 'Heebo', sans-serif; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.1; }
.of2-h1-sub { font-size: 12px; color: var(--of2-muted); margin-top: 4px; letter-spacing: 0.04em; }
.of2-header-fields { display: flex; gap: 22px; align-items: flex-end; }
.of2-micro-field { text-align: center; }
.of2-micro-label { font-size: 10px; color: var(--of2-muted); letter-spacing: 0.06em; margin-bottom: 2px; }
.of2-micro-input {
  width: 120px; text-align: center; font-size: 14px; border: none;
  border-bottom: 1px solid var(--of2-underline); background: transparent; padding: 2px 0;
}

.of2-client-row {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 0 28px;
  padding: 0 0 16px; border-bottom: 1px solid var(--of2-border); margin-bottom: 16px;
}
.of2-client-label { font-size: 10px; color: var(--of2-muted); letter-spacing: 0.08em; margin-bottom: 3px; }
.of2-client-input {
  width: 100%; font-size: 20px; font-weight: 600; border: none; background: transparent; padding: 0;
}

/* ---- שני עמודות: פרטי הזמנה / כריכה ---- */
.of2-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-bottom: 4px; }
.of2-col-title {
  font-family: 'Heebo', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--of2-accent); margin-bottom: 10px;
}
.of2-field-row { display: flex; gap: 14px; align-items: flex-end; margin-bottom: 12px; }
.of2-field-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.of2-field { flex: 1; }
.of2-label-sm { font-size: 10px; color: var(--of2-muted); margin-bottom: 2px; }
.of2-input-underline {
  width: 100%; border: none; border-bottom: 1px solid var(--of2-underline); background: transparent;
  padding: 0 0 3px; font-size: 15px;
}
.of2-input-underline:focus-visible, .of2-client-input:focus-visible { outline: 2px solid var(--of2-focus); outline-offset: 1px; }
.of2-emph-field { border-top: 1px solid var(--of2-border); padding-top: 10px; }
.of2-emph-input {
  width: 100%; font-size: 17px; font-weight: 600; border: none;
  border-bottom: 1px solid var(--of2-underline); background: transparent; padding: 0 0 4px;
}
.of2-qty-input {
  width: 82px; text-align: center; font-size: 26px; font-weight: 700; line-height: 1;
  border: none; border-bottom: 2px solid var(--of2-ink); background: transparent; padding: 0 0 2px;
}

.of2-pill-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.of2-pill {
  border: 1px solid var(--of2-pill-border); background: transparent; color: var(--of2-muted2);
  border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; print-color-adjust: exact;
}
.of2-pill.on { border-color: var(--of2-accent); background: var(--of2-accent); color: #fff; }

.of2-note {
  font-size: 11.5px; color: var(--of2-muted); background: var(--of2-tint-light); border-radius: 6px;
  padding: 8px 10px; margin-bottom: 16px;
}

/* ---- מידות ייצור — מחושב ---- */
.of2-section-title {
  font-family: 'Heebo', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--of2-accent); margin: 22px 0 10px;
}
.of2-cuts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.of2-cut-card { border: 1px solid var(--of2-border); border-radius: 6px; padding: 11px 13px; break-inside: avoid; }
.of2-cut-card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.of2-cut-card-title { font-size: 13px; font-weight: 600; }
.of2-cut-card-hint { font-size: 10px; color: var(--of2-faint); }
.of2-cut-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.of2-cut-tile { flex: 1 1 72px; background: var(--of2-tile); border-radius: 4px; padding: 7px 9px; print-color-adjust: exact; }
.of2-cut-tile-label { font-size: 10px; color: var(--of2-muted); margin-bottom: 2px; }
.of2-cut-tile-value { font-family: 'Heebo', sans-serif; font-size: 19px; font-weight: 500; letter-spacing: -0.01em; }

/* ---- כרכי הסט (מראה מחושבת, לקריאה בלבד) ---- */
.of2-set-note { font-size: 11px; color: var(--of2-muted); }
.of2-table-wrap { border: 1px solid var(--of2-border); border-radius: 6px; overflow: hidden; }
.of2-table { width: 100%; border-collapse: collapse; }
.of2-table thead tr {
  background: var(--of2-tint); font-size: 10px; color: var(--of2-faint); letter-spacing: 0.04em; print-color-adjust: exact;
}
.of2-table thead th { padding: 6px 8px; font-weight: 500; text-align: right; }
.of2-table tbody tr { border-bottom: 1px solid var(--of2-border-light); }
.of2-table tbody td { padding: 5px 8px; vertical-align: middle; }
.of2-table .of2-cell-index { font-family: 'Heebo', sans-serif; font-size: 14px; color: var(--of2-faint); }
.of2-table .of2-cell-muted { color: var(--of2-muted2); }
.of2-table .of2-cell-num { font-family: 'Heebo', sans-serif; font-size: 16px; }
.of2-table .of2-cell-num.strong { font-weight: 500; }

/* ---- מידות הספר (טבלת קלט) ---- */
.of2-input-table-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  background: var(--of2-tint); padding: 9px 14px; border-bottom: 1px solid var(--of2-border); print-color-adjust: exact;
}
.of2-input-table-title { font-family: 'Heebo', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: var(--of2-accent); }
.of2-input-table-hint { font-size: 11px; color: var(--of2-muted); }
.of2-vol-table thead tr { background: var(--of2-tint-light); font-size: 10px; color: var(--of2-faint); letter-spacing: 0.04em; print-color-adjust: exact; }
.of2-vol-table thead th { padding: 6px 8px; font-weight: 500; text-align: right; }
.of2-vol-table tbody tr { border-bottom: 1px solid var(--of2-border-light); }
.of2-vol-table tbody td { padding: 4px 8px; vertical-align: middle; }
.of2-vol-input {
  width: 100%; font-size: 15px; border: none; border-bottom: 1px solid var(--of2-border);
  background: transparent; padding: 0 0 2px;
}
.of2-vol-input.of2-num { font-size: 19px; font-weight: 500; }
.of2-icon-btn {
  width: 22px; height: 22px; border: 1px solid var(--of2-pill-border); background: transparent;
  color: var(--of2-muted2); border-radius: 4px; cursor: pointer; font-size: 12px; line-height: 1; print-color-adjust: exact;
}
.of2-icon-btn.on { border-color: var(--of2-accent); background: var(--of2-accent); color: #fff; }
.of2-icon-btn-plain {
  width: 20px; height: 20px; border: none; background: transparent; color: var(--of2-faint2);
  cursor: pointer; font-size: 14px; line-height: 1;
}
.of2-vol-footer {
  display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--of2-border);
  padding: 8px 14px; background: var(--of2-tint-light2); print-color-adjust: exact;
}
.of2-add-btn {
  border: 1px dashed var(--of2-underline); background: transparent; color: var(--of2-accent);
  border-radius: 5px; padding: 4px 13px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.of2-override-row {
  display: flex; align-items: flex-end; gap: 10px; padding: 8px 8px 10px; background: var(--of2-tint-light2);
  border-bottom: 1px solid var(--of2-border-light); print-color-adjust: exact;
}
.of2-override-label { font-size: 9.5px; color: var(--of2-faint); white-space: nowrap; padding-bottom: 6px; }
.of2-override-row .combo { flex: 1; max-width: 130px; }
.of2-override-row .combo-input { font-size: 13px !important; }
.of2-override-emboss {
  flex: 1.2; max-width: 150px; font-size: 13px; border: none; border-bottom: 1px solid var(--of2-underline);
  background: transparent; padding: 0 0 2px;
}
.of2-revert-btn {
  font-size: 11px; color: var(--of2-muted); background: transparent; border: none; cursor: pointer;
  padding-bottom: 4px; text-decoration: underline; white-space: nowrap;
}

/* ---- לשימוש משרדי בלבד + מע"מ ---- */
.of2-office { margin-top: 22px; border-top: 1px solid var(--of2-border-strong); padding-top: 12px; }
.of2-office-title { font-size: 11px; letter-spacing: 0.1em; color: var(--of2-faint); margin-bottom: 10px; }
.of2-office-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.of2-office-input {
  width: 100%; font-family: 'Heebo', sans-serif; font-size: 16px; border: none;
  border-bottom: 1px solid var(--of2-pill-border); background: transparent; padding: 0 0 3px;
}
.of2-vat-toggle { display: flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }
.of2-vat-box { background: var(--of2-tint); border-radius: 6px; padding: 10px 12px; font-size: 12.5px; margin-top: 12px; print-color-adjust: exact; }
.of2-vat-row { display: flex; justify-content: space-between; margin-bottom: 3px; color: var(--of2-muted); }
.of2-vat-total {
  display: flex; justify-content: space-between; border-top: 1px solid var(--of2-border); padding-top: 5px;
  margin-top: 3px; font-weight: 700; color: var(--of2-ink); font-size: 15px;
}
.of2-notes-input {
  width: 100%; font-size: 13px; border: none; border-bottom: 1px solid var(--of2-border);
  background: transparent; padding: 0 0 4px;
}

/* ---- קומבובוקס (לקוח/ספר/צבע/דוגמה) — אותה מסגרת התנהגות כמו combo-dropdown הרגיל, גוון עדין תואם ---- */
.of2-scope .combo-dropdown {
  border-color: var(--of2-border-strong) !important;
  border-radius: 6px !important;
  box-shadow: 0 4px 16px oklch(0.24 0.008 260 / 0.12) !important;
}
.of2-scope .combo-option { font-size: 14px; }
.of2-scope .combo-option.add-new { color: var(--of2-accent) !important; border-top-color: var(--of2-border-light) !important; }
.of2-scope .combo-option:hover, .of2-scope .combo-option.highlighted { background: var(--of2-tint) !important; }

/* ---- דף עבודה מודפס — אותם טוקנים בדיוק, גרסת הדפסה ---- */
.of2-print .of2-header { margin-bottom: 0; }
.of2-print-strip {
  display: flex; gap: 22px; padding: 12px 0; border-bottom: 1px solid var(--of2-border); margin-bottom: 8px; flex-wrap: wrap;
}
.of2-print-cell .label { font-size: 10px; color: var(--of2-muted); letter-spacing: 0.06em; display: block; margin-bottom: 2px; }
.of2-print-cell .value { font-size: 15px; font-weight: 600; }

/* ============ שלב 2 — "מה דורש טיפול" (docs/features/15-attention-first-ui.md) ============ */
.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
.att-summary { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text2); padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.att-group { margin-top: 14px; }
.att-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.att-title span { color: var(--text2); font-weight: 500; }
.att-row { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.att-row:hover, .att-row:focus-visible { background: var(--bg3); }
.att-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.att-main { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-meta { font-size: 12px; color: var(--text2); white-space: nowrap; }
.empty-state { padding: 20px 8px; text-align: center; color: var(--text2); font-size: 13.5px; }
.empty-state p { margin: 0 0 12px; }
.row-highlight { background: var(--gold-dim); transition: background 0.3s ease; }
.card-title-text { display: flex; gap: 8px; align-items: baseline; }
.cal-badge-late { background: var(--red-dim); color: var(--red); }
@media (max-width: 1024px) { .kpi-grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .kpi-grid-3 { grid-template-columns: 1fr; } }

/* ============ שלב 3 — תפריט ⋯, חלון אישור, מצב ריק (components/menu.js, confirmDialog.js) ============ */
.kebab-btn { min-width: 34px; padding: 4px 10px; font-size: 16px; line-height: 1; letter-spacing: 1px; }
.kebab-menu { position: fixed; z-index: 80; min-width: 150px; background: var(--bg2); border: 1px solid var(--border2); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 4px; }
.kebab-menu button { display: block; width: 100%; text-align: right; background: none; border: none; padding: 9px 12px; font: inherit; font-size: 13.5px; color: var(--text); border-radius: var(--radius-xs); cursor: pointer; }
.kebab-menu button:hover, .kebab-menu button:focus-visible { background: var(--bg3); outline: none; }
.kebab-menu button.danger { color: var(--red); }
dialog.confirm-dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; width: min(420px, calc(100vw - 32px)); color: var(--text); box-shadow: var(--shadow-md); }
dialog.confirm-dialog::backdrop { background: oklch(0.2 0.02 260 / 35%); }
dialog.confirm-dialog h2 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
dialog.confirm-dialog p { font-size: 14px; color: var(--text2); line-height: 1.6; margin-bottom: 18px; white-space: pre-line; }
.confirm-actions { display: flex; gap: 8px; justify-content: flex-start; }
.btn-danger { background: var(--red); border: 1px solid var(--red); color: #fff; font-weight: 600; }
.btn-danger:hover { background: oklch(0.5 0.19 27); color: #fff; border-color: oklch(0.5 0.19 27); }
.filter-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tb-titles { min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* מובייל — אחרי חוקי הבסיס של "דורש טיפול" (שלב 2), כדי שיגברו עליהם */
@media (max-width: 600px) {
  .att-row { flex-wrap: wrap; gap: 4px 10px; padding: 8px 6px; }
  .att-main { flex-basis: 100%; white-space: normal; }
  .att-summary { gap: 4px 12px; }
}
@media (max-width: 600px) {
  .tbl-wrap td { white-space: nowrap; } /* במובייל הטבלה נגללת לרוחב, במקום שורות של ארבע שורות טקסט */
}
#catalog-admin-title { font-size: 15px; font-weight: 600; color: var(--text); } /* span בתוך .card-title — לא כותרת משנה */

/* טפסים של פלאגין ספקים — שתי עמודות, ועמודה אחת בטלפון (docs/features/18-suppliers-plugin.md) */
.ff-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .ff-form-grid { grid-template-columns: 1fr; } }
/* שורות בחשבונית ספק (18ב) — שדות בתוך הטבלה */
.inv-lines-table select { min-width: 150px; }
.inv-lines-table input { min-width: 0; }
.inv-lines-table td { vertical-align: top; }
.inv-cost { display: block; font-size: 11px; font-weight: 400; color: var(--text3); margin-top: 2px; }
/* פריט בגריד לא מתכווץ מתחת לרוחב התוכן שלו — בלי זה טבלת השורות מרחיבה את כל הטופס בטלפון */
.ff-form-grid > * { min-width: 0; }
.inv-lines-table td:nth-child(2) input { min-width: 130px; }

/* טופס ההזמנה בטלפון (מקרי קצה לפני העלייה, 2026-10-17). עד כאן נשארו בו שתי עמודות גם
   ברוחב 390px: הכותרת נשברה לשלוש שורות, שדה התאריך נחתך בקצה, וערכים כמו "כחול כהה"
   נחתכו. כאן — עמודה אחת. "screen" כדי לא לגעת בהדפסת דף העבודה (.of2-print). */
@media screen and (max-width: 600px) {
  .of2-header { flex-direction: column; align-items: stretch; gap: 12px; }
  .of2-h1 { font-size: 20px; }
  .of2-header-fields { justify-content: space-between; gap: 12px; }
  .of2-micro-field { flex: 1; min-width: 0; }
  .of2-micro-input { width: 100%; }
  .of2-client-row,
  .of2-two-col,
  .of2-cuts-grid { grid-template-columns: 1fr; }
  .of2-client-row { gap: 12px; }
  /* טבלת הכרכים: חמש עמודות מספרים לא נכנסות ב-390px, ושם הכרך נחתך לשתי אותיות. הטבלה
     נגללת לרוחב בתוך המסגרת שלה (כמו שאר הטבלאות בטלפון), והכותרת והסיכום נשארים במקום. */
  #book-dims { overflow-x: auto !important; }
  .of2-vol-table { min-width: 520px; }
  .of2-vol-footer { flex-wrap: wrap; }
  #set-note { flex-basis: 100% !important; }
}

/* ============ מדבקות הכוונה (docs/features/27-order-labels.md) ============
   דף A4, 6 × 12 מדבקות של 35 × 23 מ"מ, בלי רווח בצדדים ובין המדבקות. המידות מגיעות מ-LABEL_SHEET
   (client/js/lib/labels.js) כ-style על כל דף; כאן רק מה שלא תלוי בדף. */
.labels-page {
  width: 210mm;
  height: 297mm;
  box-sizing: border-box;
  display: grid;
  justify-content: start;
  align-content: start;
  position: relative;
  break-after: page;
  overflow: hidden;
}
.labels-page:last-child { break-after: auto; }
/* עדכון 2026-10-24: הכל באמצע, עד 6 שורות — מספר, לקוח, ספר, חלק, ספיין, דוגמה + צבע */
.label-cell {
  box-sizing: border-box;
  padding: 1mm 1.5mm;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0.2mm;
  overflow: hidden;
  font-family: 'Heebo', 'Assistant', Arial, sans-serif;
  font-size: 7.5pt;
  line-height: 1.15;
  color: #000;
}
.label-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.label-code { font-weight: 800; font-size: 9pt; direction: ltr; unicode-bidi: isolate; }
.label-product { font-weight: 600; }
.label-volume, .label-spine { font-weight: 700; font-size: 8pt; }
.label-muted { font-size: 7pt; }
.labels-draft {
  position: absolute; top: 3mm; left: 50%; transform: translateX(-50%);
  font-size: 8pt; font-weight: 700; color: #92400E;
}
@media print {
  body.printing-labels > *:not(#print-sheet) { display: none !important; }
  body.printing-labels #print-sheet { position: static; padding: 0; width: auto; }
}

/* ============ דף עבודה — כמו טופס הנייר של המפעל (2026-10-18, components/print.js) ============
   שחור-לבן, מסגרות דקות, כותרות אפורות ומספרים גדולים. דף A4 אחד גם לסט של 5 כרכים. */
.wo { color: #000; font-size: 9pt; line-height: 1.25; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.wo-printed { text-align: center; font-size: 8pt; margin-bottom: 2mm; display: flex; align-items: center; justify-content: center; gap: 4mm; }
.wo-logo { max-height: 14mm; max-width: 45mm; object-fit: contain; }
.wo-title-row { display: grid; grid-template-columns: 10mm 1fr 34mm; align-items: stretch; border: 1.5px solid #000; margin-bottom: 2.5mm; }
.wo-bh { font-size: 8pt; padding: 1mm; }
.wo-title { font-size: 15pt; font-weight: 700; padding: 1.5mm 3mm; border-left: 1.5px solid #000; border-right: 1.5px solid #000; }
.wo-title span { text-decoration: underline; }
.wo-title-date { font-size: 10pt; padding: 1.5mm; display: flex; align-items: center; justify-content: center; }
.wo-row { display: grid; gap: 2.5mm; margin-bottom: 2.5mm; align-items: start; }
.wo-ids { grid-template-columns: 40mm 1fr 1fr; }
.wo-cell { border: 1.5px solid #000; text-align: center; }
.wo-cap { font-size: 7.5pt; padding: 0.6mm 1mm; border-bottom: 1px solid #000; }
.wo-val { font-size: 12pt; font-weight: 700; padding: 1mm; }
.wo-dark .wo-cap { background: #000; color: #fff; }
.wo-number { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.wo-number > div + div { border-right: 1px solid #000; }
.wo-details { grid-template-columns: 1.6fr 1fr 1fr; }
.wo-work { grid-template-columns: 1fr 1fr; }
.wo-office { grid-template-columns: 1.4fr 1fr 1fr; }
.wo-col { display: flex; flex-direction: column; gap: 2mm; }
/* מידות הדבקה — צרה, לפי התוכן (המפעיל: "רחב מדי") */
.wo-table.wo-narrow { width: auto; align-self: flex-start; }
.wo-narrow td.wo-big { min-width: 16mm; }
.wo-table { width: 100%; border-collapse: collapse; border: 1.5px solid #000; break-inside: avoid; }
/* מבטל את עיצוב הטבלאות של המסך (גובה 44px, פסים לסירוגין) */
.wo-table th, .wo-table td { border: 1px solid #000; padding: 0.6mm 1.2mm; text-align: center; vertical-align: middle; height: auto; color: #000; background: #fff; white-space: normal; font-size: inherit; }
.wo-table tbody tr:nth-child(even) td, .wo-table tbody tr:hover td { background: #fff; }
.wo-table .wo-head th { background: #d9d9d9; font-size: 9.5pt; font-weight: 700; }
.wo-sub th { font-size: 7.5pt; font-weight: 600; }
.wo .wo-rowlabel { text-align: right !important; font-size: 8.5pt; white-space: nowrap; }
.wo .wo-big { font-size: 13pt; font-weight: 700; }
.wo-table td.wo-black, .wo-table tbody tr:nth-child(even) td.wo-black { background: #000; color: #fff; }
.wo .wo-slack { color: #000; font-size: 6.5pt; font-weight: 400; text-align: right; }
.wo .wo-knife { font-size: 11pt; font-weight: 700; }
.wo-box { display: inline-block; width: 3mm; height: 3mm; border: 1px solid #000; font-size: 7pt; line-height: 3mm; text-align: center; vertical-align: middle; }
.wo .wo-bookname { font-size: 10.5pt; font-weight: 700; }
.wo .wo-check { font-size: 8.5pt; font-weight: 400; margin-top: 1mm; }
.wo .wo-emboss-name { height: 9mm; }
.wo-section-title { border: 1.5px solid #000; background: #d9d9d9; text-align: center; font-weight: 700; font-size: 10pt; padding: 0.6mm; }
.wo-matrix td { height: 6mm; }
.wo-table .wo-total td { border-top: 1.5px solid #000; }
.wo-office-title { border-top: 1.5px solid #000; text-align: center; font-size: 9pt; padding: 1mm 0; margin-top: 3mm; }
.wo-office .wo-table td { font-size: 10pt; }

/* כמה סטים מכל צבע ודוגמה — טופס ההזמנה (docs/features/29-color-design-breakdown.md) */
.of2-variants { margin: 18px 0 6px; padding: 14px 16px; border: 1px solid var(--of2-border-strong, var(--border)); border-radius: 8px; }
#btn-add-variant { font-weight: 600; }
.of2-variants-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.of2-variants-hint { font-size: 12px; color: var(--of2-muted); }
.of2-variants-table { margin-bottom: 6px; }
.of2-variants-table td { height: auto; padding: 4px 6px; }
.of2-variants-table th { padding: 6px; }
.of2-variants-table .combo-input { width: 100%; }
#f-qty[readonly] { background: var(--bg3); cursor: not-allowed; }

/* דוחות — "מתאריך / עד" (docs/features/30-reports-date-range.md) */
.reports-range { display: inline-flex; gap: 8px; align-items: center; padding: 2px 8px; border-radius: 8px; border: 1px solid transparent; }
.reports-range.on { border-color: var(--gold, #8B6914); }
.reports-range label { font-size: 12.5px; color: var(--text2); display: inline-flex; gap: 4px; align-items: center; white-space: nowrap; }
.reports-range input { font-size: 12.5px; padding: 4px 6px; }

/* לוגו המפעל — בתפריט ובהגדרות (docs/features/32-factory-logo.md) */
/* לוגו רחב לא נדחס לריבוע: הגובה כמו האותיות (40px), הרוחב לפי התמונה עד 110px */
.sb-logo.has-image { width: auto; min-width: 40px; max-width: 110px; background: #fff; border: 1px solid var(--border); padding: 3px; overflow: hidden; }
.sb-logo.has-image img { height: 100%; width: auto; max-width: 100%; object-fit: contain; display: block; }
.logo-settings { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.logo-preview { width: 120px; height: 72px; border: 1px dashed var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; background: #fff; overflow: hidden; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* תנאי השימוש (docs/features/33-terms-of-use.md) — דף הרישום ומסך האישור בכניסה */
#terms-overlay { z-index: 300; }
.terms-modal { width: 760px; max-width: calc(100vw - 32px); }
.terms-box { max-height: 52vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 14px 18px; background: var(--bg); font-size: 13.5px; line-height: 1.75; }
.terms-doc-title { font-weight: 700; font-size: 15px; }
.terms-doc-version { font-size: 12px; color: var(--text3); margin-bottom: 8px; }
.terms-doc-list { padding-inline-start: 20px; margin: 0; }
.terms-doc-list li { margin-bottom: 8px; }
.terms-accept { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 14px; margin-top: 10px; cursor: pointer; }
.terms-accept input { width: 17px; height: 17px; }
.terms-accepted-text { white-space: pre-wrap; font-family: inherit; margin: 0; }

/* ============ חיפוש הזמנה (docs/features/34-order-search.md) ============
   מה שהתאים לחיפוש מסומן בטבלה. מספר ההזמנה של המפעל ("15-356-26") משמאל לימין, בלי שהדפדפן
   יהפוך את סדר המספרים בשורה בעברית. */
#orders-tbody mark { background: oklch(0.64 0.11 85 / 28%); color: inherit; border-radius: 3px; padding: 0 1px; }
#orders-tbody .row-num { direction: ltr; unicode-bidi: isolate; text-align: right; white-space: nowrap; }

/* ============ כריכות בדוחות (docs/features/35-reports-bindings.md) ============ */
.bindings-table tr.bindings-on td { background: oklch(0.64 0.11 85 / 14%); font-weight: 600; }
