/* ========================================
   VISITAS A FUNCIONARIOS
   ======================================== */

:root {
    --visitas-primary: #2d6a4f;
    --visitas-primary-dark: #1e4d38;
    --visitas-primary-light: #d4edda;
    --visitas-accent: #e91e63;
    --visitas-accent-light: #fce4ec;
    --visitas-archivo: #16a085;
    --visitas-registro: #d63384;
    --visitas-border: #e6e8eb;
    --visitas-bg-soft: #f8fafc;
    --visitas-text-muted: #64748b;
}

/* ========================================
   ENCABEZADO
   ======================================== */

.v-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--visitas-border);
    padding: 1.5rem 0 1.25rem;
    margin-bottom: 1.25rem;
}

.v-hero .v-logo img {
    height: 56px;
}

.v-hero .v-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    letter-spacing: -0.02em;
}

.v-hero .v-subtitle {
    color: var(--visitas-text-muted);
    font-size: 0.875rem;
    margin: 0.15rem 0 0;
}

/* ========================================
   CARD FILTROS
   ======================================== */

.v-filters {
    border: 1px solid var(--visitas-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    padding: 1rem 1.25rem 0.85rem;
    margin-bottom: 1rem;
}

.v-filters .v-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--visitas-text-muted);
    margin-bottom: 0.3rem;
    display: block;
}

.v-filters .form-select,
.v-filters .form-control {
    border-color: #dcdfe3;
    border-radius: 7px;
    font-size: 0.9rem;
}

.v-filters .form-control:focus,
.v-filters .form-select:focus {
    border-color: var(--visitas-primary);
    box-shadow: 0 0 0 0.15rem rgba(45, 106, 79, 0.15);
}

.v-search-wrap {
    position: relative;
}

.v-search-wrap .v-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.v-search-wrap input {
    padding-left: 2.1rem;
}

/* Chips de meses */
.v-month-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 0.65rem;
}

.v-month-chip {
    flex: 1 1 auto;
    min-width: 60px;
    text-align: center;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.v-month-chip:hover {
    border-color: var(--visitas-primary);
    color: var(--visitas-primary);
    background: var(--visitas-primary-light);
}

.v-month-chip.active {
    background: var(--visitas-primary);
    border-color: var(--visitas-primary);
    color: #fff;
    box-shadow: 0 2px 5px rgba(45, 106, 79, 0.25);
}

.v-month-chip.has-data::after {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--visitas-accent);
    margin-left: 4px;
    vertical-align: middle;
}

.v-month-chip.active.has-data::after {
    background: #fff;
}

/* ========================================
   STATS
   ======================================== */

.v-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.1rem;
}

.v-stat {
    background: #fff;
    border: 1px solid var(--visitas-border);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.v-stat:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}

.v-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.v-stat-icon.is-green { background: #d4edda; color: #1c7430; }
.v-stat-icon.is-blue  { background: #d1ecf1; color: #0c5460; }
.v-stat-icon.is-pink  { background: #fadcea; color: #a3185a; }
.v-stat-icon.is-amber { background: #fff3cd; color: #856404; }

.v-stat-body {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    min-width: 0;
}

.v-stat-value {
    font-size: 1.45rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.02em;
}

.v-stat-label {
    font-size: 0.72rem;
    color: var(--visitas-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    margin-top: 1px;
}

/* ========================================
   TOOLBAR DEL CALENDARIO
   ======================================== */

.v-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.v-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.v-toolbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--visitas-primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0 0.5rem;
    min-width: 175px;
    text-align: center;
}

.v-toolbar-btn {
    border: 1px solid var(--visitas-primary);
    background: #fff;
    color: var(--visitas-primary);
    width: 36px;
    height: 36px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.v-toolbar-btn:hover {
    background: var(--visitas-primary);
    color: #fff;
}

.v-toolbar-btn.is-today {
    background: var(--visitas-primary);
    color: #fff;
    padding: 0 0.85rem;
    width: auto;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.v-toolbar-btn.is-today:hover {
    background: var(--visitas-primary-dark);
}

/* Tabs vista */
.v-view-tabs {
    display: inline-flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}

.v-view-tab {
    border: 0;
    background: transparent;
    padding: 0.35rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    color: var(--visitas-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.v-view-tab:hover {
    color: #1e293b;
}

.v-view-tab.active {
    background: #fff;
    color: var(--visitas-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ========================================
   CALENDARIO - TABLA
   ======================================== */

.v-calendar-card {
    background: #fff;
    border: 1px solid var(--visitas-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

table.calendario {
    margin: 0;
    table-layout: fixed;
    width: 100%;
}

table.calendario thead th.c-dia {
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: center;
    padding: 0.5rem 0.25rem;
    border-bottom: 2px solid #e2e8f0 !important;
}

table.calendario tbody td.c-celda {
    height: 90px;
    vertical-align: top;
    padding: 6px 6px 8px;
    border: 1px solid #eef0f3 !important;
    background: #fff;
    transition: background-color 0.15s ease;
    position: relative;
}

table.calendario tbody td.c-celda:hover:not(.c-disabled) {
    background: #f8fbf9;
}

td.c-celda.c-disabled {
    background: #f8fafc;
    color: #cbd5e1;
}

td.c-celda.c-disabled .c-dia-numero {
    color: #cbd5e1;
}

td.c-celda.activo {
    background: #ecfdf5;
    box-shadow: inset 0 0 0 2px var(--visitas-primary);
}

td.c-celda.activo .c-dia-numero {
    background: var(--visitas-primary);
    color: #fff;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.c-dia-numero {
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    line-height: 1;
    margin-bottom: 6px;
    padding: 2px 0 0 2px;
}

.c-dia-contenido {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.c-enlace {
    display: inline-block;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.c-enlace:hover {
    transform: scale(1.1);
}

.c-enlace .avatar {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.c-enlace .avatar.bg-green-lt {
    color: var(--visitas-archivo);
    background: #d1f2eb !important;
}

.c-enlace .avatar.bg-pink-lt {
    color: var(--visitas-registro);
    background: #fadcea !important;
}

/* Indicador de cantidad de registros */
.c-badge-count {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--visitas-registro);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 1px 6px;
    line-height: 1.3;
    min-width: 18px;
    text-align: center;
}

/* ========================================
   LEYENDA
   ======================================== */

.v-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 0.75rem 0;
    font-size: 0.8rem;
    color: var(--visitas-text-muted);
    justify-content: center;
}

.v-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.v-legend-dot {
    width: 14px;
    height: 14px;
    border-radius: 4px;
    display: inline-block;
}

.v-legend-dot.is-archivo { background: #d1f2eb; border: 1px solid #16a085; }
.v-legend-dot.is-registro { background: #fadcea; border: 1px solid #d63384; }
.v-legend-dot.is-today { background: #ecfdf5; border: 2px solid var(--visitas-primary); }

/* ========================================
   VISTA LISTA
   ======================================== */

.v-list-card {
    background: #fff;
    border: 1px solid var(--visitas-border);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.v-list-card .table thead th {
    background: #f8fafc;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid #e2e8f0 !important;
    padding: 0.7rem 0.85rem;
}

.v-list-card .table tbody td {
    vertical-align: middle;
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
}

.v-list-card .table tbody tr:hover td {
    background: #f8fbf9;
}

.v-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    background: #e2e8f0;
    color: #475569;
}

.v-pill.is-doc { background: #dbeafe; color: #1e40af; }

.v-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--visitas-text-muted);
}

.v-empty svg {
    color: #cbd5e1;
    margin-bottom: 0.5rem;
}

.v-empty-title {
    font-weight: 600;
    color: #475569;
    margin: 0.25rem 0 0.15rem;
}

/* ========================================
   MODAL
   ======================================== */

#detalle .modal-header {
    background: linear-gradient(135deg, #ffffff, #f1f5f9);
    border-bottom: 2px solid #e2e8f0;
}

#detalle .modal-title {
    font-weight: 700;
    color: var(--visitas-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#detalle .v-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    font-size: 0.8rem;
    color: var(--visitas-text-muted);
    padding: 0.75rem 0;
    border-bottom: 1px solid #eef0f3;
}

#detalle .v-modal-search {
    padding: 0.65rem 0 0.85rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 991.98px) {
    .v-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .v-toolbar-title {
        min-width: 130px;
        font-size: 1rem;
    }
}

@media (max-width: 767.98px) {
    table.calendario tbody td.c-celda {
        height: 70px;
        padding: 4px;
    }
    .c-dia-numero {
        font-size: 0.78rem;
    }
    .c-enlace .avatar {
        width: 26px;
        height: 26px;
    }
    .v-hero .v-title {
        font-size: 1.25rem;
    }
    .v-month-chip {
        min-width: 48px;
        font-size: 0.7rem;
        padding: 0.3rem 0.35rem;
    }
}

@media (max-width: 575.98px) {
    .v-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .v-stat {
        padding: 0.65rem;
        gap: 0.5rem;
    }
    .v-stat-icon {
        width: 36px;
        height: 36px;
    }
    .v-stat-value {
        font-size: 1.15rem;
    }
    table.calendario tbody td.c-celda {
        height: 60px;
    }
    .v-toolbar {
        justify-content: center;
    }
}

/* Tabla de la lista responsive */
@media (max-width: 767.98px) {
    .v-list-responsive {
        overflow-x: auto;
    }
}
