/* REDISEÑO ESTILO "IMÁGENES NUEVAS" (BEIGE/NEGRO/AZUL - TOP NAV) */
:root {
    /* Paleta de Colores de la captura */
    --bg-main: #F4F2EB;
    /* Beige muy claro */
    --card-bg: #FFFFFF;
    --hero-bg: #18181B;
    /* Casi negro para la tarjeta principal */

    --text-main: #171717;
    /* Texto principal oscuro */
    --text-muted: #737373;
    /* Gris para subtítulos */
    --text-hero: #FFFFFF;
    /* Texto blanco sobre negro */
    --text-hero-muted: #A1A1AA;

    --blue-main: #2563eb;
    /* Azul intenso (sustituye al verde según petición) */
    --blue-hover: #1d4ed8;

    --border: #E5E5E5;
    --font: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg-main);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
}

/* ================= TOP NAV (CABECERA) ================= */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 3rem;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 3rem;
}

.brand {
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 1px;
    color: var(--text-main);
}

.tabs {
    background: #E5E5E5;
    padding: 5px;
    border-radius: 30px;
    display: flex;
    gap: 4px;
}

.tab-btn {
    border: none;
    background: transparent;
    padding: 6px 20px;
    border-radius: 24px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
}

.tab-btn.active {
    background: #FFFFFF;
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-user-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-admin-nav,
.btn-logout-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    box-sizing: border-box;
    text-decoration: none;
    line-height: 1.2;
}

.btn-admin-nav {
    background: #FFFFFF;
    color: var(--text-main);
    border: 1px solid #D4D4D8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-admin-nav:hover {
    background: #F4F4F5;
    border-color: #A1A1AA;
}

.btn-logout-nav {
    background: #18181B;
    color: #FFFFFF;
    border: 1px solid #18181B;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.btn-logout-nav:hover {
    background: #27272A;
}

#live-time {
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.avatar {
    background: #18181B;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.invisible-select {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* ================= CONTENEDOR PRINCIPAL ================= */
.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem 2rem 4rem 2rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================= PESTAÑA: HOY ================= */
/* HERO CARD (NEGRA) */
.hero-card {
    background: var(--hero-bg);
    color: var(--text-hero);
    border-radius: 24px;
    padding: 3rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.hero-date {
    color: var(--text-hero-muted);
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    font-weight: 500;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 500;
    letter-spacing: -1px;
    margin-bottom: 1.5rem;
    max-width: 500px;
    line-height: 1.2;
}

.hero-subtitle {
    color: var(--text-hero-muted);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2.5rem;
}

.dot-gray {
    width: 8px;
    height: 8px;
    background: #52525B;
    border-radius: 50%;
    display: inline-block;
}

.dot-blue {
    width: 8px;
    height: 8px;
    background: var(--blue-main);
    border-radius: 50%;
    display: inline-block;
}

.dot-amber {
    width: 8px;
    height: 8px;
    background: #F59E0B;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.btn-fichar {
    padding: 1.1rem 2.5rem;
    border-radius: 30px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.btn-fichar:active {
    transform: scale(0.98);
}

.btn-blue {
    background: var(--blue-main);
    color: white;
}

.btn-blue:hover {
    background: var(--blue-hover);
}

.btn-white {
    background: white;
    color: var(--text-main);
}

.btn-dark-pill {
    background: #27272A;
    color: white;
    border: 1px solid #3F3F46;
    padding: 1.1rem 2.5rem;
    border-radius: 30px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
}

/* TIMER CIRCULAR (AMPLIADO A 240px) */
.circular-timer {
    position: relative;
    width: 240px;
    height: 240px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.progress-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: #27272A;
    stroke-width: 5;
}

.ring-fill {
    fill: none;
    stroke: var(--blue-main);
    stroke-width: 5.5;
    stroke-dasharray: 282.74;
    stroke-dashoffset: 282.74;
    transition: stroke-dashoffset 1s linear, opacity 0.3s ease, stroke 0.4s ease;
    stroke-linecap: round;
}

.ring-fill.overtime {
    stroke: #ef4444 !important;
    filter: drop-shadow(0 0 6px rgba(239, 68, 68, 0.45));
}

.timer-text {
    text-align: center;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#session-timer {
    font-size: 2.35rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -1px;
    line-height: 1.1;
}

.timer-label {
    font-size: 0.8rem;
    color: var(--text-hero-muted);
    margin-top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* BADGES DE ESTADO DENTRO DEL CÍRCULO */
.status-pill-pause {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(245, 158, 11, 0.16);
    color: #FBBF24;
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status-indicator-working {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-hero-muted);
    font-size: 0.8rem;
    font-weight: 500;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--blue-main);
    box-shadow: 0 0 8px var(--blue-main);
    display: inline-block;
    animation: pulseGlow 2s infinite ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}

/* STATS GRID */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.2rem;
    margin: 1.5rem 0 2rem 0;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    letter-spacing: -0.5px;
}

.stat-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* BOTTOM GRID */
.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.white-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 2.5rem;
    border: 1px solid var(--border);
}

.section-header {
    margin-bottom: 2rem;
}

.section-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* CALENDARIO HEADER Y NAVEGACIÓN SEMANAL RESPONSIVE */
.calendar-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: nowrap !important;
    gap: 8px;
    width: 100%;
}

.calendar-header-info {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
}

#cal-semana-titulo {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.3px;
    color: var(--text-main);
}

#cal-semana-total {
    background: #e0f2fe;
    color: #0284c7;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: -0.2px;
    flex-shrink: 0;
    white-space: nowrap;
}

.semana-nav-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.semana-nav-buttons button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border);
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    line-height: 1;
    transition: all 0.15s ease;
    user-select: none;
    font-family: inherit;
}

.semana-nav-buttons button:hover {
    background: #f3f4f6;
    border-color: #cbd5e1;
}

.btn-nav-arrow {
    width: 32px;
    height: 32px;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-main);
}

.btn-nav-today {
    height: 32px;
    padding: 0 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: #f9fafb;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.link-registro {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
}

.link-registro:hover {
    text-decoration: underline;
    color: var(--blue-main);
}

/* CALENDARIO (ESTA SEMANA) */
.week-days {
    display: flex;
    justify-content: space-between;
    height: 180px;
}

.day-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 12%;
}

.d-name-top {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.day-pill {
    width: 100%;
    height: 100%;
    background: #F4F4F5;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 6px;
    transition: 0.2s;
    position: relative;
}

.day-pill.active,
.day-pill.past-day,
.day-pill.dark-bg {
    background: #18181B;
}

/* Indicador de día seleccionado en el calendario */
.day-pill.selected {
    box-shadow: 0 0 0 2px var(--blue-main), 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Rectángulo Negro */
.day-pill-num {
    position: absolute;
    top: 12px;
    left: 0;
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    z-index: 2;
}

.day-pill.active .day-pill-num,
.day-pill.past-day .day-pill-num,
.day-pill.dark-bg .day-pill-num {
    color: #FFFFFF;
}

.day-fill {
    width: 100%;
    background: var(--blue-main);
    border-radius: 8px;
    transition: height 1s;
}

/* DÍA COMPLETADO (8h cumplidas en cualquier día de la semana): marco oscuro, interior 100% azul y número blanco */
.day-pill.completado {
    background: #18181B !important;
}

.day-pill.completado .day-fill {
    height: 100% !important;
    background: var(--blue-main) !important;
    border-radius: 8px;
}

.day-pill.completado .day-pill-num {
    color: #FFFFFF !important;
    font-weight: 700 !important;
    z-index: 2;
}

.d-time-bot {
    font-size: 0.75rem;
    color: var(--text-main);
    font-weight: 600;
    margin-top: 10px;
    white-space: nowrap;
    text-align: center;
}

/* ACTIVIDAD DE HOY */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.act-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.act-item:last-child {
    border-bottom: none;
}

.activity-section {
    display: flex;
    flex-direction: column;
}

.activity-list {
    flex: 1;
}



.act-left {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

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

.dot.entrada {
    background: var(--blue-main);
}

.dot.salida {
    background: var(--text-main);
}

.act-text .t-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.act-text .t-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.act-time {
    font-size: 0.9rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

/* ================= PESTAÑA: REGISTRO OFICIAL ================= */
.registro-header {
    margin-bottom: 2rem;
}

.registro-header h2 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.padding-0 {
    padding: 0 !important;
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    padding: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 1.5rem;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
}

.valido {
    color: var(--blue-main);
    font-weight: 500;
    font-size: 0.85rem;
}

.dot-list {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 8px;
}

/* ================= PESTAÑA: AUSENCIAS ================= */
#tab-ausencias {
    margin-top: 0;
}

#tab-ausencias .registro-header {
    margin-bottom: 1.25rem;
}

#tab-ausencias .registro-header h2 {
    font-size: 1.85rem;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: -0.5px;
}

#tab-ausencias .registro-header .subtitle {
    font-size: 0.9rem;
}

#tab-ausencias .ausencias-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 1.5rem;
    align-items: stretch;
}

#tab-ausencias .white-card {
    padding: 1.85rem 2rem;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

#tab-ausencias .white-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

#tab-ausencias .ausencia-types {
    display: flex;
    gap: 10px;
    margin: 0.85rem 0 1.35rem 0;
    flex-wrap: wrap;
}

#tab-ausencias .pill-btn {
    padding: 8px 18px;
    border-radius: 30px;
    border: 1px solid var(--border);
    background: transparent;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-main);
    transition: 0.2s;
}

#tab-ausencias .pill-btn.active {
    background: #18181B;
    color: white;
    border-color: #18181B;
}

#tab-ausencias .date-inputs {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

#tab-ausencias .input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1.25rem;
}

#tab-ausencias .input-group label {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: block;
}

#tab-ausencias .input-group input {
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-family: var(--font);
    color: var(--text-main);
    font-size: 0.92rem;
    outline: none;
    box-sizing: border-box;
    width: 100%;
    background: #FAFAFA;
    transition: border-color 0.2s, background-color 0.2s;
}

#tab-ausencias .input-group input:focus {
    border-color: #18181B;
    background: #FFFFFF;
}

#tab-ausencias .input-group input[type="file"] {
    padding: 9px 12px;
    background: #FAFAFA;
    cursor: pointer;
}

#tab-ausencias .input-group input[type="file"]::file-selector-button {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #FFFFFF;
    font-family: var(--font);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 12px;
    transition: 0.2s;
}

#tab-ausencias .input-group input[type="file"]::file-selector-button:hover {
    background: #F4F4F5;
}

#btn-solicitar-ausencia {
    margin-top: auto;
    padding: 13px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 28px;
    width: 100%;
    cursor: pointer;
}

#tab-ausencias #ausencias-list {
    flex: 1;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
}

.ausencia-item-row {
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

#tab-ausencias #ausencias-list > div:last-child,
.ausencia-item-row:last-child {
    border-bottom: none;
}

.ausencia-item-info {
    font-size: 0.92rem;
    line-height: 1.4;
    flex: 1;
}

.ausencia-item-status {
    text-align: right;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.status-badge-inline {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.76rem;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.status-badge-inline.status-aprobado {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.status-badge-inline.status-rechazado {
    background: rgba(239, 68, 68, 0.12);
    color: #DC2626;
}

.status-badge-inline.status-pendiente {
    background: rgba(245, 158, 11, 0.12);
    color: #D97706;
}



.empty-state {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
}

.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #18181B;
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 0.95rem;
    opacity: 0;
    transition: 0.3s;
    pointer-events: none;
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 9999;
}

.toast.show {
    opacity: 1;
}

/* ================= RESPONSIVE (Móviles y Tablets) ================= */
@media (max-width: 1024px) {
    .top-nav {
        padding: 1.25rem 2rem;
    }

    .main-container {
        padding: 1rem 1.5rem 3rem 1.5rem;
    }

    .hero-card {
        padding: 2.5rem 2rem;
    }

    .hero-title {
        font-size: 1.9rem;
    }
}

@media (max-width: 850px) {
    .top-nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 1.5rem;
    }

    .nav-left {
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .nav-right {
        width: 100%;
        justify-content: space-between;
        gap: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .bottom-grid {
        grid-template-columns: 1fr;
    }

    #tab-ausencias .ausencias-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {

    /* TOP NAV */
    .top-nav {
        padding: 0.85rem 1rem 0.5rem 1rem;
        gap: 0.75rem;
    }

    .nav-left {
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 0.65rem;
    }

    .brand {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

    .brand img {
        height: 65px !important;
    }

    .brand span {
        font-size: 1.25rem !important;
        letter-spacing: 0.5px;
    }

    /* Tabs tipo selector nativo */
    .tabs {
        width: 100%;
        display: flex;
        padding: 4px;
        gap: 3px;
        border-radius: 20px;
    }

    .tab-btn {
        flex: 1;
        text-align: center;
        padding: 8px 6px;
        font-size: 0.82rem;
    }

    /* Barra de usuario y acciones inferior (2 líneas elegantes y con espacio) */
    .nav-right {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 9px 12px;
        background: #ECE8DE;
        border-radius: 18px;
    }

    .nav-user-info {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .user-profile {
        display: flex;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }

    #display-user-name {
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--text-main);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }

    #live-time {
        font-size: 0.85rem;
        font-weight: 600;
        color: var(--text-muted);
        flex-shrink: 0;
    }

    .nav-user-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .btn-admin-nav {
        flex: 1;
        text-align: center;
        padding: 8px 12px;
        font-size: 0.82rem;
        font-weight: 600;
        border-radius: 20px;
        background: #FFFFFF;
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
        color: var(--text-main);
        cursor: pointer;
    }

    .btn-logout-nav {
        flex: 1;
        text-align: center;
        padding: 8px 12px;
        font-size: 0.82rem;
        font-weight: 600;
        border-radius: 20px;
        background: #18181B;
        color: #FFFFFF;
        cursor: pointer;
    }

    /* CONTENEDOR */
    .main-container {
        padding: 0.75rem 0.75rem 3rem 0.75rem;
    }

    /* HERO CARD (NEGRA) - REORDENADA Y CENTRADA */
    .hero-card {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.6rem 1.2rem;
        gap: 0;
        border-radius: 20px;
    }

    .hero-left {
        display: contents;
        /* Permite reordenar los hijos con flex/grid */
    }

    .hero-date {
        order: 1;
        font-size: 0.85rem;
        margin-bottom: 0.4rem;
    }

    .hero-title {
        order: 2;
        font-size: 1.45rem;
        line-height: 1.25;
        margin-bottom: 0.35rem;
        max-width: 100%;
    }

    .hero-subtitle {
        order: 3;
        font-size: 0.85rem;
        margin-bottom: 0.8rem;
        justify-content: center;
    }

    .hero-right {
        order: 4;
        margin: 0.2rem 0 1.2rem 0;
        display: flex;
        justify-content: center;
    }

    .circular-timer {
        width: 220px;
        height: 220px;
        transform: none;
        margin: 0.2rem auto 0.6rem auto;
    }

    .progress-ring {
        width: 100%;
        height: 100%;
    }

    #session-timer {
        font-size: 2.15rem;
    }

    .timer-label {
        font-size: 0.78rem;
        margin-top: 5px;
    }

    .hero-actions {
        order: 5;
        width: 100%;
        display: flex;
        flex-direction: row;
        gap: 0.6rem;
        justify-content: center;
        margin: 0;
    }

    .hero-actions .btn-fichar,
    .hero-actions .btn-dark-pill {
        flex: 1;
        min-width: 0;
        padding: 0.9rem 0.5rem;
        font-size: 0.95rem;
        border-radius: 24px;
        text-align: center;
        white-space: nowrap;
    }

    /* TARJETAS ESTADÍSTICAS (2x2) */
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
        margin: 1rem 0;
    }

    .stat-card {
        padding: 1rem 0.85rem;
        border-radius: 16px;
    }

    .stat-label {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-sub {
        font-size: 0.72rem;
    }

    /* TARJETAS BLANCAS */
    .white-card {
        padding: 1.25rem 1rem;
        border-radius: 18px;
    }

    /* CALENDARIO HEADER RESPONSIVE */
    .calendar-header-row {
        margin-bottom: 0.85rem;
        gap: 6px;
    }

    .calendar-header-info {
        gap: 6px;
    }

    #cal-semana-titulo {
        font-size: 0.98rem;
    }

    #cal-semana-total {
        font-size: 0.7rem;
        padding: 2px 6px;
    }

    .semana-nav-buttons {
        gap: 4px;
    }

    .btn-nav-arrow {
        width: 30px;
        height: 30px;
        font-size: 0.95rem;
    }

    .btn-nav-today {
        height: 30px;
        padding: 0 8px;
        font-size: 0.74rem;
    }

    /* CALENDARIO SEMANAL */
    .week-days {
        overflow-x: auto;
        padding-bottom: 8px;
        justify-content: space-between;
        gap: 4px;
        height: 160px;
    }

    .day-col {
        min-width: 36px;
        width: 13%;
    }

    .d-name-top {
        font-size: 0.7rem;
        margin-bottom: 8px;
    }

    .d-time-bot {
        font-size: 0.65rem;
        margin-top: 6px;
        white-space: nowrap;
        text-align: center;
        letter-spacing: -0.4px;
        display: block;
        width: 100%;
    }

    /* TABLA REGISTRO */
    .table-responsive {
        overflow-x: auto;
        width: 100%;
        -webkit-overflow-scrolling: touch;
        border-radius: 14px;
    }

    .data-table th,
    .data-table td {
        padding: 0.9rem 0.75rem;
        font-size: 0.82rem;
        white-space: nowrap;
    }

    .registro-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .registro-header h2 {
        font-size: 1.5rem;
    }

    .registro-header .btn-dark-pill {
        width: 100%;
        text-align: center;
        padding: 10px;
        font-size: 0.9rem;
    }

    /* AUSENCIAS */
    .ausencia-types {
        display: flex;
        flex-direction: row;
        gap: 6px;
        width: 100%;
    }

    .pill-btn {
        flex: 1;
        text-align: center;
        padding: 8px 4px;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    .date-inputs {
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .btn-dark-pill.mt-4 {
        width: 100%;
        text-align: center;
        padding: 12px;
    }

    .toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        text-align: center;
        font-size: 0.85rem;
        padding: 12px 20px;
    }
}

@media (max-width: 380px) {
    .brand img {
        height: 40px !important;
    }

    .brand span {
        font-size: 1.1rem !important;
    }

    .hero-title {
        font-size: 1.25rem;
    }

    .circular-timer {
        width: 205px;
        height: 205px;
    }

    .progress-ring {
        width: 100%;
        height: 100%;
    }

    #session-timer {
        font-size: 2rem;
    }

    .status-pill-pause {
        padding: 3px 10px;
        font-size: 0.74rem;
    }

    #cal-semana-titulo {
        font-size: 0.88rem;
    }

    #cal-semana-total {
        font-size: 0.66rem;
        padding: 1px 5px;
    }

    .btn-nav-arrow {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .btn-nav-today {
        height: 28px;
        padding: 0 6px;
        font-size: 0.7rem;
    }

    .hero-actions .btn-fichar,
    .hero-actions .btn-dark-pill {
        font-size: 0.85rem;
        padding: 0.75rem 0.35rem;
    }

    #display-user-name {
        max-width: 140px;
    }
}

/* ================= PAGINACIÓN UNIFICADA Y ALINEADA ================= */
.pagination-container,
#actividad-paginacion,
#registro-paginacion,
#ausencias-paginacion {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: auto;
    padding: 1.25rem 0 0.5rem 0;
    border-top: 1px solid var(--border);
    box-sizing: border-box;
    text-align: center;
}

@media (min-width: 769px) {
    #registro-paginacion {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1.25rem 0.5rem 0.5rem 0.5rem;
    }
}

.pagination-info {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    margin: 0;
    line-height: 1.4;
    font-weight: 500;
}

.pagination-info strong {
    color: var(--text-main);
    font-weight: 700;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: nowrap !important;
    max-width: 100%;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 7px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #FFFFFF;
    color: var(--text-main);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    white-space: nowrap;
    flex-shrink: 0;
    line-height: 1;
}

.page-btn:hover:not(:disabled):not(.active) {
    background: #F4F4F5;
    border-color: #D4D4D8;
    color: #18181B;
}

.page-btn.active {
    background: #18181B !important;
    border-color: #18181B !important;
    color: #FFFFFF !important;
    cursor: default;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(24, 24, 27, 0.2);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: #FAFAFA;
}

.page-btn-nav {
    padding: 0 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 32px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.85rem;
    user-select: none;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .pagination-container,
    #actividad-paginacion,
    #registro-paginacion,
    #ausencias-paginacion {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 8px;
        padding: 1rem 0 0.25rem 0;
    }

    .pagination-info {
        font-size: 0.8rem;
    }

    .pagination-controls {
        gap: 3px;
        flex-wrap: nowrap !important;
    }

    .nav-full-text {
        display: none !important;
    }

    .page-btn-nav {
        min-width: 30px;
        height: 30px;
        padding: 0 6px;
        font-size: 0.95rem;
    }

    .page-btn {
        min-width: 28px;
        height: 28px;
        padding: 0 4px;
        font-size: 0.78rem;
        border-radius: 6px;
    }

    .page-ellipsis {
        min-width: 14px;
        height: 28px;
        font-size: 0.8rem;
    }

    /* RESPONSIVE: AUSENCIAS (MÓVILES) */
    #tab-ausencias .registro-header h2 {
        font-size: 1.55rem;
    }

    #tab-ausencias .white-card {
        padding: 1.35rem 1.15rem;
        border-radius: 20px;
    }

    #tab-ausencias .date-inputs {
        flex-direction: column;
        gap: 0.85rem;
        margin-bottom: 1rem;
    }

    #tab-ausencias .input-group input {
        font-size: 16px; /* Evita zoom automático en Safari iOS */
        padding: 12px 14px;
    }

    #tab-ausencias .pill-btn {
        padding: 7px 14px;
        font-size: 0.82rem;
    }

    .ausencia-item-row {
        flex-direction: column;
        gap: 6px;
        padding: 12px 0;
    }

    .ausencia-item-status {
        text-align: left;
    }
}

/* SELECTOR DE IDIOMA (MULTI-IDIOMA ES / EN) */
.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.btn-lang {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.btn-lang:hover {
    color: var(--text-main);
    background: #f4f4f5;
}

.btn-lang.active {
    background: var(--blue-main);
    color: #ffffff !important;
}

.lang-divider {
    color: var(--text-muted);
    opacity: 0.35;
    font-size: 0.75rem;
    user-select: none;
}