/* Importar la fuente Inter de Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

/* --- ESTILOS GLOBALES Y FOOTER --- */
html {
    height: 100%;
}

body {
    background: #f7f7fc;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    color: #2b2171;
    margin: 0;
    padding: 0;
    /* --- Estructura para Footer Pegajoso --- */
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

main {
    flex: 1 0 auto; /* Permite que el contenido principal crezca */
    max-width: 900px;
    margin: 32px auto;
    padding: 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(43, 33, 113, 0.08);
    text-align: center;
}

footer {
    flex-shrink: 0; /* Evita que el footer se encoja */
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    font-size: 0.85em;
    color: #888;
    background-color: #fff;
    border-top: 1px solid #f0f0f0;
}

footer p {
    margin: 2px 0;
}

footer a {
    color: #1a61c4;
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}


/* --- ESTILOS DE LA PÁGINA EULA --- */
.eula-container {
    max-width: 800px;
    margin: 32px auto;
    padding: 20px 30px;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(43, 33, 113, 0.08);
}
.eula-container h1 {
    color: #1a61c4;
    text-align: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}
.eula-container h2 {
    color: #2b2171;
    margin-top: 30px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
}
.eula-container p, .eula-container ul {
    text-align: justify;
    line-height: 1.6;
}


/* --- OTROS ESTILOS DE LA APLICACIÓN --- */
.logo { max-width: 160px; margin-bottom: 20px; }
.bienvenida { font-size: 2.1rem; font-weight: 700; color: #2b2171; margin-bottom: 8px; }
.subbienvenida { font-size: 1.25rem; margin-top: 0; margin-bottom: 24px; letter-spacing: 0.01em; color: #5f5897; font-weight: 400; }

/* --- ESTILOS GENERALES DE FORMULARIO --- */
input[type="password"], input[type="text"], select, input[type="date"], input[type="time"], input[type="file"] {
    border: 1px solid #c9c7e0;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 0 4px;
    font-size: 1rem;
    box-sizing: border-box;
    font-family: inherit;
    background-color: #fff;
}
input[type="password"]:focus, input[type="text"]:focus, select:focus, input[type="date"]:focus, input[type="time"]:focus {
    outline: 2px solid #a3a0d8;
    border-color: #5f5897;
}
label { font-family: inherit; margin: 0 4px; vertical-align: middle; color: #5f5897; font-weight: 400; }
button { background: #10a37f; color: #fff; border: none; border-radius: 8px; padding: 9px 22px; margin: 0 4px; font-size: 1rem; font-weight: 400; cursor: pointer; transition: background 0.18s; vertical-align: middle; }
button:hover { background: #0d8a6a; }
button:disabled { background: #cccccc; cursor: not-allowed; }
button.editar-btn { background: #ffc107; color: #212529; }
button.editar-btn:hover { background: #ffca2c; }
button.eliminar-btn { background: #dc3545; color: #fff; }
button.eliminar-btn:hover { background: #bb2d3b; }
button#btnSalida, button.detalle-btn { background: #0d6efd; color: #fff; }
button#btnSalida:hover, button.detalle-btn:hover { background: #0b5ed7; }

/* --- SECCIONES DEL PANEL DE ADMIN --- */
#adminPanel h2, #adminPanel h3, main > h2 { font-weight: 700; }
#adminPanel h3 { text-align: left; border-bottom: 1px solid #eee; padding-bottom: 8px; margin-top: 2em; }
.panel-form { padding: 16px; background: #fafafd; border-radius: 8px; border: 1px solid #ececec; margin-bottom: 1em; text-align: left; }
.panel-form h4 { margin-top: 0; margin-bottom: 1em; color: #2b2171; font-weight: 600; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 600; color: #5f5897; font-size: 0.9rem; }
.form-inline-group { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.form-inline-group label { display: inline-block; margin-bottom: 0; font-weight: 400; }
.form-inline-group button { margin-left: auto; }

/* --- TABLAS --- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.97rem; }
th, td { border: 1px solid #ececec; padding: 10px 8px; text-align: center; vertical-align: middle; white-space: nowrap; }
th { background: #f8f9fa; color: #2b2171; font-weight: 600; }

/* --- ESTILOS PARA CREAR HORARIO (DENTRO DEL MODAL) --- */
.employee-schedule-card { border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px; margin-bottom: 16px; background: #fff; }
.employee-schedule-card .card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.employee-schedule-card h3 { margin: 0; text-align: left; font-size: 1.2rem; color: #2b2171; }
.hours-counter { font-weight: 600; font-size: 1.1rem; color: #0d6efd; background-color: #e7f0ff; padding: 4px 8px; border-radius: 6px; }
.days-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; }
.day-input-group { display: flex; flex-direction: column; align-items: center; }
.day-input-group label { font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.day-input-group .time-input { width: 100px; padding: 6px; font-size: 0.9rem; margin-bottom: 4px; text-align: center; }
.split-shift-control { display: flex; align-items: center; margin-top: 8px; }
.split-shift-control input[type="checkbox"] { margin-right: 6px; }
.split-shift-control label { font-size: 0.8rem; font-weight: 400; color: #5f5897; }
#summary-table { margin-top: 1em; }
#summary-table td:last-child { font-weight: 600; }
.actions-footer { margin-top: 24px; text-align: right; }

/* --- ESTILOS PARA MODALES --- */
#modal-container {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(43, 33, 113, 0.6);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}
.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 25px;
    border: 1px solid #888;
    width: 90%;
    max-width: 950px;
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    animation: slideIn 0.4s ease-out;
}
.close-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-modal:hover, .close-modal:focus {
    color: #333;
    text-decoration: none;
}

/* Animaciones para el modal */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes slideIn { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-50px); opacity: 0; } }

/* --- OTROS ESTILOS --- */
.nombre-colaborador{color:#ff914d!important;font-size:2.1rem;font-weight:700;margin-bottom:18px!important;margin-top:10px!important;text-align:center;z-index:10;background:#fff}
#selfieArea{display:flex;flex-direction:column;align-items:center;justify-content:center;margin-top:16px!important}
#selfieArea img,#selfieArea video,#selfieArea canvas{display:block;margin:0 auto 12px auto;max-width:320px;border-radius:12px}
hr{border:none;border-top:1px solid #eee;margin:24px 0}
.summary-card {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    text-align: left;
}
.summary-card h4 { margin-top: 0; margin-bottom: 1rem; color: #343a40; text-align: center; }
.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; font-size: 0.9rem; }
.summary-grid div { background-color: #fff; padding: 8px 12px; border-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.summary-grid span { color: #6c757d; }
.summary-grid strong { color: #212529; float: right; }

.status-badge {
    display: inline-block;
    background-color: #ffebee; /* Un fondo rojo muy claro */
    color: #c62828; /* Texto rojo oscuro */
    padding: 2px 8px;
    border-radius: 12px; /* Bordes redondeados */
    font-size: 0.6em; /* Más pequeño que el título */
    font-weight: 700;
    vertical-align: middle; /* Alineado con el texto del título */
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- MEDIA QUERIES PARA RESPONSIVE DESIGN --- */
@media (max-width: 700px) {
    body {
        min-height: -webkit-fill-available; /* Fix para iOS */
    }
    main { 
        max-width: 100%;
        margin: 0;
        padding: 12px;
        border-radius: 0;
        box-shadow: none;
    }
    .bienvenida { font-size: 1.8rem; }
    .subbienvenida { font-size: 1.1rem; }
    table, th, td { font-size: 0.87rem; }
    .form-inline-group { 
        flex-direction: column; 
        align-items: stretch; 
    }
    .form-inline-group input, .form-inline-group select {
        width: 100%;
        margin: 0 0 8px 0;
    }
    .form-inline-group button { 
        margin-left: 0; 
        width: 100%; 
    }
    td .actions-container {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    td .actions-container button {
        width: 100%;
        margin: 0;
    }
    #loginForm {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    #loginForm .label-pin {
        margin-bottom: 0;
    }
    #loginForm input[type="password"] {
        width: 80%;
        max-width: 280px;
        margin: 0;
        text-align: center;
        font-size: 1.2rem;
    }
    #loginForm button {
        width: 80%;
        max-width: 280px;
        margin: 0;
    }
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 15px;
    }
}