/* ═══ תפריט הצד: מצב מקופל (עיצוב 1c) ומגירת הסלולר ════════════════════════
   מה כאן: מה משתנה כשהתפריט מקופל ל-64 פיקסלים במחשב, והתיקונים שהמגירה
   בסלולר צריכה מול כללים ישנים ב-budget.css.
   מה לא כאן: רוחב הקיפול, האנימציה והשמירה ב-localStorage (layout.css,
   toggleSidebar ב-app-init.js). נטען אחרי sidebar.css ו-sidebar-account.css. */

/* ── מצב מקופל, מחשב בלבד. בסלולר התפריט הוא מגירה מלאה תמיד. ─────────── */
@media (min-width: 769px) {
    .sidebar.collapsed {
        align-items: center;
        gap: 14px;
        padding: 14px 0;
    }
    /* הכותרת מתפרקת לטור: לוגו, כפתור ההרחבה, כפתור המערכות. ההרחבה למעלה,
       מתחת ללוגו, ולא בתחתית כמו בעיצוב: בעל המוצר (18.10.2026), כי למטה
       לא ימצאו אותו. */
    .sidebar.collapsed .sidebar-header-row { display: contents; }
    .sidebar.collapsed .sidebar-header {
        display: flex;
        order: 0;
        flex: 0 0 auto;
    }
    .sidebar.collapsed .sidebar-brand { display: none; }
    #mainSidebar.collapsed .shc-as-btn {
        display: flex;
        order: 2;
        width: 34px;
        height: 34px;
        border: 0;
        border-radius: 9px;
        box-shadow: none;
        background: color-mix(in srgb, var(--brand-primary, #2f4f7f) 8%, #ffffff);
        color: var(--brand-primary, #2f4f7f);
    }
    #mainSidebar.collapsed .shc-as-btn:hover,
    #mainSidebar.collapsed .shc-as-btn[aria-expanded="true"] {
        background: var(--brand-primary, #2f4f7f);
        color: #ffffff;
    }
    .sidebar.collapsed .sidebar-nav {
        order: 3;
        width: 100%;
    }
    /* פס גלילה תופס עד 10 פיקסלים מתוך 64 ומזיז את האייקונים מהציר של
       הלוגו והריבועים. הגלילה עצמה נשארת: גלגלת, ופוקוס במקלדת. */
    .sidebar.collapsed .sidebar-menu {
        align-items: center;
        gap: 4px;
        scrollbar-width: none;
    }
    .sidebar.collapsed .sidebar-menu::-webkit-scrollbar { display: none; }
    .sidebar.collapsed .sidebar-group-label {
        flex: 0 0 1px;
        width: 20px;
        height: 1px;
        padding: 0;
        margin: 8px 0;
        overflow: hidden;
        font-size: 0;
        background: #e2e8f0;
    }
    .sidebar.collapsed .sidebar-menu > .sidebar-group-label:first-child { display: none; }
    .sidebar.collapsed .sidebar-item {
        width: 40px;
        height: 40px;
        padding: 0;
        gap: 0;
        justify-content: center;
        border-radius: 8px;
    }
    .sidebar.collapsed .sidebar-item.active {
        background: color-mix(in srgb, var(--brand-primary, #2f4f7f) 8%, #ffffff);
        color: color-mix(in srgb, var(--brand-primary, #2f4f7f) 82%, #000000);
        box-shadow: none;
        border-radius: 8px;
    }
    .sidebar.collapsed .sidebar-item:hover .nav-icon { color: #334155; }
    .sidebar.collapsed .sidebar-item.active:hover .nav-icon { color: var(--brand-primary, #2f4f7f); }
    .sidebar.collapsed .nav-label,
    .sidebar.collapsed .nav-badge { display: none; }

    .sidebar.collapsed .sidebar-footer {
        display: flex;
        order: 4;
        align-items: center;
        gap: 14px;
    }
    .sidebar.collapsed .sidebar-entity-chip {
        width: 34px;
        height: 34px;
        padding: 0;
        border: 0;
        border-radius: 8px;
        background: transparent;
        justify-content: center;
    }
    .sidebar.collapsed .sidebar-entity-chip .sec-icon {
        width: 34px;
        height: 34px;
    }
    .sidebar.collapsed .sidebar-entity-chip .sec-body,
    .sidebar.collapsed .sidebar-entity-chip .sec-switch-icon { display: none; }
    .sidebar.collapsed .sidebar-user-row {
        padding: 0;
        gap: 0;
        border: 0;
        background: transparent;
    }
    .sidebar.collapsed .sidebar-user-row .account-card__meta,
    .sidebar.collapsed .sidebar-user-row .sidebar-signout { display: none; }
    .sidebar.collapsed .sidebar-user-row .sidebar-profile-btn {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
        border: 0;
        border-radius: 8px;
        background: #e3f2ec;
        color: #065f46;
    }
    .sidebar.collapsed .sidebar-profile-btn .sidebar-icon-btn__icon { display: none; }
    .sidebar.collapsed .sidebar-profile-btn .user-avatar {
        display: flex;
        width: auto;
        height: auto;
        border-radius: 0;
        background: transparent;
        color: inherit;
        font-size: 14px;
        font-weight: 700;
    }
    .sidebar.collapsed .sidebar-toggle-btn {
        order: 1;
        width: 34px;
        height: 34px;
        margin: 0;
        border-radius: 8px;
        color: #475569;
    }
    .sidebar.collapsed .sidebar-toggle-btn:hover {
        background: #f1f5f9;
        color: #334155;
    }
    .sidebar.collapsed .sidebar-credit { display: none; }
}

/* ── מגירת הסלולר: אותו מראה. budget.css מחזיר בה את הפריטים מהמצב המקופל
   בכללים שגוברים על הכללים הכלליים כאן, ולכן הם נדרסים במפורש. ─────────── */
@media (max-width: 768px) {
    .sidebar-item,
    .sidebar.collapsed .sidebar-item {
        height: 44px;
        padding: 0 10px;
        gap: 11px;
    }
    .sidebar.collapsed .sidebar-footer { display: flex; }
}
