/* =====================================================================
   Control de Horas Extras — tema según mi_estilo.md
   Bootstrap 5.3 · mobile-first · glass cards · acento cian
   ===================================================================== */

:root {
    --bs-body-font-family: Tahoma, 'Segoe UI', sans-serif;
    --bs-body-color: #e0e3e5;
    --primary-color: #000814;
    --secondary-color: #74f5ff;
    --secondary-hover: #00f1fe;
    --surface-modal: #00122e;
    --footer-bg: #00050e;
    --border-soft: rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text-muted: rgba(255, 255, 255, 0.5);
    --topbar-height: 64px;
    --sidebar-width: 260px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--bs-body-font-family);
    color: var(--bs-body-color);
    min-height: 100vh;
    margin: 0;
    background-color: var(--primary-color);
    background-image: linear-gradient(
        to bottom right,
        rgba(0, 8, 20, 0.92),
        rgba(0, 36, 107, 0.85),
        rgba(0, 15, 46, 0.92)
    );
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

body.has-bg-image {
    background-image: linear-gradient(
        to bottom right,
        rgba(0, 8, 20, 0.92),
        rgba(0, 36, 107, 0.85),
        rgba(0, 15, 46, 0.92)
    ), url('../img/fondo.png');
    background-size: cover, cover;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
}

a:hover {
    color: var(--secondary-hover);
}

h1, h2, h3, h4, .navbar-brand {
    font-family: var(--bs-body-font-family);
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
    vertical-align: middle;
    font-size: 1.3rem;
    line-height: 1;
}

.text-secondary-fixed {
    color: var(--secondary-color) !important;
}

.text-muted-soft {
    color: var(--text-muted) !important;
}

/* ------------------------------ Botones ---------------------------- */
.btn-primary-custom {
    background-color: var(--secondary-color);
    color: #0a0e17;
    font-weight: 600;
    border: none;
    border-radius: 50rem;
    padding: 0.5rem 1.5rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover,
.btn-primary-custom:focus {
    background-color: var(--secondary-hover);
    color: #0a0e17;
    transform: scale(1.04);
}

.btn-primary-custom:disabled,
.btn-primary-custom.disabled {
    background-color: rgba(116, 245, 255, 0.35);
    color: rgba(10, 14, 23, 0.65);
    transform: none;
}

.btn-outline-custom {
    background-color: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50rem;
    padding: 0.5rem 1.5rem;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
}

.btn-outline-custom:hover,
.btn-outline-custom:focus {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.5);
}

/* Columnas de filtro que son a la vez contenedor flex («Filtrar» + limpiar):
   los botones bajan a una segunda línea antes de desbordar la columna. */
.row > .d-flex.gap-2 {
    flex-wrap: wrap;
}

.btn-icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.btn-icon:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: var(--secondary-color);
}

.btn-sm-custom {
    min-height: 36px;
    padding: 0.25rem 1rem;
    font-size: 0.8rem;
}

/* ------------------------------ Tarjetas --------------------------- */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-soft);
    border-radius: 1rem;
}

.glass-card.dashboard-card {
    padding: 1.25rem;
    height: 100%;
}

.pulse-border {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%   { box-shadow: 0 0 0 0 rgba(116, 245, 255, 0.4); }
    70%  { box-shadow: 0 0 0 10px rgba(116, 245, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(116, 245, 255, 0); }
}

/* KPIs de los paneles */
.kpi-card {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: 0.85rem;
    background-color: rgba(116, 245, 255, 0.12);
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.kpi-label {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ------------------------------ Formularios ------------------------ */
.form-label {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.form-control,
.form-select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-strong);
    color: #fff;
    min-height: 44px;
}

.form-control:focus,
.form-select:focus {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.25rem rgba(116, 245, 255, 0.25);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.45);
}

.form-select option {
    background-color: var(--surface-modal);
    color: #fff;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: #ff6b6b;
}

.invalid-feedback {
    font-size: 0.78rem;
}

.form-check-input {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--border-strong);
}

.form-check-input:checked {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* ------------------------------ Tablas ----------------------------- */
.table-custom {
    --bs-table-bg: rgba(255, 255, 255, 0.02);
    --bs-table-color: #fff;
    --bs-table-border-color: var(--border-soft);
    font-size: 0.8rem;
    margin-bottom: 0;
}

.table-custom thead th {
    color: rgba(255, 255, 255, 0.65);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
    padding: 0.2rem 0.35rem;
}

.table-custom tbody td {
    padding: 0.35rem;
    white-space: nowrap;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.table-custom.table-responsive {
    border-radius: 0.75rem;
}

/* DataTables con el tema */
.dt-container {
    color: #fff;
    font-size: 0.8rem;
}

.dt-container .dt-search input,
.dt-container .dt-length select {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-strong);
    color: #fff;
    border-radius: 0.5rem;
    padding: 0.3rem 0.6rem;
}

.dt-container .dt-info,
.dt-container .dt-length label,
.dt-container .dt-search label {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.dt-container .dt-paging .page-link {
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
}

/* ------------------------------ Paginación ------------------------- */
.page-link {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-strong);
    color: #fff;
}

.page-link:hover {
    background-color: rgba(255, 255, 255, 0.12);
    color: var(--secondary-color);
}

.page-item.active .page-link {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #0a0e17;
}

.page-item.disabled .page-link {
    background-color: rgba(255, 255, 255, 0.02);
    color: rgba(255, 255, 255, 0.35);
}

/* ------------------------------ Badges ----------------------------- */
.badge {
    font-weight: 600;
    font-size: 0.68rem;
    padding: 0.35em 0.6em;
    border-radius: 0.5rem;
    letter-spacing: 0.02em;
}

.badge-soft-info {
    background-color: rgba(116, 245, 255, 0.15);
    color: var(--secondary-color);
}

/* ------------------------------ Layout interno --------------------- */
.app-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    max-width: 85vw;
    background-color: rgba(0, 8, 20, 0.96);
    border-right: 1px solid var(--border-soft);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 1045;
}

body.sidebar-open .sidebar {
    transform: translateX(0);
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1040;
}

body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid var(--border-soft);
}

.sidebar-brand .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 0.75rem;
    background-color: rgba(116, 245, 255, 0.14);
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.sidebar-brand .brand-text {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.15;
}

.sidebar-nav {
    padding: 0.75rem 0.6rem 1.5rem;
    overflow-y: auto;
    flex: 1 1 auto;
}

.nav-section-title {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
    padding: 0.75rem 0.6rem 0.35rem;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff;
    font-weight: 500;
    font-size: 0.86rem;
    padding: 0.6rem 0.7rem;
    border-radius: 0.5rem;
    margin-bottom: 0.15rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-link-custom:hover {
    color: var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-link-custom.active {
    color: var(--secondary-color);
    background-color: rgba(255, 255, 255, 0.08);
}

.nav-link-custom.disabled {
    color: rgba(255, 255, 255, 0.35);
    pointer-events: none;
}

.nav-link-custom .pending-tag {
    margin-left: auto;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.35);
}

.app-main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.9rem;
    background-color: rgba(0, 8, 20, 0.85);
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(8px);
}

.topbar-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.topbar-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.user-chip {
    display: none;
    text-align: right;
    line-height: 1.15;
}

.user-chip .user-name {
    font-size: 0.82rem;
    font-weight: 600;
}

.user-chip .user-role {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* -------------------- Campana de notificaciones ------------------- */
.notif-wrap {
    position: relative;
}

.notif-btn {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 50rem;
    background-color: #ff5470;
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.notif-menu {
    width: min(340px, calc(100vw - 2rem));
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 1rem;
    background-color: var(--surface-modal);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.notif-cabecera {
    border-bottom: 1px solid var(--border-soft);
}

.notif-enlace {
    color: var(--secondary-color);
    font-size: 0.72rem;
    text-decoration: none;
}

.notif-enlace:hover {
    color: var(--secondary-hover);
}

.notif-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.9rem;
    border: 0;
    border-bottom: 1px solid var(--border-soft);
    background-color: transparent;
    color: var(--bs-body-color);
    text-align: left;
    transition: background-color 0.2s ease;
}

.notif-item:hover,
.notif-item:focus {
    background-color: rgba(255, 255, 255, 0.07);
}

.notif-nueva {
    background-color: rgba(116, 245, 255, 0.08);
    box-shadow: inset 3px 0 0 var(--secondary-color);
}

.notif-titulo {
    font-size: 0.8rem;
    font-weight: 600;
}

.notif-texto {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.notif-fecha {
    font-size: 0.66rem;
    color: var(--text-muted);
}

.notif-ver {
    color: var(--secondary-color);
}

.content-wrap {
    padding: 1rem;
    flex: 1 1 auto;
}

.page-header {
    margin-bottom: 1rem;
}

.page-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.app-footer {
    background-color: rgba(0, 5, 14, 0.6);
    border-top: 1px solid var(--border-soft);
    color: var(--text-muted);
    font-size: 0.72rem;
    padding: 0.75rem 1rem;
    text-align: center;
}

/* ------------------------------ Landing ---------------------------- */
.landing-body {
    background-attachment: scroll;
}

/* Video de fondo del sistema (RF-16): fijo, cubriendo la pantalla y atenuado.
   Lo pinta `app/views/partials/fondo_video.php`, incluido por los layouts `guest` y `app`.
   z-index negativo: queda sobre el degradado del body y debajo del contenido. */
.landing-media {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.landing-media-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.53;
    filter: saturate(0.95) contrast(1.02);
}

.landing-media-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 8, 20, 0.66),
        rgba(0, 15, 46, 0.50) 45%,
        rgba(0, 8, 20, 0.70)
    );
}

@media (prefers-reduced-motion: reduce) {
    .landing-media {
        display: none;
    }
}

.bg-fixed-shader {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(116, 245, 255, 0.12), transparent 45%),
                radial-gradient(circle at 80% 0%, rgba(0, 36, 107, 0.55), transparent 50%);
    pointer-events: none;
}

.navbar-custom {
    background-color: rgba(0, 8, 20, 0.55);
    border-bottom: 1px solid var(--border-soft);
    backdrop-filter: blur(10px);
}

.hero {
    position: relative;
    padding: 4rem 0 3rem;
    text-align: center;
    overflow: hidden;
}

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1rem;
    /* Sombra suave: mantiene el contraste sobre el video de fondo (RF-16). */
    text-shadow: 0 2px 12px rgba(0, 8, 20, 0.85);
}

.hero-title span {
    color: var(--secondary-color);
}

.hero-text {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.95rem;
    max-width: 40rem;
    margin: 0 auto 1.75rem;
    text-shadow: 0 1px 8px rgba(0, 8, 20, 0.9);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.landing-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 1rem;
    padding: 1.25rem;
    height: 100%;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.landing-card:hover {
    transform: translateY(-5px);
    border-color: rgba(116, 245, 255, 0.45);
}

.step-index {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background-color: rgba(116, 245, 255, 0.15);
    color: var(--secondary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.6rem;
}

.section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1.25rem;
}

/* Animaciones de entrada */
.fade-slide-up {
    animation: fade-slide-up 0.8s ease both;
}

@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-left  { transform: translateX(-24px); }
.reveal-right { transform: translateX(24px); }
.reveal-zoom  { transform: scale(0.94); }

.reveal-visible {
    opacity: 1;
    transform: none;
}

.reveal-d-1 { transition-delay: 0.1s; }
.reveal-d-2 { transition-delay: 0.2s; }
.reveal-d-3 { transition-delay: 0.3s; }

/* ------------------------------ Login ------------------------------ */
.login-wrap {
    min-height: calc(100vh - 130px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 1.75rem 1.5rem;
}

/* Imagen de fondo de la pantalla de acceso (public/media/landing/fondo.jpg).
   Fija, cubriendo la pantalla y atenuada con un overlay para no perder contraste. */
.login-media {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    filter: saturate(0.95) contrast(1.02);
}

.login-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 8, 20, 0.72),
        rgba(0, 15, 46, 0.56) 45%,
        rgba(0, 8, 20, 0.80)
    );
}

.login-card .brand-mark {
    width: 52px;
    height: 52px;
    border-radius: 1rem;
    background-color: rgba(116, 245, 255, 0.14);
    color: var(--secondary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.login-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    border-top: 1px dashed var(--border-soft);
    padding-top: 0.75rem;
    margin-top: 1rem;
}

/* ------------------------------ Varios ----------------------------- */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 1rem;
    font-size: 0.85rem;
}

.empty-state .material-symbols-outlined {
    font-size: 2.2rem;
    color: rgba(255, 255, 255, 0.25);
    display: block;
    margin-bottom: 0.5rem;
}

.alert {
    border-radius: 0.75rem;
    font-size: 0.85rem;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.18);
    border-color: rgba(25, 135, 84, 0.4);
    color: #b6f0d3;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.18);
    border-color: rgba(220, 53, 69, 0.4);
    color: #ffd2d7;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.16);
    border-color: rgba(255, 193, 7, 0.35);
    color: #ffe39a;
}

.alert-info {
    background-color: rgba(116, 245, 255, 0.12);
    border-color: rgba(116, 245, 255, 0.3);
    color: #c9fbff;
}

.list-clean {
    list-style: none;
    padding: 0;
    margin: 0;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ------------------------------ Modales ---------------------------- */
.modal-content {
    background: var(--surface-modal);
    border: 1px solid var(--border-soft);
    border-radius: 1rem;
    color: var(--bs-body-color);
    box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.45);
}

.modal-header,
.modal-footer {
    border-color: var(--border-soft);
}

.modal-title {
    color: #fff;
}

.modal-header .btn-close {
    filter: invert(1) grayscale(1) brightness(1.8);
    opacity: 0.75;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-backdrop.show {
    opacity: 0.7;
}

/* ------------------------------ Móvil / táctil --------------------- */
/* Objetivos táctiles de al menos 44x44 px en pantallas pequeñas (tarea 7.5) */
@media (max-width: 991.98px) {
    .btn-sm-custom {
        min-height: 44px;
        padding: 0.4rem 1rem;
    }

    .nav-link-custom {
        min-height: 44px;
        padding: 0.7rem;
    }

    .btn-close {
        min-width: 44px;
        min-height: 44px;
    }

    .link-touch {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0 0.25rem;
    }

    .pagination .page-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }
}

/* ------------------------------ Escritorio ------------------------- */
@media (min-width: 992px) {
    .sidebar {
        transform: none;
        background-color: rgba(255, 255, 255, 0.04);
        backdrop-filter: none;
    }

    .sidebar-backdrop,
    .mobile-toggler {
        display: none !important;
    }

    .app-main {
        margin-left: var(--sidebar-width);
    }

    .topbar {
        padding: 0.6rem 1.5rem;
    }

    .content-wrap {
        padding: 1.5rem;
    }

    .topbar-title {
        font-size: 1.1rem;
    }

    .user-chip {
        display: block;
    }

    .hero {
        padding: 6rem 0 4rem;
        text-align: left;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-text {
        margin-left: 0;
        margin-right: 0;
    }

    .hero-actions {
        justify-content: flex-start;
    }
}
