/* ═══ תפריט הצד (עיצוב 1a, ומצב מקופל 1c) ═══════════════════════════════
   מה כאן: המראה של התפריט הפתוח: הכותרת, הקבוצות והפריטים. התחתית (ארגון,
   משתמש, קרדיט) ב-sidebar-account.css, והמצב המקופל ומגירת הסלולר ב-
   sidebar-collapsed.css. שלושתם נטענים אחרי כל שאר קובצי העיצוב, בסדר הזה,
   ודורסים את השכבות הישנות של התפריט ב-layout.css, overlays.css,
   budget.css (v2, v5) ו-entity-picker.css.
   מה לא כאן: המיקום, הרוחב, אנימציית הקיפול ומגירת הסלולר. אלה נשארו
   בקבצים הישנים בלי שינוי, ולכן הקובץ הזה אינו קובע position, width,
   transform או display של התפריט עצמו.
   צבע הארגון (--brand-primary) הוא ה-accent היחיד: פריט פעיל, כרטיס ארגון. */

.sidebar {
    background: #ffffff;
    color: #334155;
    border-inline-end: 1px solid #e2e8f0;
    padding: 14px 12px;
    gap: 16px;
}

/* ── כותרת ─────────────────────────────────────────────────────────────── */
.sidebar-header-row {
    align-items: center;
    gap: 4px;
    padding: 2px 4px 0;
    margin: 0;
    border-bottom: 0;
}
.sidebar .sidebar-header {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 0;
    text-align: start;
}
/* בלי מסגרת, בבקשת בעל המוצר (18.10.2026), בניגוד לעיצוב. הלוגו ממלא את
   כל ה-36 פיקסלים. */
.sidebar-logo-frame {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    box-sizing: border-box;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: hidden;
    display: flex;
}
.sidebar .sidebar-logo {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    object-fit: contain;
}
.sidebar-brand {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
}
.sidebar .sidebar-header h2,
.sidebar .sidebar-header p {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: normal;
}
.sidebar .sidebar-header h2 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.15;
}
.sidebar .sidebar-header p {
    font-size: 12px;
    font-weight: 400;
    color: #64748b;
}

/* כפתור המעבר בין מערכות SHC מוזרק בידי shc-appswitcher.js, שמזריק גם את
   העיצוב שלו. המזהה נדרש כדי לגבור על ה-<style> שנוסף אחרי הקובץ הזה. */
/* 32 ולא 36 כמו בעיצוב, בבקשת בעל המוצר (18.10.2026). */
#mainSidebar .shc-as-btn {
    width: 32px;
    height: 32px;
    box-sizing: border-box;
    margin: 0;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #ffffff;
    color: #475569;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}
#mainSidebar .shc-as-btn svg {
    width: 16px;
    height: 16px;
}
#mainSidebar .shc-as-btn:hover {
    background: #f8fafc;
    color: #0f172a;
}
#mainSidebar .shc-as-btn[aria-expanded="true"] {
    color: var(--brand-primary, #2f4f7f);
    border-color: var(--brand-primary, #2f4f7f);
    background: color-mix(in srgb, var(--brand-primary, #2f4f7f) 10%, #ffffff);
}

.sidebar .sidebar-toggle-btn {
    width: 24px;
    height: 36px;
    padding: 0;
    margin: 0;
    border-radius: 6px;
    background: transparent;
    color: #475569;
}
.sidebar .sidebar-toggle-btn:hover {
    background: transparent;
    color: #0f172a;
}

/* ── ניווט ─────────────────────────────────────────────────────────────── */
/* align-items מפורש: overlays.css ממרכז את הפריטים בסלולר (נשאר מפס הצ'יפים
   הישן), ובמגירה כל פריט היה מתכווץ לרוחב הטקסט שלו. */
.sidebar-menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 0;
    margin: 0;
    scrollbar-color: #cbd5e1 transparent;
}
.sidebar-menu::-webkit-scrollbar-thumb { background: #cbd5e1; }

/* כותרת קבוצה. בלי letter-spacing: DESIGN.md אוסר אותו על עברית. */
.sidebar-group-label {
    list-style: none;
    padding: 16px 10px 6px;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    user-select: none;
}
.sidebar-menu > .sidebar-group-label:first-child { padding-top: 2px; }
/* sidebar-groups.js: אף פריט בקבוצה אינו מוצג. */
.sidebar-group-label.is-empty { display: none; }

.sidebar-item {
    box-sizing: border-box;
    flex: 0 0 auto;
    height: 38px;
    padding: 0 10px;
    margin: 0;
    gap: 11px;
    border: 0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
}
.sidebar-item .nav-icon { color: #94a3b8; }
.sidebar-item--muted { color: #64748b; }
.sidebar-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}
/* הפס בצד הימני, צד הסרגל. box-shadow אינו לוגי, והדף כולו dir="rtl". */
.sidebar-item.active {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 600;
    box-shadow: inset -2px 0 0 var(--brand-primary, #2f4f7f);
    border-start-start-radius: 0;
    border-end-start-radius: 0;
}
.sidebar-item.active .nav-icon { color: var(--brand-primary, #2f4f7f); }

.nav-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nav-badge {
    flex: 0 0 auto;
    padding: 1px 7px;
    border-radius: 999px;
    background: #eef2f7;
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    unicode-bidi: isolate;
}
.nav-badge[hidden] { display: none; }

.sidebar .sidebar-item:focus-visible,
.sidebar [role="button"]:focus-visible,
.sidebar button:focus-visible {
    outline: 2px solid var(--brand-primary, #2f4f7f);
    outline-offset: -2px;
}

/* במחשב הקו לבדו מפריד; הצל הישן מ-layout.css היה מוסיף קצה שני. במגירת
   הסלולר הצל נשאר, כי היא צפה מעל התוכן. */
@media (min-width: 769px) {
    .sidebar { box-shadow: none; }
}

/* ברוחב 769 עד 1024 הסרגל צר יותר (220, overlays.css) ושורת התיאור נחתכת. */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar .sidebar-header p { display: none; }
}

/* מסך נמוך (מחשב נייד 1366x768 עם סרגלי הדפדפן): כותרות הקבוצות הוסיפו גובה,
   וקבוצת "מערכת" נדחקה מתחת לקצה. מהדקים ריווח ומוותרים על הקרדיט. */
@media (min-width: 769px) and (max-height: 820px) {
    .sidebar {
        gap: 10px;
        padding-block: 10px;
    }
    .sidebar .sidebar-credit { display: none; }
    .sidebar-item { height: 34px; }
    .sidebar-group-label { padding-block-start: 10px; }
    .sidebar-menu > .sidebar-group-label:first-child { padding-block-start: 2px; }
}

/* ניגודיות גבוהה של Windows מוחקת box-shadow ורקעים, ואיתם את סימון הפריט
   הפעיל. */
@media (forced-colors: active) {
    .sidebar-item.active { border-inline-start: 3px solid Highlight; }
}
