/* ===== Large screens (max-width: 1200px) ===== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Tablet & Mobile (max-width: 768px) ===== */
@media (max-width: 768px) {
    /* Sidebar off-screen */
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 100;
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Sidebar overlay when open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }

    .sidebar-overlay.open {
        display: block;
    }

    /* Main content full width */
    .main-content {
        margin-left: 0;
        padding: 1rem;
        padding-top: calc(var(--header-height) + 1rem);
    }

    /* Mobile header with hamburger */
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--header-height);
        padding: 0 1rem;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        z-index: 90;
    }

    .mobile-header .hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: transparent;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        color: var(--text-primary);
        cursor: pointer;
        font-size: 1.25rem;
    }

    .mobile-header .hamburger:hover {
        border-color: var(--border-hover);
    }

    /* Stats single column */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Table horizontal scroll */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 600px;
    }

    /* Modal nearly full width */
    .modal {
        max-width: 95%;
        padding: 1.5rem;
    }

    /* Page header stack on small */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    /* Toast full width on mobile */
    .toast {
        left: 1rem;
        right: 1rem;
        max-width: none;
        min-width: auto;
    }
}

/* Hide mobile header on desktop */
.mobile-header {
    display: none;
}
