/* ==================== RESPONSIVE CSS ==================== */

/* Large tablets and small desktops (1280px and below) */
@media (max-width: 1280px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablets (1024px and below) */
@media (max-width: 1024px) {
    /* Sidebar mobile behavior */
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* Main content full width */
    .main-content {
        margin-left: 0;
    }
    
    /* Show mobile menu button */
    .mobile-menu-btn {
        display: flex;
    }
    
    /* Show overlay when sidebar open */
    .mobile-overlay.active {
        display: block;
    }
    
    /* Grid adjustments */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid,
    .analytics-grid,
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    /* Header adjustments */
    .header-content {
        padding: 0.75rem 1rem;
    }
    
    /* Page content padding */
    .page-content {
        padding: 1rem;
    }
    
    /* Form grid adjustments */
    .form-row-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile devices (768px and below) */
@media (max-width: 768px) {
    /* Stats grid 2 columns on mobile */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    /* Filter bar mobile */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-input,
    .filter-select {
        flex: 1;
        min-width: 0;
        max-width: none;
    }
    
    .filter-bar .btn {
        width: 100%;
    }
    
    /* Form grids single column */
    .form-row-2,
    .form-row-3 {
        grid-template-columns: 1fr;
    }
    
    /* Header adjustments */
    .header-right {
        gap: 0.5rem;
    }
    
    .user-section {
        border-left: none;
        padding-left: 0;
    }
    
    .user-info {
        display: none;
    }
    
    /* Modal full width */
    .modal {
        width: calc(100% - 2rem);
        max-width: none;
        margin: 1rem;
    }
    
    /* Card body padding */
    .card-body,
    .stat-card {
        padding: 1rem;
    }
    
    /* Stat card adjustments */
    .stat-card-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .stat-card-value {
        font-size: 1.5rem;
    }
    
    /* Hide on mobile */
    .hidden-mobile {
        display: none !important;
    }
    
    /* Show on mobile */
    .show-mobile {
        display: block !important;
    }
    
    /* Dashboard table mobile */
    .table th.hidden-mobile,
    .table td.hidden-mobile {
        display: none !important;
    }
    
    /* Smaller tenant avatar on mobile */
    .tenant-avatar {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 0.75rem;
    }
    
    /* Table cells padding */
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8125rem;
    }
    
    /* Section header stacking */
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .section-header .btn {
        width: 100%;
    }
}

/* Small mobile devices (480px and below) */
@media (max-width: 480px) {
    /* Sidebar full width */
    .sidebar {
        width: 100%;
    }
    
    /* Stats grid single column */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Tenant detail stats */
    .grid-cols-4 {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.5rem !important;
    }
    
    /* Modal smaller padding */
    .modal-body {
        padding: 1rem;
    }
    
    /* Smaller text */
    .text-2xl {
        font-size: 1.25rem !important;
    }
    
    /* Smaller card radius */
    .card {
        border-radius: 8px;
    }
    
    /* Full width buttons */
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    /* Filter group stacking */
    .filter-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .filter-input,
    .filter-select,
    .input {
        width: 100%;
        min-width: 0;
    }
    
    /* Header title size */
    .header-title {
        font-size: 1rem;
    }
    
    .header-subtitle {
        font-size: 0.75rem;
    }
    
    /* Page content minimal padding */
    .page-content {
        padding: 0.75rem;
    }
    
    /* Status items stacking */
    .status-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .sidebar,
    .header,
    .mobile-menu-btn,
    .mobile-overlay,
    .filter-bar,
    .btn,
    .modal-overlay,
    .toast-container {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .page-content {
        padding: 0;
    }
    
    .card {
        break-inside: avoid;
        border: 1px solid #ddd;
        box-shadow: none;
    }
    
    .table thead {
        display: table-header-group;
    }
    
    .table tbody tr {
        display: table-row;
        border: none;
        background: none;
        padding: 0;
        margin: 0;
    }
    
    .table tbody td {
        display: table-cell;
    }
    
    .table tbody td::before {
        display: none;
    }
}
