/* =========================================================
   VOXA FACTURACIÓN — TEMA UI
   Capa visual sobre Bootstrap 5.3 / VxTable / SlimSelect.
   No define comportamiento: solo apariencia.
   ========================================================= */

:root {
    /* Superficies */
    --vx-bg: #f4f6f9;
    --vx-surface: #ffffff;
    --vx-surface-2: #fafbfc;
    --vx-hover: #f0f3f7;

    /* Bordes */
    --vx-border: #e2e7ee;
    --vx-border-strong: #d5dce5;
    --vx-border-soft: #eef1f5;

    /* Texto */
    --vx-text: #0e1a2b;
    --vx-text-2: #3b4a60;
    --vx-muted: #5a6880;
    --vx-subtle: #6b7890;

    /* Marca */
    --vx-primary: #16325b;
    --vx-primary-hover: #0b1f3d;
    --vx-primary-soft: #e8eef7;
    --vx-accent: #227b94;
    --vx-focus: #9db5d6;

    /* Estados */
    --vx-success: #146c3b;
    --vx-success-soft: #e7f4ec;
    --vx-warning: #9a4a0c;
    --vx-warning-soft: #fdf0e3;
    --vx-danger: #a3261b;
    --vx-danger-soft: #fcebe9;
    --vx-info: #1d6f86;
    --vx-info-soft: #e5f2f5;

    --vx-radius: 8px;
    --vx-radius-lg: 12px;
    --vx-sidebar-w: 256px;
    --vx-font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --vx-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Bootstrap */
    --bs-body-font-family: var(--vx-font);
    --bs-body-font-size: 14px;
    --bs-body-color: var(--vx-text);
    /* Los componentes Bootstrap (modal, dropdown, list-group, inputs) usan body-bg como fondo:
       se deja blanco y el gris de la página se aplica directo en <body>. */
    --bs-body-bg: var(--vx-surface);
    --bs-body-bg-rgb: 255, 255, 255;
    --bs-border-color: var(--vx-border);
    --bs-secondary-color: var(--vx-muted);
    --bs-tertiary-bg: var(--vx-surface-2);
    --bs-primary: #16325b;
    --bs-primary-rgb: 22, 50, 91;
    --bs-link-color: var(--vx-primary);
    --bs-link-color-rgb: 22, 50, 91;
    --bs-link-hover-color: var(--vx-primary-hover);
    --bs-link-hover-color-rgb: 11, 31, 61;
    --bs-border-radius: var(--vx-radius);
    --bs-border-radius-sm: 6px;
    --bs-border-radius-lg: var(--vx-radius-lg);
    --bs-success-rgb: 20, 108, 59;
    --bs-danger-rgb: 180, 35, 24;
    --bs-warning-rgb: 217, 130, 43;
    --bs-info-rgb: 34, 123, 148;
}

/* ---------- Base ---------- */
html, body {
    font-size: 14px;
}

body {
    background: var(--vx-bg);
    color: var(--vx-text);
    font-family: var(--vx-font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--vx-text);
    letter-spacing: -0.01em;
}
h1, .h1 { font-size: 1.75rem; }
h2, .h2 { font-size: 1.4rem; }
h3, .h3 { font-size: 1.2rem; }
h4, .h4 { font-size: 1.1rem; }
h5, .h5 { font-size: 1rem; }
h6, .h6 { font-size: .9rem; }

.text-muted { color: var(--vx-muted) !important; }
.mono, .font-monospace { font-family: var(--vx-mono) !important; font-variant-numeric: tabular-nums; }
.tabular { font-variant-numeric: tabular-nums; }

hr {
    margin: .75rem 0;
    border-color: var(--vx-border);
    opacity: 1;
}

::selection { background: var(--vx-primary-soft); }

/* ---------- Shell ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--vx-sidebar-w);
    background: var(--vx-surface);
    border-right: 1px solid var(--vx-border);
    display: flex;
    flex-direction: column;
    padding: 18px 14px 14px;
    overflow-y: auto;
    z-index: 1040;
    transition: transform .2s ease;
}

.app-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--vx-sidebar-w);
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1;
    padding: 28px 32px 48px;
    min-width: 0;
}

.app-topbar {
    display: none;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 16px;
    background: var(--vx-surface);
    border-bottom: 1px solid var(--vx-border);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.app-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(14, 26, 43, .35);
    z-index: 1035;
}

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); box-shadow: 0 10px 40px rgba(14, 26, 43, .18); }
    .app-main { margin-left: 0; }
    .app-topbar { display: flex; }
    .app-content { padding: 20px 16px 40px; }
    body.sidebar-open .app-sidebar { transform: translateX(0); }
    body.sidebar-open .app-backdrop { display: block; }
}

/* ---------- Sidebar ---------- */
.sb-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 6px 16px;
    text-decoration: none;
    color: var(--vx-text);
}
.sb-brand img { width: 36px; height: 36px; object-fit: contain; }
.sb-brand-name { font-weight: 700; font-size: 15px; line-height: 1.1; }
.sb-brand-sub { font-size: 12px; color: var(--vx-subtle); }

.sb-company {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--vx-border);
    border-radius: 10px;
    background: var(--vx-surface-2);
    text-decoration: none;
    color: var(--vx-text);
}
.sb-company:hover { background: var(--vx-hover); color: var(--vx-text); }
.sb-company.is-empty { border-color: #f1c8c3; background: var(--vx-danger-soft); }
.sb-company-icon {
    flex: 0 0 auto;
    width: 30px; height: 30px;
    border-radius: 6px;
    background: var(--vx-primary-soft);
    color: var(--vx-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
}
.sb-company.is-empty .sb-company-icon { background: #fff; color: var(--vx-danger); }
.sb-company-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sb-company-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-company-rut { font-size: 12px; color: var(--vx-subtle); font-family: var(--vx-mono); }

.sb-cta {
    margin: 14px 0 4px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px;
    border-radius: var(--vx-radius);
    background: var(--vx-primary);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}
.sb-cta:hover { background: var(--vx-primary-hover); color: #fff; }

.sb-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--vx-subtle);
    padding: 16px 10px 6px;
}

.sb-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--vx-radius);
    color: var(--vx-text-2);
    text-decoration: none;
    font-weight: 500;
}
.sb-link i { font-size: 17px; width: 18px; text-align: center; color: var(--vx-subtle); }
.sb-link:hover { background: var(--vx-hover); color: var(--vx-text); }
.sb-link.active { background: var(--vx-primary-soft); color: var(--vx-primary); font-weight: 600; }
.sb-link.active i { color: var(--vx-primary); }

.sb-footer {
    margin-top: auto;
    padding: 12px 6px 0;
    border-top: 1px solid var(--vx-border);
    display: flex;
    align-items: center;
    gap: 10px;
}
.sb-avatar {
    flex: 0 0 auto;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--vx-accent);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600;
}
.sb-user { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sb-user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-sub { font-size: 12px; color: var(--vx-subtle); font-family: var(--vx-mono); }

/* ---------- Page header ---------- */
.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}
.page-header-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.page-eyebrow { font-size: 13px; color: var(--vx-muted); }
.page-title { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }
.page-subtitle { font-size: 14px; color: var(--vx-muted); }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- Cards / secciones ---------- */
.card {
    --bs-card-border-color: var(--vx-border);
    --bs-card-border-radius: var(--vx-radius-lg);
    --bs-card-inner-border-radius: calc(var(--vx-radius-lg) - 1px);
    --bs-card-cap-bg: var(--vx-surface);
    --bs-card-spacer-x: 1.25rem;
    --bs-card-spacer-y: 1.1rem;
    background: var(--vx-surface);
}
.card-header {
    font-weight: 600;
    border-bottom-color: var(--vx-border);
}
.card-title { font-weight: 600; }

.vx-card {
    background: var(--vx-surface);
    border: 1px solid var(--vx-border);
    border-radius: var(--vx-radius-lg);
    padding: 20px 24px;
}
.vx-card + .vx-card { margin-top: 16px; }
.vx-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.vx-card-title { margin: 0; font-size: 16px; font-weight: 600; }
.vx-card-sub { font-size: 13px; color: var(--vx-muted); }
.vx-card.p-0 .vx-card-header { padding: 16px 20px 0; }

.vx-stat {
    background: var(--vx-surface);
    border: 1px solid var(--vx-border);
    border-radius: var(--vx-radius-lg);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
}
.vx-stat-label { font-size: 13px; color: var(--vx-muted); font-weight: 500; }
.vx-stat-value { font-family: var(--vx-mono); font-size: 26px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15; }
.vx-stat-hint { font-size: 12px; color: var(--vx-muted); }

.vx-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--vx-muted);
}
.vx-empty i { font-size: 28px; color: var(--vx-subtle); display: block; margin-bottom: 8px; }

/* ---------- Badges de estado ---------- */
.vx-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--vx-border-soft);
    color: var(--vx-text-2);
    white-space: nowrap;
}
.vx-badge-success { background: var(--vx-success-soft); color: var(--vx-success); }
.vx-badge-warning { background: var(--vx-warning-soft); color: var(--vx-warning); }
.vx-badge-danger  { background: var(--vx-danger-soft);  color: var(--vx-danger); }
.vx-badge-info    { background: var(--vx-info-soft);    color: var(--vx-info); }
.vx-badge-primary { background: var(--vx-primary-soft); color: var(--vx-primary); }
.vx-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.vx-tag {
    display: inline-block;
    font-family: var(--vx-mono);
    font-size: 12px;
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--vx-border-soft);
    color: var(--vx-text-2);
}

.badge { font-weight: 600; border-radius: 999px; padding: .4em .7em; }

/* ---------- Botones ---------- */
.btn {
    --bs-btn-font-weight: 500;
    --bs-btn-border-radius: var(--vx-radius);
    --bs-btn-padding-y: .45rem;
    --bs-btn-padding-x: .9rem;
    --bs-btn-font-size: 14px;
    --bs-btn-focus-box-shadow: 0 0 0 3px rgba(157, 181, 214, .55);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.btn-sm {
    --bs-btn-padding-y: .32rem;
    --bs-btn-padding-x: .7rem;
    --bs-btn-font-size: 13px;
    --bs-btn-border-radius: var(--vx-radius);
}
.btn-lg { --bs-btn-padding-y: .65rem; --bs-btn-font-size: 15px; }
.btn.w-100 { display: flex; }

.btn-primary {
    --bs-btn-bg: var(--vx-primary);
    --bs-btn-border-color: var(--vx-primary);
    --bs-btn-hover-bg: var(--vx-primary-hover);
    --bs-btn-hover-border-color: var(--vx-primary-hover);
    --bs-btn-active-bg: var(--vx-primary-hover);
    --bs-btn-active-border-color: var(--vx-primary-hover);
    --bs-btn-disabled-bg: var(--vx-primary);
    --bs-btn-disabled-border-color: var(--vx-primary);
}

/* Botón neutro (secundario) */
.btn-light,
.btn-outline-secondary,
.btn-outline-dark,
.btn-outline-primary,
.btn-outline-warning,
.btn-outline-info {
    --bs-btn-color: var(--vx-text);
    --bs-btn-bg: var(--vx-surface);
    --bs-btn-border-color: var(--vx-border-strong);
    --bs-btn-hover-color: var(--vx-text);
    --bs-btn-hover-bg: var(--vx-hover);
    --bs-btn-hover-border-color: var(--vx-border-strong);
    --bs-btn-active-color: var(--vx-text);
    --bs-btn-active-bg: #e6ebf1;
    --bs-btn-active-border-color: var(--vx-border-strong);
    --bs-btn-disabled-color: var(--vx-subtle);
    --bs-btn-disabled-bg: var(--vx-surface-2);
    --bs-btn-disabled-border-color: var(--vx-border);
}
.btn-outline-primary { --bs-btn-color: var(--vx-primary); --bs-btn-hover-color: var(--vx-primary); }

.btn-secondary {
    --bs-btn-color: var(--vx-text);
    --bs-btn-bg: var(--vx-border-soft);
    --bs-btn-border-color: var(--vx-border-soft);
    --bs-btn-hover-color: var(--vx-text);
    --bs-btn-hover-bg: #e2e7ee;
    --bs-btn-hover-border-color: #e2e7ee;
    --bs-btn-active-color: var(--vx-text);
    --bs-btn-active-bg: #d5dce5;
    --bs-btn-active-border-color: #d5dce5;
}

.btn-outline-success {
    --bs-btn-color: var(--vx-success);
    --bs-btn-bg: var(--vx-surface);
    --bs-btn-border-color: #b9dcc7;
    --bs-btn-hover-color: var(--vx-success);
    --bs-btn-hover-bg: var(--vx-success-soft);
    --bs-btn-hover-border-color: #9fcfb2;
    --bs-btn-active-color: var(--vx-success);
    --bs-btn-active-bg: #d5ecdf;
    --bs-btn-active-border-color: #9fcfb2;
}
.btn-outline-danger {
    --bs-btn-color: var(--vx-danger);
    --bs-btn-bg: var(--vx-surface);
    --bs-btn-border-color: #f1c8c3;
    --bs-btn-hover-color: var(--vx-danger);
    --bs-btn-hover-bg: var(--vx-danger-soft);
    --bs-btn-hover-border-color: #e9aaa3;
    --bs-btn-active-color: var(--vx-danger);
    --bs-btn-active-bg: #f8d9d5;
    --bs-btn-active-border-color: #e9aaa3;
}
.btn-success {
    --bs-btn-bg: #157347;
    --bs-btn-border-color: #157347;
    --bs-btn-hover-bg: #105c38;
    --bs-btn-hover-border-color: #105c38;
}
.btn-danger {
    --bs-btn-bg: #b42318;
    --bs-btn-border-color: #b42318;
    --bs-btn-hover-bg: #912018;
    --bs-btn-hover-border-color: #912018;
}

/* Botón de icono */
.btn-icon {
    --bs-btn-padding-x: 0;
    --bs-btn-padding-y: 0;
    width: 32px;
    height: 32px;
    color: var(--vx-text-2);
    border: 1px solid transparent;
    background: transparent;
}
.btn-icon:hover { background: var(--vx-hover); border-color: var(--vx-border); color: var(--vx-text); }
.btn-icon.text-danger:hover { color: var(--vx-danger) !important; }

.btn-ghost-dashed {
    --bs-btn-color: var(--vx-primary);
    --bs-btn-bg: var(--vx-surface);
    --bs-btn-border-color: var(--vx-border-strong);
    --bs-btn-hover-color: var(--vx-primary);
    --bs-btn-hover-bg: var(--vx-primary-soft);
    --bs-btn-hover-border-color: var(--vx-primary);
    border-style: dashed;
}

.btn-link { --bs-btn-color: var(--vx-primary); --bs-btn-hover-color: var(--vx-primary-hover); text-decoration: none; }

/* ---------- Formularios ---------- */
.form-control,
.form-select {
    border-color: var(--vx-border-strong);
    border-radius: var(--vx-radius);
    color: var(--vx-text);
    font-size: 14px;
    min-height: 38px;
    padding: .45rem .75rem;
    background-color: var(--vx-surface);
}
.form-control-sm,
.form-select-sm {
    min-height: 34px;
    font-size: 14px;
    padding: .32rem .65rem;
    border-radius: var(--vx-radius);
}
.form-select, .form-select-sm { padding-right: 2.1rem; }
textarea.form-control { min-height: auto; }
.form-control:focus,
.form-select:focus {
    border-color: var(--vx-primary);
    box-shadow: 0 0 0 3px rgba(157, 181, 214, .45);
}
.form-control:disabled,
.form-select:disabled,
.form-control[readonly] {
    background-color: var(--vx-surface-2);
    color: var(--vx-muted);
}
.form-control::placeholder { color: #8a97ab; }

/* Inputs que antes llevaban borde rojo decorativo */
.form-control.border-danger:not(.is-invalid),
.form-select.border-danger:not(.is-invalid) {
    border-color: var(--vx-border-strong) !important;
}

.form-label,
.form-label-sm,
.col-form-label,
.col-form-label-sm {
    font-size: 13px;
    font-weight: 500;
    color: var(--vx-text-2);
    margin-bottom: 6px;
}

.input-group-text {
    background: var(--vx-surface-2);
    border-color: var(--vx-border-strong);
    color: var(--vx-muted);
    font-size: 13px;
    font-weight: 500;
}
.input-group-sm > .input-group-text { font-size: 13px; }
.input-group > .form-control,
.input-group > .form-select { min-height: 0; }

.form-check-input {
    border-color: var(--vx-border-strong);
    width: 1.05em;
    height: 1.05em;
}
.form-check-input:checked { background-color: var(--vx-primary); border-color: var(--vx-primary); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(157, 181, 214, .45); border-color: var(--vx-primary); }
.form-switch .form-check-input:checked { background-color: var(--vx-accent); border-color: var(--vx-accent); }
input[type="checkbox"]:not(.form-check-input),
input[type="radio"]:not(.form-check-input) { accent-color: var(--vx-primary); }

.invalid-feedback { font-size: 12px; }

/* Campo con etiqueta arriba (para vistas nuevas) */
.vx-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vx-field > label,
.vx-field > .vx-label { font-size: 13px; font-weight: 500; color: var(--vx-text-2); margin: 0; }

/* Segmentado */
.vx-segmented {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--vx-hover);
    border-radius: 10px;
    flex-wrap: wrap;
}
.vx-segmented .btn-check + .btn,
.vx-segmented > .btn {
    --bs-btn-border-color: transparent;
    --bs-btn-bg: transparent;
    --bs-btn-color: var(--vx-muted);
    --bs-btn-hover-bg: rgba(255, 255, 255, .6);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: #fff;
    --bs-btn-active-color: var(--vx-primary);
    --bs-btn-active-border-color: transparent;
    border-radius: 7px !important;
}
.vx-segmented .btn-check:checked + .btn { background: #fff; color: var(--vx-primary); box-shadow: 0 1px 2px rgba(14, 26, 43, .12); }

/* ---------- Tablas ---------- */
.table {
    --bs-table-color: var(--vx-text);
    --bs-table-border-color: var(--vx-border-soft);
    --bs-table-striped-bg: var(--vx-surface-2);
    --bs-table-hover-bg: var(--vx-hover);
    --bs-table-bg: transparent;
    font-size: 14px;
    margin-bottom: 0;
}
.table > :not(caption) > * > * { padding: .6rem .75rem; vertical-align: middle; }
.table-sm > :not(caption) > * > * { padding: .45rem .6rem; }
.table > thead th,
.table thead.table-dark th,
.table thead.table-light th {
    background: var(--vx-surface-2) !important;
    color: var(--vx-muted) !important;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid var(--vx-border) !important;
    white-space: nowrap;
}
.table-bordered > :not(caption) > * { border-color: var(--vx-border-soft); }
.table-responsive { border-radius: inherit; }
.vx-table-wrap {
    border: 1px solid var(--vx-border);
    border-radius: var(--vx-radius-lg);
    overflow: hidden;
    background: var(--vx-surface);
}
.vx-table-wrap .table-responsive { overflow-x: auto; }

/* ---------- Modales ---------- */
.modal {
    --bs-modal-border-radius: var(--vx-radius-lg);
    --bs-modal-inner-border-radius: calc(var(--vx-radius-lg) - 1px);
    --bs-modal-border-color: var(--vx-border);
    --bs-modal-header-border-color: var(--vx-border);
    --bs-modal-footer-border-color: var(--vx-border);
    --bs-modal-header-padding: 1rem 1.25rem;
    --bs-modal-padding: 1.25rem;
    --bs-modal-box-shadow: 0 20px 60px rgba(14, 26, 43, .2);
}
.modal-content { box-shadow: var(--bs-modal-box-shadow); }
.modal-title { font-size: 16px !important; font-weight: 600; }
.modal-backdrop { --bs-backdrop-bg: #0e1a2b; --bs-backdrop-opacity: .4; }

/* ---------- Toasts ---------- */
.toast {
    --bs-toast-border-radius: 10px;
    --bs-toast-font-size: 14px;
    box-shadow: 0 10px 30px rgba(14, 26, 43, .18);
}
.toast.text-bg-danger { background-color: #b42318 !important; }
.toast.text-bg-success { background-color: #146c3b !important; }
.toast.text-bg-warning { background-color: #fdf0e3 !important; color: var(--vx-warning) !important; }
.toast.text-bg-info { background-color: #1d6f86 !important; }

/* ---------- Tooltips / Nav tabs / Alerts / Pagination ---------- */
.tooltip { --bs-tooltip-bg: #0e1a2b; --bs-tooltip-font-size: 12px; --bs-tooltip-border-radius: 6px; }
.tooltip.show { opacity: .95 !important; }

.nav-tabs {
    --bs-nav-tabs-border-color: var(--vx-border);
    --bs-nav-tabs-link-active-color: var(--vx-primary);
    --bs-nav-tabs-link-active-border-color: transparent transparent var(--vx-primary);
    --bs-nav-tabs-link-hover-border-color: transparent;
    --bs-nav-link-color: var(--vx-muted);
    --bs-nav-link-hover-color: var(--vx-text);
    gap: 20px;
}
.nav-tabs .nav-link {
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 2px;
    font-weight: 500;
    background: none !important;
}
.nav-tabs .nav-link.active { border-bottom-color: var(--vx-primary); font-weight: 600; }

.alert { border-radius: 10px; font-size: 14px; }

.pagination { --bs-pagination-color: var(--vx-text-2); --bs-pagination-active-bg: var(--vx-primary); --bs-pagination-active-border-color: var(--vx-primary); --bs-pagination-border-color: var(--vx-border-strong); }

.dropdown-menu {
    --bs-dropdown-border-color: var(--vx-border);
    --bs-dropdown-border-radius: 10px;
    --bs-dropdown-link-hover-bg: var(--vx-hover);
    --bs-dropdown-font-size: 14px;
    box-shadow: 0 10px 30px rgba(14, 26, 43, .12);
    padding: 6px;
}
.dropdown-item { border-radius: 6px; padding: 7px 10px; display: flex; align-items: center; gap: 8px; }

.progress { --bs-progress-height: 6px; --bs-progress-bg: var(--vx-border-soft); --bs-progress-bar-bg: var(--vx-primary); border-radius: 3px; }

/* ---------- VxTable (listados) ---------- */
.vx-dt {
    border: 1px solid var(--vx-border);
    border-radius: var(--vx-radius-lg);
    background: var(--vx-surface);
    overflow: hidden;
}
.vx-dt-scroll { overflow-x: auto; }
.vx-dt-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; color: var(--vx-text); }
.vx-dt-table th,
.vx-dt-table td { padding: 8px 10px; white-space: nowrap; vertical-align: middle; background: var(--vx-surface); }
.vx-dt-table thead th { background: var(--vx-surface-2); color: var(--vx-muted); font-size: 12px; font-weight: 600; }
.vx-dt-head th { padding-bottom: 4px; white-space: normal; line-height: 1.25; vertical-align: bottom; }
.vx-dt-filters th { padding-top: 0; border-bottom: 1px solid var(--vx-border); }
.vx-dt-head.no-filters th { padding-bottom: 8px; border-bottom: 1px solid var(--vx-border); }
.vx-dt-filters .form-control,
.vx-dt-filters .form-select {
    width: 100%;
    min-width: 0;
    font-size: 12px;
    padding-top: 3px;
    padding-bottom: 3px;
    border-color: var(--vx-border-strong);
}
.vx-dt-filters .form-control { min-width: 56px; padding-left: 7px; padding-right: 7px; }
.vx-dt-filters .form-select { padding-left: 7px; padding-right: 22px; background-position: right 6px center; }
.vx-dt-sortable { cursor: pointer; user-select: none; }
.vx-dt-sortable:hover { color: var(--vx-text); }
.vx-dt-title { display: inline-flex; align-items: center; gap: 4px; }
.vx-dt-sort { font-size: 10px; opacity: .45; }
.vx-dt-sortable.is-sorted { color: var(--vx-text); }
.vx-dt-sortable.is-sorted .vx-dt-sort { opacity: 1; }
.vx-dt-table tbody td { border-bottom: 1px solid var(--vx-border-soft); }
.vx-dt-table tbody tr:last-child td { border-bottom: none; }
.vx-dt-table tbody tr:hover td { background: var(--vx-hover); }
.vx-dt-table tbody tr.vx-dt-warn td { background: var(--vx-danger-soft); }
.vx-dt-table tbody tr.is-selected td { background: var(--vx-primary-soft); }
.vx-dt-num { width: 1%; color: var(--vx-subtle); font-size: 12px; text-align: center; }
.vx-dt-check { width: 1%; text-align: center; }
.vx-dt-check .form-check-input { margin: 0; }
/* La columna "grow" absorbe el espacio libre y trunca su texto */
.vx-dt-table .vx-dt-grow { width: 100%; min-width: 170px; max-width: 0; }
.vx-dt-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vx-dt-clickable { cursor: copy; }
.vx-dt-table .vx-dt-sticky { position: sticky; right: 0; z-index: 1; box-shadow: inset 1px 0 0 var(--vx-border-soft); }
.vx-dt-scroll.is-overflowing .vx-dt-sticky { box-shadow: inset 1px 0 0 var(--vx-border), -8px 0 10px -8px rgba(15, 23, 42, .18); }
.vx-dt-table td.vx-dt-sticky { padding-top: 4px; padding-bottom: 4px; }
.vx-dt-actions { display: flex; justify-content: flex-end; gap: 2px; }
.vx-dt-empty { text-align: center; color: var(--vx-muted); padding: 32px 10px !important; }
.vx-dt-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid var(--vx-border);
    color: var(--vx-muted);
    font-size: 13px;
}
.vx-dt-info strong { color: var(--vx-text); font-weight: 600; }
.vx-dt-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.vx-dt-size { display: flex; align-items: center; gap: 6px; margin: 0; }
.vx-dt-size .form-select { width: auto; font-size: 13px; padding-top: 3px; padding-bottom: 3px; }
.vx-dt-pages { display: flex; gap: 4px; }
.vx-dt-pages .btn { min-width: 32px; --bs-btn-padding-x: .5rem; --bs-btn-padding-y: .2rem; font-size: 13px; }
.vx-dt-menu { position: fixed; z-index: 1080; min-width: 170px; }

/* ---------- SlimSelect ---------- */
.ss-main {
    min-height: 38px;
    border-color: var(--vx-border-strong) !important;
    border-radius: var(--vx-radius) !important;
    color: var(--vx-text);
    font-size: 14px;
    padding: 4px 8px;
}
.ss-main:focus, .ss-main.ss-open-below, .ss-main.ss-open-above { border-color: var(--vx-primary) !important; box-shadow: 0 0 0 3px rgba(157, 181, 214, .45); }
.ss-content {
    border-color: var(--vx-border) !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 30px rgba(14, 26, 43, .12);
    font-size: 14px;
}
.ss-content .ss-search input { border-color: var(--vx-border-strong) !important; border-radius: 6px !important; }
.ss-content .ss-list .ss-option:hover,
.ss-content .ss-list .ss-option.ss-highlighted { background: var(--vx-primary-soft) !important; color: var(--vx-primary) !important; }
.ss-content .ss-list .ss-option.ss-selected { background: var(--vx-primary) !important; color: #fff !important; }
.ss-main .ss-values .ss-value { background: var(--vx-primary-soft); color: var(--vx-primary); border-radius: 6px; }

/* ---------- Login ---------- */
.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    background: var(--vx-bg);
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--vx-surface);
    border: 1px solid var(--vx-border);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(14, 26, 43, .06);
}

/* Las tablas nunca empujan el ancho de la página: si no caben, hacen scroll dentro de su tarjeta */
.vx-card { min-width: 0; }
.vx-dt { max-width: 100%; }
