:root {
  /* Tema: estos valores se reemplazan según el estilo elegido en Datos de la empresa */
  --dc-primary: #f59e0b;
  --dc-primary-dark: #d97706;
  --dc-primary-text: #0f172a;
  --dc-primary-soft: #fef3c7;
  --sb-bg: #0f172a;
  --sb-text: #cbd5e1;
  --sb-title: #ffffff;
  --sb-muted: #64748b;
  --sb-hover: rgba(255,255,255,.06);
  --sb-active-bg: #f59e0b;
  --sb-active-text: #0f172a;
  --sb-border: rgba(255,255,255,.06);
  --top-bg: #ffffff;
  --top-text: #1e293b;
  --top-border: #e2e8f0;
  --dc-dark: #1e293b;
  --dc-darker: #0f172a;
  --dc-bg: #f1f5f9;
  --dc-border: #e2e8f0;
  --sidebar-w: 260px;
  --bs-font-sans-serif: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-primary: #2563eb;
}
:root:not([data-bs-theme=dark]) { --bs-body-color: #334155; }
body { background: var(--dc-bg); font-size: .925rem; color: var(--bs-body-color); }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); background: var(--sb-bg); color: var(--sb-text); border-right: 1px solid var(--sb-border);
  position: fixed; inset: 0 auto 0 0; z-index: 1040; overflow-y: auto;
  transition: transform .25s ease;
}
/* Barra de desplazamiento del menú: delgada e invisible, aparece al pasar el cursor */
.sidebar { scrollbar-width: thin; scrollbar-color: transparent transparent; }
.sidebar:hover { scrollbar-color: rgba(255,255,255,.28) transparent; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: transparent; border-radius: 6px; }
.sidebar:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); }
.brand { display: flex; align-items: center; gap: .7rem; padding: 1.1rem 1.2rem; text-decoration: none; color: var(--sb-title); border-bottom: 1px solid var(--sb-border); }
.brand strong { display: block; font-size: 1.15rem; letter-spacing: .3px; }
.brand small { display: block; font-size: .7rem; color: var(--sb-muted); }
.menu { padding: .6rem .7rem 2rem; }
.menu-header { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--sb-muted); padding: 1rem .7rem .35rem; font-weight: 600; }
.menu-link { display: flex; align-items: center; gap: .75rem; padding: .55rem .75rem; border-radius: .5rem; color: var(--sb-text); text-decoration: none; font-size: .88rem; margin-bottom: 2px; }
.menu-link i { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.menu-link:hover { background: var(--sb-hover); color: var(--sb-title); }
.menu-link.active { background: var(--sb-active-bg); color: var(--sb-active-text); font-weight: 600; }
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 1020; background: var(--top-bg); color: var(--top-text); border-bottom: 1px solid var(--top-border); display: flex; align-items: center; gap: .75rem; padding: .6rem 1.25rem; min-height: 60px; }
.page-title { font-size: 1.1rem; font-weight: 600; margin: 0; color: var(--top-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .btn-icon, .topbar .btn-user { color: var(--top-text); }
.topbar .btn-user .text-muted { color: inherit !important; opacity: .7; }
.btn-icon { border: 0; font-size: 1.5rem; line-height: 1; padding: .25rem .4rem; }
.btn-user { display: flex; align-items: center; gap: .5rem; border: 0; padding: .25rem .5rem; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--dc-primary); color: var(--dc-primary-text); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.content { padding: 1.25rem; flex: 1; }
.footer { padding: .8rem 1.25rem; font-size: .75rem; color: #94a3b8; text-align: center; }
.sidebar-backdrop { display: none; }

/* Menú oculto en PC (botón ☰ de la barra superior) */
@media (min-width: 992px) {
  .main { transition: margin-left .25s ease; }
  .menu-oculto .sidebar { transform: translateX(-100%); }
  .menu-oculto .main { margin-left: 0; }
}
/* Logo en la barra superior: sólo cuando el menú (y su logo) no se ve */
.topbar-logo { display: none; flex-shrink: 0; }
.topbar-logo img { width: 34px; height: 34px; object-fit: contain; border-radius: .5rem; background: #fff; padding: 2px; box-shadow: 0 1px 3px rgba(15,23,42,.15); }
.menu-oculto .topbar-logo { display: inline-flex; animation: logo-entra .25s ease; }
@media (max-width: 991.98px) { .topbar-logo { display: inline-flex; } }
@keyframes logo-entra { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .sidebar-backdrop.show { display: block; position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 1035; }
  .main { margin-left: 0; }
  .content { padding: 1rem; }
}

/* ---------- Componentes ---------- */
.card { border: 1px solid var(--dc-border); border-radius: .75rem; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.card-header { background: var(--bs-body-bg); border-bottom: 1px solid var(--dc-border); font-weight: 600; padding: .85rem 1rem; border-radius: .75rem .75rem 0 0 !important; }
.stat { display: flex; align-items: center; gap: .9rem; padding: 1rem; }
.stat-icon { width: 48px; height: 48px; border-radius: .75rem; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.stat-label { font-size: .78rem; color: var(--bs-secondary-color); margin: 0; }
.stat-value { font-size: 1.2rem; font-weight: 700; margin: 0; color: var(--bs-emphasis-color); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat > div:last-child { flex: 1 1 auto; min-width: 0; }
.min-w-0 { min-width: 0; }
.bg-soft-primary { background: #dbeafe; color: #1d4ed8; }
.bg-soft-success { background: #dcfce7; color: #15803d; }
.bg-soft-danger  { background: #fee2e2; color: #b91c1c; }
.bg-soft-warning { background: #fef3c7; color: #b45309; }
.bg-soft-info    { background: #cffafe; color: #0e7490; }
.bg-soft-dark    { background: #e2e8f0; color: #1e293b; }

.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.filters { background: var(--bs-body-bg); border: 1px solid var(--dc-border); border-radius: .75rem; padding: .85rem 1rem; margin-bottom: 1rem; }
.filters .form-label { font-size: .75rem; color: var(--bs-secondary-color); margin-bottom: .2rem; }

.btn-warning { --bs-btn-bg: var(--dc-primary); --bs-btn-border-color: var(--dc-primary); --bs-btn-color: var(--dc-primary-text);
  --bs-btn-hover-bg: var(--dc-primary-dark); --bs-btn-hover-border-color: var(--dc-primary-dark); --bs-btn-hover-color: var(--dc-primary-text);
  --bs-btn-active-bg: var(--dc-primary-dark); --bs-btn-active-border-color: var(--dc-primary-dark); --bs-btn-active-color: var(--dc-primary-text);
  --bs-btn-disabled-bg: var(--dc-primary); --bs-btn-disabled-border-color: var(--dc-primary); --bs-btn-disabled-color: var(--dc-primary-text); font-weight: 600; }
.progress-bar.bg-warning { background-color: var(--dc-primary) !important; }
.table { font-size: .875rem; }
.table > thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--bs-secondary-color); background: var(--bs-tertiary-bg); white-space: nowrap; }
.table td { vertical-align: middle; }
.actions { white-space: nowrap; }
.actions .btn { padding: .2rem .45rem; }
.progress { height: .55rem; border-radius: 1rem; }
.progress-sm { height: .4rem; }
.text-ingreso { color: #15803d !important; }
.text-egreso  { color: #b91c1c !important; }
.money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.saldo-box { border-radius: .75rem; padding: .75rem 1rem; background: var(--bs-tertiary-bg); border: 1px dashed var(--bs-border-color); }
.nav-tabs .nav-link { color: var(--bs-secondary-color); font-weight: 500; }
.nav-tabs .nav-link.active { color: var(--bs-emphasis-color); border-bottom: 3px solid var(--dc-primary); }
.nav-tabs { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
.nav-tabs .nav-link { white-space: nowrap; }
.timeline { list-style: none; padding-left: 1rem; border-left: 2px solid var(--dc-border); margin: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1rem; }
.timeline li::before { content: ''; position: absolute; left: -1.45rem; top: .3rem; width: .8rem; height: .8rem; border-radius: 50%; background: var(--dc-primary); border: 2px solid #fff; box-shadow: 0 0 0 2px var(--dc-primary); }
.empty { text-align: center; padding: 2rem 1rem; color: #94a3b8; }
.empty i { font-size: 2.5rem; display: block; margin-bottom: .5rem; }
.ts-wrapper.form-select { padding: 0; }
.ts-control { min-height: 38px; }
.modal-header { background: var(--bs-tertiary-bg); }
.form-label { font-weight: 500; font-size: .85rem; }
.required::after { content: ' *'; color: #dc2626; }

/* DataTables */
div.dt-container .dt-buttons .btn { font-size: .8rem; }
div.dt-container div.dt-search input { margin-left: .4rem; }
div.dt-container .dt-paging .page-link { font-size: .8rem; }
@media (max-width: 575.98px) {
  div.dt-container .dt-layout-row { flex-direction: column; align-items: stretch !important; gap: .4rem; }
  div.dt-container .dt-buttons { justify-content: center; }
  .stat-value { font-size: .98rem; }
  .stat { padding: .75rem; gap: .6rem; }
  .stat > .stat-icon { display: none; }
}

/* ---------- Login ---------- */
/* Dos paneles: marca (izquierda, con los colores del tema) y formulario (derecha) */
.auth-body { min-height: 100vh; background: var(--bs-body-bg); }
.auth { display: flex; min-height: 100vh; }
.auth-logo { width: 46px; height: 46px; object-fit: contain; border-radius: .7rem; background: #fff; padding: 3px; flex-shrink: 0; box-shadow: 0 4px 14px rgba(0,0,0,.18); }

.auth-hero { position: relative; overflow: hidden; flex: 0 0 46%; max-width: 640px; display: flex; flex-direction: column; justify-content: space-between;
  padding: 2.5rem 3rem; color: var(--sb-text); background: var(--sb-bg); isolation: isolate; }
/* Cuadrícula tipo plano de obra + halo del color principal */
.auth-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .55;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 32px 32px; mask-image: linear-gradient(160deg, #000 30%, transparent 85%); -webkit-mask-image: linear-gradient(160deg, #000 30%, transparent 85%); }
.auth-hero::after { content: ''; position: absolute; z-index: -1; width: 520px; height: 520px; right: -180px; bottom: -200px; border-radius: 50%;
  background: radial-gradient(circle, var(--dc-primary) 0%, transparent 65%); opacity: .35; }
.auth-hero-top { display: flex; align-items: center; gap: .85rem; color: var(--sb-title); }
.auth-hero-top strong { font-size: 1.1rem; letter-spacing: .2px; }
.auth-hero-top small { display: block; font-size: .75rem; color: var(--sb-muted); }
.auth-hero-body { max-width: 440px; padding: 3rem 0; }
.auth-hero-body h2 { color: var(--sb-title); font-weight: 700; font-size: 2.1rem; line-height: 1.2; letter-spacing: -.02em; margin-bottom: .9rem; }
.auth-hero-body > p { font-size: 1rem; opacity: .85; margin-bottom: 2rem; }
.auth-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.1rem; }
.auth-features li { display: flex; gap: .9rem; align-items: flex-start; font-size: .88rem; }
.auth-features li strong { display: block; color: var(--sb-title); font-size: .95rem; margin-bottom: .1rem; }
.auth-features li > span { width: 40px; height: 40px; border-radius: .65rem; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.15rem; background: var(--dc-primary); color: var(--dc-primary-text); }
.auth-hero-foot { font-size: .75rem; color: var(--sb-muted); }

.auth-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: var(--bs-body-bg); }
.auth-box { width: 100%; max-width: 380px; margin: auto 0; }
.auth-brand-sm { display: none; align-items: center; gap: .75rem; margin-bottom: 2rem; color: var(--bs-emphasis-color); }
.auth-brand-sm strong { font-size: 1.1rem; }
.auth-title { font-size: 1.75rem; font-weight: 700; color: var(--bs-emphasis-color); letter-spacing: -.02em; margin-bottom: .35rem; }
.auth-sub { color: var(--bs-secondary-color); margin-bottom: 1.75rem; }
.auth .form-label { font-weight: 600; font-size: .85rem; color: var(--bs-emphasis-color); }
.auth-input { position: relative; }
.auth-input > .bi { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: var(--bs-secondary-color); pointer-events: none; z-index: 2; }
.auth-input .form-control { padding-left: 2.75rem; font-size: 1rem; border-radius: .65rem; background: var(--bs-tertiary-bg); border-color: var(--dc-border); }
.auth-input .form-control:focus { background: var(--bs-body-bg); border-color: var(--dc-primary); box-shadow: 0 0 0 .25rem var(--dc-primary-soft); }
.auth-input .form-control:focus ~ .bi, .auth-input:focus-within > .bi { color: var(--dc-primary-dark); }
.auth-input #pwd { padding-right: 3rem; }
.auth-eye { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; width: 38px; height: 38px; border-radius: .5rem;
  color: var(--bs-secondary-color); display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; z-index: 2; }
.auth-eye:hover { background: rgba(128,128,128,.12); color: var(--bs-emphasis-color); }
.was-validated .auth-input .form-control:invalid { background-image: none; padding-right: 1rem; }
.was-validated .auth-input #pwd:invalid { padding-right: 3rem; }
.auth-caps { font-size: .8rem; color: #b45309; margin-top: .4rem; }
.auth-btn { border-radius: .65rem; padding-top: .7rem; padding-bottom: .7rem; font-size: 1rem; box-shadow: 0 6px 18px -6px var(--dc-primary); }
.auth-demo { display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; margin: 1.25rem 0 0; border-radius: .65rem; font-size: .85rem;
  background: var(--dc-primary-soft); border: 1px dashed var(--dc-primary); color: var(--bs-emphasis-color); }
.auth-demo > .bi { font-size: 1.4rem; color: var(--dc-primary-dark); }
.auth-demo code { font-size: .9em; font-weight: 600; color: var(--bs-emphasis-color); background: rgba(255,255,255,.6); padding: .05rem .35rem; border-radius: .3rem; }
[data-bs-theme=dark] .auth-demo { background: rgba(128,128,128,.12); }
[data-bs-theme=dark] .auth-demo code { background: rgba(0,0,0,.3); }
.auth-help { margin-top: 1.5rem; font-size: .8rem; color: var(--bs-secondary-color); }
.auth-main-foot { font-size: .72rem; color: var(--bs-secondary-color); margin-top: 1.5rem; }

/* Posición del formulario (Datos de la empresa › Inicio de sesión) */
.auth-izquierda { flex-direction: row-reverse; }
.auth-centro .auth-hero { display: none; }
.auth-centro .auth-main { position: relative; isolation: isolate; background: var(--sb-bg); overflow: hidden; }
.auth-centro .auth-main::before { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .55;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 32px 32px; }
.auth-centro .auth-main::after { content: ''; position: absolute; z-index: -1; width: 640px; height: 640px; right: -200px; bottom: -260px; border-radius: 50%;
  background: radial-gradient(circle, var(--dc-primary) 0%, transparent 65%); opacity: .35; }
.auth-centro .auth-box { max-width: 430px; background: var(--bs-body-bg); border-radius: 1rem; padding: 2.25rem 2rem; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.auth-centro .auth-brand-sm { display: flex; }
.auth-centro .auth-main-foot { color: var(--sb-muted); }

@media (max-width: 991.98px) {
  .auth-hero { display: none; }
  .auth-brand-sm { display: flex; }
  .auth-main { background: linear-gradient(180deg, var(--dc-primary-soft) 0, var(--bs-body-bg) 260px); }
}

/* ---------- Impresión ---------- */
@media print {
  .sidebar, .topbar, .footer, .no-print, .dt-buttons, .dt-search, .dt-paging, .dt-length { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
  .card { border: 0; box-shadow: none; }
}

/* Visor de PDF (assets/js/pdf.js) */
.pdf-visor { position: relative; height: 78vh; display: flex; flex-direction: column; background: #525659; }
.pdf-visor iframe { flex: 1; width: 100%; border: 0; display: block; }
.pdf-cargando, .pdf-sin-visor { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1.5rem; background: var(--bs-body-bg); }
.pdf-sin-visor > .bi { font-size: 3rem; color: #dc2626; margin-bottom: .5rem; }
.pdf-cargando.d-none, .pdf-sin-visor.d-none { display: none !important; }
@media (max-width: 991.98px) { .pdf-visor { height: auto; } }

/* Tablas con inputs (planilla, compra) */
#tblPl input, #tblItems input { min-width: 78px; }
#tblPl td:nth-child(2) { min-width: 170px; }

/* Logo de la empresa */
.brand img { border-radius: .5rem; object-fit: contain; background: #fff; padding: 2px; flex-shrink: 0; }
.brand strong { display: block; max-width: 180px; }

.logo-preview { width: 150px; height: 150px; border: 1px dashed var(--bs-border-color); border-radius: .75rem; display: flex; align-items: center; justify-content: center; background: #f8fafc; padding: .5rem; }
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.membrete { display: flex; align-items: center; gap: 1rem; border-bottom: 2px solid var(--dc-dark); padding-bottom: .75rem; margin-bottom: 1rem; }
.membrete img { width: 70px; height: 70px; object-fit: contain; }
.membrete .datos { font-size: .8rem; line-height: 1.35; }

/* ---------- Selector de posición del login ---------- */
.pos-card { display: block; cursor: pointer; border: 2px solid var(--dc-border); border-radius: .75rem; overflow: hidden; background: var(--bs-body-bg); transition: border-color .15s, box-shadow .15s; }
.pos-card:hover { box-shadow: 0 4px 14px rgba(15,23,42,.1); }
.btn-check:checked + .pos-card { border-color: var(--dc-primary); box-shadow: 0 0 0 3px var(--dc-primary-soft); }
.btn-check:disabled + .pos-card { cursor: default; opacity: .7; }
.pos-mini { display: flex; height: 84px; background: #f8fafc; }
.pos-hero { flex: 0 0 45%; background: var(--sb-bg); background-image: radial-gradient(circle at 90% 100%, var(--dc-primary) 0, transparent 55%); }
.pos-form { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 14%; }
.pos-form i { display: block; height: 7px; border-radius: 3px; background: #cbd5e1; }
.pos-form b { display: block; height: 9px; border-radius: 3px; background: var(--dc-primary); margin-top: 2px; }
.pos-izquierda .pos-mini { flex-direction: row-reverse; }
.pos-centro .pos-mini { background: var(--sb-bg); background-image: radial-gradient(circle at 90% 100%, var(--dc-primary) 0, transparent 55%); align-items: center; justify-content: center; }
.pos-centro .pos-hero { display: none; }
.pos-centro .pos-form { flex: 0 0 46%; height: 62%; background: #fff; border-radius: 5px; padding: 0 9%; }
.pos-nombre { display: flex; justify-content: space-between; align-items: center; padding: .45rem .6rem; font-size: .82rem; font-weight: 600; border-top: 1px solid var(--dc-border); }
.pos-nombre .bi { color: var(--dc-primary); visibility: hidden; }
.btn-check:checked + .pos-card .pos-nombre .bi { visibility: visible; }
[data-bs-theme=dark] .pos-mini { background: #1e2430; }
[data-bs-theme=dark] .pos-form i { background: #475569; }

/* ---------- Selector de estilos ---------- */
.tema-card { cursor: pointer; border: 2px solid var(--dc-border); border-radius: .75rem; overflow: hidden; background: var(--bs-body-bg); transition: border-color .15s, box-shadow .15s; height: 100%; }
.tema-card:hover { box-shadow: 0 4px 14px rgba(15,23,42,.1); }
.btn-check:checked + .tema-card { border-color: var(--dc-primary); box-shadow: 0 0 0 3px var(--dc-primary-soft); }
.tema-mini { display: flex; height: 92px; }
.tema-mini .mini-sb { width: 32%; padding: 8px 6px; display: flex; flex-direction: column; gap: 5px; }
.tema-mini .mini-sb span { height: 7px; border-radius: 4px; opacity: .55; }
.tema-mini .mini-sb span.on { opacity: 1; height: 10px; }
.tema-mini .mini-main { flex: 1; display: flex; flex-direction: column; }
.tema-mini .mini-top { height: 18px; }
.tema-mini .mini-body { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.tema-mini .mini-body i { display: block; height: 6px; border-radius: 3px; background: rgba(128,128,128,.3); }
.tema-mini .mini-btn { width: 46px; height: 14px; border-radius: 4px; margin-top: auto; }
.tema-card .tema-nombre { padding: .45rem .6rem; font-size: .82rem; font-weight: 600; border-top: 1px solid var(--dc-border); display: flex; justify-content: space-between; align-items: center; }

/* =====================================================================
 * MODO OSCURO (data-bs-theme="dark" en <html>, botón de la barra superior)
 * Bootstrap 5.3 se encarga de formularios, tablas, modales y menús;
 * aquí se ajustan los componentes propios.
 * ===================================================================== */
:root[data-bs-theme=dark] {
  --bs-body-bg: #171b24;
  --bs-body-color: #d1d5db;
  --bs-emphasis-color: #f3f4f6;
  --bs-secondary-color: #9ca3af;
  --bs-tertiary-bg: #1e2430;
  --bs-secondary-bg: #1e2430;
  --bs-border-color: #2b3240;
  --dc-border: #2b3240;
  --dc-dark: #f3f4f6;
}
[data-bs-theme=dark] .card { box-shadow: none; }
[data-bs-theme=dark] .table-light { --bs-table-bg: var(--bs-tertiary-bg); --bs-table-color: var(--bs-body-color); --bs-table-border-color: var(--bs-border-color); }
[data-bs-theme=dark] .table > thead th { background: var(--bs-tertiary-bg); }
[data-bs-theme=dark] .text-ingreso { color: #4ade80 !important; }
[data-bs-theme=dark] .text-egreso  { color: #f87171 !important; }
[data-bs-theme=dark] .bg-soft-primary { background: rgba(59,130,246,.18); color: #93c5fd; }
[data-bs-theme=dark] .bg-soft-success { background: rgba(34,197,94,.18); color: #86efac; }
[data-bs-theme=dark] .bg-soft-danger  { background: rgba(239,68,68,.18); color: #fca5a5; }
[data-bs-theme=dark] .bg-soft-warning { background: rgba(245,158,11,.18); color: #fcd34d; }
[data-bs-theme=dark] .bg-soft-info    { background: rgba(6,182,212,.18); color: #67e8f9; }
[data-bs-theme=dark] .bg-soft-dark    { background: rgba(148,163,184,.18); color: #e2e8f0; }
[data-bs-theme=dark] .alert-warning { --bs-alert-bg: rgba(245,158,11,.12); --bs-alert-color: #fcd34d; --bs-alert-border-color: rgba(245,158,11,.3); }
[data-bs-theme=dark] .ts-control, [data-bs-theme=dark] .ts-dropdown, [data-bs-theme=dark] .ts-control input { background: var(--bs-body-bg) !important; color: var(--bs-body-color) !important; border-color: var(--bs-border-color); }
[data-bs-theme=dark] .ts-dropdown .active { background: var(--bs-tertiary-bg); color: var(--bs-emphasis-color); }
[data-bs-theme=dark] .swal2-popup { background: var(--bs-body-bg); color: var(--bs-body-color); }
[data-bs-theme=dark] .swal2-title, [data-bs-theme=dark] .swal2-html-container { color: var(--bs-body-color); }
[data-bs-theme=dark] .swal2-input { background: var(--bs-tertiary-bg); color: var(--bs-body-color); border-color: var(--bs-border-color); }
[data-bs-theme=dark] .timeline li::before { border-color: var(--bs-body-bg); }
[data-bs-theme=dark] .tema-card { background: var(--bs-tertiary-bg); }
[data-bs-theme=dark] .auth-main { background: var(--bs-body-bg); }
[data-bs-theme=dark] .auth-caps { color: #fcd34d; }
.btn-modo { font-size: 1.2rem !important; border-radius: 50%; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; }
.btn-modo:hover { background: rgba(128,128,128,.15); }
@media print { :root[data-bs-theme=dark] { --bs-body-bg: #fff; --bs-body-color: #000; } [data-bs-theme=dark] body { background: #fff; color: #000; } }
