/* --- TOASTS --- */
#toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 400px;
}

.toast {
    background: #1e293b;
    color: white;
    padding: 14px 20px;
    border-radius: 2px; /* Aspecto cuadrado */
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 5px solid var(--primary); /* Línea lateral gruesa */
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease-out;
}

.toast.active {
    transform: translateY(0);
    opacity: 1;
}

.toast-error { border-left-color: var(--danger); }
.toast-success { border-left-color: var(--primary); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: #3b82f6; } /* Azul info */



/* --- MODALS --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s;
}

.modal-overlay.active { opacity: 1; pointer-events: all; }

.modal-content {
    background: var(--bg-panel);
    width: 90%;
    max-width: 400px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transform: translateY(20px);
    transition: 0.3s;
}

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

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 50%;
}

.close-modal:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

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

.modal-body::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 10px;
}

.res-date-info {
    text-align: center;
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-light);
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-weight: 700;
    font-size: 1.1rem;
}

.res-options-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 15px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.res-option { display: flex; justify-content: space-between; align-items: center; }
.res-option strong { display: block; font-size: 0.9rem; }
.res-option span { font-size: 0.7rem; color: var(--text-muted); }

/* Toggle Switch */
.toggle-switch { position: relative; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: var(--bg-dark); border-radius: 0; transition: .4s; }
.slider:before { position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px; background: white; transition: .4s; border-radius: 0; }
input:checked + .slider { background: var(--primary); }
input:checked + .slider:before { transform: translateX(20px); }

.hidden { display: none !important; }



/* --- FORMULARIOS UNIFICADOS --- */
.field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}
.field-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    min-height: 2.4em; /* Asegurar alineación si hay 2 líneas */
    display: flex;
    align-items: flex-end;
    margin-bottom: 4px;
}
.field-label--warning { color: var(--warning); }
.field-label--danger  { color: var(--danger);  }
.field-label--info    { color: #3b82f6;         }
.field-label--success { color: var(--primary);  }

.field-input {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 0;
    color: var(--text-color);
    padding: 12px 14px;
    font-family: inherit;
    font-size: 0.9rem;
    transition: border-color 0.2s;
}
.field-input:focus {
    outline: none;
    border-color: var(--primary);
}
.field-input--password {
    padding-left: 45px; /* Modificado para ojo a la izquierda */
}

/* Corrección de altura/padding para evitar heredar los estilos gigantes del login,
   pero manteniendo el espacio a la izquierda para el icono del ojo */
.input-wrapper input.field-input {
    padding: 12px 14px 12px 45px !important;
    font-size: 0.9rem !important;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 15px;
}
.field-row--4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 15px;
}

@media (max-width: 992px) {
    .field-row--4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .field-row { grid-template-columns: 1fr; gap: 10px; }
    .field-row--4 { grid-template-columns: 1fr; gap: 10px; }
}



/* --- BOTÓN SECUNDARIO (outline) --- */
.btn-secondary-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 0;
}
.btn-secondary-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}



/* --- BOTÓN PELIGRO --- */
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }



/* --- BOTÓN WARNING --- */
.btn-warning { background: var(--warning); color: black; }
.btn-warning:hover { background: #d97706; }



/* --- TOGGLE ROW (opciones con switch) --- */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.toggle-row-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 2px;
}



/* --- STRENGTH BAR (contraseña) --- */
.strength-bar-wrapper {
    height: 4px;
    background: rgba(255,255,255,0.05);
    width: 100%;
    margin-top: 8px;
    overflow: hidden;
}
.strength-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--danger);
    transition: all 0.3s;
}
.strength-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.strength-hint {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
}
.strength-value {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--danger);
}



/* --- PASSWORD REQ LIST --- */
.req-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}
.req-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}
.req-item i { font-size: 1rem; }



/* --- PASSWORD FIELD WRAPPER (Simplificado) --- */
.input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.input-wrapper i:not(.toggle-pass) {
    position: absolute;
    left: 15px;
    z-index: 10;
    color: var(--text-muted);
}

.input-wrapper input {
    padding-left: 45px !important;
    width: 100%;
}



/* --- SELECT UNIFICADO --- */
.field-select {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 0;
    color: var(--text-color);
    padding: 12px 14px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
}
.field-select:focus {
    outline: none;
    border-color: var(--primary);
}



/* --- INTERACTIVE DIALOGS (v1.4.0) --- */
.dialog-content {
    padding: 10px 5px;
}

.dialog-message {
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 20px;
}

.dialog-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.dialog-actions .btn {
    flex: 1;
}

/* Animación de pulso para iconos de alerta en diálogos */
@keyframes dlg-icon-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

#modal-title i {
    margin-right: 10px;
    font-size: 1.4rem;
    vertical-align: middle;
}

#modal-title i.ri-error-warning-fill {
    animation: dlg-icon-pulse 2s infinite ease-in-out;
}

.btn-warning { background: var(--warning); color: black; }
.btn-danger { background: var(--danger); color: white; }
.btn-success { background: var(--primary); color: white; }
.btn-info { background: #3b82f6; color: white; }

.btn-secondary-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
}

.btn-secondary-outline:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

/* Estilos extra para el prompt input */
#dlg-input {
    background: var(--bg-dark) !important;
    border: 1px solid var(--border-color) !important;
    color: white !important;
    width: 100% !important;
}

#dlg-input:focus {
    border-color: var(--primary) !important;
    outline: none;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

/* ══════════════════════════════════════════════════════
   ADMIN PANEL — MONOCHROME THEME
   Mismo lenguaje visual que el resto de la app:
   fondo muy oscuro, texto blanco apagado, sin colores.
   ══════════════════════════════════════════════════════ */

/* Contenedor */
#admin-section .profile-card, 
#superadmin-section .profile-card,
#stats-view .profile-card {
    background: transparent;
    padding: 0;
    box-shadow: none;
    display: block;  /* Evita el colapso de flex-column sin height en contextos scroll */
}

/* Todos los paneles: igual, planos, oscuros */
#admin-section .panel, 
#superadmin-section .panel,
#admin-section .panel--warning, 
#superadmin-section .panel--warning,
#admin-section .panel--danger, 
#superadmin-section .panel--danger,
#admin-section .panel--info, 
#superadmin-section .panel--info,
#admin-section .panel--success, 
#superadmin-section .panel--success,
#stats-view .panel,
#stats-view .panel--warning,
#perfil-section .panel,
#perfil-section .panel--success {
    background: var(--bg-panel) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 0 !important;
    margin-bottom: 2px !important;
    padding: 20px !important;
    box-shadow: none !important;
}

/* Títulos: pequeños, uppercase, muted — sin colores */
#admin-section .panel-title, 
#superadmin-section .panel-title,
#admin-section .panel-title--warning, 
#superadmin-section .panel-title--warning,
#admin-section .panel-title--danger, 
#superadmin-section .panel-title--danger,
#admin-section .panel-title--info, 
#superadmin-section .panel-title--info,
#admin-section .panel-title--success, 
#superadmin-section .panel-title--success,
#stats-view .panel-title,
#stats-view .panel-title--warning,
#perfil-section .panel-title,
#perfil-section .panel-title--success {
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    color: var(--text-muted) !important;
    text-transform: uppercase !important;
    letter-spacing: 1.5px !important;
    padding-bottom: 12px !important;
    margin-bottom: 14px !important;
    border-bottom: 1px solid var(--border-color) !important;
    background: none !important;
}

/* Icono en el título: solo en color primary de la app */
#admin-section .panel-title i, 
#superadmin-section .panel-title i,
#stats-view .panel-title i,
#perfil-section .panel-title i {
    color: var(--primary) !important;
    font-size: 0.9rem !important;
}

/* Descripción */
#admin-section .panel-desc, 
#superadmin-section .panel-desc,
#stats-view .panel-desc,
#perfil-section .panel-desc {
    font-size: 0.75rem !important;
    color: var(--text-muted) !important;
    margin-bottom: 16px !important;
}

/* Labels — sin colores por tipo */
#admin-section .field-label, 
#superadmin-section .field-label,
#admin-section .field-label--warning, 
#superadmin-section .field-label--warning,
#admin-section .field-label--danger, 
#superadmin-section .field-label--danger,
#admin-section .field-label--info, 
#superadmin-section .field-label--info,
#stats-view .field-label,
#stats-view .field-label--warning,
#perfil-section .field-label,
#perfil-section .field-label--success {
    color: var(--text-muted) !important;
    font-size: 0.62rem !important;
    font-weight: 800 !important;
}

/* Badge de config actual */
#admin-section .config-badge , 
#superadmin-section .config-badge {
    background: rgba(0,0,0,0.25) !important;
    border-left: 2px solid var(--primary) !important;
    border-top: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-radius: 0 !important;
    font-size: 0.75rem !important;
    color: var(--text-muted) !important;
}
#admin-section .config-badge span , 
#superadmin-section .config-badge span { color: var(--primary-light) !important; }

/* Toggle rows */
#admin-section .toggle-row, 
#superadmin-section .toggle-row,
#perfil-section .toggle-row {
    border-bottom: 1px solid var(--border-color) !important;
    padding: 12px 0 !important;
    background: transparent !important;
}
#admin-section .toggle-row-label, 
#superadmin-section .toggle-row-label,
#perfil-section .toggle-row-label {
    font-size: 0.75rem !important;
    color: var(--text-color) !important;
    font-weight: 700 !important;
}

/* Subheader SMTP */
#admin-section h4 , 
#superadmin-section h4 {
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    color: var(--text-muted) !important;
    margin: 20px 0 12px !important;
    padding-bottom: 8px !important;
    border-bottom: 1px solid var(--border-color) !important;
}
#admin-section h4 i , 
#superadmin-section h4 i { color: var(--primary) !important; }

/* Botones: neutralizar colores sólidos */
#admin-section .btn-warning , 
#superadmin-section .btn-warning {
    background: transparent !important;
    color: var(--text-color) !important;
    border: 1px solid var(--border-color) !important;
}
#admin-section .btn-warning:hover , 
#superadmin-section .btn-warning:hover {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
}
#admin-section .btn-danger , 
#superadmin-section .btn-danger {
    background: transparent !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border-color) !important;
}
#admin-section .btn-danger:hover , 
#superadmin-section .btn-danger:hover {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}
#admin-section .btn-block.btn-warning, 
#superadmin-section .btn-block.btn-warning,
#admin-section .btn-block.btn-danger, 
#superadmin-section .btn-block.btn-danger,
#perfil-section .btn-block.btn-primary {
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    text-transform: uppercase !important;
}

/* Tabla de usuarios */
#admin-section .user-table-wrapper , 
#superadmin-section .user-table-wrapper {
    border: 1px solid var(--border-color) !important;
    background: var(--bg-dark) !important;
    border-radius: 0 !important;
}
#admin-section .user-table th , 
#superadmin-section .user-table th {
    background: var(--bg-panel) !important;
    color: var(--text-muted) !important;
    font-size: 0.62rem !important;
    padding: 10px 15px !important;
}
#admin-section .user-name , 
#superadmin-section .user-name { color: var(--text-color) !important; font-size: 0.9rem !important; }
#admin-section .user-role , 
#superadmin-section .user-role { color: var(--text-muted) !important; font-size: 0.65rem !important; }
#admin-section .login-value , 
#superadmin-section .login-value { color: var(--text-muted) !important; }

/* Separadores entre paneles admin */
#admin-section .field-separator , 
#superadmin-section .field-separator {
    border-top: 1px solid var(--border-color) !important;
    margin: 15px 0 !important;
}

/* === FIN ADMIN MONOCHROME THEME === */

/* ================================================================
   STATS DASHBOARD V4.1.0 — Integrado con look de la app
   ================================================================ */



/* --- INLINE FLEX ROW --- */
.flex-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 10px;
}
.flex-row .field-group { margin-bottom: 0; flex: 1; }



/* --- HINT TEXT --- */
.field-hint {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 4px;
}



/* --- SEPARADOR --- */
.section-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
}



/* --- CHECKBOX CHIPS (Wizard/Admin) --- */
.checkbox-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    margin-right: 8px;
    margin-bottom: 8px;
}

.checkbox-chip:hover {
    background: rgba(255,255,255,0.06);
    border-color: var(--chip-color, rgba(255,255,255,0.2));
}

.checkbox-chip input {
    display: none;
}

.checkbox-chip .chip-check {
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: transparent;
    transition: all 0.2s;
    border-radius: 2px;
}

.checkbox-chip input:checked + .chip-check {
    background: var(--chip-color, var(--primary));
    border-color: var(--chip-color, var(--primary));
    color: white;
}

.checkbox-chip:has(input:checked) {
    border-color: var(--chip-color, var(--primary));
    background: rgba(255,255,255,0.05);
}

.checkbox-chip span {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.checkbox-chip input:checked ~ span {
    color: white;
}
