/* Sidebar toggle buttons (Desktop defaults) */
.burger-menu-btn, .sidebar-close-btn {
    display: none;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .dashboard-wrapper {
        flex-direction: column;
    }
    
    /* Off-canvas sidebar drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        border-right: 1px solid var(--border-color);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        gap: 2rem;
        background-color: var(--bg-secondary);
        padding: 1.5rem;
    }
    
    .sidebar.open {
        transform: translateX(280px);
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.5);
    }
    
    .sidebar-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        font-size: 1.25rem;
        color: var(--text-secondary);
        cursor: pointer;
        padding: 0.5rem;
    }
    
    .burger-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        border: none;
        font-size: 1.5rem;
        color: var(--text-primary);
        cursor: pointer;
        padding: 0.25rem;
    }
    
    .sidebar-menu {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }
    
    .sidebar-menu-item {
        width: 100%;
    }
    
    .sidebar-menu-item a {
        justify-content: flex-start;
        padding: 0.75rem 1rem;
        font-size: 1rem;
    }
    
    .sidebar-footer {
        margin-top: auto;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 1rem;
        border-top: none;
        padding-top: 0;
    }
    
    .user-badge {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    .btn-logout {
        padding: 0.75rem;
        font-size: 1rem;
        width: 100%;
    }
    
    .topbar {
        padding: 0 1rem;
        height: 70px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }
    
    .content-body {
        padding: 1rem;
    }
    
    .responsive-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 600px) {
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
    }
    
    .filter-group {
        width: 100%;
        min-width: 0;
    }
    
    .filter-bar button {
        width: 100%;
    }
    
    /* Make tables stackable cards on mobile */
    .data-table, .data-table tbody, .data-table tr {
        display: block;
    }
    
    .data-table thead {
        display: none;
    }
    
    .data-table tr {
        padding: 1rem 0.5rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .data-table td {
        display: block;
        width: 100% !important;
        padding: 0.5rem 0 !important;
        text-align: left !important;
        border-bottom: none;
    }
    
    .data-table td:before {
        content: attr(data-label);
        font-size: 0.7rem;
        text-transform: uppercase;
        font-weight: 700;
        letter-spacing: 0.05em;
        color: var(--text-secondary);
        display: block;
        margin-bottom: 0.25rem;
    }
    
    .status-toggle-group {
        display: flex;
        width: 100%;
    }
    
    .status-toggle-item {
        flex: 1;
    }
    
    .status-toggle-label {
        width: 100%;
        padding: 10px 4px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 1.5rem 1rem;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* RTL Layout Direction Support */
[dir="rtl"] body {
    direction: rtl;
    text-align: right;
}

[dir="rtl"] .sidebar {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

[dir="rtl"] .form-group {
    text-align: right;
}

[dir="rtl"] .data-table {
    text-align: right;
}

[dir="rtl"] .data-table th, [dir="rtl"] .data-table td {
    text-align: right;
}

[dir="rtl"] .modal-content {
    text-align: right;
}

@media (max-width: 768px) {
    [dir="rtl"] .sidebar {
        left: auto;
        right: -280px;
        border-left: none;
        border-right: 1px solid var(--border-color);
    }
    
    [dir="rtl"] .sidebar.open {
        transform: translateX(-280px);
        box-shadow: -4px 0 25px rgba(0, 0, 0, 0.5);
    }
}

@media (max-width: 600px) {
    [dir="rtl"] .data-table td {
        text-align: right !important;
    }
}
