/* ==================== Responsive Design ==================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-alerts {
        grid-template-columns: 1fr;
    }

    .reports-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile (hasta 768px) */
@media (max-width: 768px) {

    /* Sidebar Mobile */
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Overlay visible solo en móvil */
    .sidebar-overlay {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .header-title {
        display: none;
    }

    /* Header */
    .top-header {
        padding: 0 var(--spacing-md);
    }

    .user-info span {
        display: none;
    }

    /* Content */
    .content-wrapper {
        padding: var(--spacing-md);
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .section-header h1 {
        font-size: 1.5rem;
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: var(--spacing-md);
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .stat-info h3 {
        font-size: 1.5rem;
    }

    /* Table Controls */
    .table-controls {
        flex-direction: column;
    }

    .search-input,
    .filter-select {
        width: 100%;
    }

    /* Tables */
    .table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 800px;
    }

    .data-table th,
    .data-table td {
        padding: var(--spacing-sm);
        font-size: 0.8125rem;
    }

    /* Action Buttons */
    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }

    /* Modals */
    .modal {
        max-width: 95%;
        margin: var(--spacing-md);
    }

    .modal-header h2 {
        font-size: 1.25rem;
    }

    .modal-body {
        padding: var(--spacing-md);
    }

    .modal-footer {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .modal-footer button {
        width: 100%;
    }

    /* Form Row */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* User Connection Grid */
    .user-connection-item {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    /* Reports */
    .reports-grid {
        grid-template-columns: 1fr;
    }

    /* Pagination */
    .pagination {
        flex-wrap: wrap;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
        margin-bottom: var(--spacing-sm);
    }

    /* System Check */
    .sc-grid {
        grid-template-columns: 1fr;
    }

    .sc-header-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-sm);
    }

    .sc-card {
        flex-wrap: wrap;
    }

    .sc-card-status {
        flex-direction: row;
        align-items: center;
        width: 100%;
        justify-content: flex-start;
        gap: var(--spacing-sm);
    }

    /* Logs */
    .logs-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .logs-filters {
        flex-direction: column;
    }

    .logs-filter-input {
        min-width: unset;
        width: 100%;
    }
}

/* Extra Small Mobile (hasta 480px) */
@media (max-width: 480px) {
    .section-header h1 {
        font-size: 1.25rem;
    }

    .stat-info h3 {
        font-size: 1.25rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8125rem;
    }

    .modal-header h2 {
        font-size: 1.125rem;
    }
}

/* Print Styles */
@media print {

    .sidebar,
    .top-header,
    .section-header button,
    .table-controls,
    .action-buttons,
    .pagination {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        padding: 0;
    }

    .data-table {
        font-size: 0.75rem;
    }
}