/* =========================================
   ESTILOS PRINCIPALES - ECOP FORECAST
   PALETA DE COLORES ECOPETROL
   ========================================= */

/* Variables CSS - Paleta Ecopetrol */
:root {
    /* Paleta Ecopetrol según manual corporativo */
    --primary-500: #A3631C;
    /* Verde brillante */
    --primary-600: #4E9C00;
    --primary-700: #004236;
    /* Verde oscuro corporativo */
    --primary-gradient: linear-gradient(120deg, #E1BC8C, #A3631C);
    --neutral-25: #F5F5F9;
    --neutral-50: #FFFFFF;
    --neutral-100: #E5E6F1;
    --neutral-300: #BFC0DD;
    --neutral-500: #666666;
    --neutral-700: #441A09;
    --success-color: #A3631C;
    --danger-color: #FF5F00;
    --warning-color: #E1BC8C;
    --info-color: #1D1E6F;

    /* Configuraciones */
    --transition-speed: 0.3s;
    --border-radius: 16px;
    --navbar-height: 75px;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 60px;
    --sidebar-header-height: 150px;
    --right-column-width: 320px;
    --footer-height: 48px;
    --hero-height: 90px;
}

/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--neutral-25);
    color: var(--neutral-700);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: hidden;
    --hero-actual-height: 0px;
}

body.services-full {
    --navbar-height: 0px;
}

body.no-scroll {
    overflow-y: hidden;
}

body.hero-visible {
    --hero-actual-height: var(--hero-height);
}

/* =========================================
   NAVBAR PRINCIPAL
   ========================================= */

.main-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: var(--navbar-height);
    background: var(--neutral-50);
    border: 1px solid rgba(36, 54, 94, 0.08);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 24px 16px;
    z-index: 1000;
    box-shadow: 0 20px 40px rgba(20, 26, 58, 0.15);
    backdrop-filter: blur(16px);
    transition: left var(--transition-speed) ease;
}

.navbar-kpi-strip {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    min-height: 72px;
}

.kpi-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--neutral-50);
    border: 1px solid rgba(17, 24, 39, 0.06);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

.kpi-card.placeholder {
    justify-content: center;
    background: rgba(0, 33, 77, 0.08);
    border-style: dashed;
}

.kpi-icon-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.25);
}

.kpi-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.kpi-label {
    font-size: 0.78rem;
    color: var(--neutral-500);
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.kpi-value-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.kpi-value {
    font-size: 1.4rem;
    color: var(--neutral-700);
}

.kpi-unit {
    font-size: 0.85rem;
    color: #64748b;
}

.kpi-description {
    margin: 0;
    font-size: 0.78rem;
    color: #334155;
}

.kpi-card .kpi-value.positive {
    color: var(--success-color);
}

.kpi-card .kpi-value.negative {
    color: var(--danger-color);
}


/* =========================================
   MENÚ EXPANDIBLE SUPERIOR
   ========================================= */


body.sidebar-expanded .main-navbar {
    left: var(--sidebar-width);
    right: 0;
}

body.sidebar-collapsed .main-navbar {
    left: var(--sidebar-collapsed-width);
    right: 0;
}

body.mobile-layout .main-navbar {
    left: 0;
    right: 0;
    width: 100%;
}

body.has-right-column .main-navbar {
    right: var(--right-column-width);
}

body.services-full .main-navbar,
body.services-full.has-right-column .main-navbar {
    right: 0;
}

body.services-full .main-navbar {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-100%);
    height: 0;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: none;
    box-shadow: none;
    transition: opacity var(--transition-speed) ease,
        transform var(--transition-speed) ease;
}


/* =========================================
   FOOTER
   ========================================= */

.main-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-height);
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(17, 24, 39, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    font-size: 0.85rem;
    color: var(--neutral-700);
    z-index: 1000;
}

body.sidebar-expanded .main-footer {
    left: var(--sidebar-width);
}

body.sidebar-collapsed .main-footer {
    left: var(--sidebar-collapsed-width);
}

body.has-right-column .main-footer {
    right: 0;
}

body.services-full .main-footer,
body.services-full.has-right-column .main-footer {
    right: 0;
}

body.mobile-layout .main-footer {
    left: 0;
    right: 0;
}

.footer-content strong {
    color: var(--neutral-700);
}

.footer-content em {
    font-style: normal;
    color: var(--primary-600);
}

.navbar-left {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.navbar-hover-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    justify-content: space-between;
}

.hover-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 0;
    height: 48px;
    border: none;
    border-radius: 16px;
    background: rgba(198, 140, 67, 0.06);
    color: #441A09;
    cursor: pointer;
    padding: 0 18px;
    transition: all 0.3s ease;
    overflow: visible;
    font-weight: 500;
    text-decoration: none;
    justify-content: flex-start;
}

.hover-menu-btn .hover-menu-icon {
    font-size: 22.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #441A09;
}

.nav-custom-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: none;
}

.hover-menu-btn {
    gap: 10px;
    padding: 10px 16px;
    min-width: 110px;
}

.hover-menu-btn .hover-menu-label {
    white-space: nowrap;
    opacity: 1;
    transform: none;
    transition: all 0.25s ease;
    font-size: 0.9rem;
}

.hover-menu-btn:hover,
.hover-menu-btn.active {
    background: var(--primary-gradient);
    color: #441A09;
    box-shadow: 0 12px 30px rgba(198, 140, 67, 0.35);
}

.hover-menu-btn.active,
.hover-menu-btn.active .hover-menu-label,
.hover-menu-btn.active .hover-menu-icon {
    color: #441A09;
}

.hover-menu-btn:hover .hover-menu-icon,
.hover-menu-btn.active .hover-menu-icon {
    color: #441A09;
}

@media (max-width: 768px) {
    .navbar-hover-menu {
        gap: 8px;
        padding: 6px 10px;
        overflow-x: auto;
    }

    .hover-menu-btn,
    .hover-menu-btn:hover,
    .hover-menu-btn.active {
        min-width: 90px;
        padding: 8px 12px;
        gap: 8px;
    }

    .hover-menu-btn .hover-menu-label {
        display: block;
        font-size: 0.8rem;
    }

}

.nav-btn {
    width: auto;
    min-height: 45px;
    border: none;
    background: rgba(198, 140, 67, 0.08);
    color: var(--neutral-700);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    padding: 8px 12px;
}

.nav-btn:hover {
    background: #441A09;
    color: #fff;
    transform: translateY(-2px);
}

.nav-btn:hover .sidebar-nav-icon {
    color: #fff;
}

.nav-btn.active {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 4px 15px rgba(198, 140, 67, 0.35);
}

.sidebar-nav-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-nav-btn {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
    padding: 0 16px;
    background: rgba(198, 140, 67, 0.07);
    color: #441A09;
}

.sidebar-nav-btn .sidebar-nav-icon {
    font-size: 18px;
    color: #441A09;
}

.sidebar-nav-btn .sidebar-nav-label {
    font-weight: 600;
}

.sidebar-nav-btn.active {
    background: var(--primary-gradient);
    color: #fff;
}

.sidebar-nav-btn.active .sidebar-nav-icon {
    color: #fff;
}

.sidebar.collapsed .sidebar-nav-btn {
    justify-content: center;
    padding: 0 10px;
    gap: 0;
}

.sidebar.collapsed .sidebar-nav-label {
    display: none;
}

.sidebar.collapsed .sidebar-nav-icon {
    margin: 0;
}

.navbar-right {
    position: relative;
}

.user-menu {
    position: relative;
}

.user-btn {
    width: 45px;
    height: 45px;
    border: none;
    background: #441A09;
    color: #441A09;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.user-btn:hover {
    background: #043070;
    color: #043070;
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    background: var(--neutral-50);
    border-radius: var(--border-radius);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-speed) ease;
    z-index: 1001;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-info {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    font-weight: 600;
    color: var(--neutral-700);
}

.logout-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--neutral-700);
    transition: background-color var(--transition-speed) ease;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

.logout-btn:hover {
    background-color: rgba(198, 140, 67, 0.08);
    color: var(--primary-600);
}

/* =========================================
   LAYOUT PRINCIPAL
   ========================================= */

.main-layout {
    display: flex;
    min-height: calc(100vh - var(--navbar-height) - var(--hero-actual-height));
    width: 100%;
    position: relative;
    transition: padding-left var(--transition-speed) ease;
    padding-left: var(--sidebar-width);
}

body.sidebar-collapsed .main-layout {
    padding-left: var(--sidebar-collapsed-width);
}

body.has-right-column .main-layout {
    padding-right: var(--right-column-width);
}

body.services-full .main-layout,
body.services-full.has-right-column .main-layout {
    padding-right: 0;
}

body.services-full .right-column {
    display: none;
}

body[data-section="cierre_diario"] .right-column {
    display: none;
}

body[data-section="cierre_diario"].has-right-column .main-layout {
    padding-right: 0;
}

body[data-section="cierre_diario"].has-right-column .main-navbar {
    right: 0;
}

body[data-section="tesoreria"] .right-column {
    display: none;
}

body[data-section="tesoreria"].has-right-column .main-layout {
    padding-right: 0;
}

body[data-section="tesoreria"].has-right-column .main-navbar {
    right: 0;
}

body.mobile-layout .main-layout {
    padding-left: 0;
    padding-right: 0;
}

/* =========================================
   SIDEBAR
   ========================================= */

/* Placeholder de métricas (sin contenido) */
.hero-placeholder {
    width: calc(100% - var(--sidebar-width) - var(--right-column-width));
    min-height: 60px;
    margin-top: var(--navbar-height);
    margin-left: var(--sidebar-width);
    margin-right: var(--right-column-width);
    display: block;
    box-sizing: border-box;
    padding: clamp(5px, 1vh, 10px) clamp(16px, 3vw, 40px);
    background: linear-gradient(180deg, #f8fbff 0%, #f3f6fb 100%);
    border-bottom: 1px solid rgba(17, 24, 39, 0.05);
}

body.sidebar-collapsed .hero-placeholder {
    width: calc(100% - var(--sidebar-collapsed-width) - var(--right-column-width));
    margin-left: var(--sidebar-collapsed-width);
}

body.services-full .hero-placeholder {
    display: none;
}

.hero-metrics-shell {
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    padding: 6px 14px;
    display: grid;
    gap: 5px;
}

.hero-metrics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hero-metrics-title {
    margin: 0;
    font-weight: 700;
    color: #1f2c3d;
    font-size: 0.95rem;
}

.hero-metrics-subtitle {
    color: #6b7a8c;
    font-size: 0.82rem;
}

.hero-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.hero-metric-card {
    background: linear-gradient(135deg, #f8fbff 0%, #f2f7ff 100%);
    border: 1px solid rgba(17, 24, 39, 0.06);
    border-radius: 10px;
    padding: 10px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
}

.hero-metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: #004236;
    font-size: 1rem;
}

.hero-metric-text {
    display: grid;
    gap: 2px;
}

.hero-metric-label {
    font-size: 0.82rem;
    color: #425165;
}

.hero-metric-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2c3d;
    line-height: 1.2;
}

.hero-metric-card small {
    color: #6b7a8c;
    font-size: 0.75rem;
}

.hero-kpi-layout {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(200px, 0.38fr) minmax(240px, 0.62fr);
    gap: clamp(4px, 0.75vw, 8px);
    min-height: 25px;
    align-items: stretch;
}

.hero-kpi-card {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8fbff 0%, #f3f6ff 100%);
    border: 1px solid rgba(17, 24, 39, 0.06);
    border-radius: 14px;
    box-shadow: 0 4px 8px rgba(15, 23, 42, 0.04);
}

.hero-kpi-card--left {
    min-height: 120px;
    display: grid;
    grid-template-rows: 1fr auto 1fr;
    align-items: center;
}

.hero-kpi-entry {
    display: flex;
    flex-direction: column;
    gap: 0px;
    padding: 1px 8px;
}

.hero-kpi-entry .hero-kpi-label {
    font-size: 0.6rem;
    font-weight: 600;
    color: #1f2c3d;
    margin: 0;
}

.hero-kpi-entry .hero-kpi-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: #0b2140;
}

.hero-kpi-subvalues {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: #4a5a6b;
    margin-top: 1px;
}

.hero-kpi-entry .hero-kpi-note {
    margin: 0;
    font-size: 0.55rem;
    color: #6b7a8c;
}

.hero-kpi-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 0.6rem;
    color: #6b7a8c;
    margin-top: 1px;
}

.kpi-change {
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.05);
}

.kpi-change.positive {
    color: #0f8b3d;
    background: rgba(15, 139, 61, 0.12);
}

.kpi-change.negative {
    color: #c0392b;
    background: rgba(192, 57, 43, 0.12);
}

.hero-kpi-divider {
    border: none;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
    margin: 0 10px;
}

/* Estilo oscuro para KPIs Qo/Qw (hero izquierdo) */
.kpi-card-dark {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0f1b2e 0%, #0b1425 38%, #0a1020 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
    color: #dbe7ff;
}

.kpi-card-dark::before {
    content: "";
    position: absolute;
    inset: -20% 10% auto auto;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 60%);
    opacity: 0.5;
    pointer-events: none;
    filter: blur(2px);
}

.kpi-row {
    display: grid;
    grid-template-columns: 6px 1fr;
    gap: 4px;
    padding: 3px 12px;
    align-items: center;
    justify-content: center;
    position: relative;
}

.kpi-row-body {
    display: flex;
    flex-direction: column;
    gap: 0px;
    align-items: center;
    text-align: center;
}

.kpi-row-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.kpi-indicator {
    width: 6px;
    height: 100%;
    border-radius: 999px;
    display: block;
}

.kpi-indicator--oil {
    background: linear-gradient(180deg, #f8c20a 0%, #f77e02 100%);
    box-shadow: 0 0 10px rgba(247, 126, 2, 0.55);
}

.kpi-indicator--water {
    background: linear-gradient(180deg, #27d3ff 0%, #0a81f7 100%);
    box-shadow: 0 0 10px rgba(10, 129, 247, 0.45);
}

.kpi-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    font-size: 0.55rem;
    font-weight: 600;
    color: #e8f1ff;
    background: rgba(255, 255, 255, 0.06);
    position: absolute;
    top: 2px;
    right: 10px;
}

.kpi-badge--oil {
    color: #f8c20a;
    border-color: rgba(248, 194, 10, 0.3);
    background: rgba(248, 194, 10, 0.1);
}

.kpi-badge--water {
    color: #46c7ff;
    border-color: rgba(70, 199, 255, 0.35);
    background: rgba(70, 199, 255, 0.1);
}

.kpi-value-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.kpi-info-icon {
    height: 0.9375em;
    width: auto;
    margin-right: 4px;
    vertical-align: middle;
    opacity: 0.95;
}

.kpi-card-ingresos .kpi-info-icon {
    height: 0.9375em;
}

.kpi-card-kpi2 .kpi-info-icon {
    height: 0.9375em;
}

.kpi-card-kpi3 .kpi-info-icon {
    height: 0.9375em;
}

.kpi-card-kpi4 .kpi-info-icon {
    height: 0.9375em;
}

.kpi-card-dark .kpi-info-icon--qo {
    height: 0.9375em;
}

.kpi-info-icon--qw {
    height: 0.9375em;
}

.kpi-row .hero-kpi-label {
    font-size: 0.58rem;
    letter-spacing: 0.02em;
    color: #d6e4ff;
    text-transform: uppercase;
    margin: 0;
}

.kpi-row .hero-kpi-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #f8c20a;
    text-shadow: 0 4px 16px rgba(248, 194, 10, 0.45);
}

.kpi-row--water .hero-kpi-value {
    color: #46c7ff;
    text-shadow: 0 3px 12px rgba(70, 199, 255, 0.35);
}

.kpi-row .hero-kpi-unit {
    font-size: 0.6rem;
    color: #c7d4e5;
    margin: 0;
}

.kpi-row .hero-kpi-note {
    margin: 0;
    font-size: 0.55rem;
    color: #9fb2d5;
}

.hero-kpi-divider--dark {
    border-top: 2px solid rgba(255, 255, 255, 0.66);
    margin: 0 12px;
    height: 1px;
}

/* Ajuste para tarjeta Ingresos aceite con formato oscuro */
.kpi-card-ingresos {
    display: block;
    padding: 4px 14px;
}

/* Ajuste para KPI derecho 2 con formato oscuro */
.kpi-card-kpi2 {
    display: block;
    padding: 3px 12px;
}

/* Ajuste para KPI derecho 3 con formato oscuro */
.kpi-card-kpi3 {
    display: block;
    padding: 3px 12px;
}

/* Layout específico KPI derecho 3 con % destacado */
.kpi-row--kpi3 {
    grid-template-columns: 6px 1fr 0.4fr;
    align-items: center;
}

.kpi-card-kpi3 .kpi-row-body,
.kpi-card-kpi4 .kpi-row-body {
    transform: translateX(-10%);
    transform-origin: left center;
}

.kpi-card-kpi3 .kpi-pct-badge,
.kpi-card-kpi4 .kpi-pct-badge {
    justify-self: start;
    transform: translateX(-30%);
    transform-origin: left center;
}

.kpi-card-kpi3 .kpi-row,
.kpi-card-kpi4 .kpi-row {
    padding-right: 80px;
}

/* =========================================
   TARJETA BRENT (formato single card)
   ========================================= */
.brent-card {
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.45);
    background: radial-gradient(circle at left, #022c22 0, #020617 50%, #020617 100%);
    overflow: hidden;
    width: 100%;
}

.brent-card-body {
    padding: 18px 20px 20px 20px;
}

.brent-label-top {
    display: block;
    text-align: center;
    font-size: 0.734rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    font-weight: 700;
    color: #9ca3af;
}

.brent-title-row {
    gap: 8px;
}

.brent-info-icon {
    width: 0.85rem;
    height: auto;
    opacity: 0.9;
}

.brent-pill {
    border-radius: 18px;
    padding: 12px 14px;
    background: #020617;
    border: 1px solid rgba(148, 163, 184, 0.45);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.8);
}

.brent-mini-label {
    font-size: 0.45rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9ca3af;
}

.brent-mini-value {
    font-size: 0.69rem;
    font-weight: 600;
    color: #e5e7eb;
}

.brent-mini-unit {
    font-size: 0.53rem;
    color: #cdd6e3;
}

.brent-main-value {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-shadow: 0 0 18px rgba(74, 222, 128, 0.7);
    color: #e5e7eb;
}

.brent-pct {
    color: #e5e7eb;
    font-weight: 600;
    font-size: 1.06rem;
}

.brent-footer-text {
    font-size: 0.53rem;
    color: #9ca3af;
}

.brent-footer-texts {
    display: none !important;
}

.brent-positive {
    color: #4ade80 !important;
}

.brent-negative {
    color: #f87171 !important;
}

/* Selector de métricas inline */
.chart-selector-row {
    width: 100%;
    margin: 0 0 10px;
    display: flex;
    justify-content: center;
}

.metric-selector {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metric-selector--inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.metric-selector__header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.metric-selector__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #441A09;
    box-shadow: 0 8px 16px rgba(198, 140, 67, 0.25);
}

.metric-selector__title {
    font-weight: 700;
    color: #441A09;
}

.metric-selector__options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.metric-selector--inline .metric-selector__options {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.metric-option {
    width: 100%;
    border: 1px solid rgba(17, 24, 39, 0.25);
    background: transparent;
    color: #441A09;
    border-radius: 12px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.metric-selector--inline .metric-option {
    width: auto;
    min-width: 180px;
}

.metric-option:hover {
    border-color: var(--primary-600);
    box-shadow: 0 6px 12px rgba(0, 66, 54, 0.12);
}

.metric-option.active {
    background: transparent;
    color: #441A09;
    border-color: var(--primary-600);
    box-shadow: none;
}

.metric-option__checkbox {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid currentColor;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.metric-option.active .metric-option__checkbox::after {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: currentColor;
    display: block;
}

.metric-option__label {
    font-weight: 600;
    line-height: 1.1;
    font-size: 0.8rem;
}

.metric-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
    flex-shrink: 0;
}

.metric-color--qo {
    background: #004236;
}

.metric-color--qw {
    background: #0A57C9;
}

.metric-color--brent {
    background: #FF5F00;
}

.metric-color--trm {
    background: #E1BC8C;
}

.metric-color--desc {
    background: #441A09;
}

.metric-color--prod {
    background: #56C90A;
}

.chart-hover-box {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 33, 77, 0.12);
    padding: 10px 12px;
    display: none;
    min-width: 180px;
    z-index: 5;
    pointer-events: none;
    font-size: 1.05rem;
    line-height: 1.5;
}

.chart-hover-box .hover-title {
    font-weight: 800;
    margin-bottom: 6px;
    color: #441A09;
    font-size: 1rem;
}

.chart-hover-box .hover-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    color: #441A09;
    line-height: 1.4;
}

.chart-hover-box .hover-row .name {
    flex: 1;
}

.chart-hover-box .hover-row .value {
    font-weight: 600;
}

.chart-hover-box .dot {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}

.chart-hover-box .value.negative {
    color: #d9534f;
}

/* Ocultar marcadores flotantes de hover en Plotly - solo para charts que lo requieran explícitamente */
/* Para aplicar este comportamiento a un chart, añadir la clase 'suppress-hover' al .chart-container */
.chart-container.suppress-hover .hoverlayer g:not(.spikelines) {
    display: none !important;
}

.chart-title-card {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    background: transparent;
    color: #441A09;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: none;
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.25em;
}

@media (max-width: 768px) {
    .brent-card-body {
        padding: 16px;
    }
}

.kpi-pct-badge {
    min-width: 96px;
    padding: 5px 15px;
    border-radius: 999px;
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f8b3d;
    background: rgba(15, 139, 61, 0.14);
    text-align: center;
}

.kpi-pct-badge--positive {
    color: #0f8b3d;
    background: rgba(15, 139, 61, 0.14);
}

.kpi-pct-badge--negative {
    color: #c0392b;
    background: rgba(192, 57, 43, 0.14);
}

.hero-kpi-right-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    grid-template-rows: repeat(2, minmax(32px, 1fr));
    gap: clamp(4px, 0.8vw, 10px);
}

@media (max-width: 992px) {
    .hero-kpi-layout {
        grid-template-columns: 1fr;
    }

    .hero-kpi-right-column {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, minmax(40px, 1fr));
    }

    .hero-kpi-card--left {
        min-height: 50px;
    }
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--neutral-50);
    border-right: 1px solid rgba(17, 24, 39, 0.08);
    transition: all var(--transition-speed) ease;
    position: fixed;
    top: 0;
    left: 0;
    bottom: var(--footer-height);
    z-index: 999;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    overflow: visible;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    min-height: auto;
    height: auto;
    padding: 14px 14px 12px;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
    background: var(--neutral-50);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
}

.sidebar-logo {
    width: 100%;
    min-height: auto;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 12px;
    margin-top: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sidebar-logo img {
    max-width: 90%;
    max-height: 100%;
    object-fit: contain;
}

.sidebar.collapsed .sidebar-logo {
    display: none;
}

.sidebar-logo-primary {
    height: auto;
    max-height: 180px !important;
}

.sidebar-logo-robustez {
    height: auto;
    max-height: 28px !important;
}

.sidebar.collapsed .sidebar-header {
    padding: 10px;
    min-height: 60px;
    height: 60px;
}

.sidebar.collapsed .sidebar-header-content {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.sidebar-toggle {
    width: 100%;
    height: 48px;
    border: none;
    background: rgba(198, 140, 67, 0.12);
    color: var(--neutral-700);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar.collapsed .sidebar-toggle {
    width: 40px;
    height: 40px;
}

.sidebar-toggle:hover {
    background: #441A09;
    transform: scale(1.05);
}

.sidebar-toggle-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: invert(9%) sepia(41%) saturate(5525%) hue-rotate(197deg) brightness(91%) contrast(103%);
}

.sidebar-content {
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-filters {
    background: var(--neutral-50);
    border-radius: var(--border-radius);
    padding: 16px;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(17, 24, 39, 0.08);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-filters.hidden {
    display: none;
}

.sidebar-tools-toggle {
    display: none;
    margin-top: auto;
    margin-bottom: 8px;
    justify-content: center;
}

.sidebar-tools-btn {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    border-radius: 28px;
    padding: 10px 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform var(--transition-speed) ease,
        box-shadow var(--transition-speed) ease,
        background var(--transition-speed) ease;
    min-width: 120px;
}

.sidebar-tools-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 35px rgba(198, 140, 67, 0.35);
    background: var(--primary-gradient);
}

.sidebar.collapsed .sidebar-tools-btn {
    width: 52px;
    height: 52px;
    min-width: auto;
    border-radius: 16px;
    padding: 0;
}

.sidebar.collapsed .sidebar-tools-btn span {
    display: none;
}

.sidebar.collapsed .sidebar-tools-toggle {
    display: flex;
}

.sidebar.collapsed .sidebar-filters {
    display: none;
}

.sidebar:not(.collapsed) .sidebar-tools-btn span {
    display: inline;
}

.sidebar-filters-header h6 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--neutral-700);
}

.sidebar-filters-header p {
    margin: 4px 0 0;
    font-size: 0.85rem;
    color: var(--neutral-500);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    font-weight: 600;
    margin: 0;
    color: var(--neutral-700);
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--neutral-700);
}

.filter-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

#filterRange,
#filterSmoothing,
#analyticsDays,
#analyticsThreshold {
    width: 100%;
}

.filter-hint {
    color: var(--neutral-500);
    font-size: 0.78rem;
}

.sidebar.collapsed .sidebar-content {
    padding: 20px 5px;
    display: none;
    pointer-events: none;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(17, 24, 39, 0.08);
    background: var(--primary-gradient);
    box-shadow: 0 -6px 24px rgba(0, 66, 54, 0.12);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    position: relative;
    margin-top: auto;
}

.sidebar.collapsed .sidebar-footer {
    padding: 12px 5px;
}

.sidebar-footer .user-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #441A09;
    border: none;
    box-shadow: 0 18px 30px rgba(198, 140, 67, 0.35);
}

.sidebar.collapsed .user-btn {
    width: 40px;
    height: 40px;
}

.sidebar-footer .user-btn:hover {
    background: var(--primary-gradient);
    color: #441A09;
    transform: scale(1.05);
}

.sidebar-footer .user-menu {
    display: flex;
    align-items: center;
    position: relative;
}

.sidebar-footer .user-dropdown {
    top: auto;
    bottom: 0;
    left: calc(100% + 12px);
    right: auto;
    transform-origin: left bottom;
}

.sidebar-footer .user-dropdown.show {
    transform: translateY(0);
}

/* Elementos del sidebar */
.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-section h6 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    color: var(--neutral-500);
    padding: 0 0.5rem;
    transition: opacity var(--transition-speed) ease;
}

.sidebar.collapsed .sidebar-section h6 {
    opacity: 0;
    height: 0;
    margin: 0;
    overflow: hidden;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu-item {
    margin-bottom: 0.25rem;
}

.sidebar-menu-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.5rem;
    color: var(--neutral-700);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-menu-link:hover {
    background: #441A09;
    color: #fff;
    text-decoration: none;
}

.sidebar-menu-link:hover .sidebar-menu-icon {
    color: #fff;
}

.sidebar-menu-link.active {
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 600;
}

.sidebar-menu-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-menu-text {
    flex: 1;
    transition: opacity var(--transition-speed) ease, width var(--transition-speed) ease;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-menu-text {
    opacity: 0;
    width: 0;
    margin: 0;
}

.sidebar.collapsed .sidebar-menu-link {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.collapsed .sidebar-menu-icon {
    margin-right: 0;
}

/* Tooltip para sidebar colapsado */
.sidebar.collapsed .sidebar-menu-link {
    position: relative;
}

.sidebar.collapsed .sidebar-menu-link::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: #111426;
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed) ease;
    z-index: 1000;
    margin-left: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar.collapsed .sidebar-menu-link:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Indicador de sección activa */
.sidebar-menu-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-500);
    transform: scaleY(0);
    transition: transform var(--transition-speed) ease;
}

.sidebar-menu-link.active::before {
    transform: scaleY(1);
}

/* ============================================================
   SIDEBAR ACCORDION — Agrupación POS / CONTABLE / REPORTES
   ============================================================ */
.sidebar-accordion {
    margin-bottom: 4px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 4px;
}

.sidebar-accordion-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 10px;
    border: none;
    background: rgba(0, 66, 54, 0.08);
    color: var(--neutral-700);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: clamp(9px, 0.9vw, 11px);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 2px;
}

.sidebar-accordion-toggle:hover {
    background: #441A09;
    color: #fff;
}

.sidebar-accordion-icon {
    width: 20px;
    text-align: center;
    margin-right: 10px;
    font-size: 13px;
    flex-shrink: 0;
    color: #004236;
}

.sidebar-accordion-toggle:hover .sidebar-accordion-icon {
    color: #fff;
}

.sidebar-accordion-title {
    flex: 1;
    text-align: left;
    transition: opacity var(--transition-speed) ease, width var(--transition-speed) ease;
    overflow: hidden;
    white-space: nowrap;
    color: inherit;
}

.sidebar-accordion-arrow {
    font-size: 10px;
    transition: transform 0.25s ease;
    color: #999;
}

.sidebar-accordion-toggle:hover .sidebar-accordion-arrow {
    color: #fff;
}

.sidebar-accordion-toggle.collapsed .sidebar-accordion-arrow {
    transform: rotate(-90deg);
}

.sidebar-accordion-body {
    overflow: hidden;
    max-height: 400px;
    transition: max-height 0.3s ease;
    padding-left: 8px;
}

.sidebar-accordion-body.collapsed {
    max-height: 0;
}

/* ── Sidebar colapsado: ocultar títulos/flechas, mostrar solo iconos ── */
.sidebar.collapsed .sidebar-accordion-toggle {
    justify-content: center;
    padding: 0.75rem;
}

.sidebar.collapsed .sidebar-accordion-title,
.sidebar.collapsed .sidebar-accordion-arrow {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .sidebar-accordion-icon {
    margin-right: 0;
}

.sidebar.collapsed .sidebar-accordion-body {
    max-height: none !important;
    padding-left: 0;
}

.sidebar.collapsed .sidebar-accordion-body.collapsed {
    max-height: none !important;
}

/* =========================================
   CONTENIDO PRINCIPAL
   ========================================= */

.main-content {
    flex: 1;
    background: var(--neutral-25);
    position: relative;
    overflow: hidden;
    min-height: calc(100vh - var(--navbar-height) - var(--hero-actual-height));
    margin-top: var(--navbar-height);
}

.right-column {
    width: var(--right-column-width);
    background: var(--neutral-50);
    border-left: 1px solid rgba(17, 24, 39, 0.08);
    position: fixed;
    top: 0;
    right: 0;
    bottom: var(--footer-height);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 998;
    font-size: 0.75rem;
}

.right-column-content {
    flex: 1;
    padding: 8px;
    overflow: hidden;
    display: grid;
    grid-auto-rows: minmax(140px, 1fr);
    align-content: stretch;
    gap: 8px;
}

.right-column-placeholder {
    border: 1px dashed rgba(17, 24, 39, 0.2);
    border-radius: var(--border-radius);
    padding: 16px;
    text-align: center;
    color: var(--neutral-500);
}

.right-column-map {
    width: 100%;
    height: 240px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.right-column-secondary {
    flex: 1;
    width: 100%;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    min-height: 0;
    padding: 16px;
}

.right-column-widget {
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: var(--border-radius);
    padding: 12px;
    background: #ffffff;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.right-column-widget.blank-widget {
    min-height: 200px;
    align-items: center;
    justify-content: center;
    color: var(--neutral-500);
}

.section-buttons {
    display: none;
    flex-direction: column;
    gap: 8px;
}

body[data-section="settings"] .section-buttons {
    display: flex;
}

.widget-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.widget-eyebrow {
    text-transform: uppercase;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--neutral-500);
    margin-bottom: 2px;
}

.widget-header h6 {
    margin: 0;
    font-weight: 600;
    color: var(--neutral-700);
    font-size: 0.95rem;
}

.widget-badge {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid currentColor;
    align-self: flex-start;
}

.widget-badge.success {
    color: var(--success-color);
    background: rgba(42, 182, 115, 0.12);
}

.widget-badge.neutral {
    color: var(--primary-600);
    background: rgba(198, 140, 67, 0.12);
}

.widget-icon-btn {
    border: none;
    background: rgba(198, 140, 67, 0.08);
    color: var(--neutral-700);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.operational-map {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.operational-map__chart {
    position: relative;
    border: 1px dashed rgba(17, 24, 39, 0.15);
    border-radius: 14px;
    height: 150px;
    background: rgba(247, 251, 242, 0.6);
    overflow: hidden;
}

.widget-map {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 14px;
}

.operational-map__legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 13px;
    color: var(--neutral-700);
}

.operational-map__legend strong {
    display: block;
    font-size: 16px;
    margin-top: 4px;
}

.legend-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.legend-dot.north {
    background: var(--primary-500);
}

.legend-dot.south {
    background: var(--success-color);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mini-kpi {
    border-radius: 12px;
    padding: 12px;
    background: rgba(198, 140, 67, 0.05);
    border: 1px solid rgba(198, 140, 67, 0.12);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mini-kpi small {
    color: #7a8c8a;
    font-weight: 600;
    text-transform: uppercase;
}

.mini-kpi strong {
    font-size: 18px;
    color: var(--neutral-700);
}

.mini-kpi .trend {
    font-size: 12px;
    color: var(--success-color);
}

.mini-kpi.caution {
    background: rgba(255, 95, 0, 0.15);
    border-color: rgba(255, 95, 0, 0.35);
    color: #C54800;
}

.mini-kpi.warning {
    background: rgba(217, 83, 79, 0.08);
    border-color: rgba(217, 83, 79, 0.3);
    color: #a94442;
}

.mini-kpi.ok {
    background: rgba(42, 182, 115, 0.15);
    border-color: rgba(42, 182, 115, 0.3);
    color: var(--neutral-700);
}

.maintenance-timeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.timeline-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.timeline-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.timeline-row small {
    color: #92a39f;
}

.timeline-title {
    margin: 0;
    font-weight: 600;
    color: var(--neutral-700);
}

.timeline-badge {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(198, 140, 67, 0.3);
}

.timeline-row.critical .timeline-badge {
    background: rgba(255, 95, 0, 0.15);
    color: #C54800;
    border-color: rgba(255, 95, 0, 0.3);
}

.timeline-row.caution .timeline-badge {
    background: rgba(255, 95, 0, 0.15);
    color: #C54800;
    border-color: rgba(255, 95, 0, 0.3);
}

.content-container {
    padding: clamp(6px, 1.5vw, 16px);
    height: calc(100vh - var(--navbar-height) - var(--hero-actual-height) - var(--footer-height));
    position: relative;
    padding-top: 8px;
    padding-bottom: 12px;
    overflow: auto;
}

/* Secciones deslizantes */
.content-section {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 10px 16px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
}

.content-section.active {
    opacity: 1;
    transform: translateX(0);
    visibility: visible;
    position: relative;
}

.content-section.slide-out-left {
    transform: translateX(-100%);
    opacity: 0;
}

.content-section.slide-in-right {
    transform: translateX(100%);
    opacity: 0;
}

/* =========================================
   COMPONENTES DE CONTENIDO
   ========================================= */

.section-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-500);
}

.section-title {
    color: var(--primary-600);
    font-size: 28px;
    font-weight: 600;
    margin: 0;
}

.section-subtitle {
    color: var(--neutral-500);
    font-size: 16px;
    margin-top: 5px;
}

.main-placeholder {
    width: 100%;
    min-height: auto;
    padding: 0 clamp(6px, 1.5vw, 16px) clamp(6px, 1.5vw, 16px);
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.chart-shell {
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0 0 6px;
    flex: 1;
}

.chart-header-inline h3 {
    margin: 0;
    font-size: 1.75rem;
    color: #441A09;
}

.chart-header-inline p {
    margin: 0;
    color: var(--neutral-500);
}

.chart-container {
    width: 100%;
    min-height: clamp(480px, 70vh, 900px);
    height: 100%;
    flex: 1 1 auto;
    overflow: hidden;
    padding-inline: 10px;
    position: relative;
}

body.services-full .services-layout {
    min-height: calc(100vh - var(--navbar-height) - var(--footer-height));
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: clamp(24px, 4vw, 48px);
}

body.services-full .services-section {
    width: min(1200px, 100%);
    gap: 32px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

body.services-full .services-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(240px, 1fr));
    gap: clamp(24px, 3vw, 42px);
    width: 100%;
    justify-items: stretch;
}

.service-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--neutral-50);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(20, 26, 58, 0.08);
    border: 1px solid rgba(0, 33, 77, 0.08);
}

.service-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #E1BC8C, #A3631C);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FDFAF7;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.service-card h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #441A09;
}

.service-card p {
    margin: 6px 0 0;
    color: #824711;
    line-height: 1.4;
}

.service-card[data-trigger-section] {
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(198, 140, 67, 0.4);
    /* #C68C43 */
    transition:
        transform 220ms cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 220ms cubic-bezier(0.4, 0, 0.2, 1),
        border-color 220ms ease,
        background 220ms ease;
}

.service-card[data-trigger-section]::after {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle, rgba(225, 188, 140, 0.35), transparent 65%);
    /* #E1BC8C */
    opacity: 0;
    transition: opacity 220ms ease;
    pointer-events: none;
}

.service-card[data-trigger-section]:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 28px 60px rgba(95, 44, 11, 0.15);
    /* #5F2C0B */
    border-color: #824711;
    background: linear-gradient(135deg, #FDFAF7, #F7EBDC);
}

.service-card[data-trigger-section]:hover::after {
    opacity: 1;
}

.service-card[data-trigger-section]:focus-visible {
    outline: 2px solid #5F2C0B;
    outline-offset: 4px;
    transform: translateY(-3px) scale(1.015);
    box-shadow: 0 24px 55px rgba(95, 44, 11, 0.12);
}

.card {
    border: 1px solid rgba(17, 24, 39, 0.06);
    border-radius: var(--border-radius);
    box-shadow: 0 15px 25px rgba(15, 23, 42, 0.08);
    transition: all var(--transition-speed) ease;
    background: var(--neutral-50);
}

.card:hover {
    box-shadow: 0 25px 45px rgba(15, 23, 42, 0.12);
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
    color: #fff;
    font-weight: 600;
    transition: all var(--transition-speed) ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(198, 140, 67, 0.35);
}

/* =========================================
   VISTA DE LOGIN
   ========================================= */

.login-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: calc(40px + var(--footer-height));
}

/* =========================================
   MENSAJES FLASH
   ========================================= */

.flash-messages {
    position: fixed;
    top: calc(var(--navbar-height) + 20px);
    right: 20px;
    z-index: 1050;
    max-width: 400px;
}

.alert {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.alert-success {
    background: rgba(42, 182, 115, 0.15);
    color: var(--success-color);
}

.alert-danger {
    background: rgba(255, 95, 0, 0.15);
    color: var(--danger-color);
}

.alert-info {
    background: rgba(59, 141, 255, 0.15);
    color: var(--info-color);
}

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */

/* Tablets y pantallas medianas */
@media (max-width: 1024px) {
    .navbar-left {
        gap: 8px;
    }

    .nav-btn {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .sidebar {
        width: 240px;
    }

    .sidebar.collapsed {
        width: var(--sidebar-collapsed-width);
    }

    body.has-right-column .main-layout {
        padding-right: 0;
    }

    body.has-right-column .main-navbar {
        right: 0;
    }

    .right-column {
        position: static;
        width: 100%;
        height: auto;
        box-shadow: none;
        border-left: none;
        display: none;
    }

    .content-container {
        padding: 25px;
    }

    .section-title {
        font-size: 26px;
    }
}

/* Tablets pequeñas */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 280px;
        --sidebar-collapsed-width: 0px;
        /* En móvil, colapsado = oculto */
        --sidebar-header-height: 70px;
    }

    body.mobile-layout .main-layout {
        padding-left: 0;
    }

    .main-navbar {
        padding: 0 15px;
    }

    .navbar-left {
        gap: 6px;
    }

    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 15px;
    }

    .user-btn {
        width: 40px;
        height: 40px;
        font-size: 15px;
    }

    /* Sidebar en móvil se convierte en overlay */
    .sidebar {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        height: calc(100vh - var(--navbar-height));
        z-index: 1001;
        width: var(--sidebar-width);
        transform: translateX(-100%);
        transition: transform var(--transition-speed) ease;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    /* Contenido principal ocupa todo el ancho en móvil */
    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .content-container {
        padding: 20px 15px;
    }

    .section-title {
        font-size: 24px;
    }

    .section-subtitle {
        font-size: 14px;
    }

    /* Overlay para cerrar sidebar en móvil */
    .sidebar-overlay {
        position: fixed;
        top: var(--navbar-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-speed) ease;
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    /* Cards más compactas en móvil */
    .card {
        margin-bottom: 15px;
    }

    .card .p-4 {
        padding: 1rem !important;
    }

    /* Dropdown de usuario ajustado */
    .user-dropdown {
        right: 0;
        min-width: 180px;
        top: 45px;
    }

    .user-info {
        padding: 12px 15px;
        font-size: 14px;
    }

    .logout-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Móviles pequeños */
@media (max-width: 576px) {
    .main-navbar {
        padding: 0 10px;
    }

    .navbar-left {
        gap: 4px;
    }

    .nav-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .user-btn {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .content-container {
        padding: 15px 10px;
    }

    .section-title {
        font-size: 22px;
    }

    .section-header {
        margin-bottom: 20px;
        padding-bottom: 10px;
    }

    /* Sidebar más estrecho en móviles muy pequeños */
    :root {
        --sidebar-width: 260px;
    }

    .sidebar-content {
        padding: 10px;
        gap: 10px;
    }

    .sidebar-header {
        height: 50px;
        padding: 0 15px;
    }

    .sidebar-toggle {
        width: 36px;
        height: 36px;
    }

    /* Cards más pequeñas */
    .card .p-4 {
        padding: 0.75rem !important;
    }

    .section-title {
        font-size: 20px;
    }

    .section-subtitle {
        font-size: 13px;
    }

    /* Botones más pequeños */
    .btn {
        padding: 0.4rem 1rem;
        font-size: 14px;
    }

    /* User dropdown ajustado para pantallas pequeñas */
    .user-dropdown {
        min-width: 160px;
        top: 40px;
    }
}

/* Móviles muy pequeños */
@media (max-width: 480px) {
    .navbar-left {
        gap: 2px;
    }

    .nav-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .user-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .content-container {
        padding: 10px 8px;
    }

    .section-title {
        font-size: 18px;
    }

    .section-subtitle {
        font-size: 12px;
    }

    /* Grid responsive para cards */
    .row>[class*="col-"] {
        margin-bottom: 15px;
    }

    /* Sidebar aún más compacto */
    :root {
        --sidebar-width: 240px;
    }

    .sidebar-content {
        padding: 10px;
    }

    .list-group-item {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Estados específicos del sidebar colapsado */
.sidebar.collapsed .sidebar-content h6 {
    display: none;
}

.sidebar.collapsed .list-group-item {
    padding: 12px;
    text-align: center;
    justify-content: center;
}

.sidebar.collapsed .list-group-item span {
    display: none;
}

.sidebar.collapsed .list-group-item i {
    margin: 0;
}

/* Desktop - sidebar colapsado */
@media (min-width: 769px) {
    .sidebar.collapsed {
        width: var(--sidebar-collapsed-width);
    }

    .sidebar.collapsed .sidebar-content {
        padding: 20px 8px;
        display: none;
        pointer-events: none;
    }

    .sidebar.collapsed .list-group-item {
        padding: 12px 8px;
        text-align: center;
        border-radius: 4px;
        margin-bottom: 5px;
    }

    .sidebar.collapsed .list-group-item:hover {
        background-color: var(--primary-500);
        color: var(--primary-600);
    }
}

/* Mejoras para contenido deslizante responsive */
@media (max-width: 768px) {
    .content-section {
        padding: 20px 15px;
    }
}

@media (max-width: 576px) {
    .content-section {
        padding: 15px 10px;
    }
}

/* Asegurar que las transiciones funcionen bien en móvil */
@media (max-width: 768px) {
    .content-section {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .sidebar {
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* =========================================
   MEJORAS PARA DISPOSITIVOS TÁCTILES
   ========================================= */

/* Áreas de toque más grandes en móvil */
@media (max-width: 768px) {

    .nav-btn,
    .user-btn,
    .sidebar-toggle {
        min-height: 44px;
        /* Recomendación de Apple para áreas táctiles */
        min-width: 44px;
    }

    .list-group-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    .btn {
        min-height: 40px;
        padding: 0.5rem 1rem;
    }
}

/* Evitar selección de texto en botones */
.nav-btn,
.user-btn,
.sidebar-toggle,
.btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Mejoras de hover solo en dispositivos no táctiles */
@media (hover: hover) and (pointer: fine) {

    .nav-btn:hover,
    .user-btn:hover,
    .sidebar-toggle:hover,
    .card:hover {
        transform: translateY(-2px);
    }

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(247, 219, 23, 0.3);
    }
}

/* En dispositivos táctiles, usar estados de focus en lugar de hover */
@media (hover: none) and (pointer: coarse) {

    .nav-btn:active,
    .user-btn:active,
    .sidebar-toggle:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }

    .btn:active {
        transform: scale(0.98);
    }

    .card:active {
        transform: scale(0.98);
    }
}

/* =========================================
   OPTIMIZACIONES DE RENDIMIENTO
   ========================================= */

/* Usar will-change para animaciones */
.content-section,
.sidebar,
.nav-btn,
.user-btn {
    will-change: transform, opacity;
}

/* Remover will-change después de las transiciones */
.content-section.active,
.sidebar:not(.transitioning) {
    will-change: auto;
}

/* Usar hardware acceleration */
.content-section,
.sidebar,
.sidebar-overlay {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* =========================================
   DARK MODE SUPPORT (Preparación)
   ========================================= */

@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #ffffff;
        --bg-color: #1a1a1a;
        --card-bg: #2d2d2d;
    }

    /* Se puede expandir en el futuro para soporte completo de dark mode */
}

/* =========================================
   PRINT STYLES
   ========================================= */

@media print {

    .main-navbar,
    .sidebar,
    .flash-messages {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        margin-top: 0 !important;
    }

    .content-container {
        padding: 0 !important;
    }

    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
}

/* =========================================
   ACCESIBILIDAD
   ========================================= */

/* Focus visible mejorado */
.nav-btn:focus-visible,
.user-btn:focus-visible,
.sidebar-toggle:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* Reducir movimiento para usuarios con preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {

    .nav-btn,
    .user-btn,
    .btn {
        border: 2px solid currentColor;
    }

    .card {
        border: 1px solid #000;
    }
}

/* =========================================
   TABLA PRODUCTOS - PAGINACIÓN
   ========================================= */

.productos-table-wrapper {
    border: 1px solid #E1BC8C;
    border-bottom: none;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    font-size: 0.8em;
}

.productos-table {
    font-size: 1em;
}

.productos-table thead th {
    background: linear-gradient(180deg, #F7EBDC 0%, #E1BC8C 100%);
    color: #441A09;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
    text-align: center;
    vertical-align: middle;
    border-bottom: 2px solid #C68C43;
}

.productos-table th,
.productos-table td {
    padding: 6px 8px;
}

.productos-footer {
    border: 1px solid #E1BC8C;
    border-top: none;
    border-radius: 0 0 12px 12px;
    background: #FDFAF7;
    padding: 12px 16px;
    gap: 12px;
}

.productos-range {
    font-size: 0.675rem;
}

.productos-page-size {
    font-size: 0.675rem;
    color: #4b5563;
}

.productos-page-size-select {
    width: auto;
    min-width: 80px;
}

.productos-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.productos-page-btn {
    border: 1px solid #C68C43;
    background: #fff;
    color: #374151;
    padding: 4px 8px;
    border-radius: 6px;
    min-width: 32px;
    font-weight: 600;
    transition: all 0.15s ease;
    font-size: 0.75rem;
}

.productos-page-btn:hover:not(:disabled) {
    border-color: #E1BC8C;
    background: #FDFAF7;
    color: #A3631C;
}

.productos-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.productos-page-btn.active {
    background: #A3631C;
    color: #fff;
    border-color: #A3631C;
    box-shadow: 0 4px 10px rgba(163, 99, 28, 0.25);
}

.productos-page-ellipsis {
    padding: 4px 8px;
    color: #6b7280;
}

.card-empty {
    border: 1px solid rgba(198, 140, 67, 0.3);
    border-radius: 12px;
    background: linear-gradient(135deg, #FDFAF7, #F7EBDC);
    box-shadow: 0 8px 16px rgba(95, 44, 11, 0.05);
}

.card-spacer {
    margin-top: clamp(12px, 2vw, 20px);
}

.productos-controls .form-control {
    font-size: 0.8rem;
}

/* =========================================
   ESTADOS DE CARGA
   ========================================= */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* =========================================
   ANIMACIONES
   ========================================= */

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Aplicar animaciones */
.card {
    animation: fadeInUp 0.6s ease forwards;
}

.sidebar-content>* {
    animation: slideInFromLeft 0.4s ease forwards;
}

/* Delays escalonados */
.card:nth-child(1) {
    animation-delay: 0.1s;
}

.card:nth-child(2) {
    animation-delay: 0.2s;
}

.card:nth-child(3) {
    animation-delay: 0.3s;
}

.card:nth-child(4) {
    animation-delay: 0.4s;
}

.kpi-board {
    padding: 18px 24px;
    background: #fdfefe;
    border: 1px solid #bfd7cc;
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    margin-bottom: 24px;
    display: block;
    margin-left: var(--sidebar-width);
    margin-right: var(--right-column-width);
}

body.sidebar-collapsed .kpi-board {
    margin-left: var(--sidebar-collapsed-width);
}

body.mobile-layout .kpi-board {
    margin-left: 0;
    margin-right: 0;
}

.productos-offline {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}

.productos-offline__image {
    max-width: 420px;
    width: min(80%, 420px);
    height: auto;
    object-fit: contain;
}

/* Facturas modal header cards */
.factura-header-grid .factura-header-card {
    padding: 0.65rem 0.9rem;
    background: var(--neutral-25);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.factura-header-label {
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    color: var(--neutral-500);
    text-transform: uppercase;
}

.factura-header-value {
    font-size: 0.95rem;
    color: var(--primary-700);
}

@media (max-width: 767px) {
    .factura-header-grid .factura-header-card {
        padding: 0.75rem;
    }
}

.facturas-toolbar .date-filter {
    min-width: 150px;
}

.facturas-toolbar .date-filter input[type="date"] {
    min-width: 150px;
}

.facturas-toolbar {
    flex-wrap: wrap;
}

.facturas-toolbar__filters {
    flex-shrink: 0;
}

.facturas-toolbar__page {
    min-width: 130px;
}

.inventarios-table-wrapper {
    font-size: 0.8em;
}

.facturas-table-wrapper {
    font-size: 0.8em;
}

@media (min-width: 992px) {
    .facturas-toolbar {
        flex-wrap: nowrap;
    }

    .facturas-toolbar__filters {
        align-items: center;
    }
}

.productos-controls .btn-success,
.facturas-toolbar .btn-success {
    background-color: #824711;
    border-color: #5F2C0B;
    color: #FDFAF7;
}

.productos-controls .btn-success:hover,
.facturas-toolbar .btn-success:hover {
    background-color: #5F2C0B;
    border-color: #441A09;
}

/* Tablas facturas */
.facturas-table-wrapper .table thead th {
    background: linear-gradient(180deg, #F7EBDC 0%, #E1BC8C 100%);
    color: #441A09;
    font-weight: 700;
    border-bottom: 2px solid #C68C43;
}

.facturas-table-wrapper .page-link {
    color: #441A09;
}

.facturas-table-wrapper .page-link.active {
    background-color: #A3631C;
    border-color: #A3631C;
    color: #fff;
}

.facturas-table-wrapper .page-link:hover:not(.active) {
    background-color: #FDFAF7;
    color: #A3631C;
}

.modal .btn-primary,
.modal .btn-success {
    background-color: #824711;
    border-color: #5F2C0B;
    color: #FDFAF7;
}

.modal .btn-primary:hover,
.modal .btn-success:hover {
    background-color: #5F2C0B;
    border-color: #441A09;
}

.modal .btn-outline-danger {
    color: #FF5F00;
    border-color: #FF5F00;
}

.modal .btn-outline-danger:hover {
    background-color: #FF5F00;
    color: #fff;
}

.factura-header-card.bg-light {
    background: linear-gradient(135deg, #FDFAF7, #F7EBDC) !important;
    border-color: rgba(198, 140, 67, 0.3) !important;
    box-shadow: 0 8px 16px rgba(95, 44, 11, 0.05);
}

/* ============================================================
   VENTAS VS COMPRAS — Sección REPORTES
   ============================================================ */

/* Badges de estado */
.vc-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: .03em;
}
.vc-badge-deficit  { background: #fef2f2; color: #dc2626; }
.vc-badge-ok       { background: #ecfdf5; color: #059669; }
.vc-badge-sin      { background: #f3f4f6; color: #6b7280; }

/* Filas de la tabla */
.vc-fila {
    cursor: pointer;
    transition: background-color .15s ease;
}
.vc-fila:hover {
    background-color: rgba(0, 66, 54, 0.05);
}
.vc-fila-activa {
    background-color: rgba(0, 66, 54, 0.10) !important;
}
.vc-fila-deficit {
    border-left: 3px solid #dc2626;
}
.vc-td-codigo {
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
}
.vc-td-nombre {
    font-size: 12px;
}
.vc-td-num {
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}

/* Boton ajustar (modulo inventario_ajustes) */
.vc-btn-ajustar {
    background: linear-gradient(135deg, #004236 0%, #006B54 100%);
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}
.vc-btn-ajustar:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 66, 54, 0.25);
}
.vc-btn-ajustar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Modal de ajuste — secciones */
.vc-modal-section {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px 14px;
    background: #f9fafb;
}
.vc-modal-section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    font-weight: 600;
    margin-bottom: 8px;
}
.btn-pola-primary {
    background: linear-gradient(135deg, #004236 0%, #006B54 100%);
    color: #fff;
    border: none;
    font-weight: 600;
}
.btn-pola-primary:hover {
    filter: brightness(1.1);
    color: #fff;
}

/* Panel de detalle de compras */
.vc-detalle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, #004236 0%, #1D1E6F 100%);
    color: #fff;
}
.vc-detalle-titulo {
    font-size: 13px;
    font-weight: 600;
}
.vc-detalle-cerrar {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    border-radius: 4px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background .15s;
}
.vc-detalle-cerrar:hover {
    background: rgba(255,255,255,.3);
}
.vc-detalle-tabla-wrap {
    overflow-x: auto;
    max-height: 380px;
    overflow-y: auto;
}
.vc-detalle-table thead th {
    background: #f9fafb;
    color: #374151;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
    padding: 6px 10px;
}
.vc-detalle-total {
    background: #f0fdf4;
    border-top: 2px solid #059669;
}
.vc-detalle-total td {
    font-weight: 700;
}

/* ═══════════════════════════════════════
   CORPORATE VENTAS — Dashboard Ventas
   ═══════════════════════════════════════ */
.cv-section { padding: 0 4px; }

.cv-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.cv-kpi {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
}
.cv-kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #78716c;
  margin-bottom: 4px;
}
.cv-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #1c1917;
  line-height: 1.2;
}
.cv-kpi-sub {
  font-size: 11px;
  color: #a8a29e;
  margin-top: 2px;
}

.cv-chart-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #78716c;
  font-weight: 600;
  margin-bottom: 10px;
}
.cv-chart-wrap svg { cursor: crosshair; }
.cv-bar { cursor: pointer; transition: opacity 0.15s; }

/* Progress bar */
.cv-progress-wrap { margin-bottom: 12px; }
.cv-progress-track {
  height: 6px;
  background: #e5e7eb;
  border-radius: 3px;
  overflow: hidden;
}
.cv-progress-fill {
  height: 100%;
  background: #b45309;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Day of week chart */
.cv-dow-chart { display: flex; flex-direction: column; gap: 6px; }
.cv-dow-row { display: flex; align-items: center; gap: 8px; }
.cv-dow-label { width: 30px; font-size: 11px; color: #78716c; text-align: right; }
.cv-dow-bar-track { flex: 1; height: 14px; background: #f5f5f4; border-radius: 3px; overflow: hidden; }
.cv-dow-bar-fill { height: 100%; background: #b45309; border-radius: 3px; transition: width 0.3s; }
.cv-dow-val { font-size: 11px; color: #57534e; width: 55px; text-align: right; }

/* Donut */
.cv-donut-arc { cursor: pointer; }
.cv-cat-legend { display: flex; flex-direction: column; gap: 6px; min-width: 160px; }
.cv-cat-item { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.cv-cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cv-cat-name { flex: 1; color: #44403c; }
.cv-cat-pct { color: #78716c; width: 32px; text-align: right; }
.cv-cat-val { color: #1c1917; font-weight: 600; width: 55px; text-align: right; }

/* Top products table */
.cv-top-table { font-size: 12px; }
.cv-top-table thead th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #78716c;
  border-bottom: 2px solid #e5e7eb;
  font-weight: 600;
}
.cv-top-table td { vertical-align: middle; padding: 6px 8px; }
.cv-rank { font-weight: 700; color: #b45309; width: 24px; }