:root {
    --brand-primary: #2a6ef2;
    --brand-secondary: #5f6af2;
    --brand-accent: #1ec9a5;
    --surface: #ffffff;
    --surface-muted: #f4f6fb;
    --text-strong: #1f2937;
    --text-muted: #6b7280;
    --border-soft: #e5e7eb;
    --shadow-sm: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 30px 60px rgba(15, 23, 42, 0.12);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at top left, rgba(88, 101, 242, 0.18), rgba(30, 200, 165, 0.12)), #f8fafc;
    color: var(--text-strong);
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-strong);
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.01em;
}

h1 {
    font-size: clamp(1.6rem, 1.2rem + 1vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.25;
}

h2 {
    font-size: clamp(1.3rem, 1.08rem + 0.6vw, 1.7rem);
    font-weight: 600;
    line-height: 1.35;
}

.navbar {
    background: #86A5D5 !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.4);
    backdrop-filter: blur(12px);
    padding: 0.85rem 1.5rem;
    position: relative;
    z-index: 1100;
}

.navbar-toggler {
    border: none;
    color: var(--brand-primary);
    font-size: 1.4rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--brand-primary) !important;
}

.navbar-logo {
    height: 40px;
    width: auto;
    display: block;
}

.navbar-brand .brand-text {
    color: currentColor;
    font-size: 1rem;
    font-weight: 600;
}

.navbar-toggler {
    border: none;
    color: var(--surface);
    font-size: 1.4rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar .nav-link {
    position: relative;
    border-radius: 999px;
    padding: 0.6rem 1rem;
    color: var(--text-muted);
    transition: all 0.25s ease;
}

.navbar .nav-link.active,
.navbar .nav-link:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.15);
}

.navbar .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 4px;
    background: var(--brand-primary);
    border-radius: 999px;
}

.navbar .megamenu {
    position: static;
}

.navbar .dropdown-menu {
    z-index: 1200;
}

.megamenu .dropdown-menu {
    width: min(1000px, calc(100vw - 3rem));
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    padding: 2rem 2.25rem;
    margin-top: 1rem;
    left: 50% !important;
    transform: translateX(-50%);
}

.megamenu .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid rgba(226, 232, 240, 0.8);
}

.megamenu-content {
    width: 100%;
}

.megamenu-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.megamenu-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0;
    color: var(--text-strong);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease, color 0.2s ease;
}

.megamenu-link i {
    color: var(--brand-primary);
    width: 20px;
    text-align: center;
}

.megamenu-link:hover,
.megamenu-link.active {
    background: rgba(42, 110, 242, 0.08);
    color: var(--brand-primary);
}

.megamenu-link.active i {
    color: var(--brand-secondary);
}

.megamenu .dropdown-menu ul {
    margin: 0;
}

.megamenu .dropdown-menu li {
    list-style: none;
}

.impersonation-banner {
    background: linear-gradient(135deg, rgba(134, 165, 213, 0.85), rgba(88, 116, 177, 0.85));
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    padding: 0.75rem 0;
    position: relative;
    z-index: 1150;
    color: #ffffff;
}

.impersonation-banner .btn {
    border-radius: 999px;
    box-shadow: none;
}

.impersonation-banner .badge {
    font-weight: 600;
}

.card {
    border-radius: var(--radius-lg);
    border: 1px solid rgba(226, 232, 240, 0.7);
    box-shadow: var(--shadow-sm);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.86) 100%);
    backdrop-filter: blur(6px);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    padding: 1.25rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.stats-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(42, 110, 242, 0.15), rgba(30, 201, 165, 0.15));
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.stats-card .value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-strong);
    margin: 0;
}

.stats-card .label {
    font-size: 0.95rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
    border: none;
    border-radius: 999px;
    padding: 0.65rem 1.4rem;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(47, 99, 255, 0.25);
}

.btn-outline-secondary {
    border-radius: 999px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 32px rgba(47, 99, 255, 0.28);
}

.badge {
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    font-weight: 600;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text-strong);
}

.section-title i {
    color: var(--brand-primary);
    background: rgba(42, 110, 242, 0.12);
    border-radius: 50%;
    padding: 0.6rem;
    font-size: 1.1rem;
}

.table {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table thead {
    background: rgba(42, 110, 242, 0.08);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
}

.table-hover tbody tr:hover {
    background: rgba(42, 110, 242, 0.07);
}

.calendar-wrapper {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    padding: 1rem;
    border: 1px solid rgba(226, 232, 240, 0.7);
    box-shadow: var(--shadow-sm);
    min-height: 360px;
}

.calendar-wrapper .fc .fc-toolbar-title {
    font-size: 1.35rem;
}

.calendar-wrapper .fc .fc-button {
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.75rem;
    font-size: 0.85rem;
}

.calendar-wrapper .fc .fc-daygrid-day-number {
    font-size: 0.9rem;
}

.fc .fc-toolbar.fc-header-toolbar {
    margin-bottom: 1.5rem;
}

.fc-theme-standard .fc-scrollgrid {
    border-radius: var(--radius-md);
    border: 1px solid rgba(226, 232, 240, 0.7);
}

.fc-theme-standard td,
.fc-theme-standard th {
    border-color: rgba(226, 232, 240, 0.6);
}

.fc-daygrid-day-number {
    color: var(--text-muted);
    font-weight: 500;
}

.fc .fc-daygrid-day.fc-day-today {
    background: rgba(42, 110, 242, 0.12);
}

.fc-event {
    border-radius: 12px;
    padding: 4px 8px;
    font-size: 0.82rem;
    border: none;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}

.fc-event .fc-event-title {
    font-weight: 600;
}

/* Estilos para días festivos */
.fc-bg-event.holiday-event {
    background-color: #e3f2fd !important;
    border: 2px dashed #2196f3 !important;
    border-radius: 4px;
    opacity: 0.6;
}

.fc-event.holiday-event-list {
    background-color: #e3f2fd !important;
    border-color: #2196f3 !important;
    color: #1565c0 !important;
    font-weight: 500;
}

.fc-daygrid-day.fc-day-today .fc-bg-event.holiday-event {
    background-color: rgba(227, 242, 253, 0.8) !important;
    opacity: 0.7;
}

/* Fondo sutil para días con festivos */
.fc-daygrid-day:has(.holiday-event) {
    background-color: rgba(227, 242, 253, 0.2) !important;
}

/* Fallback para navegadores que no soportan :has() */
.fc-daygrid-day .holiday-event + .fc-daygrid-day-events {
    position: relative;
}

.fc-daygrid-day .holiday-event + .fc-daygrid-day-events::before {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: #2196f3;
    border-radius: 50%;
    border: 1px solid #ffffff;
}

.quick-actions .btn {
    border-radius: var(--radius-md);
    border: 1px solid rgba(226, 232, 240, 0.7);
    padding: 1.2rem;
    font-weight: 600;
    color: var(--text-strong);
    background: rgba(255, 255, 255, 0.85);
    transition: all 0.25s ease;
}

.quick-actions .btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-sm);
}

.filter-section {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(226, 232, 240, 0.7);
    border-radius: var(--radius-lg);
}

.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1px solid rgba(203, 213, 225, 0.8);
    background: rgba(255, 255, 255, 0.92);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(42, 110, 242, 0.4);
    box-shadow: 0 0 0 4px rgba(42, 110, 242, 0.15);
}

.card-ghost {
    border: 1px dashed rgba(148, 163, 184, 0.7);
    background: rgba(241, 245, 249, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--text-muted);
    gap: 0.75rem;
    padding: 2.5rem;
}

.avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(42, 110, 242, 0.1);
    color: var(--brand-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.page-heading {
    margin-bottom: 2.25rem;
}

.page-heading .page-title {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    letter-spacing: -0.02em;
}

.page-heading .page-title i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(42, 110, 242, 0.12);
    color: var(--brand-primary);
    font-size: 1.5rem;
}

.page-heading .page-subtitle {
    margin-bottom: 0;
    color: var(--text-muted);
    font-size: 0.76rem;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(30, 201, 165, 0.12);
    color: var(--brand-accent);
    font-weight: 500;
}

footer {
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    background: rgba(255, 255, 255, 0.6);
}

.navbar-brand,
.navbar .nav-link,
.navbar .nav-link i,
.navbar .dropdown-toggle .nav-label,
.navbar .dropdown-toggle i {
    color: #ffffff !important;
}

.navbar .dropdown-menu .megamenu-link,
.navbar .dropdown-menu .megamenu-title,
.navbar .dropdown-menu .megamenu-link i {
    color: var(--text-strong);
}

.navbar .dropdown-menu .megamenu-link:hover,
.navbar .dropdown-menu .megamenu-link.active {
    color: var(--brand-primary);
}

@media (max-width: 991px) {
    .navbar {
        padding: 0.75rem 1rem;
    }

    .stats-card .value {
        font-size: 2rem;
    }

    .quick-actions .btn {
        padding: 1rem;
    }

    .megamenu .dropdown-menu {
        width: calc(100vw - 1.5rem);
        left: 0 !important;
        transform: none;
        margin: 0.5rem auto;
    }

    .calendar-wrapper {
        padding: 0.6rem;
        min-height: 300px;
    }

    .calendar-wrapper .fc .fc-toolbar-title {
        font-size: 1.1rem;
    }

    .calendar-wrapper .fc .fc-button {
        padding: 0.25rem 0.6rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 767.98px) {
    .stack-table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .stack-table thead {
        display: none;
    }

    .stack-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid rgba(226, 232, 240, 0.8);
        border-radius: var(--radius-lg);
        padding: 0.85rem 1rem;
        margin-bottom: 1rem;
        box-shadow: var(--shadow-sm);
    }

    .stack-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .stack-table tbody td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.4rem 0;
        border-bottom: 1px solid rgba(226, 232, 240, 0.8);
        font-size: 0.95rem;
    }

    .stack-table tbody td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .stack-table tbody td:first-child {
        padding-top: 0;
    }

    .stack-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
    }
}


