/* ============================================================
   נגישות — ביטול/קיצור המיקרו-אינטראקציות למשתמשים שביקשו פחות תנועה
============================================================ */
@media (prefers-reduced-motion: reduce) {
  .stat-value.kpi-skel,
  .btn-refresh .refresh-icon.spinning,
  .kanban-board-inner,
  .kanban-card,
  .view-anim-in,
  .drawer-tab-content.active,
  .dz-timeline.dz-animate .dz-tl-node,
  .dz-timeline.dz-animate .dz-tl-rail,
  .dz-timeline.dz-animate .dz-tl-body {
    animation-duration: .001s !important;
  }
  .drawer-tab-indicator { transition-duration: .001s !important; }
}

/* ============================================================
   רדיזיין מגירת אישור בקשת רכש (#drawer בלבד) — layout דבוק:
   כותרת/טאבים/פס-פעולות קבועים, גוף גולל, X צף על הקצה הפנימי.
============================================================ */
#drawer {
  display: flex;
  flex-direction: column;
  overflow: visible;               /* כדי שכפתור ה-X הצף לא ייחתך */
  left: 0;                         /* מעוגן שמאל; הקצה הפנימי = ימין */
  right: auto;
  transform: translateX(-100%);
}
#drawer.active {
  transform: translateX(0);
  box-shadow: 24px 0 60px -20px rgba(15, 23, 42, 0.5);
}
#drawer .drawer-header { flex: none; position: static; padding: 18px 34px 18px 22px; }
#drawer .drawer-tabs { flex: none; margin-bottom: 0; padding: 0 22px; gap: 22px; border-bottom-width: 1px; border-bottom-color: #eef2f7; }
#drawer .drawer-content { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 22px; }
#drawer .drawer-tab { padding: 13px 2px; }
#drawer .drawer-tab.active { color: #4f46e5; }
#drawer .drawer-tab-indicator { background: #6366f1; height: 3px; bottom: -1px; }

/* כפתור סגירה: בליטה עגולה לבנה (צבע הכרטיס) שיושבת על הקצה הפנימי
   בפינה העליונה-ימנית ובולטת אל הרקע, עם X שחור בפנים */
#drawer .drawer-close {
  position: absolute;
  top: 14px;
  right: -22px;
  left: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: none;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0;
  z-index: 6;
  box-shadow: 0 6px 20px -4px rgba(15, 23, 42, .30);
}
#drawer .drawer-close:hover { background: #f1f5f9; }
/* כשהמגירה סגורה (מוסתרת מימין) הבליטה עדיין בולטת אל המסך בגלל overflow:visible —
   להסתיר אותה עד שהמגירה נפתחת */
#drawer:not(.active) .drawer-close { display: none; }

/* במסך צר המגירה במלוא הרוחב — הבליטה עוברת פנימה כדי לא לצאת מהמסך */
@media (max-width: 768px) {
  #drawer .drawer-close { right: 12px; left: auto; }
  #drawer .drawer-header { padding: 18px 62px 18px 22px; }
}

/* כותרת חדשה */
#drawer .dz-eyebrow { font-weight: 600; }
#drawer .dz-headline { font-size: 18px; font-weight: 800; color: #0f172a; margin-top: 2px; }
#drawer .dz-subline { margin-top: 4px; gap: 10px; }
#drawer .dz-amount { font-size: 30px; font-weight: 700; color: #0f172a; line-height: 1.1; }

/* חיווי סטטוס — נקודה + תווית (בלי גלולה) */
.dz-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.dz-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* שורת סכום + כמות/דחיפות */
.dz-amountrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.dz-amountrow .dz-qty { text-align: left; }
.dz-qtyval { font-size: 20px; font-weight: 800; color: #0f172a; line-height: 1.1; }

/* תגית דחיפות מרובעת (לא גלולה) */
.dz-urg { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 8px; margin-top: 4px; border: 1px solid; }
.dz-urg .dz-urg-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dz-urg-normal { color: #475569; background: #f1f5f9; border-color: #e2e8f0; }
.dz-urg-normal .dz-urg-dot { background: #94a3b8; }
.dz-urg-high { color: #b45309; background: #fff7ed; border-color: #fed7aa; }
.dz-urg-high .dz-urg-dot { background: #f59e0b; }
.dz-urg-urgent { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.dz-urg-urgent .dz-urg-dot { background: #ef4444; }

/* כרטיס ספק — שורה קומפקטית + הערת סוג ספק בתוך אותו כרטיס */
.dz-supplier { background: #fff; border: 1px solid #e2e8f0; border-radius: 11px; padding: 10px 14px; }
.dz-supplier-row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.dz-sup-label { font-size: 12px; font-weight: 700; color: #5a6779; }
.dz-sup-name { font-size: 15px; font-weight: 800; color: #0f172a; }
.dz-sup-ok { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: #047857; }
.dz-supplier-note { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; line-height: 1.5; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f1f5f9; }
.dz-supplier-note svg { flex-shrink: 0; margin-top: 1px; }
.dz-supplier-note.is-ok { color: #047857; }
.dz-supplier-note.is-warn { color: #b45309; }

/* כרטיס מגיש עם אווטאר */
.dz-person { background: #fff; border: 1px solid #e2e8f0; border-radius: 13px; padding: 14px; display: flex; align-items: center; gap: 12px; }
.dz-person-avatar { width: 42px; height: 42px; flex: none; border-radius: 50%; background: #eef2ff; color: #4f46e5; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; }
.dz-person-main { flex: 1; min-width: 0; }
.dz-person-name { font-size: 15px; font-weight: 700; color: #0f172a; }
.dz-person-email { font-size: 12px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dz-person-side { flex: none; text-align: left; }
.dz-person-date { font-size: 14px; font-weight: 700; color: #334155; }

/* כרטיס תיאור/כללי */
.dz-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 13px; padding: 14px; }
.dz-desc { font-size: 14px; line-height: 1.6; color: #334155; text-wrap: pretty; }
.dz-desc-empty { color: #5a6779; font-style: italic; }

/* כרטיס תקציב — מצב ריק */
.dz-budget-empty { background: #fff; border: 1px solid #e2e8f0; border-radius: 13px; padding: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#drawer .dz-budget { background: #fff; border-color: #e2e8f0; border-radius: 13px; padding: 15px; }

/* דרישות הבקשה — כל דרישה ככרטיס ממוסגר */
#drawer .dz-req { display: block; border: 1px solid #e2e8f0; border-radius: 13px; padding: 16px; margin-bottom: 12px; }
#drawer .dz-req:last-child { margin-bottom: 0; border-bottom: 1px solid #e2e8f0; }
#drawer .dz-req-name { font-size: 14px; font-weight: 700; color: #1e293b; }
#drawer .dz-req-desc { font-size: 12px; color: #64748b; }
#drawer .dz-req-highlight { background: #f5f5ff; border-color: #6366f1; }

/* פס פעולות דבוק + תפריט ⋮ אינדיגו */
/* פס הפעולות יושב במעגן קבוע מחוץ לאזור הגלילה */
#drawer .drawer-dock { flex: none; }
#drawer .drawer-dock:empty { display: none; }
#drawer .dz-footer { position: static; margin: 0; padding: 15px 22px; border-top: 1px solid #eef2f7; background: #fff; box-shadow: 0 -8px 24px -16px rgba(15, 23, 42, .2); }
#drawer .dz-menu-btn { width: 46px; height: 46px; border: 1.5px solid #6366f1; background: #f5f5ff; color: #4f46e5; border-radius: 12px; }
#drawer .dz-menu-btn:hover { background: #eef2ff; }
#drawer .dz-menu { inset-inline-start: auto; inset-inline-end: 0; min-width: 236px; border-radius: 14px; box-shadow: 0 20px 40px -12px rgba(15, 23, 42, .28); }


/* ============================================================
   WCAG 2.2 AA (2.5.8) — minimum 24x24 pointer target.
   These controls were 14-20px on a side, which is a miss on
   touch and a strain with a mouse. The visual size is kept;
   only the hit area grows, via min-* and centred content.
   ============================================================ */
.drawer-close,
.req-menu-btn,
.activity-gear,
.exp-del-btn,
.modal-close {
    min-width: 24px;
    min-height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Text-styled buttons: pad the line box out to 24px without moving the text. */
.dlh-link,
.activity-report-link,
.exp-quick-link,
.filter-clear-link {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
}

/* Selects were 20px tall in dense filter bars. */
select { min-height: 24px; }

/* תיבת סימון וכפתור רדיו: רצפת 24px היא מטרת אצבע, וכפייתה גם בעכבר
   הפכה כל תיבה בטבלאות לריבוע צעקני. WCAG 2.2 קריטריון 2.5.8 מתיר
   מטרה קטנה יותר כשחריג הריווח מתקיים, כלומר כשמעגל בקוטר 24px סביב
   כל מטרה אינו חותך מטרה אחרת. בטבלת הבקשות התיבה יושבת לבדה בעמודה
   ברוחב 34px ובשורות במרווח של כחמישים פיקסל, ולכן החריג מתקיים.
   על מכשיר מגע אין חריג ואין דיוק, ושם הרצפה נשארת. */
@media (pointer: coarse) {
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 24px;
        min-width: 24px;
    }
}

/* Elements upgraded by a11y-clickable.js need a visible focus ring — they had
   none, having never been focusable. */
[role="button"][tabindex="0"]:focus-visible,
.sidebar-item:focus-visible,
.drawer-tab:focus-visible,
.dash-row:focus-visible,
.stat-card:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 6px;
}
/* Inside the dark sidebar a blue ring on navy is hard to see. */
.sidebar .sidebar-item:focus-visible,
.sidebar [role="button"]:focus-visible {
    outline-color: #ffffff;
}
