:root {
    --primary: #2a9d8f;
    --dark: #1d3557;
    --accent: #e63946;
    --white: #ffffff;
    --bg-light: #f4f7f6;
    --shadow: 0 10px 25px rgba(0,0,0,0.1);
    --success: #2a9d8f;
    --danger: #e63946;
    --gray: #777;
}

* { box-sizing: border-box; }

body, html { 
    margin: 0; 
    padding: 0; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: var(--bg-light); 
    color: #333;
}

/* =========================================
   LOGIN ESTILIZADO
   ========================================= */
.login-page { 
    height: 100vh; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    position: relative; 
    overflow: hidden;
}

.login-bg { 
    position: absolute; 
    width: 100%; 
    height: 100%; 
    background: linear-gradient(135deg, var(--dark) 0%, #111 100%); 
    z-index: -1; 
}

.login-card { 
    background: white; 
    padding: 40px 30px; 
    border-radius: 20px; 
    width: 90%;
    max-width: 380px; 
    text-align: center; 
    box-shadow: 0 15px 35px rgba(0,0,0,0.3); 
    position: relative;
}

/* Círculo de Perfil */
.profile-circle { 
    width: 90px; 
    height: 90px; 
    background: #f0f0f0; 
    border-radius: 50%; 
    margin: -85px auto 20px; 
    border: 5px solid white; 
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.profile-circle img { width: 100%; height: 100%; object-fit: cover; }

.login-card h2 { color: var(--dark); margin: 10px 0 5px; font-size: 1.5rem; }
.login-card .subtitle { color: var(--gray); font-size: 0.9rem; margin-bottom: 25px; }

/* Inputs Login */
.login-card .input-group { text-align: left; margin-bottom: 15px; }
.login-card .input-group label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 5px; color: #555; }
.login-card input[type="text"], .login-card input[type="password"] {
    width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 8px; transition: 0.3s;
}

/* Checkbox Login */
.options-row { margin: 15px 0; text-align: left; }
.checkbox-container { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: #666; cursor: pointer; user-select: none; }
.checkbox-container input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }

/* Botón Login y Footer */
.btn-login { width: 100%; padding: 14px; background-color: var(--dark); color: white; border: none; border-radius: 8px; font-size: 1rem; font-weight: bold; cursor: pointer; margin-top: 10px; transition: background 0.3s, transform 0.2s; }
.btn-login:hover { background-color: var(--primary); transform: translateY(-2px); }
.login-footer { margin-top: 25px; }
.forgot-link { font-size: 0.8rem; color: #999; text-decoration: none; transition: color 0.3s; }
.forgot-link:hover { color: var(--accent); text-decoration: underline; }

/* =========================================
   LAYOUT DASHBOARD
   ========================================= */
.admin-container { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { 
    width: 260px; 
    background: var(--dark); 
    color: white; 
    height: 100vh; 
    position: fixed; 
    padding: 25px; 
    display: flex; 
    flex-direction: column; 
    z-index: 100;
}
.sidebar-header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.logo-circle-small { font-size: 1.5rem; }
.sidebar-nav { display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
.nav-btn { 
    padding: 12px 15px; 
    background: transparent; 
    border: none; 
    color: #a8dadc; 
    text-align: left; 
    cursor: pointer; 
    border-radius: 10px; 
    font-size: 1rem; 
    text-decoration: none; 
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
}
.nav-btn i { width: 20px; text-align: center; }
.nav-btn.active, .nav-btn:hover { background: var(--primary); color: white; }

/* Contenido Principal */
.admin-content { 
    margin-left: 260px; 
    padding: 40px; 
    width: calc(100% - 260px); 
}

/* =========================================
   TARJETAS DEL PANEL (CARDS)
   ========================================= */
.admin-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 25px; 
    margin-top: 20px;
    align-items: start; /* Evita que las tarjetas se estiren verticalmente de más */
}

.admin-card { 
    background: white; 
    padding: 25px; 
    border-radius: 15px; 
    border: 1px solid #eee; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.02); 
}

.admin-card h3 { 
    margin: 0 0 20px 0; 
    color: var(--dark); 
    border-bottom: 2px solid var(--primary); 
    padding-bottom: 10px; 
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Formularios dentro de las tarjetas */
.form-group { margin-bottom: 15px; display: flex; flex-direction: column; }
.form-group label { font-size: 0.9rem; font-weight: 600; color: #555; margin-bottom: 5px; }

input[type="text"], 
input[type="number"], 
input[type="password"], 
input[type="color"], 
input[type="file"], 
select {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
    background: white;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.1); }
input[type="color"] { padding: 5px; cursor: pointer; height: 40px; }

/* ESTILOS DEL SWITCH */
.switch-container { position: relative; display: inline-block; width: 54px; height: 28px; }
.switch-container input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--success); }
input:focus + .slider { box-shadow: 0 0 1px var(--success); }
input:checked + .slider:before { transform: translateX(26px); }

/* TABLAS */
.table-container, .editor-table-container { background: white; border-radius: 15px; overflow-x: auto; margin-top: 20px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); }
.admin-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.admin-table th { background: #f8f9fa; color: var(--dark); font-weight: 600; }
.admin-table th, .admin-table td { padding: 15px; text-align: left; border-bottom: 1px solid #eee; vertical-align: middle; }
.table-img { width: 45px; height: 45px; object-fit: cover; border-radius: 8px; border: 1px solid #ddd; }

/* BOTONES GLOBALES */
button { transition: 0.3s; cursor: pointer; }
button:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: white; border: none; padding: 10px 20px; border-radius: 8px; font-weight: 600; display: inline-block; text-align: center; }
.btn-promo { background: var(--accent); color: white; border: none; padding: 12px; border-radius: 8px; font-weight: bold; text-align: center; }
.btn-logout { background: rgba(255,255,255,0.1); border: none; color: white; padding: 12px; border-radius: 8px; margin-top: auto; }
.btn-logout:hover { background: var(--accent); }
.btn-add { background: var(--primary); color: white; border: none; padding: 10px 15px; border-radius: 8px; }

/* UTILIDADES */
.hidden { display: none !important; }
.w-100 { width: 100%; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.action-buttons { display: flex; gap: 8px; }
.btn-edit { color: #f39c12; background: #fdf5e6; border: none; padding: 8px 12px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;}
.btn-delete { color: #e74c3c; background: #fbeee0; border: none; padding: 8px 12px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;}

/* MODAL */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: none; justify-content: center; align-items: center; z-index: 1000; padding: 20px; }
.modal-content { background: white; padding: 30px; border-radius: 20px; width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* RESPONSIVO */
@media (max-width: 768px) {
    .sidebar { width: 100%; height: auto; position: relative; padding: 15px; }
    .admin-content { margin-left: 0; width: 100%; padding: 20px; }
    .admin-container { flex-direction: column; }
    .admin-grid { grid-template-columns: 1fr; }
}


/* --- ESTILOS PARA CONFIGURACIÓN DE USUARIO --- */
.input-with-btn {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-with-btn input {
    flex-grow: 1; /* El input ocupa todo el espacio posible */
}

.btn-icon {
    background: #f0f0f0;
    border: 1px solid #ddd;
    color: var(--dark);
    width: 45px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: 0.3s;
}

.btn-icon:hover {
    background: #e2e2e2;
    color: var(--primary);
}

.btn-secondary {
    background: #e9ecef;
    color: #333;
    border: none;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: 0.3s;
}

.btn-secondary:hover {
    background: #dee2e6;
}

.pass-section-box {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 10px;
}

.mb-0 { margin-bottom: 0 !important; }



/* --- RECUPERACIÓN DE CONTRASEÑA --- */
.relative-box { position: relative; }

.btn-back-corner {
    position: absolute;
    top: -20px;
    left: -10px;
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}
.btn-back-corner:hover { color: var(--dark); }

.method-box {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 12px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: 0.3s;
    text-align: left;
}
.method-box:hover {
    border-color: var(--primary);
    background: rgba(42, 157, 143, 0.05);
}
.method-icon {
    font-size: 2rem;
    color: var(--dark);
}
.method-text h3 { margin: 0; font-size: 1.1rem; color: var(--dark); }
.method-text p { margin: 5px 0 0 0; font-size: 0.8rem; color: var(--gray); line-height: 1.3; }

.code-inputs-container {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 20px 0;
}
.code-input {
    width: 45px !important;
    height: 55px;
    font-size: 1.5rem !important;
    text-align: center;
    font-weight: bold;
    border: 2px solid #ddd !important;
    border-radius: 10px !important;
    padding: 0 !important;
}
.code-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 10px rgba(42, 157, 143, 0.2) !important;
}

/* ====================================================
   MEJORAS ESTÉTICAS DE INPUTS Y BOTONES
   ==================================================== */

/* --- 1. Botón de "Seleccionar Archivo" Moderno --- */
input[type="file"] {
    width: 100%;
    padding: 8px;
    background: #fdfdfd;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

input[type="file"]:hover {
    border-color: var(--primary, #2a9d8f);
    background: #f4fbf9;
}

/* El botoncito interno que dice "Elegir archivo" */
input[type="file"]::file-selector-button {
    background-color: var(--dark, #1d3557);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 15px;
    font-weight: bold;
    font-size: 0.8rem;
    transition: background 0.3s ease, transform 0.2s ease;
}

input[type="file"]::file-selector-button:hover {
    background-color: var(--primary, #2a9d8f);
}

/* --- 2. Cajas de Texto (Gmail, Teléfono, Contraseñas, etc.) --- */
.admin-card input[type="text"],
.admin-card input[type="email"],
.admin-card input[type="tel"],
.admin-card input[type="number"],
.admin-card input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background-color: #f9fafb;
    color: #374151;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

/* Cuando haces clic en la caja de texto (Focus) */
.admin-card input:focus {
    border-color: var(--primary, #2a9d8f);
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.15); /* Halo de luz brillante */
}

/* --- 3. Selector de Fecha y Hora (Promos) --- */
input[type="datetime-local"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background-color: #f9fafb;
    color: #374151;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

input[type="datetime-local"]:focus,
input[type="datetime-local"]:hover {
    border-color: var(--danger, #e63946); /* Le ponemos rojo para que destaque que es una Promo */
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.15);
}

/* --- 4. Ajuste al input con botón del ojo (Contraseñas) --- */
.input-with-btn {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-btn input {
    padding-right: 45px !important; /* Espacio para que el texto no pise al ojo */
}

.input-with-btn .btn-icon {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: 0.2s;
}

.input-with-btn .btn-icon:hover {
    color: var(--primary, #2a9d8f);
    background: #f3f4f6;
}
