/* ============================================================
   דפוס דותן — העיצוב המקורי (ניווט עליון, רקע בהיר, כחול Bootstrap)
   קובץ זה מחזיר את המראה המקורי ושומר על הקלאסים
   שהדפים המעודכנים משתמשים בהם
   ============================================================ */

:root {
    /* צבעי המקור - כחול Bootstrap */
    --accent: #0d6efd;
    --accent-hover: #0b5ed7;
    --accent-light: #e7f1ff;
    --bg: #f0f2f5;
    --surface: #ffffff;
    --fill: #f8f9fa;
    --border: #e9ecef;
    --border-strong: #dee2e6;
    --text: #212529;
    --text-secondary: #6c757d;
    --warning: #ff9800;
    --danger: #dc3545;
    --success: #198754;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-2: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-4: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-8: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-16: 0 10px 25px rgba(0,0,0,0.1);
}

/* padding-bottom: מקום לכפתורים הצפים (☕ / 📥 / 💬) שלא יכסו את תחתית הטבלאות */
body { font-family: 'Rubik', sans-serif; background-color: var(--bg); padding-bottom: 80px; }

/* מודל האישור והודעות ה-toast של app.js - פונט גדול (מזכירה) */
#appConfirmModal .modal-body { font-size: 1.25rem; line-height: 1.5; white-space: pre-line; }
#appToastWrap { z-index: 1090; }
#appToastWrap .toast { font-size: 1.1rem; }

/* --- הניווט העליון המקורי --- */
.navbar { background-color: #ffffff; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.navbar-collapse { min-width: 0; }
.navbar .navbar-nav { flex-wrap: wrap; }
.nav-link { font-weight: 500; color: #555 !important; margin-inline-end: 2px; }
/* התפריט העליון: שורה אחת אחידה - הסמן לא שובר את הכפתור לשתי שורות */
.navbar .nav-link { white-space: nowrap; font-size: 15px; padding-inline: 9px; }
.navbar .nav-link .badge {
    font-size: 10.5px; padding: 3px 6px; vertical-align: 2px;
}
.nav-link:hover, .nav-link.active { color: #0d6efd !important; }
.dashboard-container { max-width: 1400px; margin: 30px auto; }
.card { border-radius: 16px; border: none; }

.search-bar {
    max-width: 300px;
    width: 100%;
    background: #f8f9fa;
    border-radius: 20px;
    padding: 5px 15px;
    display: flex;
    align-items: center;
}
.search-bar input { border: none; background: transparent; width: 100%; outline: none; font-size: 0.9rem; }

/* ============ כרטיסי סטטיסטיקה (דף ראשי) - המקור ============ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.06);
    position: relative;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.813rem;
    color: #6c757d;
    font-weight: 500;
}

.stat-subtitle {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 4px;
}

/* צבעים עדינים לכל כרטיס - המקור */
.stat-card.color-1 .stat-value { color: #5f27cd; }
.stat-card.color-2 .stat-value { color: #0a8f90; } /* היה #00d2d3 — יחס 1.88, בלתי קריא */
.stat-card.color-3 .stat-value { color: #ff6b6b; }
.stat-card.color-4 .stat-value { color: #0e8a68; } /* היה #1dd1a1 */

.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:active { transform: scale(0.98) translateY(-2px); }

/* ============ טאבי סטטוס - המקור ============ */
.status-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 20px 0;
    padding: 0;
}

.status-tab {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    background: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.status-tab:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

.status-tab.active {
    border-color: currentColor;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    background: #f8f9fa;
}

.status-tab-count {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 4px 0;
}

.status-tab-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6c757d;
}

/* צבעים עדינים - המקור */
.tab-all { color: #495057; }
.tab-all.active { background: #f8f9fa; }

.tab-new { color: #5f27cd; }
.tab-new.active { background: #f3f0ff; }

.tab-design { color: #0984e3; }
.tab-design.active { background: #e3f2fd; }

.tab-work { color: #a86b00; } /* היה #fdcb6e — יחס 1.51 על לבן */
.tab-work.active { background: #fff8e1; }

.tab-ready { color: #00745c; } /* היה #00b894 */
.tab-ready.active { background: #e8f5e9; }

.tab-completed { color: #636e72; }
.tab-completed.active { background: #f5f5f5; }

.tab-cancelled { color: #d63031; }
.tab-cancelled.active { background: #ffebee; }

.tab-efrat { color: #e84393; }
.tab-efrat.active { background: #fce4ec; }

/* ============ התאמות לקבצים המעודכנים (טפסי הזמנה) ============
   הקלאסים האלה בשימוש בטפסים החדשים - כאן הם מקבלים את המראה המקורי */

/* פאנל תחשיב מחיר - כחלחל בהיר כמו המקור (bg-primary bg-opacity-10) */
.price-panel { background: rgba(13, 110, 253, 0.1) !important; }
.price-box {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.price-box .input-group-text,
.price-box .form-control { background: #f8f9fa !important; }

/* שדות קלט רכים - אפור בהיר כמו המקור */
.soft-input {
    background: #f8f9fa !important;
    border: 0 !important;
}
.soft-input:focus {
    background: #fff !important;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1) !important;
}

/* כרטיס תשלום */
.payment-card {
    background-color: #fff;
    border: 2px solid transparent;
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.payment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

/* צ'יפים של גימורים - המקור (נבחר = כחול) */
.finish-btn {
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #e9ecef;
    transition: all 0.2s;
    cursor: pointer;
}
.finish-btn:hover { background-color: #e9ecef; }
.btn-check:checked + .finish-btn {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
    box-shadow: 0 2px 5px rgba(13, 110, 253, 0.3);
}

/* מתג חשבונית מס - צהוב כמו המקור */
.form-switch .form-check-input:checked { background-color: #ffc107; border-color: #ffc107; }

/* אנימציות לעדכון בלי רענון (נשאר מהשדרוג) */
.badge-loading { opacity: .45; pointer-events: none; }
.row-leaving { transition: opacity .4s, transform .4s; opacity: 0; transform: translateX(30px); }
.badge-pop { animation: badge-pop .35s ease; }
@keyframes badge-pop { 0% { transform: scale(.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* =====================================================================
   עיצוב חדש (28/09) — תפריט עליון כחול + המסך הראשי. שמות חדשים בלבד (--d-*, --st-*),
   וכל הכללים בתוך .shell / .v3 — שאר המסכים לא משתנים. הדמיה: לוח העיצוב "עיצוב מחדש — המסך הראשי".
   ===================================================================== */
:root {
    --d-navy: #1E3A5F; --d-navy-2: #2B4A73; --d-page: #F3F4F7; --d-ink: #1B2533; --d-ink-2: #5B6778; --d-ink-3: #647082;
    --d-line: #E6E9EF; --d-blue: #2457A7; --d-blue-hover: #1B4382; --d-teal-count: #7FD1C8; --d-teal-count-ink: #0B3F3B;
    --d-shadow: 0 1px 2px rgba(27,37,51,.05), 0 4px 16px rgba(27,37,51,.04);
    --d-font: 'Heebo', Arial, sans-serif;
    /* צבע קבוע לכל מצב הזמנה: רקע / טקסט / נקודה */
    --st-new-bg: #EAF1FB;    --st-new-ink: #23508F;    --st-new-dot: #3F6FC0;
    --st-gfx-bg: #F1ECF9;    --st-gfx-ink: #5A3E8A;    --st-gfx-dot: #7A5CB5;
    --st-work-bg: #E3F3F1;   --st-work-ink: #0E5C57;   --st-work-dot: #23857F;
    --st-ready-bg: #E8F4EC;  --st-ready-ink: #265F3D;  --st-ready-dot: #3E8E5A;
    --st-efrat-bg: #FDF3DF;  --st-efrat-ink: #7D4F0B;  --st-efrat-dot: #C98A1B;
    --st-done-bg: #EEF0F3;   --st-done-ink: #4A5565;   --st-done-dot: #8A94A3;
    --st-cancel-bg: #FBEEEF; --st-cancel-ink: #9B2F3A; --st-cancel-dot: #C4515A;
}
.skip-link { position: absolute; inset-inline-start: 16px; top: -120px; z-index: 2000; background: #fff; color: var(--d-navy);
    padding: 10px 18px; border-radius: 999px; font: 700 17px var(--d-font); text-decoration: none; box-shadow: var(--d-shadow); }
.skip-link:focus { top: 12px; }
#main:focus { outline: none; }

/* ---------- התפריט העליון (בכל המסכים) ---------- */
.shell { position: sticky; top: 0; z-index: 1030; margin-bottom: 1.5rem; font-family: var(--d-font); color: #fff; }
body.v3 .shell { margin-bottom: 0; }
.shell :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.shell .dropdown-menu :focus-visible { outline-color: var(--d-blue); }
.shell-top { background: var(--d-navy); display: flex; align-items: center; gap: 20px; padding: 10px 28px; min-height: 64px; }
.shell-brand { font-size: 24px; font-weight: 700; color: #fff; text-decoration: none; white-space: nowrap; }
.shell-brand:hover { color: #fff; }
.shell-search { flex: 0 1 380px; margin: 0; }
.shell-search input { width: 100%; height: 44px; border: 0; border-radius: 999px; padding: 0 20px; background: #fff; color: var(--d-ink); font: 400 17px var(--d-font); }
.shell-search input::placeholder { color: var(--d-ink-3); }
.shell-tools { display: flex; align-items: center; gap: 6px; margin-inline-start: auto; }
.shell-tool, .shell-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 0; border-radius: 999px;
    background: transparent; color: #fff; font: 500 17px var(--d-font); text-decoration: none; white-space: nowrap; cursor: pointer; }
.shell-tool:hover, .shell-link:hover, .shell-link.show { background: rgba(255,255,255,.12); color: #fff; }
.shell-tool.is-soft { background: rgba(255,255,255,.12); }
.shell-tool.is-soft:hover { background: rgba(255,255,255,.2); }
.shell-tool[aria-pressed="true"], .shell-tool[aria-expanded="true"] { background: rgba(255,255,255,.22); }
.shell-count { display: inline-block; min-width: 24px; padding: 1px 8px; border-radius: 999px; background: #fff; color: var(--d-navy);
    font: 700 14px var(--d-font); text-align: center; font-variant-numeric: tabular-nums; line-height: 1.5; }
.shell-count.is-teal { background: var(--d-teal-count); color: var(--d-teal-count-ink); }
.shell-count[hidden] { display: none; }
.shell-user { width: 44px; height: 44px; border: 0; border-radius: 50%; background: #fff; color: var(--d-navy); font: 700 16px var(--d-font); }
.shell-menu-btn { display: none; }
.shell-menu { background: var(--d-navy-2); }
.shell-links { list-style: none; margin: 0; padding: 8px 24px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.shell-link { min-height: 40px; padding: 0 16px; }
.shell-link[aria-current="page"], .shell-link.is-current { background: #fff; color: var(--d-navy); font-weight: 700; }
.shell-link.dropdown-toggle::after { border: 0; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg); margin: -5px 2px 0; vertical-align: middle; }
.shell .dropdown-menu { font: 400 17px var(--d-font); border: 0; border-radius: 14px; padding: 8px; box-shadow: 0 8px 28px rgba(27,37,51,.16); min-width: 240px; }
.shell .dropdown-item { border-radius: 10px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; color: var(--d-ink); }
.shell .dropdown-item:hover, .shell .dropdown-item:focus { background: var(--d-page); color: var(--d-ink); }
.shell .dropdown-item[aria-current="page"] { background: var(--st-new-bg); color: var(--st-new-ink); font-weight: 700; }
.shell .dropdown-item .shell-count { margin-inline-start: auto; background: var(--d-page); }
.shell-user-name { padding: 8px 14px 10px; color: var(--d-ink-2); font-size: 16px; border-bottom: 1px solid var(--d-line); margin-bottom: 6px; }
.shell-small { display: none; }
@media (max-width: 1099.98px) {
    .shell-menu-btn { display: inline-flex; }
    .shell-top { gap: 12px; padding: 10px 16px; flex-wrap: wrap; }
    .shell-links { flex-direction: column; align-items: stretch; padding: 10px 16px 16px; }
    .shell-links .dropdown-menu { position: static !important; transform: none !important; box-shadow: none; background: rgba(255,255,255,.08); }
    .shell-links .dropdown-item { color: #fff; }
    .shell-links .dropdown-item:hover, .shell-links .dropdown-item:focus { background: rgba(255,255,255,.14); color: #fff; }
    .shell-links .dropdown-item[aria-current="page"] { background: #fff; color: var(--d-navy); }
}
@media (min-width: 1100px) { .shell-menu.collapse:not(.show) { display: block; } }
@media (max-width: 767.98px) {
    .shell-search, .shell-tool.is-optional { display: none; }
    .shell-small { display: block; }
    .shell-long, .shell-tools > .dropdown { display: none; }
    .shell-top { flex-wrap: nowrap; }
    .shell-brand { font-size: 20px; }
}
/* הכפתורים הצפים עברו לתפריט: מוסתרים, והחלוניות שלהם נפתחות מהפינה */
body:has(.shell [data-shell-open="msgw"]) #msgwFab,
body:has(.shell [data-shell-open="notes"]) #ntFab,
body:has(.shell [data-shell-open="today"]) #todayFab { display: none !important; }
body:has(.shell [data-shell-open="msgw"]) #msgwPanel,
body:has(.shell [data-shell-open="msgw"]) #msgwToast { bottom: 24px !important; left: 24px !important; }
body:has(.shell [data-shell-open="notes"]) #ntBar,
body:has(.shell [data-shell-open="notes"]) #ntToast { bottom: 24px !important; left: 24px !important; }
body:has(.shell [data-shell-open="notes"]) #ntMenu { bottom: 78px !important; left: 24px !important; }
body:has(.shell) { padding-bottom: 24px; }
@media (prefers-reduced-motion: reduce) { .shell *, .v3 * { transition: none !important; animation: none !important; } }

/* =====================================================================
   רכיבים משותפים לכל המסכים בעיצוב החדש (body.v3) — הדמיה: לוח "עיצוב מחדש — כל המסכים".
   מסך בעיצוב החדש: $__body_class = 'v3' ו-<main class="ui">. בלי אייקונים — כל פעולה כתובה.
   ===================================================================== */
body.v3 { background: var(--d-page); font-family: var(--d-font); color: var(--d-ink); font-size: 18px; line-height: 1.5; }
/* גוונים: כל רכיב צבעוני קורא --t-bg / --t-ink */
.tone-new { --t-bg: var(--st-new-bg); --t-ink: var(--st-new-ink); }       .tone-gfx { --t-bg: var(--st-gfx-bg); --t-ink: var(--st-gfx-ink); }
.tone-work { --t-bg: var(--st-work-bg); --t-ink: var(--st-work-ink); }    .tone-ready { --t-bg: var(--st-ready-bg); --t-ink: var(--st-ready-ink); }
.tone-efrat { --t-bg: var(--st-efrat-bg); --t-ink: var(--st-efrat-ink); } .tone-done { --t-bg: var(--st-done-bg); --t-ink: var(--st-done-ink); }
.tone-cancel { --t-bg: var(--st-cancel-bg); --t-ink: var(--st-cancel-ink); }

.ui { padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 24px; }
.ui :focus-visible, .ui-dialog :focus-visible { outline: 2px solid var(--d-blue); outline-offset: 2px; }
.ui h1 { margin: 0; font-size: 32px; font-weight: 700; color: var(--d-navy); letter-spacing: -.3px; }
.ui h2 { margin: 0; font-size: 20px; font-weight: 700; color: var(--d-ink); }
.ui h3 { margin: 0; font-size: 18px; font-weight: 700; }
.ui .num, .ui-dialog .num { font-variant-numeric: tabular-nums; }
.ui-sub { font-size: 16px; color: var(--d-ink-2); }
.ui-hint { font-size: 15px; color: var(--d-ink-3); }
.ui-back { font-size: 16px; font-weight: 500; }
.ui-debt { color: var(--st-cancel-ink); font-weight: 700; }
.ui-paid { color: var(--st-ready-ink); font-weight: 700; }
.ui-warn { color: var(--st-efrat-ink); font-weight: 500; }
.ui-muted { color: var(--d-ink-3); }
.ui-clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* כותרת העמוד: כותרת + שורת משנה, ופעולות העמוד בקצה */
.ui-head { display: flex; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; }
.ui-head-actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.ui-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* כפתורים — מסגרת כחולה = הפעולה של השורה; מלא = הפעולה הראשית של האזור; שקט = "עוד", "ביטול" */
.ui-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px;
    border: 1px solid var(--d-blue); background: #fff; color: var(--d-blue); font: 500 17px var(--d-font); text-decoration: none; white-space: nowrap; cursor: pointer;
    transition: background .15s, border-color .15s; }
.ui-btn:hover { background: var(--st-new-bg); color: var(--d-blue-hover); }
.ui-btn.is-solid { background: var(--d-navy); border-color: var(--d-navy); color: #fff; }
.ui-btn.is-solid:hover { background: var(--d-navy-2); color: #fff; }
.ui-btn.is-quiet { border-color: var(--d-line); color: var(--d-ink); }
.ui-btn.is-quiet:hover { background: var(--d-page); color: var(--d-ink); }
.ui-btn.is-danger { border-color: var(--d-line); color: var(--st-cancel-ink); }
.ui-btn.is-danger:hover { background: var(--st-cancel-bg); color: var(--st-cancel-ink); }
.ui-btn.is-danger-solid { background: var(--st-cancel-ink); border-color: var(--st-cancel-ink); color: #fff; }
.ui-btn.is-lg { min-height: 48px; padding: 0 26px; }
.ui-btn.is-sm { padding: 0 14px; font-size: 16px; }
.ui-btn.is-block { width: 100%; }
.ui-btn:disabled, .ui-btn.disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.ui-link { border: 0; background: none; padding: 0; color: var(--d-blue); text-decoration: underline; font: inherit; cursor: pointer; }

/* צ'יפים: סינון / בחירה (aria-pressed או aria-current) */
.ui-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ui-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border: 1px solid var(--d-line); border-radius: 999px;
    background: #fff; color: var(--d-ink); font: 500 16px var(--d-font); text-decoration: none; white-space: nowrap; cursor: pointer; }
.ui-chip:hover { background: var(--d-page); color: var(--d-ink); }
.ui-chip[aria-pressed="true"], .ui-chip[aria-current], .ui-chip.active { background: var(--d-navy); border-color: var(--d-navy); color: #fff; }

/* תווית / תגית צבעונית */
.ui-pill { display: inline-flex; align-items: center; gap: 8px; padding: 3px 12px; border-radius: 999px; font-size: 15px; font-weight: 500; white-space: nowrap;
    background: var(--t-bg, var(--st-done-bg)); color: var(--t-ink, var(--st-done-ink)); }
.ui-pill.is-dot { padding: 4px 14px; font-size: 16px; }
.ui-pill.is-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .75; }

/* כרטיסים */
.ui-card { background: #fff; border-radius: 16px; box-shadow: var(--d-shadow); padding: 22px 24px; }
.ui-card.is-flush { padding: 0; overflow: hidden; }
.ui-card-head { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.ui-card.is-flush > .ui-card-head { padding: 18px 24px; }
.ui-card-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.ui-stack { display: flex; flex-direction: column; gap: 16px; }
.ui-cols { display: flex; gap: 20px; align-items: flex-start; }
.ui-cols > .ui-main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.ui-cols > .ui-side { flex: 0 0 400px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* אריחי ספירה שמסננים (כמו "איפה ההזמנות עכשיו") */
.ui-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.ui-tile { display: flex; flex-direction: column; padding: 14px 16px; border-radius: 14px; border: 0; text-align: start; text-decoration: none; font: inherit; cursor: pointer;
    background: var(--t-bg, var(--d-page)); color: var(--t-ink, var(--d-ink)); transition: box-shadow .15s; }
.ui-tile:hover { box-shadow: inset 0 0 0 1px currentColor; color: var(--t-ink, var(--d-ink)); }
.ui-tile[aria-current], .ui-tile[aria-pressed="true"] { box-shadow: inset 0 0 0 2px currentColor; }
.ui-tile-n { font-size: 30px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ui-tile-label { font-size: 17px; font-weight: 500; }
.ui-tile-sub { font-size: 15px; color: var(--d-ink-2); }

/* סיכום: כמה ערכים בשורה, מופרדים בקו דק */
.ui-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.ui-stat { padding: 2px 24px; border-inline-start: 1px solid var(--d-line); min-width: 0; }
.ui-stat:first-child { border-inline-start: 0; padding-inline-start: 0; }
.ui-stat-label { font-size: 17px; font-weight: 500; }
.ui-stat-val { font-size: 28px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.ui-stat-sub { font-size: 15px; color: var(--d-ink-3); }
/* שורות ערך (כמו כרטיס "כסף") */
.ui-kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--d-line); }
.ui-kv:first-child { border-top: 0; }
.ui-kv-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* הודעה בתוך העמוד — טקסט בלבד, לפי גוון (ברירת מחדל ענבר) */
.ui-callout { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; font-size: 16px; font-weight: 500;
    background: var(--t-bg, var(--st-efrat-bg)); color: var(--t-ink, var(--st-efrat-ink)); }
.ui-callout a:not(.ui-btn):not(.ui-chip) { color: inherit; text-decoration: underline; }
.ui-callout .ui-end { margin-inline-start: auto; }

/* רשימה: טבלה אמיתית, מתחת ל-1200px כל שורה כרטיס (data-label על התאים) */
.ui-table-wrap { overflow-x: auto; }
.ui-table { width: 100%; border-collapse: collapse; }
.ui-table th { text-align: start; font-size: 15px; font-weight: 500; color: var(--d-ink-3); padding: 10px 14px; border-top: 1px solid var(--d-line); white-space: nowrap; }
.ui-table td { padding: 14px; border-top: 1px solid var(--d-line); vertical-align: middle; font-size: 17px; }
.ui-table th:first-child, .ui-table td:first-child { padding-inline-start: 24px; }
.ui-table th:last-child, .ui-table td:last-child { padding-inline-end: 24px; }
.ui-table tbody tr { transition: background .15s; }
.ui-table tbody tr:hover { background: #FAFBFD; }
.ui-table tr.is-muted td { color: var(--d-ink-3); }
.ui-table tr.is-paid { background: #F4FAF6; }
.ui-table tr.is-late { background: #FDF6F6; }
.ui-table .ui-td-act { width: 1%; white-space: nowrap; }
/* טבלה קטנה בתוך כרטיס רגיל (לא נהפכת לכרטיסים) */
.ui-card:not(.is-flush) .ui-table th:first-child, .ui-card:not(.is-flush) .ui-table td:first-child { padding-inline-start: 0; }
.ui-card:not(.is-flush) .ui-table th:last-child, .ui-card:not(.is-flush) .ui-table td:last-child { padding-inline-end: 0; }
.ui-table-compact td { padding-top: 10px; padding-bottom: 10px; font-size: 16px; }
.ui-table-compact th { padding-top: 8px; padding-bottom: 8px; }
.ui-name { font-weight: 500; color: var(--d-ink); text-decoration: none; }
.ui-id { font-weight: 700; color: var(--d-navy); font-variant-numeric: tabular-nums; }
a.ui-name:hover { color: var(--d-ink); text-decoration: underline; }
.ui-row-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.ui-empty { padding: 28px 24px; text-align: center; color: var(--d-ink-2); border-top: 1px solid var(--d-line); }
.ui-more { padding: 18px; text-align: center; border-top: 1px solid var(--d-line); }
.ui-search { display: flex; gap: 8px; margin: 0; }
.ui-search input { width: 320px; max-width: 100%; height: 46px; border: 1px solid transparent; border-radius: 999px; background: var(--d-page); padding: 0 20px;
    font: 400 17px var(--d-font); color: var(--d-ink); }
.ui-search input::placeholder { color: var(--d-ink-3); }
.ui-search input:focus { background: #fff; border-color: var(--d-blue); outline: none; box-shadow: 0 0 0 2px var(--st-new-bg); }
.ui-menu { font: 400 17px var(--d-font); border: 0; border-radius: 14px; padding: 8px; box-shadow: 0 8px 28px rgba(27,37,51,.16); min-width: 220px; }
.ui-menu .dropdown-item { border-radius: 10px; padding: 10px 14px; color: var(--d-ink); }
.ui-menu .dropdown-item:hover, .ui-menu .dropdown-item:focus { background: var(--d-page); color: var(--d-ink); }
.ui-menu .dropdown-item.is-danger { color: var(--st-cancel-ink); }
.ui-menu .dropdown-item:disabled, .ui-menu .dropdown-item.disabled { color: var(--d-ink-3); }

/* טפסים: תווית מעל השדה, שדות 48px */
.ui .form-label, .ui-dialog .form-label, .ui-label { display: block; font-size: 17px; font-weight: 500; margin-bottom: 8px; color: var(--d-ink); }
.ui-opt { font-size: 15px; font-weight: 400; color: var(--d-ink-3); }
.ui .form-control, .ui .form-select, .ui-dialog .form-control, .ui-dialog .form-select { min-height: 48px; border: 1px solid #7B8797; border-radius: 12px;
    padding: 10px 14px; font: 400 17px var(--d-font); color: var(--d-ink); background-color: #fff; box-shadow: none; }
.ui .form-select, .ui-dialog .form-select { padding-inline-end: 40px; background-position: left 14px center; }
.ui .form-control:focus, .ui .form-select:focus, .ui-dialog .form-control:focus, .ui-dialog .form-select:focus { border-color: var(--d-blue); box-shadow: 0 0 0 3px var(--st-new-bg); }
.ui-check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 17px; font-weight: 500; cursor: pointer; margin: 0; }
.ui-check input { width: 22px; height: 22px; margin: 0; accent-color: var(--d-navy); flex-shrink: 0; }
.ui-grid { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 16px; }
.ui-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* חלונית (Bootstrap modal) בעיצוב החדש — סגירה בכפתור כתוב */
.ui-dialog .modal-content { border: 0; border-radius: 16px; font-family: var(--d-font); font-size: 18px; color: var(--d-ink); box-shadow: 0 12px 40px rgba(27,37,51,.22); }
.ui-dialog .modal-header { border-bottom: 1px solid var(--d-line); padding: 18px 24px; gap: 12px; }
.ui-dialog .modal-title { font-size: 22px; font-weight: 700; color: var(--d-navy); }
.ui-dialog .modal-body { padding: 20px 24px 24px; }
.ui-dialog .modal-footer { border-top: 1px solid var(--d-line); padding: 14px 24px; gap: 8px; justify-content: flex-start; }
.ui-dialog .modal-footer > * { margin: 0; }
.ui-close { margin-inline-start: auto; }

@media (max-width: 1099.98px) {
    .ui { padding: 20px 16px 32px; }
    .ui-cols { flex-direction: column; align-items: stretch; }
    .ui-cols > .ui-main, .ui-cols > .ui-side { flex: 0 0 auto; }
}
@media (max-width: 1199.98px) {
    .ui-table:not(.ui-table-compact) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .ui-table:not(.ui-table-compact), .ui-table:not(.ui-table-compact) > tbody { display: block; }
    .ui-table:not(.ui-table-compact) tr { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 20px; padding: 16px; border-top: 1px solid var(--d-line); }
    .ui-table:not(.ui-table-compact) td { display: block; padding: 0 !important; border: 0; width: auto !important; font-size: 17px; }
    .ui-table td[data-label]::before { content: attr(data-label); display: block; font-size: 15px; font-weight: 500; color: var(--d-ink-3); }
    .ui-table td.ui-td-main { flex: 1 1 100%; }
    .ui-table td.ui-td-act { flex: 1 1 100%; white-space: normal; }
    .ui-table td.ui-td-act .ui-row-actions { justify-content: stretch; }
    .ui-table td.ui-td-act .ui-row-actions > .ui-btn:first-child { flex: 1; min-height: 48px; }
}
@media (max-width: 767.98px) {
    .ui h1 { font-size: 26px; }
    .ui-head-actions { margin-inline-start: 0; width: 100%; }
    .ui-card.is-flush > .ui-card-head { padding: 16px; }
    .ui-card-tools { margin-inline-start: 0; width: 100%; }
    .ui-search, .ui-search input { width: 100%; }
    .ui-grid { grid-template-columns: minmax(0, 1fr); }
    .ui-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 0; }
    .ui-stat:nth-child(odd) { border-inline-start: 0; padding-inline-start: 0; }
    .ui-stat-val { font-size: 24px; }
    .ui-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ui-tile-n { font-size: 24px; }
}
