:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --background-light: #f8f9fa;
    --text-light: #ecf0f1;
    --text-dark: #2c3e50;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
}

* {
    border: 0;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

html, body, main {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: row;
    background-color: var(--background-light);
}

.options {
    height: 100%;
    color: var(--text-light);
    background: linear-gradient(145deg, var(--primary-color), #34495e);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    gap: 2rem;
    width: 250px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.options-menu-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.options h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--secondary-color);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.options ul {
    width: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.menu-auth-section {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.auth-user-label {
    display: none;
    align-items: center;
    gap: 0.5rem;
    color: #ecf0f1;
    font-size: 0.9rem;
    opacity: 0.95;
}

.auth-btn {
    width: 100%;
    font-size: 0.85rem;
}

.login-modal-content {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(44, 62, 80, 0.22);
}

.login-modal-header {
    border-bottom: none;
    background: linear-gradient(135deg, #f3f7fb, #e6eff8);
    padding: 1rem 1.25rem;
}

.login-modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.login-badge-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3498db, #1d6fa5);
    color: #fff;
    font-size: 1.2rem;
}

.login-subtitle {
    color: #6c757d;
    font-size: 0.86rem;
}

#login-form .form-control {
    border-radius: 10px;
    border: 1px solid #d7e0e8;
    padding: 0.6rem 0.8rem;
}

#login-form .form-control:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.2);
}

#toggle-login-password {
    border-radius: 0 10px 10px 0;
    border-color: #d7e0e8;
    min-width: 46px;
}

#toggle-login-password i {
    color: #516170;
}

.login-show-pass-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #4f5d6b;
    font-size: 0.9rem;
    user-select: none;
}

.login-show-pass-check .form-check-input {
    cursor: pointer;
}

.login-show-pass-check .form-check-label {
    cursor: pointer;
}

.login-submit-btn {
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.login-submit-btn i {
    margin-right: 6px;
}

.options ul .menu-item {
    color: #bdc3c7;
    padding: 0.8rem 1rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0.5rem;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.options ul .menu-item i {
    font-size: 1.2rem;
    transition: transform var(--transition-speed) ease;
}

.options ul .menu-item.options-active {
    color: var(--text-light) !important;
    background: var(--secondary-color);
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.options ul .menu-item:hover:not(.options-active) {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
}

.options ul .menu-item:hover i {
    transform: scale(1.1);
}

.options ul .menu-item:active {
    transform: scale(0.98);
}

.main-app {
    width: 100%;
    background-color: var(--background-light);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    gap: 2rem;
    overflow-y: auto;
}

.top-buttons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0.5rem;
}

.btn {
    padding: 0.5rem 1.5rem;
    font-weight: 500;
    border-radius: 8px;
    transition: all var(--transition-speed) ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.btn-warning {
    background: var(--warning-color);
    border: none;
    color: var(--text-dark);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(241, 196, 15, 0.3);
}

.dashboard {
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 200px;
    padding: 1rem;
}

.top-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    justify-content: center;
    margin-top: 1rem;
}

.dashboard-layout {
    display: grid;
    gap: 2rem;
    margin-top: 1rem;
}

.dashboard-summary-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.dashboard-summary-row .card {
    display: flex;
    flex-direction: column;
    min-height: 330px;
}

.dashboard-summary-row .card-content {
    flex: 1;
}

.bottom-dashboard {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 3rem;
}

.bottom-dashboard .card {
    width: 100%;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--secondary-color), var(--success-color));
}

.card h3 {
    color: var(--text-dark);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    padding: 1rem;
}

/* Estilos específicos para cada tarjeta */
#tiempo .card-content i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

#tiempo .card-content .bi-sun-fill {
    color: var(--warning-color);
}

#tiempo .card-content .bi-cloud-rain-fill {
    color: var(--secondary-color);
}

#visitas .card-content p {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Banda de condiciones meteorologicas */
#tiempo .card-content {
    align-items: stretch;
    justify-content: stretch;
    min-height: 0;
    padding: 0;
}

.weather-card-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    width: 100%;
    color: var(--text-dark);
}

.weather-primary {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex: 0 1 310px;
    min-width: 250px;
}

.weather-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.12), rgba(26, 188, 156, 0.14));
    color: #0d6efd;
    font-size: 1.8rem;
}

.weather-condition {
    min-width: 0;
}

.weather-label {
    color: #7f8c8d;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.weather-status,
.weather-metric-value {
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.weather-status {
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weather-temperature {
    margin-left: auto;
    padding-left: 0.8rem;
    border-left: 1px solid #e1e8ed;
}

.weather-temperature-value {
    color: var(--text-dark);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.weather-temperature-value span {
    font-size: 1rem;
    font-weight: 600;
}

.weather-metrics {
    display: grid;
    grid-template-columns: repeat(7, minmax(82px, 1fr));
    flex: 1 1 680px;
    gap: 0.75rem;
}

    border-left: 2px solid #e8f4f8;
}

.weather-metric-value {
    font-size: 0.9rem;
}

.weather-updated {
    width: 100%;
    padding-top: 0.65rem;
    border-top: 1px solid #edf1f4;
    color: #7f8c8d;
    font-size: 0.78rem;
    font-weight: 600;
}

.weather-updated i {
    margin-right: 0.35rem;
}

/* Distribucion interna del historial de caudal */
#realtime-flow .card-content {
    width: 100%;
    padding: 0;
}

#realtime-flow .card-content > div {
    display: grid !important;
    grid-template-columns: minmax(150px, 0.75fr) 2px minmax(260px, 2.4fr) minmax(125px, 0.65fr);
    align-items: center;
    width: 100%;
    padding: 0.5rem 0 !important;
    gap: 1rem;
}

#realtime-flow .card-content > div > div:nth-child(3) {
    min-width: 0;
}

#realtime-flow .card-content > div > div:last-child {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (max-width: 1200px) {
    .weather-metrics {
        grid-template-columns: repeat(4, minmax(100px, 1fr));
    }
}

/* Estilos para el overlay de carga */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

#main-loading-overlay {
    position: fixed;
    background: rgba(255, 255, 255, 0.98);
    z-index: 9999;
}

.loading-content {
    text-align: center;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.loading-overlay.active .loading-content {
    transform: translateY(0);
}

.loading-content .spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--secondary-color);
}

.loading-content p {
    margin-top: 1rem;
    color: var(--text-dark);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Estilos para los dashboards */
.dashboard {
    display: none;
    animation: fadeIn 0.3s ease;
}

.dashboard.active-dashboard {
    display: flex;
    flex-direction: column;
}

.dashboard-title {
    color: var(--text-dark);
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--secondary-color);
}

/* Estilos para la tabla de informes */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--background-light);
    color: var(--text-dark);
    font-weight: 600;
    border-bottom: 2px solid var(--secondary-color);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
}

.table tbody tr {
    transition: all var(--transition-speed) ease;
}

.table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.1);
}

.table .btn {
    margin: 0 0.25rem;
}

.table .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.table .btn i {
    margin-right: 0.25rem;
}

/* Estilos para vista de cards en móvil (informes) */
.informes-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0;
}

.informe-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all var(--transition-speed) ease;
    border-left: 4px solid var(--secondary-color);
}

.informe-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.informe-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}

.informe-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--secondary-color), var(--success-color));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.informe-info {
    flex: 1;
    min-width: 0;
}

.informe-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.informe-info p {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.informe-info p i {
    font-size: 0.9rem;
}

.informe-actions {
    display: flex;
    gap: 0.5rem;
}

.informe-actions .btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    border-radius: 8px;
}

.informe-actions .btn i {
    font-size: 1rem;
}

/* Animación de fade in */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilos para el overlay de carga */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    padding: 20px;
}

.loading-content p {
    margin-top: 10px;
    color: #666;
    font-size: 1.1em;
}

/* Mejoras para las tarjetas */
.card {
    flex: 1;
    min-width: 200px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
}

.card-content {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cuaderno-welcome-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cuaderno-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    border: 1px solid #dbe7f3;
    border-radius: 14px;
    background: linear-gradient(135deg, #f3f8fc 0%, #eaf3fb 100%);
}

.cuaderno-hero-subtitle {
    color: #516170;
    font-size: 1rem;
}

.cuaderno-institutional {
    color: #2f5d87;
    font-weight: 600;
    font-size: 0.95rem;
}

.cuaderno-hero-icon {
    width: 74px;
    height: 74px;
    border-radius: 16px;
    background: linear-gradient(135deg, #3498db, #1d6fa5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    flex-shrink: 0;
}

.quick-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.quick-metric-card {
    background: #fff;
    border: 1px solid #e1ebf4;
    border-radius: 12px;
    padding: 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    box-shadow: 0 3px 10px rgba(44, 62, 80, 0.08);
}

.quick-metric-card i {
    color: #1d6fa5;
    font-size: 1.4rem;
}

.quick-metric-label {
    color: #5e6d7c;
    font-size: 0.86rem;
    font-weight: 600;
}

.quick-metric-value {
    color: #2c3e50;
    font-size: 1.25rem;
    line-height: 1.3;
    font-weight: 700;
}

.metric-activity {
    font-size: 0.92rem;
    font-weight: 600;
    color: #314252;
}

.modules-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.module-card {
    background: #fff;
    border: 1px solid #e6edf5;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-height: 150px;
    box-shadow: 0 3px 10px rgba(44, 62, 80, 0.08);
}

.module-card i {
    font-size: 1.6rem;
    color: #2f81bf;
}

.module-card h4 {
    margin: 0;
    color: #2a3f55;
    font-size: 1rem;
    font-weight: 700;
}

.module-card p {
    margin: 0;
    color: #657687;
    font-size: 0.9rem;
}

.quick-start-card {
    background: #fff;
    border: 1px solid #e5edf4;
    border-radius: 12px;
    padding: 1.1rem;
}

.quick-start-card h3 {
    margin: 0 0 0.85rem;
    color: #2c3e50;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.quick-start-card ol {
    margin: 0;
    padding-left: 1.2rem;
    color: #526273;
}

.quick-start-card li {
    margin-bottom: 0.35rem;
}

/* Responsive */
@media (max-width: 768px) {
    html, body, main {
        flex-direction: column;
    }
    
    .options {
        width: 100%;
        height: auto;
        padding: 1rem;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        gap: 1rem;
    }

    .options-menu-wrapper {
        height: auto;
        gap: 0.75rem;
    }
    
    .options h2 {
        font-size: 1.5rem;
        margin-bottom: 0;
    }
    

    .menu-auth-section {
        margin-top: 0.25rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.25);
    }

    .login-modal-header {
        padding: 0.85rem 1rem;
    }

    .login-badge-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .options ul {
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .options ul .menu-item {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        margin-bottom: 0;
    }
    
    .options ul .menu-item i {
        font-size: 1rem;
    }
    
    .main-app {
        padding: 1rem;
        gap: 1rem;
        overflow-x: hidden;
    }
    
    .top-dashboard {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-layout {
        gap: 1rem;
        margin-top: 0;
    }

    .dashboard-summary-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-summary-row .card {
        min-height: 0;
    }
    
    .bottom-dashboard {
        margin-top: 1.5rem;
    }
    
    .card {
        width: 100%;
        padding: 1rem;
    }
    
    .card h3 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .card-content {
        min-height: 80px;
        padding: 0.5rem;
    }

    .cuaderno-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .cuaderno-hero-icon {
        width: 60px;
        height: 60px;
        border-radius: 14px;
        font-size: 1.6rem;
    }

    .quick-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modules-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    /* Ajustes para el flujómetro en móvil */
    #flujometro .card-content > div {
        padding: 10px 5px !important;
    }
    
    /* Ajustes para el medidor en tiempo real en móvil */
    #realtime-flow .card-content > div {
        grid-template-columns: 1fr !important;
        padding: 15px 10px !important;
        gap: 15px;
    }
    
    #realtime-flow .card-content > div > div:first-child {
        flex: 1 !important;
        margin-bottom: 10px;
    }
    
    #realtime-flow .card-content > div > div:nth-child(2) {
        display: none !important; /* Ocultar separador vertical en móvil */
    }
    
    #realtime-flow .card-content > div > div:nth-child(3) {
        flex: 1 !important;
        padding: 0 10px !important;
    }
    
    #realtime-flow .card-content > div > div:last-child {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 20px;
    }

    .weather-card-layout {
        gap: 0.9rem;
    }

    .weather-primary {
        flex-basis: 100%;
    }

    .weather-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        flex-basis: 100%;
        gap: 0.65rem;
    }
    
    .top-buttons {
        justify-content: center;
        padding: 0.25rem;
    }
    
    .btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
    }
    
    .dashboard-title {
        font-size: 1.4rem;
    }
    
    .table-responsive {
        overflow-x: auto;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table thead th,
    .table tbody td {
        padding: 0.5rem;
    }
    
    /* Ocultar tabla y mostrar cards en móvil */
    .table-responsive {
        display: none;
    }
    
    .informes-grid {
        display: flex !important;
    }
    
    .informe-card {
        animation: slideInUp 0.3s ease;
    }
    
    @keyframes slideInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .loading-content {
        padding: 1rem;
    }
    
    .loading-content .spinner-border {
        width: 2rem;
        height: 2rem;
    }
    
    .loading-content p {
        font-size: 0.9rem;
    }
}

/* Ajustes adicionales para pantallas muy pequeñas */
@media (max-width: 480px) {
    .options {
        padding: 0.75rem;
    }
    
    .options h2 {
        font-size: 1.2rem;
    }
    
    .options ul .menu-item {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .main-app {
        padding: 0.75rem;
    }
    
    .card {
        padding: 0.75rem;
    }

    .weather-primary {
        min-width: 0;
        gap: 0.6rem;
    }

    .weather-icon {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
        font-size: 1.5rem;
    }

    .weather-temperature-value {
        font-size: 1.65rem;
    }

    .quick-metrics-grid,
    .modules-grid {
        grid-template-columns: 1fr;
    }
    
    .card h3 {
        font-size: 0.95rem;
    }
    
    #visitas .card-content > div > div {
        font-size: 3.5em !important;
    }
    
    #realtime-flow .card-content > div > div:first-child > div:nth-child(2) {
        font-size: 32px !important;
    }
    
    /* Ajustar gráfico en tiempo real para móvil */
    #realtime-flow .card-content svg {
        height: 60px !important;
    }
}

/* Landscape mode en móviles */
@media (max-width: 768px) and (orientation: landscape) {
    .options {
        padding: 0.5rem 1rem;
    }
    
    .options h2 {
        font-size: 1.2rem;
    }
    
    .main-app {
        padding: 0.75rem;
    }
    
    .top-dashboard {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
    
    .bottom-dashboard {
        margin-top: 1rem;
    }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .top-dashboard {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .options {
        width: 200px;
        padding: 1.5rem;
    }
}

/* Sidebar movil tipo off-canvas */
.app-mobile-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: linear-gradient(145deg, var(--primary-color), #34495e);
    color: #eaf4ff;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    z-index: 1202;
}

.app-sidebar-overlay {
    display: none;
}

@media (max-width: 768px) {
    .app-mobile-toggle {
        display: inline-flex;
    }

    .app-sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        border: none;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
        z-index: 1200;
    }

    .options {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(84vw, 300px);
        height: 100vh;
        padding: 1.2rem;
        transform: translateX(-100%);
        transition: transform 0.28s ease, box-shadow 0.28s ease;
        z-index: 1201;
        overflow-y: auto;
    }

    body.app-sidebar-open .options {
        transform: translateX(0);
        box-shadow: 14px 0 28px rgba(0, 0, 0, 0.28);
    }

    body.app-sidebar-open .app-sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    body.app-sidebar-open {
        overflow: hidden;
    }

    .options ul {
        flex-direction: column;
        gap: 0.55rem;
    }

    .main-app {
        padding-top: 4.25rem;
    }

    .btn,
    .form-control,
    .form-select,
    button {
        min-height: 44px;
    }
}
