/* ============================================================
   מגירת בקשת רכש (#drawer.dz3): מעטפת, כותרת, לשוניות, כרטיסים,
   פרטים, תקציב ומסמכים. הפונט נשאר של המערכת (DESIGN.md); הצבעים
   הם של העיצוב שאושר, כטוקנים מקומיים למגירה בלבד.
   לא כאן: כרטיס הפעולה, הכפתורים, התפריט והתצוגה המקדימה
   (drawer-v3-actions.css).
============================================================ */
#drawer.dz3 {
    --dz3-text: #111827;
    --dz3-text-2: #374151;
    --dz3-text-3: #4b5563;
    --dz3-muted: #6b7280;
    --dz3-faint: #6b7280;
    --dz3-muted-strong: #5f6672;
    --dz3-bg: #eceff3;
    --dz3-card: #fff;
    --dz3-subtle: #f6f7f9;
    --dz3-subtle-2: #f1f3f6;
    --dz3-border: #e6e8ec;
    --dz3-hair: #f0f1f4;
    --dz3-sep: #eceef1;
    --dz3-input: #d9dde3;
    --dz3-blue: #2453c9;
    --dz3-green: #137a52;
    --dz3-amber: #9a5308;
    --dz3-info: #075985;
    --dz3-red: #c2362b;
    --dz3-ease: cubic-bezier(.3, .7, .2, 1);
    width: 600px;
    max-width: 90vw;
    background: var(--dz3-bg);
    color: var(--dz3-text);
}
#drawer.dz3 .dz3-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#drawer.dz3 .dz3-ic { flex: none; display: block; }
#drawer.dz3 bdi { unicode-bidi: isolate; white-space: nowrap; }

/* ── חלק עליון קבוע: כותרת + לשוניות ── */
#drawer.dz3 .dz3-top {
    flex: none;
    background: var(--dz3-card);
    border-bottom: 1px solid var(--dz3-border);
    padding: 16px 24px 12px;
    position: relative;
}
#drawer.dz3 .drawer-title { font-size: inherit; font-weight: inherit; color: inherit; }
#drawer.dz3 .drawer-content { padding: 0; background: var(--dz3-bg); }
#drawer.dz3 .dz3-head { display: flex; flex-direction: column; gap: 8px; }
/* ריווח לכפתור הסגירה העגול שיושב על הקצה הפנימי של המגירה */
#drawer.dz3 .dz3-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding-inline-start: 12px; }
#drawer.dz3 .dz3-chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#drawer.dz3 .dz3-urg,
#drawer.dz3 .dz3-status {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; font-weight: 600; border-radius: 7px; padding: 5px 10px; white-space: nowrap;
}
#drawer.dz3 .dz3-status { background: var(--dz3-subtle); border: 1px solid var(--dz3-border); gap: 6px; }
#drawer.dz3 .dz3-meter { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
#drawer.dz3 .dz3-meter i { display: block; width: 4px; border-radius: 1px; }
#drawer.dz3 .dz3-meter i:nth-child(1) { height: 5px; }
#drawer.dz3 .dz3-meter i:nth-child(2) { height: 8px; }
#drawer.dz3 .dz3-meter i:nth-child(3) { height: 12px; }
#drawer.dz3 .dz3-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
#drawer.dz3 .dz3-tools { display: flex; gap: 8px; align-items: center; color: var(--dz3-text-3); }
#drawer.dz3 .dz3-nav { display: flex; align-items: center; border: 1px solid var(--dz3-border); border-radius: 8px; height: 32px; }
#drawer.dz3 .dz3-nav-btn {
    width: 30px; height: 30px; border-radius: 7px; border: 0; background: none;
    display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--dz3-text-3);
}
#drawer.dz3 .dz3-nav-btn:disabled { color: #b8bec7; cursor: default; }
#drawer.dz3 .dz3-nav-btn:not(:disabled):hover { background: var(--dz3-subtle-2); }
#drawer.dz3 .dz3-nav-label { font-size: 12.5px; color: var(--dz3-muted); padding: 0 4px; white-space: nowrap; }
#drawer.dz3 .dz3-more {
    height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--dz3-border); background: var(--dz3-card);
    display: flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 500; color: var(--dz3-text-2);
    cursor: pointer; white-space: nowrap;
}
#drawer.dz3 .dz3-more:hover,
#drawer.dz3 .dz3-more[aria-expanded="true"] { background: var(--dz3-subtle-2); }
#drawer.dz3 .dz3-title { font-size: 21px; font-weight: 600; line-height: 1.35; color: var(--dz3-text); margin: 6px 0 0; overflow-wrap: anywhere; }
#drawer.dz3 .dz3-amountrow { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
#drawer.dz3 .dz3-amount {
    font: inherit; font-size: 32px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums;
    color: var(--dz3-text); background: none; border: 0; padding: 0; cursor: copy; border-radius: 6px;
}
#drawer.dz3 .dz3-cur { font-size: 20px; font-weight: 600; color: var(--dz3-muted); margin-inline-end: 3px; }
#drawer.dz3 .dz3-amount-sub { font-size: 13px; color: var(--dz3-muted); }
#drawer.dz3 .dz3-meta { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr .9fr; margin-top: 8px; }
#drawer.dz3 .dz3-meta-cell { min-width: 0; }
#drawer.dz3 .dz3-meta-cell + .dz3-meta-cell { border-inline-start: 1px solid var(--dz3-sep); padding: 0 14px; }
#drawer.dz3 .dz3-meta-cell:first-child { padding-inline-end: 14px; }
#drawer.dz3 .dz3-meta-l { font-size: 12px; color: var(--dz3-muted); }
#drawer.dz3 .dz3-meta-v {
    font-size: 13.5px; font-weight: 500; color: var(--dz3-text); margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#drawer.dz3 .dz3-copy {
    display: inline-flex; align-items: center; gap: 5px; font: inherit; color: inherit;
    background: none; border: 0; padding: 0; cursor: copy;
}
#drawer.dz3 .dz3-copy .dz3-ic { color: var(--dz3-faint); }

/* ── לשוניות: בורר מקוטע עם מחוון נע ── */
#drawer.dz3 .dz3-tabs {
    position: relative; display: flex; gap: 4px; margin-top: 16px; padding: 4px;
    background: var(--dz3-subtle-2); border-radius: 10px;
}
#drawer.dz3 .dz3-tab {
    position: relative; z-index: 1; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 8px 10px; border-radius: 7px; border: 0; background: none; cursor: pointer; white-space: nowrap;
    font: inherit; font-size: 14px; font-weight: 500; color: var(--dz3-muted-strong); transition: color .2s ease;
}
#drawer.dz3 .dz3-tab.active { font-weight: 600; color: var(--dz3-text); }
#drawer.dz3 .dz3-tab svg { stroke-width: 1.8; }
#drawer.dz3 .dz3-tab-count {
    font-size: 11.5px; font-weight: 600; background: var(--dz3-blue); color: #fff;
    border-radius: 99px; padding: 1px 7px; line-height: 1.5;
}
#drawer.dz3 .dz3-tab-ind {
    position: absolute; top: 4px; bottom: 4px; inset-inline-start: 0; width: 0; z-index: 0;
    border-radius: 7px; background: var(--dz3-card);
    box-shadow: 0 1px 2px rgba(17, 24, 39, .08), 0 1px 6px rgba(17, 24, 39, .06);
    transition: inset-inline-start .3s var(--dz3-ease), width .3s var(--dz3-ease);
}
#drawer.dz3 .drawer-tab-content.dz3-enter { animation: dz3Enter .24s var(--dz3-ease); }
@keyframes dz3Enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── גוף וכרטיסים ── */
#drawer.dz3 .dz3-body { padding: 14px 16px 0; display: flex; flex-direction: column; gap: 12px; }
#drawer.dz3 .dz3-footer { padding: 12px 16px 20px; }
#drawer.dz3 .dz3-footer .request-action-status { margin-bottom: 12px; }
#drawer.dz3 .dz3-card { background: var(--dz3-card); border: 1px solid var(--dz3-border); border-radius: 12px; padding: 16px; }
#drawer.dz3 .dz3-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
#drawer.dz3 .dz3-card-title {
    display: flex; align-items: center; gap: 8px; margin: 0;
    font-size: 14.5px; font-weight: 600; color: var(--dz3-text); white-space: nowrap;
}
#drawer.dz3 .dz3-card-title .dz3-ic { color: var(--dz3-muted); }
#drawer.dz3 .dz3-desc { margin: 0 0 16px; font-size: 14px; line-height: 1.7; color: var(--dz3-text-3); text-wrap: pretty; white-space: pre-line; overflow-wrap: anywhere; }
#drawer.dz3 .dz3-desc.is-empty { color: var(--dz3-faint); }
#drawer.dz3 .dz3-fields {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    column-gap: 24px; row-gap: 16px; align-items: start;
    padding-top: 16px; border-top: 1px solid var(--dz3-hair);
}
#drawer.dz3 .dz3-field[hidden] { display: none; }
#drawer.dz3 .dz3-field-l { font-size: 12.5px; color: var(--dz3-muted); }
#drawer.dz3 .dz3-field-v { font-size: 14.5px; font-weight: 500; color: var(--dz3-text); margin-top: 2px; overflow-wrap: anywhere; }
#drawer.dz3 .dz3-field-v.dz3-muted { color: var(--dz3-muted); font-weight: 400; }
#drawer.dz3 .dz3-field-s { font-size: 12.5px; line-height: 1.5; color: var(--dz3-muted); margin-top: 1px; overflow-wrap: anywhere; }
#drawer.dz3 .dz3-field-s .dz3-ic { display: inline-block; vertical-align: -2px; margin-inline-end: 3px; }
#drawer.dz3 .dz3-reason { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--dz3-hair); }
#drawer.dz3 .dz3-reason-text { font-size: 14.5px; color: var(--dz3-text); margin-top: 2px; white-space: pre-line; }

/* ── תקציב רכש ── */
#drawer.dz3 .dz3-budget-head { font-size: 13px; font-weight: 600; white-space: nowrap; }
#drawer.dz3 .dz3-budget-sub { font-size: 12.5px; color: var(--dz3-muted); margin: -4px 0 10px; }
#drawer.dz3 .dz3-bar { height: 6px; border-radius: 3px; background: #eef0f3; display: flex; overflow: hidden; }
#drawer.dz3 .dz3-bar span { display: block; height: 100%; }
#drawer.dz3 .dz3-legend { display: flex; gap: 6px 16px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--dz3-text-3); }
#drawer.dz3 .dz3-legend span { display: inline-flex; align-items: center; gap: 5px; }
#drawer.dz3 .dz3-swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; }
#drawer.dz3 .dz3-legend-total { margin-inline-start: auto; color: var(--dz3-muted); }
#drawer.dz3 .dz3-over {
    display: flex; align-items: center; gap: 7px; margin-top: 10px; padding: 8px 10px; border-radius: 8px;
    font-size: 13px; font-weight: 500; color: #9b2a21; background: #fdf1ef;
}
#drawer.dz3 .dz3-graybox { font-size: 13.5px; line-height: 1.6; color: var(--dz3-text-3); background: var(--dz3-subtle); border-radius: 8px; padding: 10px 12px; }

/* ── מסמכים ── */
#drawer.dz3 .dz3-card-head + .dz3-files { margin-top: -6px; }
#drawer.dz3 .dz3-file { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--dz3-hair); font-size: 14px; }
#drawer.dz3 .dz3-file-kind {
    width: 38px; height: 38px; border-radius: 8px; background: var(--dz3-subtle-2); color: var(--dz3-text-3);
    display: flex; align-items: center; justify-content: center; flex: none; border: 0; cursor: pointer;
    font: inherit; font-size: 10px; font-weight: 700; text-decoration: none;
}
#drawer.dz3 .dz3-file-main {
    flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: start;
    background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: none;
}
#drawer.dz3 .dz3-file-main:disabled { cursor: default; }
#drawer.dz3 .dz3-file-name { display: block; max-width: 100%; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#drawer.dz3 .dz3-file-meta { display: block; font-size: 12.5px; color: var(--dz3-muted); }
#drawer.dz3 .dz3-docs-empty {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 0 4px; border-top: 1px solid var(--dz3-hair); font-size: 14px; color: var(--dz3-muted);
}
#drawer.dz3 .dz3-dropbox {
    display: flex; align-items: center; gap: 12px; padding: 12px; margin-top: 6px;
    border: 1px dashed #cfd5dd; border-radius: 9px; font-size: 13.5px; color: var(--dz3-text-3);
}
#drawer.dz3 .dz3-dropbox-text { flex: 1; }
#drawer.dz3 .dz3-faint { color: var(--dz3-faint); }
#drawer.dz3 .dz3-upload-status:empty { display: none; }

/* ── שלד טעינה ── */
#drawer.dz3 .dz3-skel {
    height: 12px; border-radius: 6px; margin-top: 8px;
    background: linear-gradient(90deg, #eef0f3 25%, #f6f7f9 37%, #eef0f3 63%);
    background-size: 400% 100%;
    animation: dz3Skel 1.3s ease infinite;
}
#drawer.dz3 .dz3-skel:first-child { margin-top: 0; }
@keyframes dz3Skel { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ── מסך צר: הרשת של ארבע התאים עוברת לשתי שורות ── */
@media (max-width: 768px) {
    #drawer.dz3 .dz3-row { padding-inline-start: 48px; }
}
@media (max-width: 640px) {
    #drawer.dz3 .dz3-top { padding: 14px 16px 12px; }
    #drawer.dz3 .dz3-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
    #drawer.dz3 .dz3-meta-cell:nth-child(3) { border-inline-start: 0; padding-inline-start: 0; }
    #drawer.dz3 .dz3-title { font-size: 19px; }
    #drawer.dz3 .dz3-amount { font-size: 28px; }
    #drawer.dz3 .dz3-body { padding: 12px 12px 0; }
    #drawer.dz3 .dz3-footer { padding: 12px 12px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    #drawer.dz3 .dz3-skel,
    #drawer.dz3 .drawer-tab-content.dz3-enter { animation-duration: .001s !important; }
    #drawer.dz3 .dz3-tab-ind { transition-duration: .001s !important; }
}
