/* =====================================================================
   H&V TimeBilling · Sistema de estilos "vidrio líquido"
   ---------------------------------------------------------------------
   Paleta de la marca: azul 1B3B5A, turquesa 3A9D95 y el dorado del logo.
   Todo panel es una lámina translúcida (backdrop-filter) con un brillo en
   el borde superior; el fondo es una luz difusa fija para que el vidrio
   tenga qué desenfocar. Tipografía: Sora (títulos) y Manrope (texto).

   Se carga después de Bootstrap 5 y redefine sus componentes, así que
   las plantillas solo necesitan las clases de siempre (.card, .btn, .table)
   más unas pocas utilidades hv-* definidas al final.
   ===================================================================== */

:root {
    --hv-blue: #1B3B5A;
    --hv-blue-deep: #12283E;
    --hv-blue-soft: #2B5A86;
    --hv-teal: #3A9D95;
    --hv-teal-deep: #2A7C76;
    --hv-teal-soft: #6CC9C0;
    --hv-gold: #D9903A;
    --hv-ink: #14263A;
    --hv-ink-2: #55697E;
    --hv-ink-3: #8A9BAE;
    --hv-ground: #E9EFF4;

    --hv-ok: #2E9E6B;
    --hv-warn: #D9912B;
    --hv-bad: #C94B4B;

    --hv-glass: rgba(255, 255, 255, 0.58);
    --hv-glass-strong: rgba(255, 255, 255, 0.78);
    --hv-glass-border: rgba(255, 255, 255, 0.78);
    --hv-hairline: rgba(27, 59, 90, 0.10);
    --hv-shadow: 0 18px 40px -18px rgba(27, 59, 90, 0.38), 0 2px 8px rgba(27, 59, 90, 0.06);
    --hv-radius: 20px;
    --hv-radius-sm: 12px;
    --hv-blur: blur(22px) saturate(160%);

    --hv-font-body: 'Manrope', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --hv-font-display: 'Sora', 'Manrope', 'Segoe UI', sans-serif;

    /* Bootstrap toma estos valores para enlaces, foco y color "primary". */
    --bs-primary: #1B3B5A;
    --bs-primary-rgb: 27, 59, 90;
    --bs-link-color: #1B3B5A;
    --bs-link-hover-color: #2A7C76;
    --bs-body-color: #14263A;
    --bs-body-font-family: var(--hv-font-body);
}

/* ---------------------------------------------------------------------
   1. Lienzo: fondo con luz difusa y trazos de brillo
   --------------------------------------------------------------------- */
html { background: var(--hv-ground); }

body {
    font-family: var(--hv-font-body);
    color: var(--hv-ink);
    background: transparent;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(60% 55% at 12% 8%, rgba(58, 157, 149, 0.40) 0%, rgba(58, 157, 149, 0) 62%),
        radial-gradient(55% 60% at 88% 16%, rgba(27, 59, 90, 0.32) 0%, rgba(27, 59, 90, 0) 60%),
        radial-gradient(50% 50% at 72% 94%, rgba(217, 144, 58, 0.18) 0%, rgba(217, 144, 58, 0) 60%),
        radial-gradient(45% 45% at 18% 88%, rgba(108, 201, 192, 0.28) 0%, rgba(108, 201, 192, 0) 60%),
        linear-gradient(180deg, #EEF3F7 0%, #E4EBF2 100%);
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, 0.42) 46%, rgba(255, 255, 255, 0) 58%),
        linear-gradient(295deg, rgba(255, 255, 255, 0) 60%, rgba(255, 255, 255, 0.25) 72%, rgba(255, 255, 255, 0) 84%);
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--hv-font-display);
    color: var(--hv-blue);
    letter-spacing: -0.01em;
    font-weight: 600;
}

.text-white h1, .text-white h2, .text-white h3, .text-white h4, .text-white h5, .text-white h6,
.hv-kpi h1, .hv-kpi h2, .hv-kpi h3, .hv-kpi h4, .hv-kpi h5, .hv-kpi h6,
.hv-card-head h1, .hv-card-head h2, .hv-card-head h3, .hv-card-head h4, .hv-card-head h5, .hv-card-head h6,
.bg-primary h1, .bg-primary h2, .bg-primary h3, .bg-primary h4, .bg-primary h5, .bg-primary h6,
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4, .bg-dark h5, .bg-dark h6 { color: #fff; }

a { text-decoration: none; }
a:hover { color: var(--hv-teal-deep); }

::selection { background: rgba(58, 157, 149, 0.30); }

/* Colores utilitarios de Bootstrap, alineados a la marca */
.text-primary { color: var(--hv-blue) !important; }
.text-dark { color: var(--hv-ink) !important; }
.text-secondary, .text-muted { color: var(--hv-ink-2) !important; }
.text-success { color: var(--hv-ok) !important; }
.text-danger { color: var(--hv-bad) !important; }
.text-warning { color: var(--hv-warn) !important; }
.text-info { color: var(--hv-teal-deep) !important; }
.bg-primary { background-color: var(--hv-blue) !important; }
.bg-white { background-color: rgba(255, 255, 255, 0.55) !important; }
.bg-light { background-color: rgba(255, 255, 255, 0.38) !important; }
.bg-dark { background-color: var(--hv-blue-deep) !important; }
.bg-secondary { background-color: var(--hv-ink-2) !important; }
.border-primary { border-color: rgba(27, 59, 90, 0.35) !important; }
.border-success { border-color: rgba(46, 158, 107, 0.45) !important; }
.border-warning { border-color: rgba(217, 145, 43, 0.5) !important; }
.border-info { border-color: rgba(58, 157, 149, 0.45) !important; }
hr { border-color: var(--hv-hairline); opacity: 1; }

/* ---------------------------------------------------------------------
   2. Vidrio: la lámina base y las tarjetas
   --------------------------------------------------------------------- */
.glass,
.card {
    position: relative;
    background: var(--hv-glass);
    -webkit-backdrop-filter: var(--hv-blur);
    backdrop-filter: var(--hv-blur);
    border: 1px solid var(--hv-glass-border);
    border-radius: var(--hv-radius);
    box-shadow: var(--hv-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    color: var(--hv-ink);
}

/* Brillo diagonal en la esquina superior izquierda, como luz sobre vidrio */
.glass::before,
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(125deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.10) 28%, rgba(255, 255, 255, 0) 46%);
}

.card > * { position: relative; }

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--hv-hairline);
    border-radius: var(--hv-radius) var(--hv-radius) 0 0 !important;
    color: var(--hv-blue);
    font-weight: 600;
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--hv-hairline);
}

/* Cabecera de tarjeta en azul cristal (sustituye los fondos azules sólidos) */
.hv-card-head {
    background: linear-gradient(135deg, rgba(27, 59, 90, 0.96) 0%, rgba(43, 90, 134, 0.94) 100%) !important;
    color: #fff !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.hv-card-head h1, .hv-card-head h2, .hv-card-head h3,
.hv-card-head h4, .hv-card-head h5, .hv-card-head h6 { color: #fff; }

/* ---------------------------------------------------------------------
   3. Barra lateral (escritorio) en azul cristal
   --------------------------------------------------------------------- */
.sidebar {
    width: 264px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    color: #fff;
    background: linear-gradient(180deg, rgba(27, 59, 90, 0.90) 0%, rgba(18, 40, 62, 0.94) 100%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    backdrop-filter: blur(24px) saturate(140%);
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 14px 0 44px -26px rgba(18, 40, 62, 0.9);
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(70% 30% at 20% 0%, rgba(108, 201, 192, 0.22) 0%, rgba(108, 201, 192, 0) 70%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 30%);
}

.sidebar > * { position: relative; }

.logo-container {
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
    text-align: center;
}

.logo-tile {
    display: inline-block;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 10px 16px;
    box-shadow: inset 0 1px 0 #fff, 0 12px 26px -16px rgba(0, 0, 0, 0.7);
}

.logo-img {
    max-width: 150px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.sidebar .overflow-auto {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.sidebar .overflow-auto::-webkit-scrollbar { width: 6px; }
.sidebar .overflow-auto::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.25); border-radius: 6px; }
.sidebar .overflow-auto::-webkit-scrollbar-track { background: transparent; }

.sidebar .nav-link {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.78);
    padding: 10px 14px;
    margin: 2px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.sidebar .nav-link i {
    margin-right: 10px;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    opacity: 0.9;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}

.sidebar .nav-link.active {
    background: linear-gradient(135deg, rgba(58, 157, 149, 0.98) 0%, rgba(42, 124, 118, 0.98) 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 20px -12px rgba(58, 157, 149, 0.95);
}

.section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.45);
    margin: 18px 0 6px 26px;
    font-weight: 700;
}

.sidebar-footer {
    margin-top: auto;
    padding: 14px 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    margin-bottom: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--hv-teal-soft), var(--hv-teal-deep));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.user-chip .user-name {
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-chip .user-state {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.6);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.8rem;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.btn-ghost.btn-ghost-danger { color: #FFB4B4; }
.btn-ghost.btn-ghost-danger:hover { background: rgba(201, 75, 75, 0.35); color: #fff; }

/* Tipo de cambio del día, en la barra lateral */
.tc-chip {
    display: block;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.10);
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}
.tc-chip strong { color: #fff; font-variant-numeric: tabular-nums; }
.tc-chip .tc-label { letter-spacing: 0.08em; text-transform: uppercase; font-weight: 700; font-size: 0.64rem; color: var(--hv-teal-soft); }

/* ---------------------------------------------------------------------
   4. Contenido principal y navegación móvil
   --------------------------------------------------------------------- */
.main-content {
    margin-left: 264px;
    padding: 28px 32px 90px;
    min-height: 100vh;
}

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    justify-content: space-around;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    backdrop-filter: blur(22px) saturate(160%);
    border-top: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 -12px 30px -18px rgba(27, 59, 90, 0.5);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--hv-ink-2);
    font-size: 0.66rem;
    font-weight: 600;
    flex: 1;
    padding: 4px 0;
}
.mobile-nav-item i { font-size: 1.3rem; margin-bottom: 2px; }
.mobile-nav-item.active { color: var(--hv-teal-deep); }
.mobile-nav-item.active i {
    background: rgba(58, 157, 149, 0.16);
    border-radius: 12px;
    padding: 2px 14px;
}

.whatsapp-float {
    position: fixed;
    width: 56px;
    height: 56px;
    bottom: 32px;
    right: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    z-index: 10000;
    background: linear-gradient(135deg, #34D06A 0%, #1FA854 100%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 14px 30px -12px rgba(31, 168, 84, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: transform 0.2s ease;
}
.whatsapp-float:hover { transform: translateY(-2px) scale(1.04); color: #fff; }

/* ---------------------------------------------------------------------
   5. Botones
   --------------------------------------------------------------------- */
.btn {
    border-radius: var(--hv-radius-sm);
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:active { transform: translateY(0) scale(0.99); }
.btn-sm { border-radius: 10px; }
.btn-lg { border-radius: 14px; }

.btn-primary, .btn-primary:focus, .btn-primary.active {
    background: linear-gradient(135deg, #2B5A86 0%, #1B3B5A 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: 0 12px 24px -14px rgba(27, 59, 90, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #336A9C 0%, #21476B 100%);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
    transform: translateY(-1px);
}

.btn-hv-teal, .btn-hv-teal:focus {
    background: linear-gradient(135deg, #4DB3AA 0%, #2F8A82 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    box-shadow: 0 12px 24px -14px rgba(58, 157, 149, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-hv-teal:hover {
    background: linear-gradient(135deg, #5AC2B8 0%, #35978E 100%);
    color: #fff;
    transform: translateY(-1px);
}

.btn-success, .btn-success:focus {
    background: linear-gradient(135deg, #3AAE78 0%, #257D56 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    box-shadow: 0 12px 24px -14px rgba(46, 158, 107, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-success:hover { background: linear-gradient(135deg, #45BD84 0%, #2B8B60 100%); color: #fff; transform: translateY(-1px); }

.btn-excel, .btn-excel:focus {
    background: linear-gradient(135deg, #2E8B57 0%, #1E6B41 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    box-shadow: 0 12px 24px -14px rgba(33, 115, 70, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-excel:hover { color: #fff; transform: translateY(-1px); background: linear-gradient(135deg, #34985F 0%, #237649 100%); }

.btn-gold, .btn-gold:focus {
    background: linear-gradient(135deg, #E2A24E 0%, #C27C2A 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    box-shadow: 0 12px 24px -14px rgba(217, 144, 58, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-gold:hover { color: #fff; transform: translateY(-1px); }

.btn-warning, .btn-warning:focus {
    background: linear-gradient(135deg, #F0B04A 0%, #D9912B 100%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    box-shadow: 0 12px 24px -14px rgba(217, 145, 43, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-warning:hover { color: #fff; transform: translateY(-1px); }

.btn-danger, .btn-danger:focus {
    background: linear-gradient(135deg, #DA6363 0%, #B93E3E 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    box-shadow: 0 12px 24px -14px rgba(201, 75, 75, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-danger:hover { color: #fff; transform: translateY(-1px); }

.btn-secondary, .btn-secondary:focus {
    background: linear-gradient(135deg, #7F93A8 0%, #5F7489 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
}
.btn-secondary:hover { color: #fff; transform: translateY(-1px); }

.btn-outline-primary, .btn-outline-secondary, .btn-outline-dark, .btn-light, .btn-outline-success, .btn-outline-danger {
    background: rgba(255, 255, 255, 0.55);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(27, 59, 90, 0.18);
    color: var(--hv-blue);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.btn-outline-primary:hover, .btn-outline-secondary:hover, .btn-outline-dark:hover, .btn-light:hover, .btn-outline-success:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(58, 157, 149, 0.6);
    color: var(--hv-teal-deep);
    transform: translateY(-1px);
}
.btn-outline-danger { color: var(--hv-bad); }
.btn-outline-danger:hover { background: rgba(201, 75, 75, 0.12); border-color: var(--hv-bad); color: var(--hv-bad); }
.btn-outline-primary.active, .btn-outline-secondary.active { background: rgba(27, 59, 90, 0.9); color: #fff; }

.btn-link { color: var(--hv-ink-2); }
.btn-link:hover { color: var(--hv-teal-deep); }

.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-radius: var(--hv-radius-sm) 0 0 var(--hv-radius-sm); }
.btn-group > .btn:last-child { border-radius: 0 var(--hv-radius-sm) var(--hv-radius-sm) 0; }

.btn-close { filter: none; }

/* ---------------------------------------------------------------------
   6. Formularios
   --------------------------------------------------------------------- */
.form-label { color: var(--hv-ink-2); font-weight: 600; }

.form-control, .form-select {
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(27, 59, 90, 0.16);
    border-radius: var(--hv-radius-sm);
    color: var(--hv-ink);
    box-shadow: inset 0 1px 2px rgba(27, 59, 90, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.form-control::placeholder { color: var(--hv-ink-3); }
.form-control:focus, .form-select:focus {
    background: rgba(255, 255, 255, 0.88);
    border-color: var(--hv-teal);
    box-shadow: 0 0 0 4px rgba(58, 157, 149, 0.20), inset 0 1px 2px rgba(27, 59, 90, 0.06);
    color: var(--hv-ink);
}
.form-control-sm, .form-select-sm { border-radius: 10px; }
.form-control-lg, .form-select-lg { border-radius: 14px; }
.form-control:disabled, .form-control[readonly] { background: rgba(27, 59, 90, 0.06); }
.form-text { color: var(--hv-ink-3); }

.input-group-text {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(27, 59, 90, 0.16);
    color: var(--hv-ink-2);
    border-radius: var(--hv-radius-sm);
}
.input-group > .form-control, .input-group > .form-select { border-radius: var(--hv-radius-sm); }
.input-group > :not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.input-group > :not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* Select2 con tema bootstrap-5 */
.select2-container--bootstrap-5 .select2-selection {
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(27, 59, 90, 0.16);
    border-radius: var(--hv-radius-sm);
    box-shadow: inset 0 1px 2px rgba(27, 59, 90, 0.06);
    color: var(--hv-ink);
}
.select2-container--bootstrap-5.select2-container--focus .select2-selection,
.select2-container--bootstrap-5.select2-container--open .select2-selection {
    border-color: var(--hv-teal);
    box-shadow: 0 0 0 4px rgba(58, 157, 149, 0.20);
}
.select2-container--bootstrap-5 .select2-dropdown {
    background: var(--hv-glass-strong);
    -webkit-backdrop-filter: var(--hv-blur);
    backdrop-filter: var(--hv-blur);
    border: 1px solid var(--hv-glass-border);
    border-radius: 14px;
    box-shadow: var(--hv-shadow);
    overflow: hidden;
}
.select2-container--bootstrap-5 .select2-dropdown .select2-results__option--highlighted { background: var(--hv-teal); color: #fff; }
.select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field { border-radius: 10px; }

/* ---------------------------------------------------------------------
   7. Tablas
   --------------------------------------------------------------------- */
.table {
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(27, 59, 90, 0.03);
    --bs-table-hover-bg: rgba(58, 157, 149, 0.09);
    --bs-table-color: var(--hv-ink);
    color: var(--hv-ink);
    font-variant-numeric: tabular-nums;
}
.table > :not(caption) > * > * { border-bottom-color: rgba(27, 59, 90, 0.08); }
.table thead th {
    font-size: 0.72rem;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--hv-ink-2);
    background: rgba(27, 59, 90, 0.05);
    border-bottom: 1px solid rgba(27, 59, 90, 0.12) !important;
    white-space: nowrap;
}
.table tbody td { vertical-align: middle; }
.table-bordered > :not(caption) > * > * { border-color: rgba(27, 59, 90, 0.10); }
.table-secondary { --bs-table-bg: rgba(27, 59, 90, 0.08); }

/* Cabecera de tabla en azul cristal */
.hv-thead th,
thead.hv-thead th {
    background: linear-gradient(135deg, rgba(27, 59, 90, 0.96) 0%, rgba(43, 90, 134, 0.94) 100%) !important;
    color: rgba(255, 255, 255, 0.94) !important;
    border-bottom: 0 !important;
}
.hv-thead th:first-child { border-top-left-radius: 14px; }
.hv-thead th:last-child { border-top-right-radius: 14px; }

/* Fila de total */
.hv-total-row td {
    background: rgba(27, 59, 90, 0.92) !important;
    color: #fff !important;
    font-weight: 700;
}
.hv-total-row td:first-child { border-bottom-left-radius: 14px; }
.hv-total-row td:last-child { border-bottom-right-radius: 14px; }

.table-responsive { border-radius: 0 0 var(--hv-radius) var(--hv-radius); }

/* ---------------------------------------------------------------------
   8. Insignias, alertas, pestañas, listas, progreso, popover
   --------------------------------------------------------------------- */
.badge { font-weight: 600; letter-spacing: 0.02em; }
.hv-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}
.hv-status--ok { background: rgba(46, 158, 107, 0.14); color: #1F7A50; border-color: rgba(46, 158, 107, 0.35); }
.hv-status--warn { background: rgba(217, 145, 43, 0.16); color: #9A6414; border-color: rgba(217, 145, 43, 0.4); }
.hv-status--bad { background: rgba(201, 75, 75, 0.14); color: #A03636; border-color: rgba(201, 75, 75, 0.35); }
.hv-status--muted { background: rgba(27, 59, 90, 0.08); color: var(--hv-ink-2); border-color: rgba(27, 59, 90, 0.16); }
.hv-status--teal { background: rgba(58, 157, 149, 0.14); color: var(--hv-teal-deep); border-color: rgba(58, 157, 149, 0.4); }
.hv-status--navy { background: rgba(27, 59, 90, 0.12); color: var(--hv-blue); border-color: rgba(27, 59, 90, 0.25); }

.alert {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: var(--hv-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    color: var(--hv-ink);
}
.alert-info { background: rgba(58, 157, 149, 0.16); }
.alert-success { background: rgba(46, 158, 107, 0.16); }
.alert-warning { background: rgba(217, 145, 43, 0.18); }
.alert-danger, .alert-error { background: rgba(201, 75, 75, 0.16); }
.alert-light { background: rgba(255, 255, 255, 0.45); }

.nav-tabs { border-bottom: 1px solid var(--hv-hairline); }
.nav-tabs .nav-link {
    border: 0;
    border-radius: 12px 12px 0 0;
    color: var(--hv-ink-2);
    font-weight: 600;
    padding: 12px 18px;
}
.nav-tabs .nav-link:hover { color: var(--hv-blue); background: rgba(255, 255, 255, 0.35); }
.nav-tabs .nav-link.active {
    background: rgba(255, 255, 255, 0.6);
    color: var(--hv-blue);
    box-shadow: inset 0 -3px 0 var(--hv-teal);
}

.list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: var(--hv-hairline); }
.list-group-item { background: transparent; color: var(--hv-ink); }
.list-group-flush > .list-group-item { border-color: var(--hv-hairline); }

.progress { background: rgba(27, 59, 90, 0.10); border-radius: 999px; box-shadow: inset 0 1px 2px rgba(27, 59, 90, 0.12); }
.progress-bar { background: linear-gradient(90deg, var(--hv-teal-soft), var(--hv-teal-deep)); border-radius: 999px; }
.progress-bar.bg-warning { background: linear-gradient(90deg, #F0B04A, #C27C2A) !important; }
.progress-bar.bg-danger { background: linear-gradient(90deg, #DA6363, #B93E3E) !important; }
.progress-bar.bg-success { background: linear-gradient(90deg, #45BD84, #2B8B60) !important; }

.popover {
    background: var(--hv-glass-strong);
    -webkit-backdrop-filter: var(--hv-blur);
    backdrop-filter: var(--hv-blur);
    border: 1px solid var(--hv-glass-border);
    border-radius: 16px;
    box-shadow: var(--hv-shadow);
    max-width: 290px;
}
.popover-header {
    background: linear-gradient(135deg, rgba(27, 59, 90, 0.96), rgba(43, 90, 134, 0.94));
    color: #fff;
    border-radius: 15px 15px 0 0;
    font-family: var(--hv-font-display);
    font-size: 0.9rem;
    border-bottom: 0;
}
.popover-body { color: var(--hv-ink); }
.bs-popover-top > .popover-arrow::after, .bs-popover-auto[data-popper-placement^=top] > .popover-arrow::after { border-top-color: rgba(255, 255, 255, 0.9); }

.tooltip .tooltip-inner { background: var(--hv-blue-deep); border-radius: 10px; font-family: var(--hv-font-body); }

.dropdown-menu {
    background: var(--hv-glass-strong);
    -webkit-backdrop-filter: var(--hv-blur);
    backdrop-filter: var(--hv-blur);
    border: 1px solid var(--hv-glass-border);
    border-radius: 14px;
    box-shadow: var(--hv-shadow);
}

/* ---------------------------------------------------------------------
   9. Utilidades hv-*
   --------------------------------------------------------------------- */
.hv-title { display: flex; flex-direction: column; gap: 2px; }
.hv-title h2, .hv-title h3 { margin: 0; font-size: 1.55rem; }
.hv-title .hv-subtitle { color: var(--hv-ink-2); font-size: 0.86rem; margin: 0; }
.hv-eyebrow {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--hv-teal-deep);
}

.hv-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.52);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    backdrop-filter: blur(16px) saturate(150%);
    border: 1px solid var(--hv-glass-border);
    box-shadow: var(--hv-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.hv-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(27, 59, 90, 0.15);
    color: var(--hv-blue);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 18px -12px rgba(27, 59, 90, 0.6);
    transition: transform 0.15s ease, background 0.15s ease;
}
.hv-icon-btn:hover { background: rgba(255, 255, 255, 0.9); color: var(--hv-teal-deep); transform: translateY(-1px); }

.hv-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(27, 59, 90, 0.12);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hv-blue);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.hv-icon-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    font-size: 1.3rem;
    color: #fff;
    background: linear-gradient(135deg, var(--hv-teal-soft), var(--hv-teal-deep));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 10px 20px -12px rgba(58, 157, 149, 0.9);
}
.hv-icon-circle.navy { background: linear-gradient(135deg, var(--hv-blue-soft), var(--hv-blue)); }

/* Indicadores grandes (KPI) en vidrio de color */
.hv-kpi {
    position: relative;
    overflow: hidden;
    border-radius: var(--hv-radius);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 24px 44px -22px rgba(27, 59, 90, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    height: 100%;
}
.hv-kpi::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(255, 255, 255, 0.30) 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0) 40%);
}
.hv-kpi > * { position: relative; z-index: 1; }
.hv-kpi--navy { background: linear-gradient(135deg, #1B3B5A 0%, #2F6390 100%); }
.hv-kpi--coral { background: linear-gradient(135deg, #B85252 0%, #D97B6E 100%); }
.hv-kpi--teal { background: linear-gradient(135deg, #2A7C76 0%, #4DB3AA 100%); }
.hv-kpi--gold { background: linear-gradient(135deg, #B9772A 0%, #E0A458 100%); }
.hv-kpi--green { background: linear-gradient(135deg, #257D56 0%, #3AAE78 100%); }
.hv-kpi .kpi-label { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; opacity: 0.82; margin-bottom: 4px; }
.hv-kpi .kpi-value { font-family: var(--hv-font-display); font-size: clamp(1.25rem, 2.1vw, 1.85rem); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: #fff; margin: 0; white-space: nowrap; }
.hv-kpi .kpi-note { font-size: 0.78rem; opacity: 0.8; }
.hv-kpi .kpi-icon { font-size: 2.4rem; opacity: 0.28; }

/* KPI claro (vidrio blanco con franja de color) */
.hv-stat {
    border-left: 5px solid var(--hv-blue);
    border-radius: var(--hv-radius);
}
.hv-stat.stat-teal { border-left-color: var(--hv-teal); }
.hv-stat.stat-green { border-left-color: var(--hv-ok); }
.hv-stat.stat-gold { border-left-color: var(--hv-gold); }
.hv-stat.stat-coral { border-left-color: var(--hv-bad); }
.hv-stat .stat-label { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--hv-ink-2); }
.hv-stat .stat-value { font-family: var(--hv-font-display); font-size: clamp(1.1rem, 1.8vw, 1.6rem); font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Barra inferior fija (hoja de tiempo) */
.hv-fixed-bar {
    position: fixed;
    left: 264px;
    right: 0;
    bottom: 0;
    z-index: 1000;
    padding: 10px 24px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: var(--hv-blur);
    backdrop-filter: var(--hv-blur);
    border-top: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 -14px 34px -22px rgba(27, 59, 90, 0.6);
}

/* Estado vacío */
.hv-empty { padding: 48px 20px; text-align: center; color: var(--hv-ink-3); }
.hv-empty i { font-size: 2.4rem; display: block; margin-bottom: 10px; opacity: 0.5; }

/* Celdas resaltadas en tablas de reporte */
.hv-cell-ok { background: rgba(46, 158, 107, 0.10) !important; }
.hv-cell-warn { background: rgba(217, 145, 43, 0.12) !important; }
.hv-cell-teal { background: rgba(58, 157, 149, 0.12) !important; }

/* Números tabulares en cualquier sitio */
.tnum { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------
   10. Móvil, impresión y accesibilidad
   --------------------------------------------------------------------- */
@media (max-width: 768px) {
    .sidebar { display: none !important; }
    .main-content { margin-left: 0; padding: 16px 14px 96px; }
    .mobile-bottom-nav { display: flex; }
    .hv-fixed-bar { left: 0; bottom: 64px; padding: 8px 14px; }
    .whatsapp-float { width: 50px; height: 50px; bottom: 86px; right: 16px; font-size: 24px; }
    h1, h2, h3 { font-size: 1.3rem; }
    .hv-title h2, .hv-title h3 { font-size: 1.25rem; }
    .table-responsive, table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .btn { width: 100%; margin-bottom: 8px; }
    .btn-group { width: 100%; display: flex; }
    .btn-group .btn { margin-bottom: 0; }
    .hv-toolbar { flex-wrap: wrap; }
    .hv-kpi .kpi-value { font-size: 1.5rem; }
}

@media print {
    body::before, body::after, .sidebar, .mobile-bottom-nav, .whatsapp-float, .hv-fixed-bar { display: none !important; }
    body { background: #fff; }
    .main-content { margin: 0; padding: 0; }
    .card, .glass, .hv-toolbar { background: #fff; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: #ddd; }
    .card::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Foco visible con teclado */
:focus-visible { outline: 3px solid rgba(58, 157, 149, 0.55); outline-offset: 2px; }
