/* =============================================================================
 * VALDERVUK · 2026 REDESIGN
 * Design tokens + shell overrides. Loaded AFTER style.css so it wins the cascade
 * without editing the vendor template. Keep everything CSS-only; never break
 * class names other module pages depend on.
 * ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ---------- TOKENS -------------------------------------------------------- */
:root {
    --vv-red:            #8A2921;   /* Valdervuk brand */
    --vv-red-hover:      #A03127;
    --vv-red-dark:       #6E201A;
    --vv-red-tint:       #FBEDEB;
    --vv-red-tint-2:     #F5DBD5;

    --vv-ink:            #1A1A1A;
    --vv-ink-soft:       #3A3A3A;
    --vv-mute:           #6C6F76;
    --vv-mute-2:         #9A9DA4;

    --vv-bg:             #F6F7F9;   /* subtle cool off-white (was warm cream #FAF7F3) */
    --vv-surface:        #FFFFFF;
    --vv-surface-soft:   #F9FAFB;
    --vv-border:         #E5E7EB;
    --vv-border-2:       #D1D5DB;

    /* Sidebar palette matched to the SATA reference (DevTools inspect):
       bg #22252B, internal border #2A2F37, muted line #3A3F47, text #C7CBD1.
       Warmer + lighter than pure black; text is soft light gray, not white. */
    --vv-sidebar:        #22252B;
    --vv-sidebar-2:      #2A2F37;
    --vv-sidebar-line:   #2A2F37;
    --vv-sidebar-line-2: #3A3F47;
    --vv-sidebar-ink:    #C7CBD1;
    --vv-sidebar-mute:   #7A8089;
    --vv-sidebar-cap:    #6A7079;
    --vv-sidebar-hover:  rgba(255,255,255,0.05);
    --vv-sidebar-active: rgba(138,41,33,0.28);

    --vv-ok:             #16A34A;
    --vv-warn:           #A16207;
    --vv-warn-bg:        #FEF3C7;
    --vv-info:           #8A2921;

    --vv-font:           "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
                         Roboto, "Helvetica Neue", Arial, sans-serif;

    --vv-r-sm: 6px;
    --vv-r-md: 10px;
    --vv-r-lg: 14px;
    --vv-r-xl: 20px;

    --vv-shadow-sm: 0 1px 2px rgba(16,17,21,0.04);
    --vv-shadow-md: 0 1px 2px rgba(16,17,21,0.05), 0 4px 12px rgba(16,17,21,0.04);
    --vv-shadow-lg: 0 8px 24px rgba(16,17,21,0.08);
}

/* ---------- GLOBAL -------------------------------------------------------- */
html, body {
    font-family: var(--vv-font);
    font-feature-settings: "cv02","cv03","cv04","cv11"; /* Inter stylistic set */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.skin-default {
    background: var(--vv-bg) !important;
    color: var(--vv-ink);
    font-size: 13.5px;
    letter-spacing: -0.005em;
}

.preloader { background: var(--vv-bg) !important; }

/* ---------- SIDEBAR ------------------------------------------------------- */
.left-sidebar {
    background: var(--vv-sidebar) !important;
    border-right: 1px solid rgba(255,255,255,0.04);
}
.scroll-sidebar { background: transparent !important; }

/* the old user block lived inside the sidebar; we move it to the topbar. */
.left-sidebar .user-profile { display: none !important; }

/* nav items */
.sidebar-nav ul#sidebarnav > li { margin: 0; }
.sidebar-nav ul#sidebarnav > li > a {
    color: var(--vv-sidebar-ink) !important;
    padding: 11px 20px !important;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: -0.005em;
    display: flex !important;
    align-items: center;
    gap: 12px;
    border-left: 3px solid transparent;
    border-radius: 0;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.sidebar-nav ul#sidebarnav > li > a:hover {
    background: var(--vv-sidebar-hover) !important;
    color: #fff !important;
}
.sidebar-nav ul#sidebarnav > li > a.active,
.sidebar-nav ul#sidebarnav > li.active > a {
    background: var(--vv-sidebar-active) !important;
    color: #fff !important;
    border-left-color: var(--vv-red);
}
.sidebar-nav ul#sidebarnav > li > a i {
    color: var(--vv-sidebar-mute);
    font-size: 15px;
    width: 18px;
    text-align: center;
    transition: color .15s ease;
}
.sidebar-nav ul#sidebarnav > li > a:hover i,
.sidebar-nav ul#sidebarnav > li > a.active i,
.sidebar-nav ul#sidebarnav > li.active > a i { color: #fff; }

/* child items (collapsible submenus). SATA-style: no dark background box on
   the ul; sub-items sit inline with the parent label (~44px), tighter vertical
   rhythm, and the active one gets the same red left border as the parent. */
.sidebar-nav ul#sidebarnav ul.collapse,
.sidebar-nav ul#sidebarnav ul.collapse.show {
    background: transparent !important;
    padding: 2px 0 6px !important;
}
.sidebar-nav ul#sidebarnav ul li a {
    padding: 7px 20px 7px 44px !important;
    color: var(--vv-sidebar-mute) !important;
    font-size: 12.5px;
    font-weight: 400;
    display: flex;
    align-items: center;
    border-left: 3px solid transparent;
    transition: color .15s ease, background .15s ease;
}
.sidebar-nav ul#sidebarnav ul li a:hover {
    color: #fff !important;
    background: var(--vv-sidebar-hover) !important;
}
.sidebar-nav ul#sidebarnav ul li a.active {
    color: #fff !important;
    background: var(--vv-sidebar-active) !important;
    border-left-color: var(--vv-red);
    font-weight: 500;
}

/* has-arrow caret color */
.sidebar-nav .has-arrow::after {
    border-color: var(--vv-sidebar-mute);
}

/* badges */
.sidebar-nav .badge,
.sidebar-nav .badge-pill {
    background: var(--vv-red) !important;
    color: #fff !important;
    border-radius: 999px !important;
    padding: 2px 8px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
}
.sidebar-nav .badge.badge-success { background: var(--vv-ok) !important; }
.sidebar-nav .badge.badge-warning { background: #eab308 !important; color: #1a1a1a !important; }
.sidebar-nav .badge.badge-info    { background: var(--vv-red) !important; }
.sidebar-nav .badge.badge-danger  { background: var(--vv-red) !important; }

/* Pulsing alert badge. Add class .vv-pulse (or .vv-pulse-red / .vv-pulse-amber)
   to any badge when its count > 0 to make it ripple. The ripple color is
   scoped so different severities feel visually distinct.  */
@keyframes vv-pulse-red {
    0%   { box-shadow: 0 0 0 0   rgba(220, 38, 38, 0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(220, 38, 38, 0.00); }
    100% { box-shadow: 0 0 0 0   rgba(220, 38, 38, 0.00); }
}
@keyframes vv-pulse-amber {
    0%   { box-shadow: 0 0 0 0   rgba(234, 179, 8, 0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(234, 179, 8, 0.00); }
    100% { box-shadow: 0 0 0 0   rgba(234, 179, 8, 0.00); }
}
.sidebar-nav .badge.vv-pulse,
.sidebar-nav .badge.vv-pulse-red {
    background: #DC2626 !important;
    color: #fff !important;
    animation: vv-pulse-red 1.8s ease-out infinite;
}
.sidebar-nav .badge.vv-pulse-amber {
    background: #EAB308 !important;
    color: #1A1A1A !important;
    animation: vv-pulse-amber 1.8s ease-out infinite;
}
/* Zero-state badge is muted and doesn't pulse. */
.sidebar-nav .badge.vv-zero {
    background: transparent !important;
    color: var(--vv-sidebar-mute) !important;
    border: 1px solid rgba(255,255,255,0.10);
    animation: none !important;
    box-shadow: none !important;
}
/* Alert badge alignment: push it to the right of the flex row and give a
   right margin when the item has a submenu caret so they don't overlap. */
.sidebar-nav .vv-alert-badge {
    margin-left: auto !important;
    font-size: 10px !important;
    padding: 2px 8px !important;
    line-height: 1.4 !important;
    height: auto !important;
    flex-shrink: 0;
    align-self: center;
}
.sidebar-nav a.has-arrow .vv-alert-badge { margin-right: 18px !important; }

/* ---------- TOPBAR -------------------------------------------------------- */
.topbar {
    background: var(--vv-surface) !important;
    /* No border here — the light 1px would cut through the dark navbar-header
       (logo strip) and read as a white line on the dark bg. We put the
       separator on .navbar-collapse below so it only shows under the white
       section of the topbar. */
    border-bottom: 0 !important;
    box-shadow: none !important;
}
.top-navbar { padding: 0 24px 0 0 !important; min-height: 60px; }
.top-navbar .navbar-header {
    background: var(--vv-sidebar) !important;
    padding-left: 22px;
}
/* Bottom separator lives only on the white/right section so it never crosses
   the dark logo strip. */
.top-navbar .navbar-collapse {
    border-bottom: 1px solid var(--vv-border);
}
.top-navbar .navbar-header .navbar-brand img { max-height: 26px; }

.top-navbar .navbar-nav .nav-link {
    color: var(--vv-mute) !important;
    padding: 0 12px !important;
    line-height: 60px;
    height: 60px;
}
.top-navbar .navbar-nav .nav-link:hover { color: var(--vv-ink) !important; }

/* hide the leftover "right side settings" icon from the vendor template */
.top-navbar .navbar-nav li.right-side-toggle { display: none !important; }

/* new user chip on the right of the topbar */
.vv-user-chip {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 8px;
    border-radius: 999px;
    color: var(--vv-ink) !important;
    text-decoration: none !important;
    line-height: 1.2 !important;
    height: auto !important;
    transition: background .15s ease;
}
.vv-user-chip:hover { background: rgba(0,0,0,0.04); }
.vv-user-chip-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--vv-red-tint);
    color: var(--vv-red);
    font-weight: 700;
    font-size: 13px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.vv-user-chip-avatar img { width: 100%; height: 100%; object-fit: cover; }
.vv-user-chip-text { display: flex; flex-direction: column; }
.vv-user-chip-name { font-size: 13px; font-weight: 600; color: var(--vv-ink); }
.vv-user-chip-role { font-size: 11px; color: var(--vv-mute); }
.vv-user-chip .fa,
.vv-user-chip .ti-angle-down { color: var(--vv-mute-2); font-size: 11px; margin-left: 4px; }

/* ---------- PAGE WRAPPER ------------------------------------------------- */
.page-wrapper { background: var(--vv-bg) !important; }
/* Extra breathing room on the sides so cards aren't glued to the edge. */
.page-wrapper > .container-fluid { padding: 24px 40px 48px !important; }

/* ---------- PAGE TITLES / BREADCRUMB ------------------------------------ */
.row.page-titles {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 4px !important;
    margin: 0 -4px 14px !important;
    align-items: center;
    min-height: 0 !important;
}
/*
 * Hide the module-name H4 in the top row. Every module page already renders
 * its own card title (usually with a subtitle for context, e.g. "Cotización /
 * Lista de Cotizaciones", "Editar Cotización #48638 / Datos Generales..."),
 * so the H4 was showing the same word twice. The breadcrumb on the right
 * survives as a small navigation cue.
 */
.row.page-titles h4.text-themecolor { display: none !important; }
.row.page-titles > div.col-md-5      { display: none !important; }
.row.page-titles > div.col-md-7 {
    flex: 0 0 100%;
    max-width: 100%;
    text-align: right;
}
.row.page-titles .breadcrumb {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 12px;
}
.row.page-titles .breadcrumb-item,
.row.page-titles .breadcrumb-item a { color: var(--vv-mute); }
.row.page-titles .breadcrumb-item + .breadcrumb-item::before {
    content: "›" !important;
    color: var(--vv-mute-2);
    padding: 0 6px;
}
.row.page-titles .breadcrumb-item.active { color: var(--vv-ink); font-weight: 500; }

/* ---------- CARDS -------------------------------------------------------- */
.card {
    background: var(--vv-surface) !important;
    border: 1px solid var(--vv-border) !important;
    border-radius: var(--vv-r-md) !important;
    box-shadow: none !important;
    margin-bottom: 18px !important;
}
.card-body { padding: 20px !important; }
.card-title,
h4.card-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--vv-ink) !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    margin: 0 0 16px 0 !important;
    line-height: 1.3;
}

/* KPI cards typography */
.card-body h3.font-light {
    font-weight: 500 !important;
    color: var(--vv-ink) !important;
    letter-spacing: -0.5px;
}
.card-body h3.font-medium { font-weight: 600 !important; color: var(--vv-ink) !important; }
.card-body h5.text-muted {
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.6px !important;
    color: var(--vv-mute) !important;
    font-weight: 600 !important;
    margin-top: 2px !important;
}

/* round icon chips inside KPI cards */
.round.round-lg {
    border-radius: 12px !important;
    width: 48px; height: 48px;
    display: flex !important;
    align-items: center; justify-content: center;
    font-size: 18px;
    box-shadow: none !important;
    line-height: 1 !important;
}
.round.round-info,
.round.round-primary { background: var(--vv-red-tint) !important; color: var(--vv-red) !important; }
.round.round-success { background: rgba(22,163,74,0.10) !important; color: var(--vv-ok) !important; }
.round.round-warning { background: rgba(234,179,8,0.14) !important; color: var(--vv-warn) !important; }
.round.round-danger  { background: var(--vv-red-tint) !important; color: var(--vv-red) !important; }

/* ---------- BUTTONS ------------------------------------------------------ */
.btn {
    border-radius: var(--vv-r-sm) !important;
    font-weight: 500 !important;
    padding: 8px 14px !important;
    font-size: 13px !important;
    line-height: 1.4 !important;
    transition: all .15s ease;
}
.btn-primary,
.btn-info {
    background: var(--vv-red) !important;
    border-color: var(--vv-red) !important;
    color: #fff !important;
}
.btn-primary:hover,
.btn-info:hover,
.btn-primary:focus,
.btn-info:focus {
    background: var(--vv-red-hover) !important;
    border-color: var(--vv-red-hover) !important;
    box-shadow: 0 0 0 3px rgba(138,41,33,0.15) !important;
}
.btn-default {
    background: var(--vv-surface) !important;
    border: 1px solid var(--vv-border-2) !important;
    color: var(--vv-ink) !important;
}
.btn-default:hover {
    background: var(--vv-surface-soft) !important;
    border-color: var(--vv-mute-2) !important;
}
.btn-sm { padding: 6px 10px !important; font-size: 12px !important; }
.btn-outline-primary,
.btn-outline-info {
    background: transparent !important;
    color: var(--vv-red) !important;
    border-color: var(--vv-red) !important;
}
.btn-outline-primary:hover,
.btn-outline-info:hover {
    background: var(--vv-red) !important;
    color: #fff !important;
}

/* text-themecolor used across pages */
.text-themecolor { color: var(--vv-ink) !important; }
a.text-themecolor { color: var(--vv-red) !important; }
a { color: var(--vv-red); }
a:hover { color: var(--vv-red-hover); }

/* ---------- TABLES ------------------------------------------------------- */
.table { color: var(--vv-ink); }
.table thead th {
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-size: 11px !important;
    color: var(--vv-mute) !important;
    font-weight: 600 !important;
    border-bottom: 1px solid var(--vv-border) !important;
    border-top: none !important;
    background: transparent !important;
}
.table td, .table th {
    border-color: var(--vv-border) !important;
    padding: 11px 12px !important;
    font-size: 13px !important;
    vertical-align: middle;
}
.table-hover tbody tr:hover { background: var(--vv-surface-soft) !important; }
.table-striped tbody tr:nth-of-type(odd) { background: var(--vv-surface-soft) !important; }

/* ---------- FORMS -------------------------------------------------------- */
.form-control {
    border-radius: var(--vv-r-sm) !important;
    border-color: var(--vv-border-2) !important;
    font-size: 13px !important;
    color: var(--vv-ink) !important;
    background: var(--vv-surface) !important;
}
.form-control:focus {
    border-color: var(--vv-red) !important;
    box-shadow: 0 0 0 3px rgba(138,41,33,0.10) !important;
}
.input-group-text {
    background: var(--vv-surface-soft) !important;
    border-color: var(--vv-border-2) !important;
    color: var(--vv-mute) !important;
    font-size: 13px !important;
}
label.control-label,
.form-group label { font-size: 12px; font-weight: 600; color: var(--vv-ink); }

/* ---------- DASHBOARD HERO ---------------------------------------------- */
.vv-hero {
    position: relative;
    /* Toned down from a saturated peach gradient to a nearly-white surface
       with a subtle warm hint on the right. Reads as a card, not a color block. */
    background: linear-gradient(105deg, #FFFFFF 0%, #FDFAF7 60%, #F9EFEB 100%);
    border: 1px solid var(--vv-border);
    border-radius: var(--vv-r-lg);
    padding: 26px 30px;
    margin-bottom: 22px;
    display: flex;
    align-items: center;
    gap: 22px;
    overflow: hidden;
}
.vv-hero::after {
    /* very faint brand watermark on the right */
    content: "";
    position: absolute;
    right: -80px; top: -60px;
    width: 260px; height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(138,41,33,0.06), transparent 65%);
    pointer-events: none;
}
.vv-hero-avatar {
    width: 68px; height: 68px;
    border-radius: 50%;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    color: var(--vv-red);
    font-weight: 700; font-size: 24px;
    box-shadow: 0 2px 12px rgba(138,41,33,0.15);
    overflow: hidden;
    flex-shrink: 0;
    z-index: 1;
}
.vv-hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.vv-hero-text { z-index: 1; }
.vv-hero-greeting {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--vv-red);
    font-weight: 700;
    margin-bottom: 4px;
}
.vv-hero-greeting .vv-greeting-emoji { margin-right: 4px; }
.vv-hero-name {
    font-size: 30px;
    font-weight: 600;
    color: var(--vv-ink);
    margin: 0 0 6px 0;
    letter-spacing: -0.6px;
    line-height: 1.1;
}
.vv-hero-meta { font-size: 13px; color: var(--vv-ink-soft); }
.vv-hero-meta .vv-dot { margin: 0 8px; color: var(--vv-mute-2); }
.vv-hero-meta strong { color: var(--vv-ink); font-weight: 600; }

/* ---------- QUICK-ACCESS CARDS ------------------------------------------ */
.vv-cap {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--vv-mute);
    font-weight: 700;
    margin: 0 0 10px 2px;
}
.vv-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
    margin: 0 0 26px 0;
}
.vv-quick-card {
    background: var(--vv-surface);
    border: 1px solid var(--vv-border);
    border-radius: var(--vv-r-md);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none !important;
    color: inherit !important;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
    position: relative;
}
.vv-quick-card:hover {
    border-color: var(--vv-red);
    transform: translateY(-1px);
    box-shadow: var(--vv-shadow-md);
}
.vv-quick-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--vv-red-tint);
    color: var(--vv-red);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
.vv-quick-text { display: flex; flex-direction: column; line-height: 1.25; }
.vv-quick-title { font-size: 14px; font-weight: 600; color: var(--vv-ink); }
.vv-quick-sub { font-size: 12px; color: var(--vv-mute); margin-top: 1px; }
.vv-quick-arrow {
    margin-left: auto;
    color: var(--vv-mute-2);
    font-size: 12px;
    transition: color .15s ease, transform .15s ease;
}
.vv-quick-card:hover .vv-quick-arrow { color: var(--vv-red); transform: translateX(2px); }

/* ---------- MISC (bootstrap alignments used across the app) ------------- */
.text-info,
.text-primary { color: var(--vv-red) !important; }
.text-success { color: var(--vv-ok) !important; }
.text-warning { color: var(--vv-warn) !important; }
.text-danger  { color: var(--vv-red) !important; }
.bg-success   { background-color: var(--vv-ok) !important; }
.bg-primary,
.bg-info      { background-color: var(--vv-red) !important; }

/* modals */
.modal-content {
    border-radius: var(--vv-r-lg) !important;
    border: 1px solid var(--vv-border) !important;
    box-shadow: var(--vv-shadow-lg) !important;
}
.modal-header {
    border-bottom: 1px solid var(--vv-border) !important;
    padding: 18px 22px !important;
}
.modal-title {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--vv-ink) !important;
}
.modal-body { padding: 22px !important; }
.modal-footer {
    border-top: 1px solid var(--vv-border) !important;
    padding: 14px 22px !important;
}

/* progress bar accent */
.progress { background: var(--vv-border) !important; border-radius: 999px !important; }
.progress-bar.bg-success { background: var(--vv-ok) !important; }

/* dropdown polish */
.dropdown-menu {
    border: 1px solid var(--vv-border) !important;
    border-radius: var(--vv-r-md) !important;
    box-shadow: var(--vv-shadow-lg) !important;
    padding: 6px !important;
}
.dropdown-item {
    border-radius: var(--vv-r-sm) !important;
    padding: 8px 10px !important;
    font-size: 13px !important;
    color: var(--vv-ink) !important;
}
.dropdown-item:hover { background: var(--vv-surface-soft) !important; }
.dropdown-item i { margin-right: 8px; color: var(--vv-mute); }
.dropdown-divider { border-color: var(--vv-border) !important; margin: 4px 0 !important; }

/* ---------- FIXES (post-first-deploy) ------------------------------------ */

/* Logo strip: uses valdervukwhite.png which is already white text + red fox
   for dark backgrounds, so no filter needed. */
.top-navbar .navbar-header .navbar-brand img {
    max-height: 38px;
    max-width: 170px;
}
/* Give the brand strip a bit more room so the bigger logo doesn't feel cramped. */
.top-navbar .navbar-header {
    padding-left: 24px !important;
    padding-right: 18px !important;
    min-height: 60px;
    display: flex;
    align-items: center;
}

/* Avatar overlay pattern: initial is always in the DOM as a background layer;
   the <img> sits absolutely on top. When the DB has an avatar path but the
   file 404s, onerror removes the img and the initial shows through gracefully
   instead of a broken empty circle. */
.vv-hero-avatar,
.vv-user-chip-avatar { position: relative; }
.vv-hero-avatar > .vv-avatar-initial,
.vv-user-chip-avatar > .vv-avatar-initial {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 0;
    color: var(--vv-red);
    font-weight: 700;
}
.vv-hero-avatar > .vv-avatar-initial      { font-size: 26px; }
.vv-user-chip-avatar > .vv-avatar-initial { font-size: 13px; }
.vv-hero-avatar > img,
.vv-user-chip-avatar > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* Sidebar section headers (VISTA GENERAL, VENTAS, OPERACIÓN, etc.) */
.sidebar-nav .nav-section-header {
    color: var(--vv-sidebar-cap);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 22px 22px 6px !important;
    list-style: none;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    background: transparent !important;
    border: none !important;
}
.sidebar-nav .nav-section-header:first-child { padding-top: 14px !important; }

/* Collapsed / mini sidebar: hide everything that only makes sense with a
   full-width sidebar. The vendor toggles body.mini-sidebar:not(.show-sidebar) and hides the
   .hide-menu label spans on its own; we mirror that for our additions so
   nothing overflows the icon strip. */
body.mini-sidebar:not(.show-sidebar) .sidebar-nav .nav-section-header,
body.mini-sidebar:not(.show-sidebar) .sidebar-nav .vv-alert-badge {
    display: none !important;
}

/* Mini-sidebar hover fly-out fix.
   When collapsed, hovering an icon pops out (a) the label next to it and (b)
   the submenu. Our --vv-sidebar-active is semi-transparent (looks great
   embedded in the sidebar bar; awful as a floating fly-out because the page
   content bleeds through). Force fully opaque backgrounds on the flying
   pieces and give them a shadow so they read as popovers. Also restore a
   solid bg on ul.collapse (kept transparent in expanded mode). */
body.mini-sidebar:not(.show-sidebar) .sidebar-nav #sidebarnav > li:hover > a,
body.mini-sidebar:not(.show-sidebar) .sidebar-nav #sidebarnav > li.active > a {
    background: var(--vv-sidebar-2) !important;
}
body.mini-sidebar:not(.show-sidebar) .sidebar-nav #sidebarnav > li > ul,
body.mini-sidebar:not(.show-sidebar) .sidebar-nav #sidebarnav > li > ul.collapse,
body.mini-sidebar:not(.show-sidebar) .sidebar-nav #sidebarnav > li:hover > ul {
    background: var(--vv-sidebar-2) !important;
    box-shadow: 0 10px 26px rgba(0,0,0,0.35) !important;
    padding: 6px 0 !important;
    z-index: 100;
}
body.mini-sidebar:not(.show-sidebar) .sidebar-nav #sidebarnav > li > ul li a {
    padding: 8px 18px !important;
    color: var(--vv-sidebar-ink) !important;
}
body.mini-sidebar:not(.show-sidebar) .sidebar-nav #sidebarnav > li > ul li a:hover {
    background: rgba(255,255,255,0.06) !important;
    color: #fff !important;
}

/* A tiny bit more vertical rhythm on collapsed icons so they don't feel
   crammed against each other. Also center the icon horizontally within the
   narrow strip and hide the label span cleanly so it can't overflow. */
body.mini-sidebar:not(.show-sidebar) .sidebar-nav #sidebarnav > li > a {
    padding: 14px 0 !important;
    justify-content: center;
    border-left-width: 0 !important;
}
body.mini-sidebar:not(.show-sidebar) .sidebar-nav #sidebarnav > li > a > i {
    font-size: 17px;
    width: 24px;
    text-align: center;
}
/* Restore the red accent as a thin left indicator on the active item so
   it doesn't disappear entirely just because we killed the border above. */
body.mini-sidebar:not(.show-sidebar) .sidebar-nav #sidebarnav > li.active > a,
body.mini-sidebar:not(.show-sidebar) .sidebar-nav #sidebarnav > li > a.active {
    box-shadow: inset 3px 0 0 0 var(--vv-red);
}

/* ---------- TOPBAR TOGGLERS ---------------------------------------------- */
/*
 * Pill-buttons for the hamburger + sidebar toggle. Don't touch `display` —
 * Bootstrap's d-none / d-md-none / d-lg-block decide which toggler is
 * visible per breakpoint; overriding display makes both render at the same
 * time on desktop. line-height:36px vertically centers the icon.
 *
 * We also (a) contain the vendor's .waves-effect ripple to the pill so it
 * can't smear beyond the button, (b) sit the pill fully INSIDE the topbar
 * so its background can't touch the topbar's bottom border and create a
 * "step" effect, and (c) use a soft off-white bg + subtle 1px inset border
 * on hover so the button reads as a proper button, not a gray smudge.
 */
.top-navbar .nav-link.nav-toggler,
.top-navbar .nav-link.sidebartoggler {
    cursor: pointer;
    border-radius: 8px;
    margin: 12px 4px !important;
    padding: 0 12px !important;
    line-height: 36px !important;
    height: 36px !important;
    color: var(--vv-mute) !important;
    text-align: center;
    overflow: hidden;                    /* contains .waves-effect ripple */
    box-shadow: none !important;
    background: transparent !important;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.top-navbar .nav-link.nav-toggler:hover,
.top-navbar .nav-link.sidebartoggler:hover,
.top-navbar .nav-link.nav-toggler:focus,
.top-navbar .nav-link.sidebartoggler:focus {
    background: var(--vv-surface-soft) !important;
    color: var(--vv-ink) !important;
    box-shadow: inset 0 0 0 1px var(--vv-border) !important;
    text-decoration: none !important;
    outline: none !important;
}
.top-navbar .nav-link.nav-toggler i,
.top-navbar .nav-link.sidebartoggler i {
    font-size: 18px;
    vertical-align: middle;
    line-height: 1;
}

/* =========================================================================
 * BRANDED LOADER · shown as page preloader AND reusable inline in any card
 *
 * Structure:
 *   .preloader           (fullscreen wrapper — vendor class, overridden)
 *     .vv-loader          (96px, holds the ring + mark)
 *       .vv-loader-ring   (rotating conic-gradient, masked into a torus)
 *       .vv-loader-mark   (white disk with the fox icon, breathing)
 *     .vv-loader-brand    (VALDERVUK wordmark, VUK in brand red)
 *     .vv-loader-dots     (3 dots blinking in sequence)
 *
 * For inline use, wrap the same 3 elements in `.vv-inline-loader` (compact
 * 48px version + reduced brand text).
 * ========================================================================= */

/* Fullscreen preloader — override the vendor .preloader entirely.
 * NOTE: do NOT put !important on `display`. jQuery's $(".preloader").fadeOut()
 * (called in dist/js/custom.js) ends by setting `display: none` INLINE; an
 * !important flex on our side would beat that inline style and the loader
 * would stay visible forever. Same for opacity: fadeOut animates opacity to
 * 0 on the inline style, so we must leave it alone here. */
.preloader {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    background: var(--vv-bg) !important;
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: column !important;
    gap: 22px;
}
/* Hide the vendor's original inner nodes so they can't peek through. */
.preloader .loader,
.preloader .loader__figure,
.preloader .loader__label { display: none !important; }

/* The 96x96 ring+mark combo. */
.vv-loader {
    position: relative;
    width: 96px;
    height: 96px;
    animation: vvLoaderIn .5s ease-out both;
}

/* Rotating red arc. conic-gradient draws a full circle; the radial-gradient
   mask keeps only a 5px-wide ring (transparent inside, opaque near the edge). */
.vv-loader-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--vv-red) 0deg,
        var(--vv-red) 55deg,
        rgba(138,41,33,0.28) 90deg,
        transparent 180deg,
        transparent 360deg
    );
    -webkit-mask: radial-gradient(circle, transparent 42%, #000 44%);
            mask: radial-gradient(circle, transparent 42%, #000 44%);
    animation: vvRingSpin 1.4s linear infinite;
    filter: drop-shadow(0 0 6px rgba(138,41,33,0.28));
}

/* Solid white disk that hosts the fox icon; gently breathes. */
.vv-loader-mark {
    position: absolute;
    inset: 11px;
    border-radius: 50%;
    background: var(--vv-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(138,41,33,0.12), inset 0 0 0 1px var(--vv-border);
    animation: vvBreathe 2.4s ease-in-out infinite;
}
.vv-loader-mark img {
    width: 42px;
    height: 42px;
    object-fit: contain;
    /* The valdervuk.png shield already comes red-on-transparent, no filter needed. */
}

/* Wordmark below the ring. */
.vv-loader-brand {
    font-family: var(--vv-font);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 7px;
    padding-left: 7px;             /* optical centering vs the letter-spacing */
    color: var(--vv-ink);
    animation: vvFadeUp .7s ease-out .1s both;
}
.vv-loader-brand span { color: var(--vv-red); }

/* Three blinking dots. */
.vv-loader-dots {
    display: flex;
    gap: 6px;
    animation: vvFadeUp .7s ease-out .2s both;
}
.vv-loader-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--vv-mute-2);
    animation: vvDotBlink 1.4s ease-in-out infinite;
}
.vv-loader-dots span:nth-child(2) { animation-delay: .18s; }
.vv-loader-dots span:nth-child(3) { animation-delay: .36s; }

/* ------------- Inline reusable version -------------
   Drop `<div class="vv-inline-loader">` anywhere (inside a tbody cell, a
   card body, etc.) and it renders the same look at compact scale. */
.vv-inline-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    padding: 30px 20px;
    color: var(--vv-mute);
}
.vv-inline-loader .vv-loader { width: 54px; height: 54px; }
.vv-inline-loader .vv-loader-mark { inset: 6px; }
.vv-inline-loader .vv-loader-mark img { width: 22px; height: 22px; }
.vv-inline-loader .vv-loader-brand {
    font-size: 10px;
    letter-spacing: 5px;
    padding-left: 5px;
}

/* ------------- Keyframes ------------- */
@keyframes vvRingSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes vvBreathe {
    0%, 100% { transform: scale(1);    box-shadow: 0 4px 20px rgba(138,41,33,0.12), inset 0 0 0 1px var(--vv-border); }
    50%      { transform: scale(0.93); box-shadow: 0 3px 14px rgba(138,41,33,0.20), inset 0 0 0 1px var(--vv-border); }
}
@keyframes vvFadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes vvDotBlink {
    0%, 100% { opacity: .28; transform: scale(0.85); }
    40%      { opacity: 1;   transform: scale(1); }
}
@keyframes vvLoaderIn {
    from { opacity: 0; transform: scale(0.85); }
    to   { opacity: 1; transform: scale(1); }
}

/* -------- Retrofit legacy inline "Cargando..." markup ---------------------
 * The whole app has 30+ JS files that fill a container with either
 *   <center><br>Cargando<br><br><img src="/images/ajax-loader2.gif" .../></center>
 * or
 *   <tr><td colspan="X"><i class="fa fa-spinner fa-spin"></i> Cargando...</td></tr>
 * Rather than touch every JS file, we intercept those exact shapes with
 * :has() and replace them visually with the branded ring + "CARGANDO" text.
 * The original nodes stay in the DOM (font-size:0 nukes their pixels; the img
 * is display:none) so JS logic that later swaps the container HTML keeps
 * working exactly the same.
 * ------------------------------------------------------------------------- */
center:has(> img[src*="ajax-loader"]),
td:has(> i.fa.fa-spinner.fa-spin) {
    padding: 34px 20px !important;
    text-align: center;
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    background: transparent !important;
}
center:has(> img[src*="ajax-loader"]) > br,
center:has(> img[src*="ajax-loader"]) > img,
td:has(> i.fa.fa-spinner.fa-spin) > i.fa-spinner { display: none !important; }

center:has(> img[src*="ajax-loader"])::before,
td:has(> i.fa.fa-spinner.fa-spin)::before {
    content: "";
    display: inline-block;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        var(--vv-red) 0deg,
        var(--vv-red) 55deg,
        rgba(138,41,33,0.28) 90deg,
        transparent 180deg,
        transparent 360deg
    );
    -webkit-mask: radial-gradient(circle, transparent 40%, #000 42%);
            mask: radial-gradient(circle, transparent 40%, #000 42%);
    animation: vvRingSpin 1.4s linear infinite;
    filter: drop-shadow(0 2px 8px rgba(138,41,33,0.20));
    vertical-align: middle;
}

center:has(> img[src*="ajax-loader"])::after,
td:has(> i.fa.fa-spinner.fa-spin)::after {
    content: "CARGANDO";
    display: block;
    margin-top: 14px;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 6px;
    padding-left: 6px;                 /* optical centering */
    color: var(--vv-mute);
    font-family: var(--vv-font);
    animation: vvFadeUp .6s ease-out both;
}

/* =========================================================================
 * RESPONSIVE · progressive tightening for tablet + phone
 * ------------------------------------------------------------------------
 * We keep the vendor's mobile drawer behavior for the sidebar (nav-toggler
 * class flips it in/out) and only tune spacing, typography, chip visibility,
 * grids and modals so nothing feels cramped or overflowing on small screens.
 * ========================================================================= */

/* ---------- TABLET (< 992px) ---------- */
@media (max-width: 991.98px) {
    .page-wrapper > .container-fluid { padding: 20px 22px 32px !important; }
    .card-body { padding: 18px !important; }

    .vv-hero { padding: 24px 26px; gap: 18px; }
    .vv-hero-name { font-size: 26px; }
    .vv-hero-meta { font-size: 12.5px; }

    /* Slightly tighter KPI numerals */
    .card-body h3.font-light { font-size: 22px; }
}

/* ---------- MOBILE (< 768px) ---------- */
@media (max-width: 767.98px) {

    body.skin-default { font-size: 13px; }
    .page-wrapper > .container-fluid { padding: 14px 14px 28px !important; }

    /* --- TOPBAR --- */
    .top-navbar { padding: 0 10px 0 0 !important; min-height: 56px; }
    .top-navbar .navbar-header { padding-left: 14px; }
    .top-navbar .navbar-header .navbar-brand img { max-height: 30px; max-width: 130px; }
    /* Kill the hairline separator on mobile so the compact header reads clean */
    .top-navbar .navbar-collapse { border-bottom: 0; }

    /* User chip collapses to just the avatar — text takes too much room */
    .vv-user-chip { padding: 4px !important; gap: 0 !important; margin: 0 4px !important; }
    .vv-user-chip-text,
    .vv-user-chip .fa-angle-down { display: none !important; }
    .vv-user-chip-avatar { width: 32px; height: 32px; }

    /* Breadcrumb: small, muted, no big top strip */
    .row.page-titles { margin: 0 0 10px !important; }
    .row.page-titles .breadcrumb { font-size: 11px !important; }
    .row.page-titles .breadcrumb-item + .breadcrumb-item::before { padding: 0 4px; }

    /* --- HERO --- */
    .vv-hero {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        gap: 14px;
        padding: 22px 20px;
        margin-bottom: 18px;
    }
    .vv-hero::after { display: none; }     /* decorative bloom off for perf + clarity */
    .vv-hero-avatar { width: 56px; height: 56px; }
    .vv-hero-avatar > .vv-avatar-initial { font-size: 22px; }
    .vv-hero-greeting { font-size: 10px; letter-spacing: 1px; }
    .vv-hero-name { font-size: 26px; margin-bottom: 4px; }
    .vv-hero-meta { font-size: 12px; }

    /* --- QUICK ACCESS --- */
    .vv-quick-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 22px;
    }
    .vv-quick-card { padding: 14px 16px; }
    .vv-quick-title { font-size: 13.5px; }
    .vv-quick-sub { font-size: 11.5px; }
    .vv-cap { font-size: 10px; letter-spacing: 1px; }

    /* --- CARDS + KPIs --- */
    .card { margin-bottom: 12px !important; border-radius: var(--vv-r-md); }
    .card-body { padding: 16px !important; }
    .card-body h3.font-light { font-size: 22px; }
    .card-body h5.text-muted { font-size: 10px; letter-spacing: 0.4px; }
    .card-title, h4.card-title { font-size: 13px !important; margin-bottom: 12px !important; }

    /* --- TABLES --- */
    .table-responsive { -webkit-overflow-scrolling: touch; margin: 0 -4px; }
    .table td, .table th { padding: 8px 10px !important; font-size: 12px !important; }
    .table thead th { font-size: 10px !important; letter-spacing: 0.4px; }
    /* DataTables toolbar buttons stack on small screens */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        text-align: left !important;
        margin: 4px 0 !important;
    }
    .dataTables_wrapper .dataTables_paginate { padding-top: 4px; }

    /* --- BUTTONS + FORMS --- */
    .btn { font-size: 12.5px !important; padding: 7px 12px !important; }
    .form-control { font-size: 13px !important; padding: 9px 12px !important; }
    label.control-label,
    .form-group label { font-size: 11.5px; }

    /* --- MODALS --- */
    .modal-dialog { margin: 8px; }
    .modal-content { border-radius: var(--vv-r-md) !important; }
    .modal-header { padding: 14px 16px !important; }
    .modal-title { font-size: 15px !important; }
    .modal-body { padding: 16px !important; }
    .modal-footer {
        padding: 12px 16px !important;
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
    }
    .modal-footer .btn { width: 100%; margin: 0 !important; }

    /* --- PRELOADER · smaller mark so it doesn't hog phone screens --- */
    .vv-loader { width: 78px; height: 78px; }
    .vv-loader-mark { inset: 9px; }
    .vv-loader-mark img { width: 34px; height: 34px; }
    .vv-loader-brand { font-size: 11px; letter-spacing: 5px; }

    /* --- SIDEBAR DRAWER open state (vendor toggles show-sidebar) ---
       When the drawer is open on mobile ensure it sits on top with a shadow,
       and dim the content behind so it's clear the drawer is modal. Clicking
       the dim area also dismisses the drawer via the vendor's own handler. */
    body.show-sidebar .left-sidebar,
    body.mini-sidebar:not(.show-sidebar) .left-sidebar { box-shadow: 6px 0 24px rgba(0,0,0,0.25); }

    body.show-sidebar::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(15,17,20,0.45);
        z-index: 998;
        animation: vvFadeIn .2s ease-out both;
    }
    .left-sidebar { z-index: 999; }

    /* On mobile, the drawer should slide down from the very top of the
       viewport — the vendor sets .left-sidebar { top: 60px } for the
       desktop layout, but on a mobile drawer that leaves a big empty
       band above the brand header. Force full-height starting at top:0
       and zero any padding-top inherited from the scroll wrapper. */
    body.show-sidebar .left-sidebar {
        top: 0 !important;
        height: 100vh !important;
        padding-top: 0 !important;
    }
    body.show-sidebar .left-sidebar .scroll-sidebar { padding-top: 0 !important; }

    /* Brand header in the drawer — mobile only. */
    .vv-sidebar-brand {
        display: flex;
        align-items: center;
        padding: 18px 22px;
        border-bottom: 1px solid var(--vv-sidebar-line);
        background: var(--vv-sidebar);
    }
    .vv-sidebar-brand a { line-height: 0; text-decoration: none !important; }
    .vv-sidebar-brand img {
        height: 32px;
        max-width: 180px;
        /* No filter — valdervukwhite.png is already the white variant. */
    }
}

/* Hide the drawer brand header on desktop; the topbar's navbar-header
   already carries the logo there. */
@media (min-width: 768px) {
    .vv-sidebar-brand { display: none !important; }
}
@keyframes vvFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- SMALL PHONE (< 480px) ---------- */
@media (max-width: 479.98px) {
    .page-wrapper > .container-fluid { padding: 10px 10px 22px !important; }
    .vv-hero { padding: 18px 16px; }
    .vv-hero-name { font-size: 22px; }
    .vv-quick-card { padding: 12px 14px; }
    .vv-quick-icon { width: 36px; height: 36px; font-size: 15px; }
    .card-body { padding: 14px !important; }
    .card-body h3.font-light { font-size: 20px; }

    /* Hide the leftmost decorative section caps on ultra-narrow to avoid
       any hairline overflow when the drawer is closed. */
    .top-navbar .navbar-header .navbar-brand img { max-height: 26px; max-width: 112px; }
}

/* ---------- Landscape phone: keep hero horizontal ---------- */
@media (max-width: 767.98px) and (orientation: landscape) and (min-width: 568px) {
    .vv-hero { flex-direction: row; align-items: center; }
    .vv-hero-avatar { width: 60px; height: 60px; }
}

/* ---------- AUTOSAVE INDICATOR (2026-07-14 · Change 3) --------------------
 * Indicador fijo top-right que aparece solo en /mode/quoteEdit. Tres estados
 * visuales: dirty (rojo tenue), saving (ámbar), saved (verde). Se posiciona
 * debajo del user chip para no chocar con él. */
.vv-autosave-indicator {
    position: fixed;
    top: 76px;                      /* justo debajo del topbar (60px) + gap */
    right: 20px;
    z-index: 1050;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    font-family: var(--vv-font);
    line-height: 1.3;
    letter-spacing: 0.1px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid var(--vv-border);
    color: var(--vv-mute);
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.vv-autosave-indicator.vv-as-dirty {
    background: #FEF3F2;
    border-color: #FCA5A5;
    color: #B91C1C;
}
.vv-autosave-indicator.vv-as-saving {
    background: #FFFBEB;
    border-color: #FDE68A;
    color: #92400E;
}
.vv-autosave-indicator.vv-as-saved {
    background: #F0FDF4;
    border-color: #BBF7D0;
    color: #166534;
}
.vv-autosave-indicator .vv-as-dot   { font-size: 10px; }
.vv-autosave-indicator .vv-as-spin  { display: inline-block; animation: vvAsSpin .9s linear infinite; }
.vv-autosave-indicator .vv-as-check { font-weight: 700; }
@keyframes vvAsSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

@media (max-width: 767.98px) {
    .vv-autosave-indicator { top: 66px; right: 12px; font-size: 11px; padding: 5px 10px; }
}
