/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores principales */
    --primary-color: #04134a;
    --primary-dark: #5a6fd8;
    --secondary-color: #002665;
    --accent-color: #f093fb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
    
    /* Colores de fondo */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-dark: #1e293b;
    --bg-card: #ffffff;
    
    /* Colores de texto */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-white: #ffffff;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Bordes */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --border-color: #e2e8f0;
    
    /* Espaciado */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Fuentes */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
}

/* Tema Oscuro */
[data-theme="dark"] {
    /* Colores principales - más vibrantes en oscuro */
    --primary-color:  #ecc465;
    --primary-dark:  #b97a35;
    --secondary-color:  #b97a35;
    --accent-color: #22d3ee;
    
    /* Colores de fondo */
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --bg-dark: #0f172a;
    --bg-card: #1f2937;
    
    /* Colores de texto */
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --text-white: #ffffff;
    
    /* Sombras más sutiles */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6), 0 8px 10px -6px rgb(0 0 0 / 0.6);
    
    /* Bordes */
    --border-color: #4b5563;
}

/* Transición suave para el cambio de tema */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}



@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Navegación */
.navbar {
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 700;
    font-size: var(--font-size-lg);
    color: var(--primary-color);
}

.nav-brand i {
    font-size: var(--font-size-xl);
}

.nav-menu {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
}

.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    margin-left: var(--spacing-md);
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle i {
    transition: transform 0.3s ease;
}

.theme-toggle:hover i {
    transform: rotate(180deg);
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
    font-weight: 500;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: var(--primary-color);
    background: var(--bg-secondary);
}

.nav-link.active {
    color: var(--primary-color);
    background: var(--bg-secondary);
}

.nav-link.logout {
    color: var(--error-color);
}

.nav-link.logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Contenido principal */
.main-content {
    min-height: 100vh;
    padding-bottom: 100px;
    background: linear-gradient(135deg, 
        rgba(102, 126, 234, 0.03) 0%, 
        rgba(118, 75, 162, 0.03) 25%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(102, 126, 234, 0.02) 75%,
        rgba(118, 75, 162, 0.02) 100%);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.main-content.with-nav {
    padding-top: 70px;
}

.main-content.no-nav {
    padding-top: 0;
}

/* Contenedores */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-sm {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
}

.card-header {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.card-subtitle {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Formularios */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-sm);
}

.form-input {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid #d1d5db;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: all 0.2s ease;
    background: #ffffff;
    color: #374151;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-select {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid #d1d5db;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    background: #ffffff;
    color: #374151;
    cursor: pointer;
}

/* Glucose Picker Styles */
.glucose-picker {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: visible;
    height: 150px;
    padding: 15px;
    position: relative;
    margin: 12px 0;
}

.picker {
    width: 80px;
    height: 120px;
    overflow-y: scroll;
    overflow-x: hidden;
    scroll-snap-type: none;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.picker::-webkit-scrollbar {
    display: none;
}

.wheel {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: center;
}

.wheel li {
    height: 50px;
    line-height: 50px;
    font-size: 24px;
    color: #64748b;
    transition: color 0.3s ease, font-size 0.3s ease, font-weight 0.3s ease;
    font-weight: 400;
}

.picker .wheel li.selected {
    color: #3b82f6;
    font-size: 18px;
    font-weight: 600;
    transition: transform 0.1s ease, color 0.2s ease;
}

/* Línea indicadora del centro */
.glucose-picker::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 15px;
    right: 15px;
    height: 50px;
    margin-top: -25px;
    border-top: 2px solid #e2e8f0;
    border-bottom: 2px solid #e2e8f0;
    pointer-events: none;
    border-radius: 8px;
}

.glucose-display {
    text-align: center;
    margin: 16px 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
    padding: 12px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 12px;
    border: 1px solid #cbd5e1;
}

/* Contenedor de cada picker con flechas */
.picker-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 8px;
}

#selectedGlucose {
    color: #3b82f6;
    font-size: 24px;
    font-weight: 600;
    border: none;
    background: transparent;
    text-align: center;
    width: 80px;
    outline: none;
    -moz-appearance: textfield; /* Firefox */
    appearance: textfield; /* Standard property */
}

#selectedGlucose::-webkit-outer-spin-button,
#selectedGlucose::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.glucose-unit {
    color: #64748b;
    font-size: 16px;
    margin-left: 8px;
}

.glucose-display {
    display: flex;
    align-items: center;
    justify-content: center;
}

.picker-arrow {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 12px;
    width: 30px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    z-index: 10;
}

.picker-arrow:hover {
    background: #e2e8f0;
    color: #3b82f6;
    border-color: #3b82f6;
}

.picker-arrow:active {
    background: #cbd5e1;
    transform: scale(0.95);
}

.picker-arrow-up {
    border-radius: 6px 6px 0 0;
    margin-bottom: 12px;
}

.picker-arrow-down {
    border-radius: 0 0 6px 6px;
    margin-top: 12px;
}

/* Estilos específicos para inputs en el modal */
.modal input[type="number"],
.modal input[type="date"],
.modal select,
.modal textarea {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid #d1d5db;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    transition: all 0.2s ease;
    background: #ffffff;
    color: #374151;
}

.modal input[type="number"]:focus,
.modal input[type="date"]:focus,
.modal select:focus,
.modal textarea:focus {
    outline: none;
    border-color: #04134a;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modal label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-sm);
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: var(--font-size-base);
    font-weight: 600;
    font-family: var(--font-family);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 44px;
    user-select: none;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #04134a 0%, #002665 100%);
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #002665 0%, #04134a 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(148, 163, 184, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(148, 163, 184, 0.3);
    border-color: var(--primary-color);
}

/* Modal Form Actions */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.form-actions .btn {
    min-width: 120px;
    height: 44px;
    font-weight: 600;
    font-size: 14px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.form-actions .btn-secondary {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #64748b;
    border: 1px solid #cbd5e1;
}

.form-actions .btn-secondary:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #475569;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.form-actions .btn-primary {
    background: linear-gradient(135deg, #04134a 0%, #002665 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.form-actions .btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
    transform: translateY(-1px);
}

.form-actions .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.5);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(245, 158, 11, 0.5);
}

.btn-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-error:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(239, 68, 68, 0.5);
}

.btn-lg {
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: var(--font-size-lg);
    min-height: 52px;
}

.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    min-height: 36px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Alertas y mensajes */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-lg);
    border-left: 4px solid;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--error-color);
    color: var(--error-color);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--info-color);
    color: var(--info-color);
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 90px;
    right: var(--spacing-md);
    z-index: 1050;
    max-width: 350px;
}

.toast {
    background: var(--bg-card);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border-left: 4px solid;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 100%);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 24px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15), 0 0 0 1px rgba(255,255,255,0.8);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.8) translateY(50px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    position: relative;
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: #b97a35;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.modal-close {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    font-size: 18px;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    transform: scale(1.1);
}

.modal-body {
    padding: var(--spacing-xl);
    max-height: 60vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(102, 126, 234, 0.3) transparent;
    background: #ffffff;
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

.modal-footer {
    padding: var(--spacing-xl);
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    background: #ffffff;
    display: flex;
    gap: var(--spacing-md);
    justify-content: flex-end;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
}


/* Footer */
.footer {
    background: var(--bg-dark);
    color: var(--text-white);
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-xl);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 700;
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-md);
}

.footer-description {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
}

.footer-section h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--text-white);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-md) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* Utilidades */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: var(--spacing-lg);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .nav-link {
        flex-direction: row;
        justify-content: flex-start;
        width: 100%;
        padding: var(--spacing-md);
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .card {
        padding: var(--spacing-lg);
        margin-bottom: var(--spacing-md);
    }
    
    .modal-content {
        width: 95%;
        margin: var(--spacing-md);
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: var(--spacing-lg);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }
    
    .toast-container {
        right: var(--spacing-sm);
        left: var(--spacing-sm);
        max-width: none;
    }
}

@media (max-width: 480px) {
    :root {
        --spacing-md: 0.75rem;
        --spacing-lg: 1rem;
        --spacing-xl: 1.25rem;
    }
    
    .card {
        padding: var(--spacing-md);
        border-radius: var(--border-radius-sm);
    }
    
    .btn {
        padding: var(--spacing-sm) var(--spacing-lg);
        min-height: 40px;
    }
    
    .btn-lg {
        padding: var(--spacing-md) var(--spacing-xl);
        min-height: 48px;
    }
}

/* Modal para detalles del día */


@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(135deg, #04134a 0%, #002665 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: opacity 0.2s;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 25px;
}

.day-summary {
    margin-bottom: 25px;
}

.day-summary h4 {
    margin: 0 0 15px 0;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat-item {
    display: block;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 4px solid #04134a;
}

.stat-label {
    font-weight: 500;
    color: #6b7280;
    font-size: 0.9rem;
}

.stat-value {
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
}

.stat-value.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.stat-value.status.normal {
    background: #d1fae5;
    color: #065f46;
}

.stat-value.status.high {
    background: #fee2e2;
    color: #991b1b;
}

.stat-value.status.low {
    background: #fef3c7;
    color: #92400e;
}

.measurements-list h4 {
    margin: 0 0 15px 0;
    color: #374151;
    font-size: 1.1rem;
    font-weight: 600;
}

.measurements-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.measurement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f3f4f6;
}

.measurement-item:last-child {
    border-bottom: none;
}

.measurement-time {
    font-weight: 500;
    color: #6b7280;
    font-size: 0.9rem;
}

/* Estilos para evaluaciones de glucosa */
.measurement-time.evaluation-good {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.measurement-time.evaluation-regular {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.measurement-time.evaluation-bad {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.measurement-time.evaluation-unknown {
    background: #f3f4f6;
    color: #6b7280;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.measurement-value {
    font-weight: 600;
    font-size: 1rem;
}

.measurement-status {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.measurement-status.normal {
    background: #d1fae5;
    color: #065f46;
}

.measurement-status.high {
    background: #fee2e2;
    color: #991b1b;
}

.measurement-status.low {
    background: #fef3c7;
    color: #92400e;
}

.modal-loader {
    text-align: center;
    padding: 40px;
}

.modal-loader .loader {
    margin: 0 auto 15px;
}

.modal-loader p {
    color: #6b7280;
    margin: 0;
}

@media (max-width: 480px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
}

/* ===== ESTILOS MODERNOS PARA DASHBOARD Y GRÁFICAS ===== */

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
    animation: fadeInUp 0.8s ease-out;
}

.stat-card {
    background: linear-gradient(135deg, #04134a 0%, #002665 100%);
    color: white;
    padding: var(--spacing-xl);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 100%);
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: rotate 4s linear infinite;
    opacity: 0;
    transition: opacity 0.5s ease;
}

@keyframes rotate {
    to {
        transform: rotate(360deg);
    }
}

.stat-card:hover::after {
    opacity: 1;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(102, 126, 234, 0.5);
}

.stat-card.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.3);
}

.stat-card.success:hover {
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.4);
}

.stat-card.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.3);
}

.stat-card.warning:hover {
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.4);
}

.stat-card.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.3);
}

.stat-card.danger:hover {
    box-shadow: 0 20px 40px rgba(239, 68, 68, 0.4);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.9;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stat-label {
    font-size: var(--font-size-sm);
    opacity: 0.9;
    font-weight: 500;
}

/* Chart Section */
.chart-section {
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.08) 100%);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 24px;
    padding: var(--spacing-xl) 1rem;
    margin-bottom: var(--spacing-2xl);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInScale 0.8s ease-out;
}

.chart-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.chart-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    padding: var(--spacing-2xl) 2rem;
    border: 1px solid rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInScale 0.6s ease-out;
}

.chart-last-measurement {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border-left: 4px solid  #b97a35;
}

.last-measurement-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
}

.last-measurement-info .glucose-title {
    font-weight: 700;
    font-size: 16px;
    color:  #b97a35;
    text-align: center;
    margin-bottom: 4px;
}

.last-measurement-info .measurement-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.last-measurement-info .label {
    color: #64748b;
    font-weight: 500;
}

.last-measurement-info .value {
    font-weight: 700;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 6px;
    background: #ecc465 !important;
}

.last-measurement-info .measurement-type {
    color: #04134a;
    font-weight: 600;
    font-size: 14px;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: capitalize;
}

[data-theme="dark"] .last-measurement-info .measurement-type {
    color:  #ecc465;
    background: #374151;
}

.last-measurement-info .period {
    color: #475569;
    font-style: italic;
    font-size: 13px;
}

[data-theme="dark"] .last-measurement-info .period {
    color: #9ca3af;
}

/* Estilos para pestañas */
.tabs-navigation {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: white;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tab-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.tab-btn.active {
    background:  #b97a35;
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Estilos para el perfil de usuario */
.profile-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.profile-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 32px;
    color: white;
    box-shadow: 0 8px 32px rgba(185, 122, 53, 0.3);
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.avatar-text {
    font-size: 28px;
    font-weight: 700;
    color: white;
}

.profile-details h1 {
    margin: 0 0 8px 0;
    font-size: 32px;
    font-weight: 700;
}

.profile-email {
    margin: 0 0 4px 0;
    font-size: 16px;
    opacity: 0.9;
}

.profile-since {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}

.profile-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    width: 100%;
}

.stat-item {
    text-align: center;
    flex: 1 1 160px;
    max-width: 260px;
    box-sizing: border-box;
}

.stat-number {
    display: block;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    color:#04134a !important;
    padding-right: 5px;

}

.stat-label {
    font-size: 14px;
    opacity: 0.8;
}

/* Asegurar que las etiquetas de KPIs en el perfil queden debajo del número */
.profile-stats .stat-label {
    display: block;
    margin-top: 2px;
}

.stat-subtext {
    display: block;
    font-size: 12px;
    opacity: 0.8;
    line-height: 1.3;
    word-break: break-word;
}

.profile-content {
    margin-top: 32px;
}

.settings-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f1f5f9;
}

.settings-card h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.settings-description {
    margin: 0 0 24px 0;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.5;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(185, 122, 53, 0.1);
}

.input-with-unit {
    position: relative;
    display: flex;
    align-items: center;
}

.input-unit {
    position: absolute;
    right: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
}

.form-help {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.checkbox-group {
    margin: 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    padding: 16px;
    border-radius: 12px;
    transition: background-color 0.2s ease;
}

.checkbox-label:hover {
    background: #f8fafc;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all 0.2s ease;
}

input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

input[type="checkbox"] {
    display: none;
}

.checkbox-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.checkbox-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.checkbox-text small {
    color: var(--text-secondary);
    font-size: 13px;
}

.reminder-settings {
    margin-top: 16px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    transition: opacity 0.2s ease;
}

.reminder-settings.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.range-preview {
    margin-bottom: 24px;
    padding: 24px;
    background: #f8fafc;
    border-radius: 12px;
}

.range-bar {
    display: flex;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.range-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.range-section.low {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.range-section.normal {
    background: linear-gradient(135deg, #10b981, #059669);
}

.range-section.high {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.range-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 2px;
}

.range-value {
    font-size: 14px;
    font-weight: 700;
}

.target-indicator {
    text-align: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.target-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--text-primary);
}

.password-strength,
.password-match {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-primary);
}

.info-value {
    color: var(--text-secondary);
    font-weight: 500;
}

/* Tema oscuro para profile */
[data-theme="dark"] .profile-header {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
}

[data-theme="dark"] .settings-card {
    background: var(--bg-card);
    border-color: #374151;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group select {
    background: var(--bg-secondary);
    border-color: #374151;
    color: var(--text-primary);
}

[data-theme="dark"] .reminder-settings {
    background: var(--bg-secondary);
}

[data-theme="dark"] .range-preview {
    background: var(--bg-secondary);
}

[data-theme="dark"] .target-indicator {
    background: var(--bg-card);
}

[data-theme="dark"] .checkbox-label:hover {
    background: var(--bg-secondary);
}

[data-theme="dark"] .info-item {
    border-color: #374151;
}

/* Responsive para profile */
@media (max-width: 768px) {
    .profile-container {
        padding: 16px;
    }
    
    .profile-header {
        padding: 24px;
    }
    
    .profile-info {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    .profile-stats {
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}
    
    .settings-card {
        padding: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .tabs-navigation {
        flex-direction: column;
    }
    
    .tab-btn {
        justify-content: flex-start;
    }
}

/* Estilos para la sección de historial */
.history-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .history-section {
    background: var(--bg-card);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.history-content {
    margin-top: 20px;
}

.month-accordion {
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.month-button {
    width: 100%;
    padding: 16px 20px;
    background: linear-gradient(135deg,  #b97a35 0%,  #ecc465 100%);
    color: white;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.month-button:hover {
    background: linear-gradient(135deg, #ecc465 0%, #b97a35 100%);
}

.month-button .chevron {
    transition: transform 0.2s ease;
    font-size: 14px;
}

.month-button.expanded .chevron {
    transform: rotate(180deg);
}

.month-content {
    display: none;
    background: white;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .month-content {
    background: var(--bg-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.month-content.expanded {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.month-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme="dark"] .month-stats {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.days-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    padding: 16px;
}

.day-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

[data-theme="dark"] .day-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.day-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color:  #b97a35;
}

[data-theme="dark"] .day-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color:  #ecc465;
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.day-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
}

[data-theme="dark"] .day-name {
    color: var(--text-primary);
}

.measurements-count {
    background:  #b97a35;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 500;
}

.day-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
}

[data-theme="dark"] .day-stats {
    color: var(--text-secondary);
}

.day-avg {
    font-weight: 600;
    color: #1e293b;
}

[data-theme="dark"] .day-avg {
    color: var(--text-primary);
}

.history-results {
    min-height: 200px;
}

.month-group {
    margin-bottom: 32px;
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
}

.month-header {
    background: linear-gradient(135deg,  #b97a35 0%,  #ecc465 100%);
    color: white;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 16px;
}

.month-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 20px;
    background: white;
    margin: 0 1px;
}

.month-stat {
    text-align: center;
    padding: 12px;
    background: #f1f5f9;
    border-radius: 8px;
}

.month-stat .stat-number {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.month-stat .stat-label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.measurements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 20px;
}

.measurement-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    transition: all 0.2s ease;
}

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

.measurement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.measurement-date {
    font-weight: 600;
    color: #1e293b;
}

.measurement-time {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
}

.measurement-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.measurement-moment {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 8px;
}

.measurement-notes {
    font-size: 13px;
    color: #475569;
    font-style: italic;
    background: #f8fafc;
    padding: 8px;
    border-radius: 4px;
    border-left: 3px solid #e2e8f0;
}

.no-measurements {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.no-measurements i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

@media (max-width: 768px) {
    .month-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .days-grid {
        grid-template-columns: 1fr;
    }
    
    .month-button {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .day-card {
        padding: 10px;
    }
    
    .day-name {
        font-size: 13px;
    }
    
    .day-stats {
        font-size: 11px;
    }
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #04134a 0%, #002665 100%);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.chart-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.2);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.chart-header h2 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.chart-controls {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.chart-period-select {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    padding: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.chart-period-select button {
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
}

.chart-period-select button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #04134a 0%, #002665 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 12px;
}

.chart-period-select button.active {
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.chart-period-select button.active::before {
    opacity: 1;
}

.chart-period-select button:hover:not(.active) {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.chart-period-select button span {
    position: relative;
    z-index: 1;
}

.chart-period-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.chart-period-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    overflow: hidden;
    margin: 0 auto;
}

.chart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.05), transparent);
    animation: slideShine 3s ease-in-out infinite;
}

@keyframes slideShine {
    0% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
    100% {
        left: 100%;
    }
}

.chart-container:hover {
    box-shadow: inset 0 4px 8px rgba(102, 126, 234, 0.1);
    background: linear-gradient(135deg, #f1f5f9 0%, #ffffff 100%);
}

.chart-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(102, 126, 234, 0.1);
    border-top: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid var(--primary-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    margin: 0 auto var(--spacing-md);
    position: relative;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.loader::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid transparent;
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 0.8s linear infinite reverse;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.chart-loader p {
    color: var(--text-secondary);
    font-weight: 500;
}

.no-data-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.no-data-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.7;
}

.no-data-message h3 {
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.no-data-message p {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

/* Botones modernos mejorados */
.btn {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #d97706 100%);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
}

.btn-warning:hover {
    box-shadow: 0 15px 35px rgba(245, 158, 11, 0.4);
}

.btn-error {
    background: linear-gradient(135deg, var(--error-color) 0%, #dc2626 100%);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.btn-error:hover {
    box-shadow: 0 15px 35px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #04134a;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.btn-secondary:hover {
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

/* Animaciones mejoradas */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.card {
    animation: fadeInUp 0.6s ease-out;
    background: var(--bg-card);
    border: 1px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

/* Responsive mejorado */
/* Login Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-2xl);
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.login-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-lg);
    box-shadow: var(--shadow-lg);
}

.login-logo i {
    font-size: var(--font-size-3xl);
    color: var(--text-white);
}

.login-title {
    font-size: var(--font-size-3xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-size-base);
}

.login-form {
    margin-bottom: var(--spacing-xl);
}

.password-input-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: var(--text-primary);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    position: relative;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    display: inline-block;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkbox-container:hover .checkmark {
    border-color: var(--primary-color);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.login-footer {
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: var(--spacing-lg);
}

.login-link {
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.login-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.login-link a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.demo-credentials {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-xl);
    text-align: center;
    border: 1px solid var(--border-color);
}

.demo-credentials h4 {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.demo-credentials p {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chart-container {
        height: 400px;
        padding: var(--spacing-sm);
        margin: 0 calc(-1 * var(--spacing-lg));
        border-radius: var(--border-radius);
        width: calc(100% + 2 * var(--spacing-lg));
        box-shadow: 0 8px 32px rgba(0,0,0,0.15);
        overflow: hidden;
    }
    
    .chart-card {
        margin: 0 calc(-1 * var(--spacing-md));
        border-radius: var(--border-radius);
    }
    
    .chart-section {
        margin: 0 calc(-1 * var(--spacing-md));
        border-radius: var(--border-radius);
    }
    
    .chart-wrapper canvas {
        width: 100% !important;
        height: 350px !important;
        max-height: 350px !important;
    }
    
    .stat-card {
        padding: var(--spacing-lg);
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .stat-icon {
        font-size: 2rem;
    }
}

/* Estilos para botón de agregar medición */
.add-measurement-section {
    margin-bottom: var(--spacing-2xl);
}

.btn-add-measurement {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
    color: var(--text-white);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn-add-measurement::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-add-measurement:hover::before {
    left: 100%;
}

.btn-add-measurement:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-add-measurement:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: var(--font-size-3xl);
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-content {
    flex: 1;
    text-align: left;
}

.btn-title {
    display: block;
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.btn-subtitle {
    display: block;
    font-size: var(--font-size-sm);
    opacity: 0.9;
}

.btn-arrow {
    font-size: var(--font-size-xl);
    transition: transform 0.3s ease;
}

.btn-add-measurement:hover .btn-arrow {
    transform: translateX(5px);
}



.glucose-display {
    text-align: center;
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary-color);
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    border: 2px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

#glucoseValue {
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

/* Filtros del gráfico */
.chart-filters {
    display: flex;
    gap: 8px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    background: #ffffff;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.filter-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.filter-btn.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: white;
}

.filter-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.filter-btn.active .filter-color {
    background-color: white !important;
}

/* Wrapper para scroll horizontal */
.chart-wrapper {
    overflow: hidden;
    padding-bottom: 10px;
    width: 100%;
    height: 100%;
    position: relative;
}

.chart-wrapper canvas {
    width: 100% !important;
    height: 350px !important;
    max-height: 350px !important;
}

@media (max-width: 768px) {
    .chart-filters {
        justify-content: center;
    }
    
    .filter-btn {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    .chart-wrapper {
        overflow: hidden;
        -webkit-overflow-scrolling: touch;
    }
    
    .chart-wrapper canvas {
        width: 100% !important;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: var(--spacing-md);
    }
    
    .login-card {
        padding: var(--spacing-xl);
    }
    
    .login-logo {
        width: 60px;
        height: 60px;
    }
    
    .login-logo i {
        font-size: var(--font-size-2xl);
    }
    
    .login-title {
        font-size: var(--font-size-2xl);
    }
    
    .btn-add-measurement {
        padding: var(--spacing-lg);
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
    }
    
    .btn-content {
        text-align: center;
    }
    
    .btn-icon {
        width: 50px;
        height: 50px;
        font-size: var(--font-size-2xl);
    }
    
    .glucose-picker {
        gap: var(--spacing-xs);
        padding: var(--spacing-md);
    }
    
    .picker-column {
        width: 60px;
    }
    
    .picker-scroll {
        height: 120px;
    }
    
    .picker-item {
        height: 40px;
        font-size: var(--font-size-lg);
    }
    
    /* Optimización para gráficos en móviles */
    .dashboard-grid {
        gap: var(--spacing-sm);
        padding: 0 var(--spacing-xs);
    }
    
    .card {
        margin: 0;
        border-radius: var(--border-radius-sm);
    }
    
    /* Hacer que las estadísticas sean más compactas */
    .stats-grid {
        gap: var(--spacing-xs);
        margin: 0 calc(-1 * var(--spacing-xs));
    }
    
    .stat-card {
        padding: var(--spacing-md);
        margin: 0;
    }
}

/* Estilos para el modal del día */
.day-measurements {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.measurement-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    border-left: 4px solid #007bff;
}

.measurement-time {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    margin-bottom: 4px;
}

.measurement-value {
    font-size: 18px;
    font-weight: 700;
    color: #007bff;
    margin-bottom: 4px;
}

.measurement-notes {
    font-size: 13px;
    color: #6c757d;
    font-style: italic;
}

.no-data, .error {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

.error {
    color: #dc3545;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

/* Estilos para tipo de medición en última medición */
.measurement-type {
    display: block;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    margin-top: 2px;
    font-style: italic;
}

/* Mediciones de hoy */
.today-section {
    margin: 20px 0;
}

.today-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

[data-theme="dark"] .today-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.today-card h3 {
    margin: 0 0 16px 0;
    color: #1f2937;
    font-size: 1.2rem;
    font-weight: 600;
}

[data-theme="dark"] .today-card h3 {
    color: var(--text-primary);
}

.measurements-timeline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.today-section .measurement-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

[data-theme="dark"] .today-section .measurement-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

.today-section .measurement-time {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.time-label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

[data-theme="dark"] .time-label {
    color: #000;
}

[data-theme="dark"] .modal label {
    color: #000;
}

/* Estilos para modo oscuro del input de glucosa */
[data-theme="dark"] #selectedGlucose {
    color: #60a5fa;
    background: transparent;
}

[data-theme="dark"] .glucose-unit {
    color: #9ca3af;
}

[data-theme="dark"] .picker-arrow {
    background: #374151;
    border-color: #4b5563;
    color: #9ca3af;
}

[data-theme="dark"] .picker-arrow:hover {
    background: #4b5563;
    color: #60a5fa;
}

[data-theme="dark"] .picker-arrow:active {
    background: #6b7280;
}

.time-value {
    font-size: 0.8rem;
    color: #6b7280;
}

[data-theme="dark"] .time-value {
    color: #000;
}

.today-section .measurement-value {
    font-weight: 600;
    font-size: 1rem;
    padding: 6px 12px;
    border-radius: 6px;
}

.today-section .measurement-value.glucose-normal {
    background: #d1fae5;
    color: #065f46;
}

[data-theme="dark"] .today-section .measurement-value.glucose-normal {
    background: #064e3b;
    color: #6ee7b7;
}

.today-section .measurement-value.glucose-high {
    background: #fee2e2;
    color: #000;
}

[data-theme="dark"] .today-section .measurement-value.glucose-high {
    background: #7f1d1d;
    color: #fff;
}

.today-section .measurement-value.glucose-low {
    background: #fef3c7;
    color: #92400e;
}

[data-theme="dark"] .today-section .measurement-value.glucose-low {
    background: #78350f;
    color: #fcd34d;
}

/* Corregir color de fondo del valor de última medición en modo oscuro */
#lastMeasurementValue.glucose-normal {
    background: #d1fae5;
    color: #065f46;
    padding: 4px 8px;
    border-radius: 4px;
}

[data-theme="dark"] #lastMeasurementValue.glucose-normal {
    background: #064e3b;
    color: #6ee7b7;
}

#lastMeasurementValue.glucose-high {
    background: #fee2e2;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
}

[data-theme="dark"] #lastMeasurementValue.glucose-high {
    background: #7f1d1d;
    color: #fff;
}

#lastMeasurementValue.glucose-low {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 8px;
    border-radius: 4px;
}

[data-theme="dark"] #lastMeasurementValue.glucose-low {
    background: #78350f;
    color: #fcd34d;
}