/* ===== Design tokens (dark) ===== */
:root,
[data-theme="dark"] {
    /* Colores base IMXTime */
    --surface-0: #0e0e15;
    --surface-1: #1b1b28;
    --surface-2: #252536;
    --text-0: #ffffff;
    --text-1: #cdd3df;
    --brand-500: #2c66a2;

    /* Mapea tokens de Bootstrap a los tuyos */
    --bs-body-bg: var(--surface-1);
    --bs-body-color: var(--text-1);
    --bs-card-bg: var(--surface-2);
    --bs-card-border-color: rgba(255, 255, 255, 0.08);
    --bs-border-color: rgba(255, 255, 255, 0.12);
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-1);
    --bs-link-color: var(--brand-500);
    --bs-link-hover-color: color-mix(in srgb, var(--brand-500) 80%, white);
}

[data-theme="light"] {
    --surface-0: #f5f7fa;
    --surface-1: #ffffff;
    --surface-2: #eef1f6;
    --text-0: #0e1117;
    --text-1: #3c4655;
    --brand-500: #2c66a2;

    --bs-body-bg: var(--surface-1);
    --bs-body-color: var(--text-1);
}


:root {
    --brand: #2c66a2;
    --brand-600: #1f4b78;
    --brand-300: #6da0d4;
    --bg-0: #0b1020;
    --bg-1: #111735;
    --bg-2: #1a2147;
    --glass: rgba(255, 255, 255, .04);
    --text-0: #e9ecf5;
    --text-1: #b9c0d9;
    --muted: #7f86a6;
    --outline: rgba(255, 255, 255, .08);
    --radius-xl: 22px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --shadow-2: 0 20px 60px rgba(0, 0, 0, .45);
    --focus: 0 0 0 3px rgba(44, 102, 162, .35), 0 0 0 6px rgba(44, 102, 162, .18);
    --ok: #22c55e;
    --warn: #f59e0b;
    --err: #ef4444;
}

/* ===== Body/background ===== */
html,
body {
    height: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial;
    color: var(--text-0);
    background:
        radial-gradient(1200px 1200px at 100% -20%, rgba(44, 102, 162, .25), transparent 60%),
        radial-gradient(900px 900px at -10% 120%, rgba(44, 102, 162, .18), transparent 55%),
        linear-gradient(160deg, #0a0f21 0%, #0f1530 50%, #0c1228 100%);
    background-attachment: fixed;
}

html[data-theme="light"] body {
    background:
        radial-gradient(1300px 1300px at 100% -20%, rgba(44, 102, 162, .08), transparent 60%),
        radial-gradient(900px 900px at -10% 120%, rgba(44, 102, 162, .06), transparent 55%),
        linear-gradient(160deg, #f4f7fb 0%, #f6f8fc 60%, #f5f7fb 100%);
}

/* ===== Generic helpers / components que ya usas en login ===== */
.auth-card .card-body {
    padding: 28px;
}

.hero-header {
    text-align: center;
    margin-bottom: 16px;
}

.hero-header h1 {
    font-size: clamp(1.2rem, 1.6vw + .9rem, 1.6rem);
    margin: 10px 0 4px;
    font-weight: 700;
}

.hero-header p {
    color: var(--text-1);
    margin: 0;
}

.form-label {
    color: var(--text-1);
    font-weight: 600;
}

.form-control {
    background: rgba(255, 255, 255, .03);
    border: 1px solid #ffffff22;
    color: var(--text-0);
    border-radius: var(--radius-md);
    padding: .8rem .9rem;
}

.form-control:focus {
    border-color: var(--brand-300);
    box-shadow: var(--focus);
    background: rgba(255, 255, 255, .06);
}

.input-group-text {
    background: rgba(255, 255, 255, .05);
    color: var(--muted);
    border: 1px solid #ffffff22;
    border-radius: var(--radius-md);
}

.btn-brand {
    --bs-btn-padding-y: .75rem;
    --bs-btn-padding-x: 1rem;
    --bs-btn-font-weight: 700;
    --bs-btn-border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--brand), var(--brand-600));
    border: 1px solid #ffffff22;
    color: #fff;
    box-shadow: 0 8px 20px rgba(44, 102, 162, .35);
}

.btn-brand:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-brand:active {
    transform: translateY(0);
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    margin: 8px 0 2px;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #ffffff22;
}

.meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--text-1);
    font-size: .95rem;
}

.link {
    color: var(--brand-300);
    text-decoration: none;
    font-weight: 600;
}

.link:hover {
    text-decoration: underline;
}

.footer {
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
    margin-top: 18px;
}

.badge-soft {
    background: rgba(34, 197, 94, .15);
    color: #a7f3d0;
    border: 1px solid rgba(34, 197, 94, .25);
    font-weight: 600;
    padding: .35rem .7rem;
    border-radius: 999px;
}

/* Branding */
.brand .logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand), var(--brand-600));
    box-shadow: inset 0 0 0 1px #ffffff22, 0 8px 30px rgba(44, 102, 162, .35);
}

html[data-theme="light"] .brand .logo {
    box-shadow: inset 0 0 0 1px #ffffff, 0 8px 30px rgba(44, 102, 162, .25);
}

/* Reusables */
.card-soft {
    color: var(--text-0);
    opacity: 1 !important;
    font-weight: initial;
    background: linear-gradient(180deg, var(--glass), rgba(255, 255, 255, .02));
    border: 1px solid var(--outline);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-2);
}

.pill {
    padding: .35rem .7rem;
    border-radius: 999px;
    font-weight: 600;
}

.kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: .85rem;
    background: rgba(255, 255, 255, .24) !important;
    /* antes: #0009 */
    padding: .2rem .4rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, .35);
    /* antes: #ffffff22 */
    color: var(--text-0) !important;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .25);
    border: 1px solid rgba(255, 255, 255, .55) !important;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .35);
}

/* ===== Checador (layout y componentes de esta vista) ===== */
.bg-dots::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .18;
    background-image: radial-gradient(#ffffff10 1px, transparent 1px);
    background-size: 18px 18px;
}

.wrap {
    min-height: 100svh;
    display: grid;
    grid-template-columns: 1.1fr 1.2fr .9fr;
    gap: 16px;
    padding: 20px;
}

@media (max-width: 1200px) {
    .wrap {
        grid-template-columns: 1fr
    }

    .side-right {
        order: 3
    }
}

.card-pane {
    background: linear-gradient(180deg, var(--glass), rgba(255, 255, 255, .02));
    border: 1px solid var(--outline);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-2);
    backdrop-filter: blur(10px) saturate(120%);
}

header.topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.clock {
    display: grid;
    place-items: center;
    padding: 24px;
}

.clock-time {
    font-weight: 800;
    letter-spacing: .8px;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    font-variant-numeric: tabular-nums;
}

.clock-date {
    color: var(--text-1);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    margin-right: 6px;
    background: #10b981;
}

.punch-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 16px;
}

.punch-btn {
    border-radius: 18px;
    padding: 22px;
    border: 1px solid #ffffff22;
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 800;
    background: rgba(255, 255, 255, .04);
    transition: .2s all;
    justify-content: center;
}

.punch-btn i {
    font-size: 1.3rem;
}

.punch-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.punch-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    filter: none;
    transform: none;
}

.btn-in {
    background: linear-gradient(135deg, #15a34a, #17803e);
}

.btn-out {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.btn-break {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.btn-break-end {
    background: linear-gradient(135deg, #06b6d4, #0e7490);
}

.timeline {
    list-style: none;
    margin: 0;
    padding: 16px;
}

.timeline li {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed #ffffff20;
}

.timeline .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 8px;
}

.keypad .btn {
    border-radius: 14px;
    font-weight: 800;
    padding: 16px;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--bg-2);
    border: 1px solid var(--outline);
}

.help {
    color: var(--text-1);
    text-align: center;
}

.pill-strong {
    border: 1px solid #ffffff22;
    background: rgba(255, 255, 255, .06);
    padding: .01rem .7rem;
    border-radius: 999px;
    font-weight: 700;
}

.countdown {
    font-variant-numeric: tabular-nums;
    letter-spacing: .5px;
}

.blink {
    animation: blink 1s steps(2, start) infinite;
}

html[data-theme="light"] .kbd {
    background: rgba(17, 24, 39, .06);
    color: var(--text-0);
    /* en light este token ya es oscuro */
    border-color: #cfd8e3;
}

@keyframes blink {
    to {
        visibility: hidden
    }
}

.card-soft .form-text {
    color: var(--text-0) !important;
    font-weight: 600;
}

.modal[hidden] {
    display: none;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 7, 25, 0.78);
    z-index: 50;
}

.modal__content {
    background: var(--bg-1, #111735);
    border-radius: var(--radius-xl, 22px);
    box-shadow: var(--shadow-3, 0 24px 60px rgba(0, 0, 0, 0.6));
    width: 100%;
    max-width: 720px;
    /* ancho razonable */
    max-height: calc(100vh - 80px);
    /* no sale de pantalla */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* el scroll va en el body */
}

.modal__header {
    padding: 16px 20px 8px;
    border-bottom: 1px solid var(--outline, rgba(255, 255, 255, 0.08));
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.modal__title {
    font-size: 1.1rem;
    font-weight: 600;
}

/* Aquí va el scroll vertical */
.modal__body {
    padding: 16px 20px 16px;
    overflow-y: auto;
}

.modal__footer {
    padding: 8px 20px 16px;
    border-top: 1px solid var(--outline, rgba(255, 255, 255, 0.08));
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 999px;
}

@media (max-width: 768px) {
    .modal__content {
        max-width: 100%;
        margin: 0 12px;
        max-height: calc(100vh - 40px);
    }

    .grid-2 {
        grid-template-columns: 1fr !important;
    }
}

/* ===== FIX select en modales (tema oscuro) ===== */
.modal select.control {
    background-color: var(--bg-2);
    color: var(--text-0);
    border: 1px solid var(--outline);
}

/* Cuando el select está abierto (chrome/edge/opera) */
.modal select.control:focus,
.modal select.control:active {
    background-color: var(--bg-1);
    color: var(--text-0);
}

/* ===== Panel desplegable del select (OPERA/CHROME/EDGE) ===== */
.modal select.control::-ms-expand {
    display: none;
    /* IE/Edge viejo */
}

/* WebKit dropdown */
.modal select.control option {
    background-color: var(--bg-2) !important;
    color: var(--text-0) !important;
}

/* Opción cuando está seleccionada o hover */
.modal select.control option:checked,
.modal select.control option:hover,
.modal select.control option:focus {
    background-color: var(--brand-600) !important;
    color: var(--text-0) !important;
}

/* ===========================
   MODAL MINIMALISTA PROFESIONAL
   =========================== */

/* ================================
   TIME PICKER (selects mejorados)
   ================================ */

#timePicker .tp-container {
    display: flex;
    gap: 16px;
    justify-content: center;
    padding: 10px 0;
}

#timePicker .pm__control {
    width: 90px;
    height: 150px;
    border: 1px solid var(--outline, rgba(255, 255, 255, 0.15));
    background: var(--bg-2, #1a2147);
    color: var(--text-0, #fff);
    border-radius: var(--radius-md, 12px);
    font-size: 18px;
    text-align: center;
    padding: 4px;
    outline: none;
    overflow-y: auto;
    scrollbar-width: thin;
    cursor: pointer;
}

/* Opción seleccionada */
#timePicker .pm__control option:checked {
    background: var(--brand-600, #1f4b78) !important;
    color: #fff;
    font-weight: bold;
}

/* Hover */
#timePicker .pm__control option:hover {
    background: var(--brand-300, #6da0d4) !important;
    color: black;
}

/* Scrollbar */
#timePicker .pm__control::-webkit-scrollbar {
    width: 6px;
}

#timePicker .pm__control::-webkit-scrollbar-thumb {
    background: var(--brand, #2c66a2);
    border-radius: 10px;
}


#editModal .pm__panel {
    max-height: 90vh;
    width: 640px;
    border-radius: 14px;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

#editModal .pm__header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--outline);
    background: var(--bg-2);
}

#editModal .pm__title {
    font-size: 18px;
    margin: 0;
}

#editModal .pm__close {
    font-size: 18px;
    opacity: .6;
    transition: opacity .15s;
}

#editModal .pm__close:hover {
    opacity: 1;
}

#editModal .pm__body {
    padding: 20px;
    overflow-y: auto;
}

/* Inputs modernos */
#editModal .pm__control {
    background: var(--bg-2);
    border: 1px solid var(--outline);
    padding: 7px 10px;
    height: 40px;
    border-radius: 8px;
}

/* Layout de inputs */
.edit-top-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Tabla */
#editModal .table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#editModal table th,
#editModal table td {
    padding: 8px 6px;
}

#editModal table th {
    color: var(--text-1);
    font-weight: 500;
    border-bottom: 1px solid var(--outline);
}

#editModal .table-wrap {
    max-height: 45vh;
    overflow-y: auto;
    margin-top: 10px;
    border: 1px solid var(--outline);
    border-radius: 10px;
}

/* Botón guardar */
#editSaveBtn {
    margin-top: 20px;
    width: 100%;
    height: 44px;
    border-radius: 10px;
    font-size: 15px;
}

/* =========================================
   Editor de geocercas (mapa + formulario)
   ========================================= */
.geo-layout {
    display: flex;
    gap: 1rem;
    height: 420px;
    max-height: 70vh;
}

.geo-map {
    flex: 2;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--outline, rgba(255, 255, 255, .12));
    background: #020617;
    min-height: 320px;
}

.geo-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid var(--outline, rgba(255, 255, 255, .12));
    background: var(--surface-2, rgba(15, 23, 42, .96));
    font-size: 0.86rem;
}

/* Slider + number juntos */
.geo-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.geo-inline input[type="range"] {
    flex: 1;
}

/* Slider estilo oscuro */
.geo-inline input[type="range"] {
    appearance: none;
    height: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, .3);
    outline: none;
}

.geo-inline input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: var(--brand, #2c66a2);
    cursor: pointer;
    box-shadow: 0 0 0 2px #0b1020;
}

.geo-inline input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: var(--brand, #2c66a2);
    cursor: pointer;
    border: none;
}

/* Responsive */
@media (max-width: 900px) {
    .geo-layout {
        flex-direction: column;
        height: auto;
    }

    .geo-map {
        min-height: 260px;
    }
}

/* ============================
   Modal geocercas: scroll interno
   ============================ */

#locModal .pm__panel {
    max-height: 90vh;
    /* no pasa del alto de la ventana */
    width: min(960px, 100vw - 32px);
    /* ancho razonable y responsive */
    display: flex;
    flex-direction: column;
}

/* el scroll va dentro del body del modal */
#locModal .pm__body {
    padding: 16px 20px 20px;
    flex: 1;
    overflow-y: auto;
}

/* Dentro del modal, el layout de geocerca NO usa 70vh */
#locModal .geo-layout {
    height: auto;
    max-height: none;
    flex-direction: column;
}

#locModal .geo-map {
    height: 260px;
    /* ajusta si quieres un poco más o menos */
    min-height: 220px;
}

/* por si en pantallas chicas se veía demasiado ancho */
@media (max-width: 768px) {
    #locModal .pm__panel {
        width: calc(100vw - 24px);
        max-height: 90vh;
    }
}

/* Ajusta colores del dropdown en select */
select.control,
select.control option {
    color: #e5e7eb;
    /* gris claro del tema */
    background-color: #0f1428;
    /* mismo color del input */
}

/* Placeholder (opción disabled) */
select.control option[disabled] {
    color: #6b7280;
    /* gris más tenue */
}

.badge-jornada {
    padding: .25rem .55rem;
    font-size: .75rem;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid transparent;
}

/* COMPLETA */
.badge-jornada-complete {
    background: rgba(34, 197, 94, .15);
    color: #4ade80;
    border-color: rgba(34, 197, 94, .3);
}

/* INCOMPLETA */
.badge-jornada-incomplete {
    background: rgba(239, 68, 68, .15);
    color: #f87171;
    border-color: rgba(239, 68, 68, .3);
}

/* PENDIENTE (faltan punches o revisión) */
.badge-jornada-pending {
    background: rgba(245, 158, 11, .15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, .3);
}

/* SIN HORARIO */
.badge-jornada-noschedule {
    background: rgba(147, 197, 253, .15);
    color: #93c5fd;
    border-color: rgba(147, 197, 253, .3);
}