@charset "UTF-8";

:root {
    --color-bg: #e9f1f5;
    --color-text: #2c3e50;
    --color-btn-primary: #0a6585;
    --color-btn-primary-hover: #06455d;
    --color-btn-secondary: #ffffff;
    --color-btn-secondary-text: #0f172a;
    --color-btn-secondary-hover: #f1f5f9;
    --color-card-bg: #ffffff;
    --color-input-bg: #ffffff;
    --color-border: #d8dee6;
    --color-muted: #64748b;
}

/* Base */
body {
    min-height: 100vh;
    font-family: Arial, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    margin: 0;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--color-bg);
}

/* Header / Footer */
.header,
.header-index,
.footer,
.footer-index {
    text-align: center;
    color: var(--color-text);
}

.header {
    font-size: 0.5rem;
    padding: 1rem;
}

.header-index {
    font-size: 0.73rem;
    padding: 1rem;
}

.footer,
.footer-index {
    font-size: 0.73rem;
    padding: 1rem;
}

/* Layout principal */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Login / tarjetas */
.form-container {
    background-color: var(--color-card-bg);
    padding: 2rem 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    width: 90%;
    max-width: 400px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-container h2 {
    color: var(--color-text);
}

form {
    width: 100%;
}

form input {
    width: 90%;
    padding: 0.8rem;
    margin: 0.5rem 0;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: var(--color-input-bg);
    color: #1f2937;
    box-sizing: border-box;
}

form input:focus {
    border-color: var(--color-btn-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(10, 101, 133, 0.12);
}

form button,
.top-buttons .btn-primary,
#captureButton {
    background-color: var(--color-btn-primary);
    color: #ffffff;
    border: 1px solid var(--color-btn-primary);
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

form button:hover,
.top-buttons .btn-primary:hover,
#captureButton:hover {
    background-color: var(--color-btn-primary-hover);
}

button {
    color: #0f172a;
    font-weight: 600;
}

/* Mensaje login */
#loginMessage {
    margin-top: 1rem;
    color: #166534;
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 8px 10px;
    font-weight: 600;
}

/* Logo */
.logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background-color: #ffffff;
    padding: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
    margin-bottom: 1rem;
}

/* Dashboard */
.main-block,
.records-section {
    background: #f8fbfd;
    border: 1px solid #d7e2ea;
    border-radius: 12px;
    padding: 18px;

    box-shadow:
        0 2px 6px rgba(0,0,0,.04),
        0 10px 30px rgba(15,23,42,.08);
}

.action-header {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.top-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px;
    gap: 10px;
}

.top-buttons button {
    flex: 1;
    padding: 12px 20px;
    font-size: 1.1em;
    border-radius: 30px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary,
.top-buttons .btn-secondary,
.modal-buttons .btn-secondary {
    background-color: #ffffff;
    color: #0f172a;
    border: 1px solid #cbd5e1;
}

.btn-secondary:hover,
.top-buttons .btn-secondary:hover,
.modal-buttons .btn-secondary:hover {
    background-color: #f1f5f9;
}

/* Registros */
.record {
    text-align: center;
    margin-bottom: 20px;
}

.record-photo {
    width: 150px;
    height: 150px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

#lastRecords {
    list-style-type: none;
    padding: 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

#lastRecords li {
    padding: 0;
    margin: 0 0 1px 0;
}

.record.horizontal {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    margin-bottom: 4px;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid #dbe5ec;
    border-radius: 0;
    box-shadow:
    0 2px 4px rgba(0,0,0,.03),
    0 6px 18px rgba(15,23,42,.06);
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.05;
}

.record-photo-mini {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 0 4px rgba(0,0,0,0.2);
}

.record-info,
.record-ubicacion,
.record-fecha,
.record-estado {
    color: var(--color-text);
}

.record-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 0.95em;
}

.record-ubicacion {
    flex: 2;
    font-size: 0.95em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.record-fecha {
    flex: 1;
    font-size: 0.85em;
    text-align: right;
}

.record-estado {
    flex: 1;
    font-weight: bold;
    text-align: right;
}

/* Modal */
.modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.45);
}

.modal.hidden,
.hidden {
    display: none !important;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 20px;
    max-width: 400px;
    width: 95%;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #003366;
    font-size: 1.5em;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.modal-buttons button {
    flex: 1 1 150px;
    max-width: 180px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    white-space: normal;
    text-align: center;
    cursor: pointer;
}

.modal-buttons .btn-primary {
    background-color: var(--color-btn-primary);
    color: #ffffff;
    border: 1px solid var(--color-btn-primary);
}

.modal-buttons .btn-primary:hover {
    background-color: var(--color-btn-primary-hover);
}

/* Selects e inputs especiales */
.dropdown,
.admin-select,
.input-fecha {
    background-color: #ffffff;
    color: #1f2937;
    border: 1.5px solid #c4c4c4;
    box-sizing: border-box;
}

.dropdown {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 8px;
    font-size: 1em;
    appearance: none;
}

.admin-filter {
    max-width: 500px;
    margin: 0 auto 15px auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.admin-label {
    color: var(--color-text);
    font-weight: bold;
    margin-bottom: 6px;
}

.admin-select {
    width: 100%;
    max-width: 100%;
    padding: 8px;
    border-radius: 6px;
    font-size: 1em;
}

#employeeSelect,
.records-section {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

/* Cámara */
.camera-container {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#video,
#canvas {
    width: 100%;
    max-width: 320px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin: 10px auto 12px auto;
    display: block;
}

#captureButton {
    width: 90%;
    max-width: 280px;
    margin: 12px 0 20px 0;
    padding: 10px;
    font-size: 1.05em;
    border-radius: 8px;
}

/* Bloque botones */
.btns-block {
    width: 80%;
    max-width: 420px;
    margin: 18px 0 24px 0;
    text-align: center;
}

.btns-block button {
    display: inline-block;
    margin: 15px 0 0 0;
    font-size: 1.15em;
    padding: 15px 80px;
    border-radius: 26px;
    width: fit-content;
}

.btns-block button + button {
    margin-top: 15px;
}

/* Choices.js */
.choices__list--dropdown .choices__item,
.choices__list[aria-expanded="true"] .choices__item {
    background-color: #e6f2fc !important;
    color: #003366 !important;
    font-size: 8px;
}

.choices__item--selectable.is-highlighted {
    background-color: #1777ff !important;
    color: #ffffff !important;
    font-weight: 600;
}

.choices[data-type*=select-multiple] .choices__inner .choices__placeholder {
    color: #007bff !important;
    font-weight: 600;
    opacity: 1;
    font-size: 1em;
}

.usuariosSelect-container {
    max-width: 340px;
    margin: 0 auto 12px auto;
    width: 100%;
    box-sizing: border-box;
}

#usuariosSelect,
.choices,
.choices__inner {
    width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
}

.choices__inner {
    border-radius: 6px !important;
    border: 1.5px solid #c4c4c4 !important;
    padding: 8px 12px !important;
    background: #ffffff !important;
}

/* Fechas */
.fechas-row {
    display: flex;
    gap: 18px;
    justify-content: space-between;
    align-items: flex-start;
    margin: 10px 0 22px 0;
    max-width: 360px;
    width: 100%;
    box-sizing: border-box;
}

.fechas-row .fecha-group:last-child {
    align-items: flex-end;
}

.fecha-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    flex: 1 1 0;
    box-sizing: border-box;
}

.fecha-group .mensaje-alerta-suave {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    font-size: 0.69em;
}

.input-fecha {
    width: 100%;
    min-width: 0;
    max-width: 160px;
    border-radius: 13px;
    padding: 6px 10px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 0;
}

.input-fecha:focus {
    border-color: #2080ef;
}

/* Mensajes suaves */
.mensaje-error-fecha.hidden {
    display: none;
}

.mensaje-alerta-suave {
    display: flex;
    align-items: center;
    background: #e7f1ff;
    color: var(--color-btn-primary);
    border: 1px solid #a8d1f0;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 6px 0 8px 0;
    font-weight: 500;
}

.mensaje-alerta-suave .iconito {
    font-size: 0.9em;
    margin-right: 4px;
    flex-shrink: 0;
}

#msgUsuariosSelect {
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 340px;
    margin: 0 auto 12px auto;
    box-sizing: border-box;
}

#exportModal .modal-content {
    max-width: 390px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive */
@media (max-width: 600px) {
    .admin-filter {
        width: 95%;
    }
}

@media (max-width: 500px) {
    #exportModal .modal-content {
        max-width: 98vw;
        padding: 10px;
    }

    .usuariosSelect-container,
    #msgUsuariosSelect,
    .fechas-row {
        max-width: 100vw;
        width: 100%;
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
        box-sizing: border-box;
    }

    .fechas-row {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .fecha-group {
        width: 100%;
        min-width: 0;
        max-width: 100vw;
        align-items: center;
        margin-bottom: 0;
    }

    .fecha-group label,
    .fecha-group .input-fecha,
    .fecha-group .mensaje-alerta-suave {
        width: 96%;
        max-width: 340px;
        margin-left: auto;
        margin-right: auto;
        box-sizing: border-box;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .top-buttons {
        flex-direction: column;
    }

    .top-buttons button {
        width: 100%;
        margin-bottom: 8px;
    }

    .record.horizontal {
        font-size: 0.68em;
        gap: 2px;
        padding: 6px 10px;
    }

    .record-photo-mini {
        width: 40px;
        height: 40px;
    }

    .record-ubicacion,
    .record-fecha,
    .record-estado {
        flex: 100%;
        margin-top: 5px;
    }

    #video,
    #canvas {
        max-width: 95%;
    }

    #captureButton {
        width: 95%;
        font-size: 1em;
    }

    .logo {
        width: 90px;
        height: 90px;
        padding: 8px;
    }
}

@media (max-width: 390px) {
    .container {
        padding: 15px;
        max-width: 320px;
    }

    h1 {
        font-size: 1.5em;
    }

    input[type="email"],
    input[type="password"],
    button {
        font-size: 0.9em;
    }
}
