/* ============================================
   Responsive Styles
   ============================================ */

/* Tablet & Small Desktop */
@media (max-width: 1024px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .page-content {
        padding: 20px 24px;
    }
}

/* Tablet */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .top-header {
        padding: 12px 16px;
    }
    
    .top-header .hamburger {
        display: block;
    }
    
    .top-header .page-title h1 {
        font-size: 17px;
    }
    
    .top-header .page-title p {
        display: none;
    }
    
    .top-header .right .user-dropdown .dropdown-toggle .name {
        display: none;
    }
    
    .top-header .right .user-dropdown .dropdown-toggle .chevron {
        display: none;
    }
    
    .page-content {
        padding: 16px;
    }
    
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-card .stat-number {
        font-size: 22px;
    }
    
    .stat-card .stat-label {
        font-size: 12px;
    }
    
    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .filter-bar {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }
    
    .filter-bar .filter-group {
        min-width: 100%;
    }
    
    .filter-bar .filter-actions {
        width: 100%;
    }
    
    .filter-bar .filter-actions .btn {
        flex: 1;
        justify-content: center;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }
    
    .table-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Mobile table as cards */
    .table-wrapper table thead {
        display: none;
    }
    
    .table-wrapper table tbody tr {
        display: block;
        border: 1px solid var(--gray-200);
        border-radius: var(--radius);
        padding: 16px;
        margin-bottom: 12px;
        background: var(--white);
    }
    
    .table-wrapper table tbody tr td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border: none;
        border-bottom: 1px solid var(--gray-100);
    }
    
    .table-wrapper table tbody tr td:last-child {
        border-bottom: none;
    }
    
    .table-wrapper table tbody tr td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--gray-600);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }
    
    .table-wrapper table tbody tr td .badge {
        font-size: 11px;
    }
    
    .table-wrapper table tbody tr td .btn {
        font-size: 12px;
        padding: 4px 10px;
    }
    
    .modal {
        padding: 24px;
        margin: 16px;
    }
    
    .profile-card {
        padding: 20px;
    }
    
    .profile-card .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
    }
    
    .toast {
        min-width: unset;
        width: 100%;
        font-size: 14px;
        padding: 14px 18px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .top-header {
        padding: 10px 12px;
    }
    
    .top-header .page-title h1 {
        font-size: 15px;
    }
    
    .page-content {
        padding: 12px;
    }
    
    .dashboard-cards {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .stat-card .stat-number {
        font-size: 18px;
    }
    
    .stat-card .stat-label {
        font-size: 11px;
    }
    
    .stat-card .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .filter-bar {
        padding: 12px;
    }
    
    .filter-bar .filter-group select,
    .filter-bar .filter-group input {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .btn {
        font-size: 13px;
        padding: 8px 14px;
    }
    
    .btn-sm {
        font-size: 11px;
        padding: 4px 8px;
    }
    
    .table-wrapper table tbody tr {
        padding: 12px;
    }
    
    .table-wrapper table tbody tr td {
        font-size: 13px;
    }
    
    .form-group .form-control {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .modal {
        padding: 20px;
    }
    
    .modal-header h3 {
        font-size: 18px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
    
    .pagination a {
        min-width: 30px;
        height: 30px;
        font-size: 12px;
    }
}

/* Extra small devices */
@media (max-width: 360px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .stat-card {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px;
    }
    
    .stat-card .stat-icon {
        margin-bottom: 0;
    }
    
    .stat-card .stat-info {
        flex: 1;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .top-header .right,
    .top-header .hamburger,
    .filter-bar .filter-actions,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .top-header {
        position: static !important;
        border-bottom: 1px solid #ddd;
    }
    
    .table-wrapper table thead {
        display: table-header-group !important;
    }
    
    .table-wrapper table tbody tr {
        display: table-row !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .table-wrapper table tbody tr td {
        display: table-cell !important;
        padding: 8px 12px !important;
        border-bottom: 1px solid #ddd !important;
    }
    
    .table-wrapper table tbody tr td::before {
        display: none !important;
    }
}