/**
 * Dashboard Page Responsive Styles
 * Optimized for mobile, tablet, and desktop
 */

/* Stats Grid Responsive */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.75rem;
    }
    
    .stat-icon {
        width: 36px !important;
        height: 36px !important;
    }
    
    .stat-icon svg {
        width: 18px !important;
        height: 18px !important;
    }
}

/* Page Header Responsive */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .page-header h1 {
        font-size: 1.25rem;
    }
    
    .page-subtitle {
        font-size: 0.85rem;
    }
    
    .page-header .flex {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.1rem;
    }
    
    .page-header .btn {
        font-size: 0.9rem;
        padding: 0.6rem 1rem;
    }
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Card Responsive */
.card {
    border-radius: var(--radius-lg);
    padding: 1.5rem;
}

@media (max-width: 768px) {
    .card {
        padding: 1rem;
        border-radius: var(--radius);
    }
    
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 0.75rem;
    }
}

/* Table Responsive */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .table-wrapper table {
        font-size: 0.85rem;
    }
    
    .table-wrapper th,
    .table-wrapper td {
        padding: 0.5rem;
    }
    
    .table-wrapper .badge {
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 480px) {
    .table-wrapper table {
        font-size: 0.75rem;
    }
    
    .table-wrapper th,
    .table-wrapper td {
        padding: 0.4rem 0.3rem;
    }
}

/* Alert Responsive */
.alert {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .alert {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .alert svg {
        width: 18px;
        height: 18px;
        flex-shrink: 0;
    }
    
    .alert strong {
        display: block;
        margin-bottom: 0.25rem;
    }
}

@media (max-width: 480px) {
    .alert {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
}

/* Empty State Responsive */
.empty-state {
    text-align: center;
    padding: 3rem;
}

@media (max-width: 768px) {
    .empty-state {
        padding: 2rem;
    }
    
    .empty-state svg {
        width: 48px;
        height: 48px;
    }
    
    .empty-state h3 {
        font-size: 1rem;
    }
    
    .empty-state p {
        font-size: 0.85rem;
    }
}

/* Chart Responsive */
@media (max-width: 768px) {
    [style*="height: 300px"] {
        height: 200px !important;
    }
}

@media (max-width: 480px) {
    [style*="height: 300px"] {
        height: 150px !important;
    }
}

/* Low Stock & Expiring Items Cards */
@media (max-width: 768px) {
    .grid-3 > div {
        padding: 0.75rem !important;
    }
    
    .grid-3 > div > div:first-child {
        font-size: 0.85rem !important;
    }
    
    .grid-3 > div > div:first-child > div:last-child {
        font-size: 0.7rem !important;
    }
    
    .grid-3 > div > div:last-child {
        font-size: 1rem !important;
    }
    
    .grid-3 > div > div:last-child > div:last-child {
        font-size: 0.6rem !important;
    }
}

/* Compact Mode for Small Screens */
@media (max-width: 480px) {
    .stat-label {
        font-size: 0.75rem !important;
    }
    
    .stat-change {
        font-size: 0.7rem !important;
    }
    
    .card-title {
        font-size: 1rem !important;
    }
    
    .btn-sm {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.6rem !important;
    }
}
