/**
 * HubSpot-inspired visual tokens (Informes).
 * Carga después de Bootstrap y estilos locales.
 */

/* HubSpot style — tipografía y tokens base */
:root {
    --hs-page-bg: #F5F8FA;
    --hs-surface: #FFFFFF;
    --hs-text: #2D3E50;
    --hs-text-muted: #516F90;
    --hs-accent: #FF7A59;
    --hs-accent-hover: #FF5C35;
    --hs-success: #00BDA5;
    --hs-border: #DFE3EB;
    --hs-input-border: #CBD6E2;
    --hs-placeholder: #99ACC2;
    --hs-row-alt: #FAFBFC;
    --hs-row-sep: #EAF0F6;
    --hs-nav-dark: #2D3E50;
    --hs-nav-text: #CBD6E2;
}

/* HubSpot style — cuerpo global */
body {
    font-family: "Lexend", system-ui, sans-serif !important;
    font-size: 14px;
    font-weight: 400;
    color: var(--hs-text) !important;
    background-color: var(--hs-page-bg) !important;
}

/* HubSpot style — jerarquía tipográfica (h1–h3 si existen en plantillas) */
h1 {
    font-size: 32px;
    font-weight: 600;
    color: var(--hs-text);
}
h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--hs-text);
}
h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--hs-text);
}

/* HubSpot style — cabecera principal (barra superior tipo nav HubSpot) */
.header-top {
    background: var(--hs-nav-dark) !important;
    border-left: none !important;
    box-shadow: none !important;
    padding: 12px 24px !important;
}

.header-top h4.mb-0.font-weight-bold {
    font-size: 24px !important;
    font-weight: 600 !important;
    color: #ffffff !important;
}

.header-top .text-muted.small,
.header-top span.text-muted {
    color: var(--hs-nav-text) !important;
}

.header-top .bg-primary {
    background-color: var(--hs-accent) !important;
    border-radius: 4px !important;
}

/* HubSpot style — botones en cabecera sobre fondo oscuro */
.header-top .btn-outline-secondary {
    background: transparent !important;
    border: 1px solid var(--hs-input-border) !important;
    color: var(--hs-nav-text) !important;
    border-radius: 4px !important;
    box-shadow: none !important;
}

.header-top .btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
    border-color: var(--hs-input-border) !important;
}

/* HubSpot style — contenedor informes */
.report-container {
    padding: 20px 24px !important;
}

/* HubSpot style — tarjetas / paneles */
.card.card-report {
    background: var(--hs-surface) !important;
    border: 1px solid var(--hs-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
}

.card-header.bg-white {
    background: var(--hs-surface) !important;
    border-bottom: 1px solid var(--hs-row-sep) !important;
}

/* HubSpot style — pestañas (marcador izquierdo activo) */
.nav-tabs-custom .nav-link {
    font-weight: 500 !important;
    color: var(--hs-text-muted) !important;
    border: none !important;
    border-left: 3px solid transparent !important;
    border-bottom: none !important;
    border-radius: 0 !important;
    padding: 14px 20px 14px 17px !important;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-tabs-custom .nav-link:hover {
    background: rgba(0, 0, 0, 0.03) !important;
    color: var(--hs-text) !important;
}

.nav-tabs-custom .nav-link.active {
    color: var(--hs-text) !important;
    font-weight: 600 !important;
    background: var(--hs-surface) !important;
    border-left-color: var(--hs-accent) !important;
    border-bottom: none !important;
}

/* HubSpot style — filtros */
.filter-section {
    padding: 20px !important;
    border-bottom: 1px solid var(--hs-row-sep) !important;
}

.filter-section label,
.filter-section label.small {
    font-size: 12px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    color: var(--hs-text-muted) !important;
}

/* HubSpot style — inputs y selects Bootstrap */
.form-control {
    background: var(--hs-surface) !important;
    border: 1px solid var(--hs-input-border) !important;
    border-radius: 4px !important;
    color: var(--hs-text) !important;
    font-size: 14px !important;
}

.form-control:focus {
    border: 2px solid var(--hs-accent) !important;
    box-shadow: none !important;
}

.form-control::placeholder {
    color: var(--hs-placeholder) !important;
}

.form-control-sm {
    border-radius: 4px !important;
}

/* HubSpot style — Chosen (mismo tratamiento que inputs) */
.chosen-container-single .chosen-single {
    background: var(--hs-surface) !important;
    border: 1px solid var(--hs-input-border) !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    color: var(--hs-text) !important;
}

.chosen-container-active.chosen-with-drop .chosen-single,
.chosen-container-active .chosen-single {
    border: 2px solid var(--hs-accent) !important;
}

.chosen-container .chosen-drop {
    border: 1px solid var(--hs-input-border) !important;
    border-radius: 0 0 4px 4px !important;
    box-shadow: none !important;
}

/* HubSpot style — botones CTA */
.btn-primary {
    background-color: var(--hs-accent) !important;
    border-color: var(--hs-accent) !important;
    color: #ffffff !important;
    border-radius: 4px !important;
    padding: 10px 20px !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--hs-accent-hover) !important;
    border-color: var(--hs-accent-hover) !important;
    color: #ffffff !important;
}

.btn-sm.btn-primary,
.btn-primary.btn-sm {
    padding: 8px 16px !important;
}

/* HubSpot style — botón secundario */
.btn-outline-secondary,
.btn-outline-info {
    background: var(--hs-surface) !important;
    border: 1px solid var(--hs-input-border) !important;
    color: var(--hs-text) !important;
    border-radius: 4px !important;
    box-shadow: none !important;
}

.btn-outline-secondary:hover,
.btn-outline-info:hover {
    background: var(--hs-page-bg) !important;
    border-color: var(--hs-input-border) !important;
    color: var(--hs-text) !important;
}

.btn-outline-success {
    background: var(--hs-surface) !important;
    border: 1px solid var(--hs-input-border) !important;
    color: var(--hs-success) !important;
}

.btn-outline-danger {
    background: var(--hs-surface) !important;
    border: 1px solid var(--hs-input-border) !important;
}

.btn-info {
    background: var(--hs-accent) !important;
    border-color: var(--hs-accent) !important;
    box-shadow: none !important;
}

/* HubSpot style — tablas informes (.table-vb) */
.table-vb thead th {
    background: var(--hs-page-bg) !important;
    color: var(--hs-text-muted) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    border: 1px solid var(--hs-row-sep) !important;
    box-shadow: none !important;
}

.table-vb thead th.header-blue {
    background: #e8faf7 !important;
    color: #0d6f63 !important;
}

.table-vb thead th.header-orange {
    background: #fff0ec !important;
    color: #b84732 !important;
}

.table-vb tbody tr:nth-child(even) {
    background-color: var(--hs-row-alt) !important;
}

.table-vb tbody tr {
    border-bottom: 1px solid var(--hs-row-sep);
}

.table-vb tbody tr:hover {
    background-color: rgba(0, 189, 165, 0.06) !important;
}

.table-vb thead tr:nth-child(1) th,
.table-vb thead tr:nth-child(2) th {
    background: var(--hs-page-bg) !important;
    color: var(--hs-text-muted) !important;
}

.table-vb thead tr:nth-child(1) th.header-blue,
.table-vb thead tr:nth-child(2) th.header-blue {
    background: #e8faf7 !important;
    color: #0d6f63 !important;
}

.table-vb thead tr:nth-child(1) th.header-orange,
.table-vb thead tr:nth-child(2) th.header-orange {
    background: #fff0ec !important;
    color: #b84732 !important;
}

.sort-icon {
    color: var(--hs-placeholder) !important;
}

th.sorted-asc .sort-icon,
th.sorted-desc .sort-icon {
    color: var(--hs-text-muted) !important;
}

/* HubSpot style — diff positivo / negativo (acento secundario éxito) */
.text-diff-pos {
    color: var(--hs-success) !important;
    font-weight: 600 !important;
}

.text-diff-neg {
    color: #c0392b !important;
    font-weight: 600 !important;
}

/* HubSpot style — filas agrupadas (tonos suaves) */
.row-g1-a {
    background-color: var(--hs-surface) !important;
}
.row-g1-a-alt {
    background-color: #f7fbfd !important;
}
.row-g1-b {
    background-color: #f0faf8 !important;
}
.row-g1-b-alt {
    background-color: #e8f7f4 !important;
}

.row-subtotal {
    background-color: #fff9e6 !important;
    border-top: 1px solid var(--hs-border) !important;
}

.group-cell {
    border-left-color: var(--hs-accent) !important;
}

.drill-down:hover {
    color: var(--hs-accent) !important;
    background-color: rgba(255, 122, 89, 0.06) !important;
}

.g1-label {
    color: var(--hs-text) !important;
    font-weight: 600 !important;
}

.g2-label {
    color: var(--hs-text-muted) !important;
}

/* HubSpot style — spinner carga */
#loadingOverlay .spinner-border.text-primary,
.text-primary {
    color: var(--hs-accent) !important;
}

/* HubSpot style — login y páginas auxiliares (card) */
body.bg-light {
    background-color: var(--hs-page-bg) !important;
}

body.bg-light .card {
    background: var(--hs-surface) !important;
    border: 1px solid var(--hs-border) !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
}

body.bg-light .card-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: var(--hs-text) !important;
}

body.bg-light .form-group label {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: var(--hs-text-muted) !important;
}

/* HubSpot style — admin: barra superior */
.navbar.navbar-dark.bg-dark {
    background-color: var(--hs-nav-dark) !important;
    border-bottom: 1px solid var(--hs-border);
}

.navbar-dark .navbar-brand {
    color: #ffffff !important;
    font-weight: 600 !important;
}

.navbar-dark .btn-outline-light {
    border: 1px solid var(--hs-input-border) !important;
    color: var(--hs-nav-text) !important;
    background: transparent !important;
    border-radius: 4px !important;
}

.navbar-dark .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
}

body.bg-light .container > h4 {
    font-size: 24px !important;
    font-weight: 600 !important;
    color: var(--hs-text) !important;
}

/* HubSpot style — tabla admin */
body.bg-light .table-responsive {
    border: 1px solid var(--hs-border) !important;
    border-radius: 8px !important;
    padding: 20px !important;
    background: var(--hs-surface) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
}

body.bg-light .table-responsive .table thead th {
    background: var(--hs-page-bg) !important;
    color: var(--hs-text-muted) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.04em !important;
    border-bottom: 1px solid var(--hs-row-sep) !important;
}

body.bg-light .table-responsive .table tbody tr:nth-child(even) {
    background-color: var(--hs-row-alt) !important;
}

body.bg-light .table-responsive .table tbody td {
    border-top: 1px solid var(--hs-row-sep) !important;
    color: var(--hs-text) !important;
    font-size: 14px !important;
}

body.bg-light .table-responsive .form-control-sm {
    border: 1px solid var(--hs-input-border) !important;
}

body.bg-light .btn-warning {
    background: #fff !important;
    border: 1px solid var(--hs-input-border) !important;
    color: var(--hs-text) !important;
}

body.bg-light .btn-secondary {
    background: var(--hs-surface) !important;
    border: 1px solid var(--hs-input-border) !important;
    color: var(--hs-text) !important;
}

/* HubSpot style — alertas */
.alert-info {
    background: #e8faf7 !important;
    border: 1px solid var(--hs-row-sep) !important;
    color: var(--hs-text) !important;
    border-radius: 8px !important;
}

.alert-danger {
    border-radius: 8px !important;
    border: 1px solid #fad2d2 !important;
}

.alert-warning {
    border-radius: 8px !important;
    border: 1px solid var(--hs-border) !important;
}
