/* =============================================
   Sidebar Styles with RTL Support
   ============================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.sidebar {
    width: 220px;
    min-width: 220px;
    height: 100vh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    z-index: 100;
    padding: 24px 0;
    box-shadow: 2px 0 12px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
    /* Default (LTR) positions */
    left: 0;
    border-right: 1px solid #f0f0f0;
}

/* Jab HTML ka dir="rtl" ho */
[dir="rtl"] .sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid #f0f0f0;
    box-shadow: -2px 0 12px rgba(0,0,0,0.04);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px 28px 20px;
    border-bottom: 1px solid #f5f5f5;
    margin-bottom: 16px;
}

/* RTL mein gap aur alignment adjust karne ke liye */
[dir="rtl"] .sidebar-brand {
    flex-direction: row;
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #FF4B00;
}

    .sidebar-logo img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.sidebar-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    font-family: 'Segoe UI', sans-serif;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 12px;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #666666;
    font-size: 13.5px;
    font-weight: 500;
    font-family: 'Segoe UI', sans-serif;
    transition: background 0.18s, color 0.18s;
    cursor: pointer;
    word-break: break-word;
}

    /* RTL mein link icons aur text ki direction automatic handle hoti hai flex se */

    .sidebar-link:hover, .sidebar-link.active {
        background: #FFF3EE;
        color: #FF4B00;
        text-decoration: none;
    }

.sidebar-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .sidebar-icon svg {
        fill: #999999; /* Changed to fill as your SVG uses fill */
        transition: fill 0.18s;
    }

.sidebar-link:hover .sidebar-icon svg,
.sidebar-link.active .sidebar-icon svg {
    fill: #FF4B00;
}

.sidebar-logout {
    padding: 12px 12px 0 12px;
    border-top: 1px solid #f5f5f5;
    margin-top: 8px;
}

/* ── Sidebar Toggle Button (visible on mobile) ── */
.sidebar-toggle-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.sidebar-toggle-btn:hover {
    background: #F4F6FA;
}

.sidebar-toggle-btn span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: #333;
    margin: 4px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ── Sidebar Overlay (mobile) ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ── Content Wrapper Logic ── */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
    background: #f8f8f8;
}

.admin-content {
    flex: 1;
    min-height: 100vh;
    background: #f8f8f8;
    transition: margin 0.3s ease;
    /* LTR Margin */
    margin-left: 220px;
    margin-right: 0;
}

/* RTL mein content ka margin right side par ho jayega */
[dir="rtl"] .admin-content {
    margin-left: 0;
    margin-right: 220px;
}

/* ══════════════════════════════
   RESPONSIVE — Sidebar
══════════════════════════════ */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: none;
    }

    [dir="rtl"] .sidebar {
        transform: translateX(100%);
    }

    .sidebar.sidebar-open {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    }

    [dir="rtl"] .sidebar.sidebar-open {
        transform: translateX(0);
        box-shadow: -4px 0 20px rgba(0,0,0,0.1);
    }

    .admin-content {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .sidebar-toggle-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
}
