@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap');

/* --- BASES Y PALETA --- */
body { 
    font-family: 'Inter', sans-serif; 
    background-color: #f2f3fa; 
    margin: 0; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    min-height: 100dvh; 
    user-select: none; -webkit-user-select: none; touch-action: manipulation; 
    color: #333;
}

/* --- REGLA DE ORO: IMÁGENES RESPONSIVE (SOLUCIÓN AL LOGO GIGANTE) --- */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- LÓGICA DE PANTALLAS (SPA) --- */
.screen { display: none; animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1); width: 100%; }
.active { display: block; }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* --- CONTENEDOR PRINCIPAL --- */
.container { 
    background: #ffffff; width: 90%; max-width: 420px; padding: 30px; 
    border-radius: 16px; box-shadow: 0 10px 40px rgba(45, 71, 152, 0.10); 
    text-align: center; position: relative; overflow: hidden; 
    box-sizing: border-box; border: 1px solid #f0f0f0;
    min-height: 500px; display: flex; flex-direction: column;
}

/* --- LOGO Y TIPOGRAFÍA --- */
h2 { color: #2d4798; margin-top: 0; font-weight: 700; font-size: 20px; margin-bottom: 20px;}

.logo-area { margin-bottom: 25px; }

/* Clase específica para el logo (Control preciso) */
.logo-img { 
    width: 180px;         /* Tamaño base ideal */
    max-width: 80%;       /* Nunca ocupará más del 80% del ancho del móvil */
    margin: 0 auto 10px;  /* Centrado */
    object-fit: contain;
}

.logo-sub { color: #c1c1c2; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; margin-top: 5px; margin-bottom: 25px;}

/* --- FORMULARIOS --- */
label { display: block; text-align: left; margin: 15px 0 6px; color: #2d4798; font-size: 12px; font-weight: 700; text-transform: uppercase; }

select, input, textarea { 
    width: 100%; padding: 14px; margin-top: 0; 
    border: 1px solid #c1c1c2; border-radius: 8px; box-sizing: border-box; 
    background: #fff; font-family: inherit; font-size: 16px; transition: border 0.2s;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: #2d4798; background-color: #fcfcfc; }

/* Icono Ojo Contraseña */
.input-wrapper { position: relative; width: 100%; }
.password-toggle { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); cursor: pointer; font-size: 18px; color: #c1c1c2; background: none; border: none; padding: 0; }
.password-toggle:hover { color: #2d4798; }

/* --- BOTONES --- */
.btn-main { 
    background: #2d4798; color: white; width: 100%; padding: 16px; 
    border: none; border-radius: 10px; font-size: 15px; font-weight: 600; 
    cursor: pointer; box-shadow: 0 4px 12px rgba(45, 71, 152, 0.25); 
    transition: transform 0.1s, background 0.2s; margin-top: 25px; 
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-main:active { transform: scale(0.97); background: #1f3370; }
.btn-main:disabled { background: #ccc; box-shadow: none; cursor: not-allowed; }

.btn-secondary { background: #f2f3fa; color: #555; border: 1px solid #e0e0e0; box-shadow: none; margin-top: 15px; color: #2d4798;}
.btn-secondary:active { background: #e6e8f0; }

.btn-back { position: absolute; top: 20px; left: 20px; background: none; border: none; color: #c1c1c2; font-size: 24px; cursor: pointer; padding: 0; line-height: 1; transition: color 0.2s; z-index: 10;}
.btn-back:hover { color: #2d4798; }

/* --- UTILIDADES --- */
.hidden { display: none !important; }
.ninja { display: none; opacity: 0; position: absolute; left: -9999px; }
.error-msg { color: #dc3545; font-size: 13px; margin-top: 15px; font-weight: 600; min-height: 18px;}

/* =========================================
   ELEMENTOS ESPECÍFICOS (LISTAS Y GRID)
   ========================================= */

/* MENU GRID (Tarjetas) */
.menu-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 10px; }
.card { 
    background: white; border: 1px solid #e0e0e0; border-radius: 12px; 
    padding: 20px 15px; text-align: center; cursor: pointer; 
    transition: 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.03); 
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.card:active { transform: scale(0.98); background: #f9fafc; border-color: #2d4798; }
.card-icon { font-size: 28px; margin-bottom: 8px; display: block; }
.card-title { font-size: 13px; font-weight: 600; color: #333; }

/* LISTA DE EMPLEADOS */
.emp-list { list-style: none; padding: 0; margin: 20px 0 0 0; text-align: left; max-height: 400px; overflow-y: auto;}
.emp-item { 
    background: #fff; border-bottom: 1px solid #f0f0f0; 
    padding: 12px 5px; display: flex; 
    justify-content: space-between; align-items: center; 
}
.emp-info { display: flex; flex-direction: column; }
.emp-initials { font-weight: 800; color: #2d4798; font-size: 15px; }
.emp-name { font-size: 12px; color: #888; margin-top: 2px; }

/* Estado Inactivo (Gris) */
.emp-item.inactive .emp-initials { color: #aaa; }
.emp-item.inactive .emp-name { text-decoration: line-through; }

/* SWITCH TOGGLE */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #e0e0e0; transition: .4s; border-radius: 34px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
input:checked + .slider { background-color: #2d4798; }
input:checked + .slider:before { transform: translateX(20px); }

/* LOADER */
.loader { border: 3px solid rgba(45, 71, 152, 0.1); border-top: 3px solid #2d4798; border-radius: 50%; width: 24px; height: 24px; animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* LOGS */
#status-log { margin-top: 15px; font-family: monospace; font-size: 11px; color: #666; background: #f8f9fa; padding: 10px; border-radius: 6px; display: none; text-align: left;}