/* ==========================================================================
   BBB פולג — מערכת ניהול ציוד עובדים
   מערכת עיצוב "Obsidian" — RTL, כהה כברירת מחדל, עם מצב בהיר.
   © אופיר ברנס (Ofir Baranes) 2026 - כל הזכויות שמורות
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. טוקנים
   -------------------------------------------------------------------------- */

:root {
    /* צבעי המותג — נלקחו מהלוגו */
    --brand-orange: #f0762b;
    --brand-orange-soft: #ff9350;
    --brand-plum: #8a5f8e;
    --brand-green: #8dc566;
    --brand-red: #ef4f5a;
    --brand-amber: #f2b544;

    /* משטחים — כהה */
    --bg: #0e0a11;
    --bg-deep: #08060a;
    --surface: rgba(255, 255, 255, 0.045);
    --surface-2: rgba(255, 255, 255, 0.07);
    --surface-solid: #17111b;
    --surface-raised: #1d1622;
    --hairline: rgba(255, 255, 255, 0.09);
    --hairline-strong: rgba(255, 255, 255, 0.16);

    /* טקסט */
    --text: #f4eff6;
    --text-soft: #c9c0ce;
    --text-muted: #948a9b;
    --text-faint: #6d6474;

    /* אינטראקציה */
    --accent: var(--brand-orange);
    --accent-contrast: #1a0d04;
    --focus: rgba(240, 118, 43, 0.45);

    /* צללים */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 12px 28px -12px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 32px 64px -24px rgba(0, 0, 0, 0.8);
    --shadow-glow: 0 8px 32px -12px rgba(240, 118, 43, 0.5);

    /* מבנה */
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-full: 999px;
    --gutter: clamp(1rem, 3vw, 2rem);
    --header-h: 68px;

    /* תנועה */
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --dur: 0.28s;

    color-scheme: dark;
}

[data-theme="light"] {
    --bg: #f4f1f6;
    --bg-deep: #e9e4ec;
    --surface: rgba(255, 255, 255, 0.85);
    --surface-2: rgba(255, 255, 255, 1);
    --surface-solid: #ffffff;
    --surface-raised: #ffffff;
    --hairline: rgba(26, 15, 32, 0.09);
    --hairline-strong: rgba(26, 15, 32, 0.16);

    --text: #1b1220;
    --text-soft: #423a49;
    --text-muted: #6c6274;
    --text-faint: #948b9c;

    --brand-plum: #6a4a6d;

    --shadow-sm: 0 1px 2px rgba(40, 20, 50, 0.08);
    --shadow-md: 0 12px 28px -14px rgba(40, 20, 50, 0.28);
    --shadow-lg: 0 32px 64px -28px rgba(40, 20, 50, 0.35);

    color-scheme: light;
}

/* --------------------------------------------------------------------------
   2. איפוס ובסיס
   -------------------------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

* {
    margin: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: "Heebo", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* רקע "אורורה" — הילות צבע רכות שנשארות מאחורי כל התוכן */
body::before {
    content: "";
    position: fixed;
    inset: -20%;
    z-index: -2;
    background:
        radial-gradient(38% 42% at 82% 8%, rgba(240, 118, 43, 0.16), transparent 60%),
        radial-gradient(42% 46% at 12% 4%, rgba(138, 95, 142, 0.2), transparent 62%),
        radial-gradient(40% 40% at 50% 100%, rgba(141, 197, 102, 0.11), transparent 60%);
    filter: blur(6px);
    pointer-events: none;
}

[data-theme="light"] body::before {
    background:
        radial-gradient(38% 42% at 82% 8%, rgba(240, 118, 43, 0.16), transparent 60%),
        radial-gradient(42% 46% at 12% 4%, rgba(138, 95, 142, 0.16), transparent 62%),
        radial-gradient(40% 40% at 50% 100%, rgba(141, 197, 102, 0.14), transparent 60%);
}

/* גרעיניות עדינה — נותנת עומק "חומרי" למשטחים */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.035;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button, input, select, textarea {
    font: inherit;
    color: inherit;
}

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

::selection {
    background: rgba(240, 118, 43, 0.35);
}

/* פסי גלילה */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--hairline-strong);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-faint);
    background-clip: content-box;
}

/* --------------------------------------------------------------------------
   3. עזרי פריסה
   -------------------------------------------------------------------------- */

.shell {
    width: min(1440px, 100%);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.gap-1 { gap: 0.35rem; }
.gap-2 { gap: 0.6rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }
.grow { flex: 1; }
.mt-1 { margin-top: 0.35rem; }
.mt-2 { margin-top: 0.75rem; }
.mt-3 { margin-top: 1.25rem; }
.mt-4 { margin-top: 2rem; }
.hidden { display: none !important; }

/* גובר על display של רכיבים כשמסתירים אותם דרך התכונה hidden */
[hidden] { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.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;
}

/* --------------------------------------------------------------------------
   4. כותרת עליונה
   -------------------------------------------------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    background: color-mix(in srgb, var(--bg) 78%, transparent);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-bottom: 1px solid var(--hairline);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: var(--header-h);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

/* הלוגו יושב על "אריח" לבן — הוא מעוצב לרקע בהיר */
.brand__mark {
    width: 44px;
    height: 44px;
    flex: none;
    display: grid;
    place-items: center;
    background: #fff;
    border-radius: 13px;
    padding: 5px;
    box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.brand__mark img { width: 100%; height: auto; }

.brand__text { min-width: 0; }

.brand__title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.brand__sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.topbar__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.85rem 0.3rem 0.35rem;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
}

.user-chip .avatar { width: 30px; height: 30px; font-size: 0.72rem; }

/* --------------------------------------------------------------------------
   5. כפתורים
   -------------------------------------------------------------------------- */

.btn {
    --btn-bg: var(--surface);
    --btn-fg: var(--text);
    --btn-border: var(--hairline);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--btn-fg);
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    white-space: nowrap;
    transition: transform var(--dur) var(--ease-spring),
                background var(--dur) var(--ease-out),
                border-color var(--dur) var(--ease-out),
                box-shadow var(--dur) var(--ease-out),
                opacity var(--dur) var(--ease-out);
    user-select: none;
}

.btn:hover:not(:disabled) {
    background: var(--surface-2);
    border-color: var(--hairline-strong);
    transform: translateY(-1px);
}

.btn:active:not(:disabled) { transform: translateY(0) scale(0.98); }

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn i { font-size: 1.05em; }

.btn--primary {
    --btn-bg: linear-gradient(135deg, var(--brand-orange), #e0611b);
    --btn-fg: #fff;
    --btn-border: transparent;
    box-shadow: var(--shadow-glow);
}

.btn--primary:hover:not(:disabled) {
    --btn-bg: linear-gradient(135deg, var(--brand-orange-soft), var(--brand-orange));
    box-shadow: 0 12px 36px -10px rgba(240, 118, 43, 0.65);
}

.btn--success {
    --btn-bg: linear-gradient(135deg, var(--brand-green), #6faa4a);
    --btn-fg: #0e1a07;
    --btn-border: transparent;
    box-shadow: 0 8px 28px -12px rgba(141, 197, 102, 0.6);
}

.btn--success:hover:not(:disabled) { --btn-bg: linear-gradient(135deg, #a2d67b, var(--brand-green)); }

.btn--ghost { --btn-bg: transparent; }

.btn--danger {
    --btn-fg: var(--brand-red);
    --btn-border: color-mix(in srgb, var(--brand-red) 35%, transparent);
    --btn-bg: color-mix(in srgb, var(--brand-red) 10%, transparent);
}

.btn--danger:hover:not(:disabled) {
    --btn-bg: color-mix(in srgb, var(--brand-red) 20%, transparent);
    --btn-border: var(--brand-red);
}

.btn--solid-danger {
    --btn-bg: linear-gradient(135deg, #f4626c, #d93b47);
    --btn-fg: #fff;
    --btn-border: transparent;
}

.btn--sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn--lg { padding: 0.85rem 1.8rem; font-size: 1rem; }
.btn--block { width: 100%; }

/* כפתור אייקון עגול */
.icon-btn {
    width: 38px;
    height: 38px;
    flex: none;
    display: inline-grid;
    place-items: center;
    background: var(--surface);
    color: var(--text-soft);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 1rem;
    transition: all var(--dur) var(--ease-out);
}

.icon-btn:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--hairline-strong);
    transform: translateY(-1px);
}

.icon-btn--sm { width: 32px; height: 32px; font-size: 0.85rem; }
.icon-btn--danger:hover { color: var(--brand-red); border-color: color-mix(in srgb, var(--brand-red) 45%, transparent); }
.icon-btn--accent:hover { color: var(--brand-orange); border-color: color-mix(in srgb, var(--brand-orange) 45%, transparent); }
.icon-btn--good:hover { color: var(--brand-green); border-color: color-mix(in srgb, var(--brand-green) 45%, transparent); }

/* --------------------------------------------------------------------------
   6. משטחים
   -------------------------------------------------------------------------- */

.panel {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid var(--hairline);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}

[data-theme="light"] .panel__head {
    background: linear-gradient(180deg, rgba(26, 15, 32, 0.02), transparent);
}

.panel__title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.02rem;
    font-weight: 700;
}

.panel__title i {
    color: var(--brand-orange);
    font-size: 1.15em;
}

.panel__tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    flex-wrap: wrap;
    flex: 1 1 auto;
}

/* בתוך סרגל הכלים השדות מקבלים רוחב טבעי — אחרת width:100% מנפח את הכותרת */
.panel__tools .select {
    width: auto;
    min-width: 146px;
    padding-block: 0.5rem;
    font-size: 0.85rem;
}

.panel__tools .search {
    flex: 0 1 210px;
    min-width: 150px;
}

.panel__tools .input {
    padding-block: 0.5rem;
    font-size: 0.85rem;
}

.panel__body { padding: 1.35rem; }
.panel__body--flush { padding: 0; }

/* --------------------------------------------------------------------------
   7. כרטיסי סטטיסטיקה
   -------------------------------------------------------------------------- */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}

.stat {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.15rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow: hidden;
    transition: transform var(--dur) var(--ease-spring), border-color var(--dur) var(--ease-out);
}

.stat:hover {
    transform: translateY(-3px);
    border-color: var(--hairline-strong);
}

/* פס צבע דק בקצה הכרטיס */
.stat::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: 3px;
    background: var(--stat-color, var(--brand-orange));
}

.stat__icon {
    width: 46px;
    height: 46px;
    flex: none;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    border-radius: 14px;
    color: var(--stat-color, var(--brand-orange));
    background: color-mix(in srgb, var(--stat-color, var(--brand-orange)) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--stat-color, var(--brand-orange)) 25%, transparent);
}

.stat__label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.stat__value {
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat__hint {
    font-size: 0.72rem;
    color: var(--text-faint);
}

.stat--orange { --stat-color: var(--brand-orange); }
.stat--amber { --stat-color: var(--brand-amber); }
.stat--green { --stat-color: var(--brand-green); }
.stat--red { --stat-color: var(--brand-red); }
.stat--plum { --stat-color: var(--brand-plum); }

/* --------------------------------------------------------------------------
   8. ניווט לשוניות
   -------------------------------------------------------------------------- */

.tabs {
    position: relative;
    display: flex;
    gap: 0.25rem;
    padding: 0.35rem;
    margin-bottom: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-full);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 1.15rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--radius-full);
    cursor: pointer;
    white-space: nowrap;
    transition: color var(--dur) var(--ease-out);
}

.tab:hover { color: var(--text-soft); }

.tab[aria-selected="true"] { color: #fff; }

[data-theme="light"] .tab[aria-selected="true"] { color: #fff; }

/* הגלולה הנעה מתחת ללשונית הפעילה */
.tabs__pill {
    position: absolute;
    z-index: 0;
    top: 0.35rem;
    bottom: 0.35rem;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--brand-orange), #d95c1a);
    box-shadow: var(--shadow-glow);
    transition: inset-inline-start var(--dur) var(--ease-spring), width var(--dur) var(--ease-spring);
    pointer-events: none;
}

.tab__count {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding-inline: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    color: var(--text-soft);
}

.tab[aria-selected="true"] .tab__count {
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
}

.tabpanel { animation: panel-in 0.4s var(--ease-out) both; }
.tabpanel[hidden] { display: none; }

@keyframes panel-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   9. שדות טופס
   -------------------------------------------------------------------------- */

.field { display: flex; flex-direction: column; gap: 0.4rem; }

.field__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-soft);
}

.field__hint {
    font-size: 0.75rem;
    color: var(--text-faint);
}

.input,
.select,
.textarea {
    width: 100%;
    padding: 0.7rem 0.95rem;
    font-size: 0.92rem;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
    transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}

.input::placeholder, .textarea::placeholder { color: var(--text-faint); }

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    background: var(--surface-2);
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 4px var(--focus);
}

.select {
    appearance: none;
    padding-inline-start: 2.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23948a9b'%3E%3Cpath d='M4.5 6.5 8 10l3.5-3.5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 0.7rem center;
    background-size: 18px;
}

.select option { background: var(--surface-solid); color: var(--text); }

.textarea { min-height: 92px; resize: vertical; }

/* שדה חיפוש עם אייקון */
.search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 200px;
}

.search i {
    position: absolute;
    inset-inline-start: 0.85rem;
    color: var(--text-faint);
    pointer-events: none;
    font-size: 0.95rem;
}

.search .input { padding-inline-start: 2.5rem; }

.form-grid {
    display: grid;
    gap: 1rem;
}

.form-grid--2 { grid-template-columns: 1fr 1fr; }

@media (max-width: 560px) {
    .form-grid--2 { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   10. תגיות ואווטארים
   -------------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.24rem 0.65rem;
    font-size: 0.73rem;
    font-weight: 700;
    line-height: 1.5;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    color: var(--text-soft);
    border: 1px solid var(--hairline);
    white-space: nowrap;
}

.badge--orange { color: var(--brand-orange); background: color-mix(in srgb, var(--brand-orange) 13%, transparent); border-color: color-mix(in srgb, var(--brand-orange) 28%, transparent); }
.badge--green  { color: var(--brand-green);  background: color-mix(in srgb, var(--brand-green) 13%, transparent);  border-color: color-mix(in srgb, var(--brand-green) 28%, transparent); }
.badge--plum   { color: var(--brand-plum);   background: color-mix(in srgb, var(--brand-plum) 18%, transparent);   border-color: color-mix(in srgb, var(--brand-plum) 34%, transparent); }
.badge--red    { color: var(--brand-red);    background: color-mix(in srgb, var(--brand-red) 13%, transparent);    border-color: color-mix(in srgb, var(--brand-red) 28%, transparent); }
.badge--amber  { color: var(--brand-amber);  background: color-mix(in srgb, var(--brand-amber) 13%, transparent);  border-color: color-mix(in srgb, var(--brand-amber) 28%, transparent); }
.badge--slate  { color: var(--text-muted); }

[data-theme="light"] .badge--plum { color: #6a4a6d; }

.badge__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge--pulse .badge__dot { animation: pulse-dot 1.8s ease-in-out infinite; }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.35; transform: scale(0.75); }
}

.avatar {
    width: 40px;
    height: 40px;
    flex: none;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    border-radius: 50%;
    background: linear-gradient(135deg,
        hsl(var(--h, 24) 62% 52%),
        hsl(calc(var(--h, 24) + 38) 55% 38%));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    letter-spacing: 0.02em;
}

.avatar--lg { width: 54px; height: 54px; font-size: 1.1rem; }

/* --------------------------------------------------------------------------
   11. גלריית פריטים — לב המערכת החדשה
   -------------------------------------------------------------------------- */

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
    gap: 1rem;
}

.item-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--dur) var(--ease-spring),
                border-color var(--dur) var(--ease-out),
                box-shadow var(--dur) var(--ease-out);
}

.item-card:hover {
    transform: translateY(-4px);
    border-color: var(--hairline-strong);
    box-shadow: var(--shadow-lg);
}

.item-card__media {
    position: relative;
    aspect-ratio: 1;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--brand-plum) 22%, transparent),
            color-mix(in srgb, var(--brand-orange) 12%, transparent));
    overflow: hidden;
    cursor: zoom-in;
}

.item-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}

.item-card:hover .item-card__media img { transform: scale(1.06); }

/* מציין מקום כשאין תמונה — אייקון הקטגוריה על גרדיאנט */
.item-card__placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    gap: 0.4rem;
    color: color-mix(in srgb, var(--text) 45%, transparent);
    font-size: 2.4rem;
    cursor: default;
}

.item-card__badges {
    position: absolute;
    inset-block-start: 0.6rem;
    inset-inline: 0.6rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.4rem;
    pointer-events: none;
}

.item-card__badges .badge {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(10, 6, 12, 0.55);
    border-color: rgba(255, 255, 255, 0.16);
}

/* כפתור המצלמה שמופיע על התמונה */
.item-card__camera {
    position: absolute;
    inset-block-end: 0.6rem;
    inset-inline-start: 0.6rem;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(10, 6, 12, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transform: translateY(6px);
    transition: all var(--dur) var(--ease-spring);
}

.item-card:hover .item-card__camera,
.item-card:focus-within .item-card__camera {
    opacity: 1;
    transform: none;
}

.item-card__camera:hover { background: var(--brand-orange); border-color: transparent; }

@media (hover: none) {
    .item-card__camera { opacity: 1; transform: none; }
}

.item-card__body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.9rem 1rem 1rem;
    flex: 1;
}

.item-card__name {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-card__meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.item-card__meta b {
    font-size: 1rem;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.item-card__actions {
    display: flex;
    gap: 0.35rem;
    padding-top: 0.15rem;
    margin-top: auto;
}

/* מד מלאי */
.meter {
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    overflow: hidden;
}

.meter__fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand-green), #a8dc84);
    transition: width 0.8s var(--ease-out);
}

.meter--low .meter__fill { background: linear-gradient(90deg, var(--brand-amber), #ffd071); }
.meter--out .meter__fill { background: linear-gradient(90deg, var(--brand-red), #ff8a92); }

/* --------------------------------------------------------------------------
   12. טבלאות
   -------------------------------------------------------------------------- */

.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.table th {
    padding: 0.75rem 1rem;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-align: start;
    color: var(--text-muted);
    background: var(--surface);
    border-bottom: 1px solid var(--hairline);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.table td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--hairline);
    vertical-align: middle;
}

.table tbody tr { transition: background var(--dur) var(--ease-out); }
.table tbody tr:hover { background: var(--surface); }
.table tbody tr:last-child td { border-bottom: 0; }

.table__actions {
    display: flex;
    gap: 0.3rem;
    justify-content: flex-end;
}

.cell-strong { font-weight: 600; }

/* התא הזה בולע את הרוחב שנותר כדי שהעמודות לא יתפזרו */
.table .cell-fill { width: 100%; }
.table .cell-tight { white-space: nowrap; }

/* שורת עובד/הקצאה עם אווטאר */
.cell-person {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.cell-person__name { font-weight: 600; white-space: nowrap; }
.cell-person__sub { font-size: 0.75rem; color: var(--text-faint); }

/* ערימת תמונות פריטים בשורת הקצאה */
.thumbs {
    display: flex;
    align-items: center;
}

.thumbs__img,
.thumbs__more {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--surface-solid);
    background: var(--surface-2);
    margin-inline-start: -10px;
    display: grid;
    place-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
}

.thumbs__img:first-child, .thumbs__more:first-child { margin-inline-start: 0; }

/* --------------------------------------------------------------------------
   13. כרטיסי עובד / מעקב
   -------------------------------------------------------------------------- */

.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.person-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    padding: 1.1rem;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    transition: transform var(--dur) var(--ease-spring), border-color var(--dur) var(--ease-out);
}

.person-card:hover { transform: translateY(-3px); border-color: var(--hairline-strong); }

.person-card__head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.person-card__name { font-weight: 700; font-size: 0.98rem; }

.equip-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-sm);
}

.equip-row__img {
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 9px;
    object-fit: cover;
    background: var(--surface-2);
    display: grid;
    place-items: center;
    color: var(--text-faint);
}

.equip-row__name { font-size: 0.87rem; font-weight: 600; line-height: 1.3; }
.equip-row__meta { font-size: 0.73rem; color: var(--text-faint); }

/* --------------------------------------------------------------------------
   14. בורר פריטים בהקצאה
   -------------------------------------------------------------------------- */

.picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.7rem;
    max-height: 46vh;
    overflow-y: auto;
    padding: 0.25rem;
}

.pick {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1.5px solid var(--hairline);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--dur) var(--ease-out);
}

.pick:hover:not(.is-disabled) { border-color: var(--hairline-strong); transform: translateY(-2px); }

.pick.is-selected {
    border-color: var(--brand-orange);
    background: color-mix(in srgb, var(--brand-orange) 10%, transparent);
    box-shadow: 0 0 0 3px var(--focus);
}

.pick.is-disabled { opacity: 0.4; cursor: not-allowed; }

.pick__media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--brand-plum) 20%, transparent),
        color-mix(in srgb, var(--brand-orange) 10%, transparent));
    display: grid;
    place-items: center;
    color: color-mix(in srgb, var(--text) 40%, transparent);
    font-size: 1.5rem;
    overflow: hidden;
}

.pick__media img { width: 100%; height: 100%; object-fit: cover; }

.pick__check {
    position: absolute;
    inset-block-start: 0.4rem;
    inset-inline-end: 0.4rem;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(10, 6, 12, 0.55);
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    color: transparent;
    font-size: 0.7rem;
    transition: all var(--dur) var(--ease-spring);
}

.pick.is-selected .pick__check {
    background: var(--brand-orange);
    border-color: var(--brand-orange);
    color: #fff;
    transform: scale(1.1);
}

.pick__body { padding: 0.55rem 0.65rem 0.65rem; }
.pick__name { font-size: 0.82rem; font-weight: 700; line-height: 1.3; }
.pick__stock { font-size: 0.7rem; color: var(--text-faint); }

.pick__qty {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.pick__qty[hidden] { display: none; }

.pick__qty input {
    width: 100%;
    padding: 0.3rem 0.4rem;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--surface-2);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    font-variant-numeric: tabular-nums;
}

.pick__qty button {
    width: 26px;
    height: 26px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 7px;
    border: 1px solid var(--hairline);
    background: var(--surface-2);
    color: var(--text-soft);
    cursor: pointer;
    font-size: 0.75rem;
}

.pick__qty button:hover { color: var(--brand-orange); border-color: var(--brand-orange); }

/* --------------------------------------------------------------------------
   15. אזור העלאת תמונה
   -------------------------------------------------------------------------- */

.dropzone {
    position: relative;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 0.45rem;
    min-height: 172px;
    padding: 1.1rem;
    text-align: center;
    background: var(--surface);
    border: 1.5px dashed var(--hairline-strong);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    overflow: hidden;
    transition: all var(--dur) var(--ease-out);
}

.dropzone:hover,
.dropzone.is-over {
    border-color: var(--brand-orange);
    background: color-mix(in srgb, var(--brand-orange) 8%, transparent);
    color: var(--text-soft);
}

.dropzone.is-over { transform: scale(1.01); }

.dropzone i { font-size: 1.8rem; }

.dropzone__hint { font-size: 0.76rem; line-height: 1.5; }

.dropzone__preview {
    position: absolute;
    inset: 0;
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.dropzone__clear {
    position: absolute;
    inset-block-start: 0.5rem;
    inset-inline-end: 0.5rem;
    z-index: 2;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(10, 6, 12, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    cursor: pointer;
}

.dropzone__clear:hover { background: var(--brand-red); border-color: transparent; }

/* --------------------------------------------------------------------------
   16. חלוניות (Modal)
   -------------------------------------------------------------------------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(6, 4, 8, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur) var(--ease-out), visibility var(--dur);
}

.modal.is-open { opacity: 1; visibility: visible; }

.modal__box {
    width: min(560px, 100%);
    max-height: min(88vh, 900px);
    display: flex;
    flex-direction: column;
    background: var(--surface-raised);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: translateY(22px) scale(0.97);
    opacity: 0;
    transition: transform 0.35s var(--ease-spring), opacity 0.25s var(--ease-out);
    overflow: hidden;
}

.modal.is-open .modal__box { transform: none; opacity: 1; }

.modal__box--wide { width: min(860px, 100%); }
.modal__box--slim { width: min(430px, 100%); }

.modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid var(--hairline);
}

.modal__title { font-size: 1.05rem; font-weight: 700; }
.modal__sub { font-size: 0.78rem; color: var(--text-muted); }

.modal__body {
    padding: 1.35rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal__foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    padding: 1rem 1.35rem;
    border-top: 1px solid var(--hairline);
    background: var(--surface);
}

/* אייקון האזהרה בדיאלוג האישור */
.confirm-icon {
    width: 60px;
    height: 60px;
    margin-inline: auto;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    border-radius: 50%;
    color: var(--brand-red);
    background: color-mix(in srgb, var(--brand-red) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand-red) 28%, transparent);
}

.confirm-icon--warn { color: var(--brand-amber); background: color-mix(in srgb, var(--brand-amber) 14%, transparent); border-color: color-mix(in srgb, var(--brand-amber) 28%, transparent); }
.confirm-icon--good { color: var(--brand-green); background: color-mix(in srgb, var(--brand-green) 14%, transparent); border-color: color-mix(in srgb, var(--brand-green) 28%, transparent); }

/* --------------------------------------------------------------------------
   17. הודעות צפות (Toast)
   -------------------------------------------------------------------------- */

.toasts {
    position: fixed;
    inset-block-end: 1.25rem;
    inset-inline-start: 1.25rem;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 260px;
    max-width: min(400px, calc(100vw - 2.5rem));
    padding: 0.8rem 1rem;
    background: var(--surface-raised);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in 0.42s var(--ease-spring) both;
}

.toast.is-leaving { animation: toast-out 0.28s var(--ease-out) both; }

.toast__icon {
    width: 32px;
    height: 32px;
    flex: none;
    display: grid;
    place-items: center;
    border-radius: 10px;
    font-size: 0.95rem;
}

.toast--success .toast__icon { color: var(--brand-green); background: color-mix(in srgb, var(--brand-green) 15%, transparent); }
.toast--error .toast__icon { color: var(--brand-red); background: color-mix(in srgb, var(--brand-red) 15%, transparent); }
.toast--info .toast__icon { color: var(--brand-orange); background: color-mix(in srgb, var(--brand-orange) 15%, transparent); }

.toast__text { font-size: 0.87rem; font-weight: 600; line-height: 1.45; }

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-40px) scale(0.94); }
    to { opacity: 1; transform: none; }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateX(-30px) scale(0.96); }
}

/* --------------------------------------------------------------------------
   18. מצבים ריקים / טעינה
   -------------------------------------------------------------------------- */

.empty {
    display: grid;
    place-items: center;
    gap: 0.6rem;
    padding: 3.5rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
}

.empty__icon {
    width: 76px;
    height: 76px;
    display: grid;
    place-items: center;
    font-size: 2rem;
    border-radius: 50%;
    color: var(--brand-orange);
    background: color-mix(in srgb, var(--brand-orange) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand-orange) 22%, transparent);
    margin-bottom: 0.3rem;
}

.empty__title { font-size: 1.02rem; font-weight: 700; color: var(--text); }
.empty__text { font-size: 0.86rem; max-width: 36ch; }

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.btn.is-busy { pointer-events: none; opacity: 0.75; }
.btn.is-busy i { display: none; }

/* --------------------------------------------------------------------------
   19. תיבת אור לתמונות
   -------------------------------------------------------------------------- */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: grid;
    place-items: center;
    padding: 2rem;
    background: rgba(5, 3, 7, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur) var(--ease-out), visibility var(--dur);
    cursor: zoom-out;
}

.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox img {
    max-width: min(720px, 100%);
    max-height: 80vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    transform: scale(0.94);
    transition: transform 0.35s var(--ease-spring);
}

.lightbox.is-open img { transform: none; }

.lightbox__caption {
    margin-top: 1rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
}

/* --------------------------------------------------------------------------
   20. ניווט תחתון במובייל
   -------------------------------------------------------------------------- */

.bottom-nav {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 90;
    display: none;
    justify-content: space-around;
    align-items: center;
    padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    border-top: 1px solid var(--hairline);
}

.bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    flex: 1;
    padding: 0.4rem 0.2rem;
    background: none;
    border: 0;
    color: var(--text-faint);
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 12px;
    transition: color var(--dur) var(--ease-out);
}

.bottom-nav__item i { font-size: 1.15rem; }

.bottom-nav__item[aria-selected="true"] { color: var(--brand-orange); }

/* --------------------------------------------------------------------------
   20b. תפריט המשתמש
   -------------------------------------------------------------------------- */

.menu { position: relative; }

.user-chip {
    cursor: pointer;
    text-align: start;
}

.user-chip__text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.user-chip__name { font-size: 0.85rem; font-weight: 700; }
.user-chip__role { font-size: 0.68rem; color: var(--text-muted); font-weight: 600; }
.user-chip__caret { font-size: 0.7rem; color: var(--text-faint); }

.menu__panel {
    position: absolute;
    inset-block-start: calc(100% + 0.5rem);
    inset-inline-end: 0; /* נפתח לכיוון מרכז המסך כדי לא לגלוש מהקצה */
    z-index: 80;
    width: 268px;
    max-width: calc(100vw - 1.5rem);
    padding: 0.4rem;
    background: var(--surface-raised);
    border: 1px solid var(--hairline-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    animation: menu-in 0.24s var(--ease-spring) both;
}

@keyframes menu-in {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

.menu__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem;
    border-bottom: 1px solid var(--hairline);
    margin-bottom: 0.35rem;
}

.menu__name { font-weight: 700; font-size: 0.92rem; }
.menu__meta { font-size: 0.74rem; color: var(--text-faint); }

.menu__note {
    padding: 0.4rem 0.7rem 0.6rem;
    font-size: 0.72rem;
    color: var(--text-faint);
}

.menu__item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.6rem 0.7rem;
    font-size: 0.87rem;
    font-weight: 600;
    color: var(--text-soft);
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: start;
    transition: background var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}

.menu__item:hover { background: var(--surface-2); color: var(--text); }
.menu__item i { font-size: 1.05em; color: var(--text-faint); }
.menu__item:hover i { color: var(--brand-orange); }
.menu__item--danger:hover { color: var(--brand-red); }
.menu__item--danger:hover i { color: var(--brand-red); }

/* --------------------------------------------------------------------------
   20c. בחירת הרשאה + מד חוזק סיסמה
   -------------------------------------------------------------------------- */

.role-picker {
    display: grid;
    gap: 0.5rem;
}

.role-opt { cursor: pointer; }
.role-opt input { position: absolute; opacity: 0; pointer-events: none; }

.role-opt__box {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.7rem;
    align-items: center;
    padding: 0.7rem 0.85rem;
    background: var(--surface);
    border: 1.5px solid var(--hairline);
    border-radius: var(--radius-sm);
    transition: all var(--dur) var(--ease-out);
}

.role-opt__box > i {
    grid-row: 1 / 3;
    font-size: 1.25rem;
    color: var(--text-faint);
    transition: color var(--dur) var(--ease-out);
}

.role-opt__name { font-size: 0.9rem; font-weight: 700; }
.role-opt__hint { font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }

.role-opt:hover .role-opt__box { border-color: var(--hairline-strong); }

.role-opt input:checked + .role-opt__box {
    border-color: var(--brand-orange);
    background: color-mix(in srgb, var(--brand-orange) 10%, transparent);
    box-shadow: 0 0 0 3px var(--focus);
}

.role-opt input:checked + .role-opt__box > i { color: var(--brand-orange); }
.role-opt input:focus-visible + .role-opt__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.role-opt input:disabled + .role-opt__box { opacity: 0.5; cursor: not-allowed; }

.strength {
    height: 4px;
    margin-top: 0.35rem;
    background: var(--surface-2);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.strength__bar {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--brand-red);
    transition: width var(--dur) var(--ease-out), background var(--dur) var(--ease-out);
}

.strength__bar[data-level="2"] { background: var(--brand-amber); }
.strength__bar[data-level="3"] { background: var(--brand-orange); }
.strength__bar[data-level="4"] { background: var(--brand-green); }

/* משתמש מושבת */
.person-card.is-inactive { opacity: 0.6; }
.person-card.is-inactive .avatar { filter: grayscale(1); }

/* --------------------------------------------------------------------------
   20d. יומן פעילות
   -------------------------------------------------------------------------- */

.timeline {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* הקו האנכי שמחבר את האירועים */
.timeline::before {
    content: "";
    position: absolute;
    inset-block: 14px;
    inset-inline-start: 17px;
    width: 2px;
    background: var(--hairline);
}

.timeline__row {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.6rem 0;
}

.timeline__dot {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    flex: none;
    display: grid;
    place-items: center;
    font-size: 0.85rem;
    border-radius: 50%;
    background: var(--surface-solid);
    border: 1px solid var(--hairline-strong);
    color: var(--text-muted);
}

[data-theme="light"] .timeline__dot { background: #fff; }

.timeline__dot--green { color: var(--brand-green); border-color: color-mix(in srgb, var(--brand-green) 45%, transparent); }
.timeline__dot--red { color: var(--brand-red); border-color: color-mix(in srgb, var(--brand-red) 45%, transparent); }
.timeline__dot--plum { color: var(--brand-plum); border-color: color-mix(in srgb, var(--brand-plum) 50%, transparent); }
.timeline__dot--orange { color: var(--brand-orange); border-color: color-mix(in srgb, var(--brand-orange) 45%, transparent); }

.timeline__text { font-size: 0.88rem; font-weight: 600; line-height: 1.45; }
.timeline__meta { font-size: 0.73rem; color: var(--text-faint); margin-top: 0.1rem; }

/* --------------------------------------------------------------------------
   20e. חיפוש מהיר (Ctrl+K)
   -------------------------------------------------------------------------- */

.palette { place-items: start center; padding-top: 12vh; }

.palette__box { max-height: 70vh; }

.palette__field {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--hairline);
}

.palette__field > i { color: var(--text-faint); font-size: 1.1rem; }

.palette__input {
    flex: 1;
    background: none;
    border: 0;
    outline: none;
    font-size: 1rem;
    font-weight: 500;
}

.palette__input::placeholder { color: var(--text-faint); }

.kbd {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--hairline);
    border-radius: 6px;
}

.palette__results {
    overflow-y: auto;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.palette__row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.55rem 0.7rem;
    background: none;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: start;
    transition: background var(--dur) var(--ease-out);
}

.palette__row[data-active] { background: color-mix(in srgb, var(--brand-orange) 14%, transparent); }
.palette__row:hover { background: var(--surface-2); }

.palette__icon,
.palette__thumb {
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 9px;
    object-fit: cover;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    color: var(--brand-orange);
    font-size: 0.95rem;
}

.palette__text { flex: 1; min-width: 0; }

.palette__label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.palette__sub {
    display: block;
    font-size: 0.74rem;
    color: var(--text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.palette__kind { flex: none; font-size: 0.68rem; }

.palette__empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}

.palette__foot {
    display: flex;
    gap: 1rem;
    padding: 0.6rem 1.15rem;
    border-top: 1px solid var(--hairline);
    font-size: 0.72rem;
    color: var(--text-faint);
    flex-wrap: wrap;
}

/* הבהוב על תוצאה שנבחרה מהחיפוש */
.is-flash {
    animation: flash-target 1.6s var(--ease-out);
}

@keyframes flash-target {
    0%, 100% { box-shadow: 0 0 0 0 transparent; }
    15%, 60% { box-shadow: 0 0 0 3px var(--brand-orange), var(--shadow-lg); }
}

/* --------------------------------------------------------------------------
   21. עמודי כניסה וחתימה
   -------------------------------------------------------------------------- */

.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.auth__card {
    width: min(430px, 100%);
    padding: clamp(1.75rem, 5vw, 2.5rem);
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 26px;
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    box-shadow: var(--shadow-lg);
    animation: rise 0.6s var(--ease-out) both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: none; }
}

.auth__logo {
    width: 84px;
    height: 84px;
    margin-inline: auto;
    display: grid;
    place-items: center;
    padding: 12px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.65), inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.auth__title {
    margin-top: 1.25rem;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.auth__sub {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.auth__form {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 1.75rem;
}

.auth__foot {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-faint);
}

.alert {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    color: var(--brand-red);
    background: color-mix(in srgb, var(--brand-red) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand-red) 28%, transparent);
    animation: shake 0.45s var(--ease-out);
}

.alert--info {
    color: var(--brand-orange);
    background: color-mix(in srgb, var(--brand-orange) 12%, transparent);
    border-color: color-mix(in srgb, var(--brand-orange) 28%, transparent);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* עמוד החתימה */
.sign-page {
    width: min(680px, 100%);
    margin-inline: auto;
    padding: 1.5rem 1rem 3rem;
}

.sign-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.sign-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    animation: rise 0.5s var(--ease-out) both;
}

.sign-item__img {
    width: 62px;
    height: 62px;
    flex: none;
    border-radius: 13px;
    object-fit: cover;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--brand-plum) 24%, transparent),
        color-mix(in srgb, var(--brand-orange) 14%, transparent));
    display: grid;
    place-items: center;
    color: var(--text-muted);
    font-size: 1.3rem;
    cursor: zoom-in;
}

.sign-item__name { font-weight: 700; font-size: 0.95rem; line-height: 1.35; }
.sign-item__cat { font-size: 0.74rem; color: var(--text-faint); }

.sign-item__qty {
    margin-inline-start: auto;
    flex: none;
    display: grid;
    place-items: center;
    min-width: 44px;
    padding: 0.3rem 0.6rem;
    font-weight: 800;
    font-size: 0.95rem;
    border-radius: 12px;
    color: var(--brand-orange);
    background: color-mix(in srgb, var(--brand-orange) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--brand-orange) 26%, transparent);
    font-variant-numeric: tabular-nums;
    direction: ltr; /* מבטיח ש-"×3" תמיד ייקרא באותו סדר */
}

.pad-wrap {
    position: relative;
    background: #fff;
    border: 1px solid var(--hairline-strong);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.pad-wrap canvas {
    display: block;
    width: 100%;
    height: 220px;
    touch-action: none;
    cursor: crosshair;
}

/* קו החתימה המקווקו */
.pad-wrap::after {
    content: "";
    position: absolute;
    inset-inline: 8%;
    inset-block-end: 26%;
    border-bottom: 1.5px dashed #d3ccd8;
    pointer-events: none;
}

.pad-wrap.is-signed::after { opacity: 0; }

.signed-proof {
    padding: 0.75rem;
    background: #fff;
    border-radius: var(--radius);
    display: inline-block;
    box-shadow: var(--shadow-md);
}

.signed-proof img { max-height: 150px; width: auto; }

/* --------------------------------------------------------------------------
   22. רספונסיביות
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
    .brand__sub { display: none; }
    /* משאירים את האווטאר, מסתירים רק את הטקסט */
    .user-chip__text, .user-chip__caret { display: none; }
    .user-chip { padding: 0.3rem; }
}

@media (max-width: 760px) {
    body { padding-bottom: 72px; }

    :root { --header-h: 60px; }

    .tabs { display: none; }
    .bottom-nav { display: flex; }

    .stats { grid-template-columns: repeat(2, 1fr); gap: 0.6rem; }

    .stat { flex-direction: column; align-items: flex-start; gap: 0.5rem; padding: 0.9rem; }
    .stat__icon { width: 38px; height: 38px; font-size: 1.05rem; }
    .stat__value { font-size: 1.5rem; }

    .panel__head { padding: 0.9rem 1rem; }
    .panel__body { padding: 1rem; }

    /* סרגל הכלים נפרס לשורות: חיפוש מלא, שני מסננים, ואז הכפתורים */
    .panel__tools { width: 100%; justify-content: stretch; }
    .panel__tools .search { flex: 1 1 100%; min-width: 0; }
    .panel__tools .select { flex: 1 1 calc(50% - 0.3rem); min-width: 0; }
    .panel__tools .btn { flex: 1 1 auto; }
    .panel__tools .row { flex: 0 0 auto; }

    /* כרטיס סטטיסטיקה יתום בשורה אחרונה נפרס לרוחב מלא */
    .stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }

    .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; }
    .item-card__body { padding: 0.7rem 0.75rem 0.8rem; gap: 0.45rem; }
    .item-card__name { font-size: 0.85rem; }

    .people-grid { grid-template-columns: 1fr; }

    .modal { padding: 0; place-items: end center; }

    .modal__box {
        width: 100%;
        max-height: 92vh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
    }

    .modal.is-open .modal__box { transform: none; }

    .modal__foot { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
    .modal__foot .btn { flex: 1; }

    .toasts { inset-inline: 1rem; inset-block-end: 84px; }
    .toast { min-width: 0; width: 100%; }

    .picker { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }

    .table th, .table td { padding: 0.65rem 0.6rem; font-size: 0.84rem; }

    /* החיפוש המהיר נפתח מלמעלה גם במובייל */
    .palette { place-items: start center; padding: 0.75rem; }
    .palette .modal__box { border-radius: var(--radius-lg); transform: translateY(-16px); max-height: 82vh; }
    .palette.is-open .modal__box { transform: none; }
    .palette__foot { display: none; }

    .user-chip__text { display: none; }
    .user-chip__caret { display: none; }
    .menu__panel { width: 280px; }

    .timeline__meta .mono { display: none; }
}

@media (max-width: 420px) {
    .stats { grid-template-columns: 1fr 1fr; }
    .brand__title { font-size: 0.95rem; }
}

/* --------------------------------------------------------------------------
   23. העדפות נגישות והדפסה
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

@media print {
    body::before, body::after,
    .topbar, .bottom-nav, .tabs, .toasts, .btn, .icon-btn { display: none !important; }

    body { background: #fff; color: #000; }
    .panel, .sign-item { border-color: #ccc; box-shadow: none; background: #fff; }
}
