:root {
  /* Paleta corporativa TGN S.A. */
  --tgn-blue: #1A4789;
  --tgn-blue-light: #2B6CB0;
  --tgn-blue-dark: #0F2D5C;
  --tgn-red: #E30613;
  --tgn-red-dark: #B8050F;
  --tgn-sky: #DCE9F7;
  --tgn-sky-soft: #EDF4FB;

  --bg: #0B1628;
  --surface: #122240;
  --surface2: #1A3055;
  --border: #2A4570;
  --gold: var(--tgn-blue-light);
  --gold-lt: var(--tgn-blue-light);
  --accent-primary: var(--tgn-blue);
  --accent-secondary: var(--tgn-red);
  --green: #16A34A;
  --red: var(--tgn-red);
  --blue: var(--tgn-blue-light);
  --text: #F0F4FA;
  --muted: #7B8FA8;
  --muted2: #A8B8CC;
  --sidebar-w: 220px;
  --ease: 0.18s ease;
  --accent: var(--tgn-red);
}

*, *::before, *::after { box-sizing: border-box; }

body.app-body, body.login-body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  margin: 0;
}

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--tgn-blue-dark) 0%, #0a1324 100%);
  border-right: 1px solid rgba(43, 108, 176, 0.35);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  height: 60px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid rgba(227, 6, 19, 0.35);
  background: linear-gradient(90deg, var(--tgn-blue) 0%, var(--tgn-blue-dark) 100%);
}

.sidebar-brand .brand-logo {
  height: 36px;
  width: auto;
  max-width: 130px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--muted2);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color var(--ease), background var(--ease), border-color var(--ease);
  font-size: 13px;
  font-weight: 500;
}

.sidebar-nav .nav-link:hover:not(.active) {
  color: #fff;
  background: rgba(43, 108, 176, 0.18);
  border-left-color: transparent;
}

.sidebar-nav .nav-link.active,
.sidebar-nav .nav-link.active:hover {
  color: #fff;
  border-left-color: var(--tgn-red);
  background: rgba(26, 71, 137, 0.42);
}

.sidebar-nav { flex: 1; padding: 8px 0; overflow-y: auto; }

.nav-section {
  padding: 12px 16px 4px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
.user-info small { display: block; color: var(--muted); }

.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 56px;
  border-bottom: 2px solid rgba(227, 6, 19, 0.45);
  background: linear-gradient(90deg, var(--surface) 0%, rgba(26, 71, 137, 0.25) 100%);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.topbar-title { font-size: 16px; font-weight: 700; margin: 0; }
.topbar-sub { font-size: 12px; color: var(--muted2); margin: 0; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; }

.content-area { flex: 1; overflow-y: auto; padding: 20px 24px; }

.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--border); padding: 16px; border-radius: 8px; }
.kpi-label { font-size: 10px; color: var(--muted2); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.kpi-val { font-size: 22px; font-weight: 700; }
.kpi-val.gold { color: var(--gold); }
.kpi-val.green { color: var(--green); }
.kpi-val.red { color: var(--red); }
.kpi-val.blue { color: var(--blue); }

.card-app {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.card-app:hover { border-color: rgba(43, 108, 176, 0.35); }

.card-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.card-title i { color: var(--tgn-red); font-size: 16px; }

.form-control, .form-select {
  background: var(--surface2) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  transition: border-color var(--ease), box-shadow var(--ease), background-color var(--ease);
}

.form-control:hover:not(:focus):not(:disabled),
.form-select:hover:not(:focus):not(:disabled) {
  border-color: rgba(43, 108, 176, 0.45) !important;
}

.form-control:focus, .form-select:focus {
  border-color: var(--tgn-blue-light) !important;
  box-shadow: 0 0 0 0.2rem rgba(43, 108, 176, 0.22) !important;
  background: var(--surface2) !important;
  color: var(--text) !important;
}

.form-select option {
  background: var(--surface);
  color: var(--text);
}

.btn-gold {
  background: linear-gradient(135deg, var(--tgn-blue) 0%, var(--tgn-blue-light) 100%);
  color: #fff;
  border: none;
  font-weight: 600;
  transition: all var(--ease);
  box-shadow: 0 2px 8px rgba(26, 71, 137, 0.35);
}
.btn-gold:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--tgn-blue-light) 0%, #4A90D9 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(26, 71, 137, 0.45);
}

.btn-gold:focus,
.btn-gold:active {
  background: linear-gradient(135deg, var(--tgn-blue) 0%, var(--tgn-blue-light) 100%);
  color: #fff;
  box-shadow: 0 0 0 0.2rem rgba(43, 108, 176, 0.35);
}
.btn-green { background: var(--green); color: #fff; border: none; transition: all var(--ease); }
.btn-red { background: var(--red); color: #fff; border: none; transition: all var(--ease); }
.btn-ghost { background: var(--surface2); color: var(--text); border: 1px solid var(--border); transition: all var(--ease); }
.btn-ghost:hover:not(:disabled) {
  border-color: var(--tgn-blue-light);
  color: var(--tgn-sky);
  background: rgba(26, 71, 137, 0.22);
}

.btn-ghost:focus,
.btn-ghost:active {
  border-color: var(--tgn-blue-light);
  color: #fff;
  background: rgba(26, 71, 137, 0.32);
  box-shadow: none;
}

.table-dark-custom { color: var(--text); margin: 0; width: 100%; border-collapse: collapse; min-width: 600px; }
/* Neutraliza las variables de Bootstrap que pintaban las celdas de blanco */
.table.table-dark-custom {
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-striped-bg: transparent;
  --bs-table-striped-color: var(--text);
  --bs-table-hover-bg: transparent;
  --bs-table-hover-color: var(--text);
  --bs-table-active-bg: transparent;
  --bs-table-border-color: var(--border);
}
.table-dark-custom thead { background: var(--surface2); }
.table-dark-custom th {
  padding: 11px 12px;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.table-dark-custom td {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  vertical-align: middle;
  background: transparent;
  color: var(--text);
}
.table-dark-custom tbody tr { transition: background var(--ease); }
.table-dark-custom tbody tr:hover td { background: rgba(43, 108, 176, 0.10); }
.table-dark-custom tbody tr td { background: transparent; }

.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}

.empty-cell { text-align: center; color: var(--muted); padding: 32px !important; }
.empty-cell i { display: block; font-size: 24px; margin-bottom: 8px; opacity: 0.5; }

.badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; }

.badge-pendiente, .badge-en-revision, .badge-ajuste-solicitado {
  background: rgba(43, 108, 176, 0.18);
  color: var(--tgn-sky);
}
.badge-aprobada { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-cerrado { background: rgba(100,116,139,0.2); color: #64748b; }
.creador-estado-panel { border-left: 4px solid var(--tgn-blue, #1a4789); }
.badge-rechazada { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-rol {
  background: rgba(43, 108, 176, 0.2);
  color: var(--tgn-sky);
  border: 1px solid rgba(74, 144, 217, 0.35);
}

.text-gold { color: var(--gold); }

/* Formularios homologados */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.form-col-full { grid-column: 1 / -1; }
.field-label, .filtro-campo label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted2);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.form-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

.filter-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; align-items: end; }
.filtro-acciones { display: flex; gap: 8px; flex-wrap: wrap; }

.page-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; margin-bottom: 20px; }
.btn-toolbar { white-space: nowrap; flex-shrink: 0; }

.detail-dl dt { color: var(--muted2); font-size: 12px; }
.timeline { list-style: none; padding: 0; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.file-actions { display: flex; gap: 4px; }

.alert { border: 1px solid var(--border); }

@media (max-width: 992px) {
  .sidebar {
    position: fixed;
    z-index: 1001;
    top: 0;
    left: 0;
    height: 100%;
    width: min(280px, 85vw);
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
  }
  .sidebar-close { display: flex; }
  .btn-menu-mobile { display: inline-flex; }
  body.sidebar-open { overflow: hidden; }
}

@media (min-width: 993px) {
  .sidebar-overlay { display: none !important; }
  .sidebar-close { display: none; }
  .btn-menu-mobile { display: none; }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.sidebar-overlay.active { display: block; }

.sidebar-close {
  display: none;
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  font-size: 1.25rem;
  padding: 4px 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.sidebar-brand { position: relative; }

.btn-menu-mobile {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

body.modo-aprobador .btn-menu-mobile {
  background: #1A4789;
  color: #fff;
  border-color: #1A4789;
}

/* ── Modo aprobador (accesible, alto contraste) ── */
body.modo-aprobador {
  --bg: #EEF2F7;
  --surface: #FFFFFF;
  --surface2: #E2E8F0;
  --border: #94A3B8;
  --gold: var(--tgn-blue);
  --gold-lt: var(--tgn-blue-light);
  --green: #15803D;
  --red: var(--tgn-red-dark);
  --blue: var(--tgn-blue-light);
  --text: #0F172A;
  --muted: #475569;
  font-size: 17px;
}

body.modo-aprobador .sidebar { background: #1A4789; border-color: #224a7a; }
body.modo-aprobador .sidebar-brand { color: #fff; border-color: #224a7a; }
body.modo-aprobador .sidebar-nav .nav-link { color: #CBD5E1; font-size: 1rem; padding: 14px 16px; }
body.modo-aprobador .sidebar-nav .nav-link:hover:not(.active) { color: #fff; background: rgba(255, 255, 255, 0.1); }
body.modo-aprobador .sidebar-nav .nav-link.active,
body.modo-aprobador .sidebar-nav .nav-link.active:hover {
  color: #fff;
  background: rgba(227, 6, 19, 0.22);
  border-left-color: var(--tgn-red);
}
body.modo-aprobador .sidebar-footer { border-color: #224a7a; }
body.modo-aprobador .user-info strong { color: #F8FAFC; }
body.modo-aprobador .user-info small { color: #94A3B8; }

body.modo-aprobador .topbar { background: #FFFFFF; border-color: #CBD5E1; }
body.modo-aprobador .topbar-title { font-size: 1.35rem; color: #0F172A; }
body.modo-aprobador .topbar-sub { font-size: 1rem; color: #64748B; }

body.modo-aprobador .alert-grande { font-size: 1.05rem; padding: 16px 20px; }

/* Resumen aprobador */
.aprobador-resumen {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.aprobador-resumen-item {
  background: linear-gradient(135deg, #1A4789 0%, #224a7a 100%);
  color: #fff;
  border-radius: 12px;
  padding: 16px 24px;
  min-width: 140px;
}

.aprobador-resumen-num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}

.aprobador-resumen-label {
  font-size: 0.9rem;
  opacity: 0.85;
}

/* Filtros aprobador (contenido dentro del acordeón) */
body.modo-aprobador .filtro-campo .form-control,
body.modo-aprobador .filtro-campo .form-select {
  background: #F8FAFC !important;
  border-color: #CBD5E1 !important;
  color: #0F172A !important;
  font-size: 1rem;
}

.btn-filtro-aplicar {
  background: #1A4789;
  color: #fff;
  border: none;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-filtro-aplicar:hover { background: #224a7a; color: #fff; }

.btn-filtro-limpiar {
  background: #E2E8F0;
  color: #475569;
  border: none;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-filtro-limpiar:hover { background: #CBD5E1; color: #0F172A; }

.lista-aprobador { display: flex; flex-direction: column; gap: 20px; }

.contador-pendientes { font-size: 1.1rem; margin-bottom: 20px; color: var(--muted); }

.cotiz-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  margin-bottom: 0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

.cotiz-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  background: #F8FAFC;
  border-bottom: 1px solid var(--surface2);
  margin-bottom: 0;
}

.cotiz-numero { font-size: 1.2rem; font-weight: 800; color: #1A4789; display: block; }
.cotiz-fecha-header { font-size: 0.9rem; color: var(--muted); }
.cotiz-estado { font-size: 0.9rem; padding: 6px 14px; flex-shrink: 0; }

.cotiz-destacados {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 0;
  border-bottom: 1px solid var(--surface2);
}

.cotiz-destacado {
  padding: 18px 22px;
}

.cotiz-destacado-monto {
  background: #EFF6FF;
  border-right: 1px solid var(--surface2);
}

.cotiz-destacado-cc {
  background: #FFFBEB;
}

.cotiz-centro-costo {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  color: #92400E;
  line-height: 1.35;
  word-break: break-word;
}

.cotiz-datos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  padding: 20px 22px;
  margin-bottom: 0;
}

.cotiz-dato-concepto { grid-column: 1 / -1; }

.cotiz-label { display: block; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 4px; }
.cotiz-obs-general { padding-top: 0.75rem; border-top: 1px solid var(--border); }
.cotiz-obs-text { white-space: pre-wrap; line-height: 1.5; color: var(--text, #0f172a); }
.cotiz-num-chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
  background: rgba(43, 108, 176, 0.22);
  border: 1px solid rgba(168, 184, 204, 0.45);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  white-space: nowrap;
}
html[data-theme="light"] .cotiz-num-chip {
  color: #1A4789;
  background: rgba(26, 71, 137, 0.12);
  border-color: rgba(26, 71, 137, 0.28);
}
.cotiz-valor { display: block; font-size: 1.05rem; font-weight: 500; color: var(--text); line-height: 1.45; }
.cotiz-monto { font-size: 1.65rem !important; font-weight: 800 !important; color: #1D4ED8 !important; }

.cotiz-acciones {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px 22px 22px;
  background: #F8FAFC;
  border-top: 1px solid var(--surface2);
}

.cotiz-form-accion { flex: 1; min-width: 140px; margin: 0; }

.btn-accion-grande {
  width: 100%;
  min-height: 58px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  text-decoration: none;
}

.btn-soportes { background: #1A4789; color: #fff !important; }
.btn-soportes:hover:not(:disabled) { background: #224a7a; color: #fff !important; }
.btn-soportes:disabled { background: #94A3B8; opacity: 0.7; }

.btn-aprobar { background: #15803D; color: #fff; }
.btn-aprobar:hover { background: #166534; color: #fff; }

.btn-rechazar { background: #B91C1C; color: #fff; }
.btn-rechazar:hover { background: #991B1B; color: #fff; }

.empty-aprobador {
  text-align: center;
  padding: 60px 24px;
  background: var(--surface);
  border-radius: 14px;
  border: 2px dashed var(--border);
}

.empty-aprobador i { font-size: 4rem; color: var(--green); }
.empty-aprobador h2 { font-size: 1.75rem; margin: 16px 0 8px; }
.empty-aprobador p { font-size: 1.1rem; color: var(--muted); }

.btn-install-pwa {
  background: #F59E0B;
  color: #78350F;
  border: none;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-install-pwa:hover { background: #D97706; color: #78350F; }

/* Paginación aprobador */
.paginacion-aprobador { margin-top: 28px; margin-bottom: 12px; }

body.modo-aprobador .paginacion-aprobador .page-link {
  color: #1A4789;
  border-color: #CBD5E1;
  font-weight: 600;
  min-width: 44px;
  text-align: center;
}

body.modo-aprobador .paginacion-aprobador .page-item.active .page-link {
  background: #1A4789;
  border-color: #1A4789;
}

@media (max-width: 768px) {
  .cotiz-destacados { grid-template-columns: 1fr; }
  .cotiz-destacado-monto { border-right: none; border-bottom: 1px solid var(--surface2); }
  .cotiz-acciones { grid-template-columns: 1fr; }
  .cotiz-form-accion { min-width: 100%; }
  body.modo-aprobador .content-area { padding: 16px; }
  body.modo-aprobador .topbar { padding: 0 16px; }
  body.modo-aprobador .topbar-title { font-size: 1.15rem; }
}

@media (max-width: 576px) {
  .filtros-aprobador-acciones { flex-direction: column; }
  .btn-filtro-aplicar, .btn-filtro-limpiar { width: 100%; justify-content: center; }
}

/* ══════════════════════════════════════════
   ACCORDION FILTROS
   ══════════════════════════════════════════ */
.accordion-filtros {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 20px;
  overflow: hidden;
  transition: border-color var(--ease);
}

body.modo-aprobador .accordion-filtros {
  background: #fff;
  border-color: #CBD5E1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.accordion-filtros-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface2);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: background var(--ease), color var(--ease);
}

body.modo-aprobador .accordion-filtros-header {
  background: #F1F5F9;
  color: #0F172A;
}

.accordion-filtros-header:hover { color: var(--gold); }
body.modo-aprobador .accordion-filtros-header:hover { color: #1A4789; }

.accordion-filtros-title { display: flex; align-items: center; gap: 10px; }
.accordion-filtros-title i { color: var(--gold); }
body.modo-aprobador .accordion-filtros-title i { color: #1A4789; }

.accordion-chevron {
  font-size: 18px;
  color: var(--muted2);
  transition: transform 0.3s ease, color var(--ease);
}

.accordion-filtros-header:not(.collapsed) .accordion-chevron { transform: rotate(180deg); color: var(--gold); }
body.modo-aprobador .accordion-filtros-header:not(.collapsed) .accordion-chevron { color: #1A4789; }

.accordion-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(26, 71, 137, 0.18);
  color: var(--gold);
  padding: 2px 8px;
  border-radius: 20px;
}

body.modo-aprobador .accordion-badge { background: rgba(26, 71, 137, 0.12); color: var(--tgn-blue); }

.accordion-filtros-body {
  padding: 18px;
  border-top: 1px solid var(--border);
}

body.modo-aprobador .accordion-filtros-body { border-color: #E2E8F0; }

.accordion-filtros .collapse { transition: height 0.32s ease; }

.filtros-aprobador-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.filtros-aprobador-acciones { display: flex; flex-wrap: wrap; gap: 10px; }

/* ══════════════════════════════════════════
   TRANSICIONES Y LOADER
   ══════════════════════════════════════════ */
.page-enter {
  animation: pageFadeIn 0.38s ease forwards;
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

body.modo-aprobador .app-loading { background: #EEF2F7; }

.app-loading.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.load-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--tgn-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

body.modo-aprobador .load-spinner { border-color: #CBD5E1; border-top-color: var(--tgn-blue); }

.load-text { font-size: 13px; color: var(--muted2); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════
   LOGIN MODERNO
   ══════════════════════════════════════════ */
body.login-page {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
  background: var(--tgn-blue-dark);
  color: var(--text);
  overflow-x: hidden;
}

.login-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: orbFloat 12s ease-in-out infinite;
}

.login-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -20px) scale(1.05); }
}

.login-animate {
  opacity: 0;
  animation: loginSlideUp 0.65s ease forwards;
}

.login-animate-delay-1 { animation-delay: 0.12s; }
.login-animate-delay-2 { animation-delay: 0.24s; }

@keyframes loginSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-bg-orb-1 {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(26, 71, 137, 0.8) 0%, transparent 70%);
  top: -120px;
  right: -80px;
}

.login-bg-orb-2 {
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(227, 6, 19, 0.35) 0%, transparent 70%);
  bottom: -100px;
  left: -60px;
  animation-delay: -6s;
}

.login-wrapper {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 24px;
  flex-wrap: wrap;
}

.login-hero {
  flex: 0 1 430px;
  max-width: 460px;
  display: flex;
}

.login-hero-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  min-height: 512px;
  padding: 30px;
  border-radius: 22px;
  overflow: hidden;
  text-align: left;
  background-color: var(--tgn-blue-dark);
  background-image:
    linear-gradient(180deg, rgba(8, 19, 38, 0.58) 0%, rgba(8, 19, 38, 0.28) 22%, rgba(8, 19, 38, 0.82) 58%, rgba(8, 19, 38, 0.97) 100%),
    url('../img/login-hero-fleet.png');
  background-position: center 42%;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px rgba(74, 144, 217, 0.22), 0 24px 56px rgba(0, 0, 0, 0.42);
}

/* Filete corporativo azul → rojo en el borde superior del panel. */
.login-hero-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--tgn-blue) 0%, var(--tgn-red) 100%);
}

.login-hero-logo {
  align-self: flex-start;
  display: inline-flex;
  padding: 11px 18px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(4, 16, 34, 0.4);
}

.login-hero-logo img {
  display: block;
  width: auto;
  height: 34px;
}

.login-hero-body { margin-top: 40px; }

.login-hero-eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(197, 219, 247, 0.75);
}

.login-hero-title {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fff;
}

.login-hero-title span {
  display: inline-block;
  margin-left: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  vertical-align: 4px;
}

.login-brand { margin-bottom: 26px; }

.login-logo-shell {
  display: none;
}

/* En escritorio el logo vive en el panel de marca: aquí solo aparece cuando
   ese panel se oculta (móvil). */
.login-brand .login-logo-chip { display: none; }

.login-brand .login-logo-chip .login-logo-img {
  display: block;
  width: auto;
  height: 32px;
}

.login-title {
  display: block;
  margin: 0 0 6px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.login-hero-tagline {
  font-size: 14.5px;
  color: rgba(226, 236, 250, 0.88);
  line-height: 1.55;
  margin: 0;
  max-width: 330px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  flex: 1 1 380px;
  background: rgba(18, 34, 64, 0.88);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(74, 144, 217, 0.25);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

.login-brand h1:not(.login-title) { display: none; }

.login-brand p {
  font-size: 13px;
  color: var(--muted2);
  margin: 0;
}

.login-field { margin-bottom: 18px; }

.login-field label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9CA3AF;
  margin-bottom: 8px;
}

.login-input {
  width: 100%;
  background: rgba(30, 35, 54, 0.8);
  border: 1px solid #2A3050;
  color: #E8EAF0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.login-input:focus {
  border-color: var(--tgn-blue-light);
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.22);
}

.login-input.is-valid { border-color: rgba(34, 197, 94, 0.5); }

.login-password-wrap { position: relative; }

.login-password-wrap .login-input { padding-right: 44px; }

.login-toggle-pwd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9CA3AF;
  cursor: pointer;
  padding: 4px;
  transition: color 0.18s ease;
}

.login-toggle-pwd:hover { color: var(--tgn-blue-light); }

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 13px;
  color: var(--muted2);
}

.login-remember input { accent-color: var(--tgn-blue-light); width: 16px; height: 16px; }

.btn-login {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.btn-login-primary {
  background: linear-gradient(135deg, var(--tgn-blue) 0%, var(--tgn-blue-light) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(26, 71, 137, 0.45);
}

.btn-login-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26, 71, 137, 0.55);
  color: #fff;
}

.btn-login-primary:active:not(:disabled) { transform: translateY(0); }
.btn-login-primary.loading .btn-login-text { opacity: 0; }
.btn-login-primary.loading .btn-login-loader { display: block; }

.btn-login-loader {
  display: none;
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-login-ghost {
  background: transparent;
  color: var(--muted2);
  border: 1px solid var(--border);
  margin-top: 10px;
}

.btn-login-ghost:hover { border-color: var(--tgn-blue-light); color: var(--tgn-sky); }

.login-actions { display: flex; flex-direction: column; }

.login-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  border: 1px solid;
}

.login-alert-danger { background: rgba(239,68,68,0.1); border-color: rgba(239,68,68,0.3); color: #FCA5A5; }
.login-alert-success { background: rgba(34,197,94,0.1); border-color: rgba(34,197,94,0.3); color: #86EFAC; }
.login-alert-info { background: rgba(59,130,246,0.1); border-color: rgba(59,130,246,0.3); color: #93C5FD; }
.login-alert-warning { background: rgba(251,191,36,0.1); border-color: rgba(251,191,36,0.3); color: #FCD34D; }

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: #6B7280;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.login-footer i { color: var(--tgn-blue-light); }

/* Responsive global */
@media (max-width: 1100px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .content-area { padding: 14px; }
  .topbar { padding: 0 14px; }
  .kpi-row { gap: 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .page-toolbar { flex-direction: column; }
  .btn-toolbar { width: 100%; justify-content: center; }
}

@media (max-width: 420px) {
  .kpi-val { font-size: 18px; }
  .login-card { padding: 28px 22px; }
}

/* PWA — modal instalación iOS / Android */
.nav-link-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--muted2);
  border-left: 3px solid transparent;
  transition: all var(--ease);
  font-size: 13px;
  font-weight: 500;
}

.nav-link-btn:hover:not(.active) { color: var(--tgn-sky); background: rgba(43, 108, 176, 0.18); }
body.modo-aprobador .nav-link-btn { color: #CBD5E1; }
body.modo-aprobador .nav-link-btn:hover:not(.active) { color: #fff; background: rgba(26, 71, 137, 0.2); }

.pwa-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.pwa-modal.open { opacity: 1; visibility: visible; }

.pwa-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.pwa-modal-content {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  transform: translateY(16px);
  transition: transform 0.3s ease;
}

.pwa-modal.open .pwa-modal-content { transform: translateY(0); }

.pwa-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted2);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
}

.pwa-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: rgba(26, 71, 137, 0.2);
  color: var(--tgn-blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin-bottom: 16px;
}

.pwa-modal-content h2 { font-size: 1.25rem; margin: 0 0 8px; }
.pwa-modal-sub { color: var(--muted2); font-size: 0.9rem; margin-bottom: 16px; line-height: 1.5; }

.pwa-modal-steps {
  margin: 0 0 20px;
  padding-left: 20px;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text);
}

.pwa-modal-steps li { margin-bottom: 8px; }

body.modo-aprobador .pwa-modal-content { background: #fff; border-color: #CBD5E1; }

.opciones-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.opcion-block { border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.opcion-compare { border: 1px solid var(--border); border-radius: 12px; padding: 16px; background: var(--surface); }
.solicitud-compare-card { border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 20px; background: var(--surface); }
.proveedor-autocomplete-wrap { position: relative; }
.autocomplete-list { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; list-style: none; margin: 4px 0 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; max-height: 220px; overflow-y: auto; box-shadow: 0 12px 32px rgba(0,0,0,.35); }
.autocomplete-list li { padding: 10px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.pagination-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.empresas-check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.recomendaciones-box { margin-top: 12px; font-size: .9rem; }
.vista-rapida-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.opcion-block legend { font-weight: 600; color: var(--tgn-blue-light); }
.opcion-compare:hover { border-color: rgba(43, 108, 176, 0.55); box-shadow: 0 8px 24px rgba(26, 71, 137, 0.25); background: rgba(26, 71, 137, 0.12); }
.opcion-block:focus-within { border-color: rgba(43, 108, 176, 0.45); }
.autocomplete-list li:hover,
.autocomplete-list li.active {
  background: rgba(26, 71, 137, 0.28);
  color: var(--tgn-sky);
}
.pagination-bar .page-link:hover { background: rgba(43, 108, 176, 0.18); border-color: var(--tgn-blue-light); color: #fff; }
.pagination-bar .page-item.active .page-link,
.pagination-bar .page-item.active .page-link:hover {
  background: var(--tgn-blue);
  border-color: var(--tgn-blue);
  color: #fff;
}
.badge-empresa { background: rgba(26, 71, 137, 0.35); color: var(--tgn-sky); margin-left: 8px; }

/* Asistente IA (M7) */
.ai-chat-widget { position: fixed; right: 20px; bottom: 20px; z-index: 1050; }
.ai-chat-toggle {
  width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--tgn-red);
  background: linear-gradient(135deg, var(--tgn-blue) 0%, var(--tgn-blue-light) 100%);
  color: #fff; font-size: 1.35rem; cursor: pointer;
  box-shadow: 0 8px 28px rgba(26, 71, 137, 0.5);
  transition: transform var(--ease), box-shadow var(--ease);
}
.ai-chat-toggle-label { display: none; }
.ai-chat-toggle:hover { transform: scale(1.05); box-shadow: 0 10px 32px rgba(227, 6, 19, 0.35); }
.ai-chat-panel {
  position: absolute; bottom: 66px; right: 0; width: min(380px, calc(100vw - 40px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: 0 20px 48px rgba(0, 0, 0, 0.45);
}
.ai-chat-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; font-weight: 600;
  background: linear-gradient(90deg, var(--tgn-blue-dark) 0%, var(--tgn-blue) 100%);
  border-bottom: 2px solid var(--tgn-red);
}
.ai-chat-header-info { display: flex; align-items: center; gap: 10px; }
.ai-chat-header-info strong { font-size: 13px; color: #fff; }
.ai-chat-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.15); color: #fff; font-size: 1.05rem;
}
.ai-chat-header small { display: flex; align-items: center; gap: 5px; font-weight: 400; font-size: 11px; color: var(--tgn-sky); margin-top: 2px; }
.ai-chat-dot-online { width: 7px; height: 7px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2); }
.ai-chat-close {
  background: transparent; border: none; color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem; cursor: pointer; padding: 4px 6px; border-radius: 6px;
  transition: background var(--ease), color var(--ease);
}
.ai-chat-close:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.ai-chat-messages { height: 320px; overflow-y: auto; padding: 14px; font-size: 0.9rem; background: var(--bg); }
.ai-chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); background: var(--surface2); }
.ai-chat-msg-user {
  width: fit-content; max-width: 85%; margin-left: auto; text-align: left;
  color: #fff; margin-bottom: 10px; padding: 8px 12px; line-height: 1.4;
  background: linear-gradient(135deg, var(--tgn-blue) 0%, var(--tgn-blue-light) 100%);
  border-radius: 12px 12px 2px 12px;
}
.ai-chat-msg-bot {
  width: fit-content; max-width: 88%; text-align: left; color: var(--text);
  margin-bottom: 10px; padding: 9px 13px; line-height: 1.45;
  background: var(--surface); border-left: 3px solid var(--tgn-red);
  border-radius: 2px 12px 12px 12px;
}
.ai-chat-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ai-chat-chip {
  font-size: 11.5px; font-weight: 600; padding: 6px 11px; cursor: pointer;
  color: var(--tgn-sky); background: rgba(43, 108, 176, 0.16);
  border: 1px solid rgba(74, 144, 217, 0.4); border-radius: 16px;
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.ai-chat-chip:hover { background: var(--tgn-blue); color: #fff; border-color: var(--tgn-blue); }
.ai-chat-typing { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 12px 14px; }
.ai-chat-typing-hint { flex-basis: 100%; font-size: 0.72rem; color: var(--muted2); margin-top: 2px; }
.ai-chat-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted2);
  animation: aiChatBlink 1.2s infinite ease-in-out both;
}
.ai-chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiChatBlink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

body.modo-aprobador .ai-chat-chip { color: var(--tgn-blue); background: rgba(26, 71, 137, 0.08); border-color: rgba(26, 71, 137, 0.3); }
body.modo-aprobador .ai-chat-chip:hover { color: #fff; background: var(--tgn-blue); }
body.modo-aprobador .ai-chat-msg-bot { background: var(--surface2); }
body.modo-aprobador .ai-chat-header small { color: var(--tgn-sky); }

@media (max-width: 768px) {
  .login-hero { display: none; }
  .login-wrapper { padding: 32px 20px; }
  .login-card { max-width: 100%; }
  .login-brand .login-logo-chip { display: inline-flex; margin-bottom: 18px; padding: 10px 18px; border-radius: 12px; background: #fff; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3); }
}

@media (min-width: 769px) and (max-width: 980px) {
  .login-hero { flex: 0 1 340px; }
  .login-hero-panel { min-height: 460px; padding: 24px; }
  .login-hero-title { font-size: 24px; }
  .login-hero-body { margin-top: 28px; }
}

/* —— Tema claro / oscuro —— */
html[data-theme="light"] {
  --bg: #EEF3F9;
  --surface: #FFFFFF;
  --surface2: #E5EEF8;
  --border: #C4D4E8;
  --text: #12233A;
  --muted: #5B6F88;
  --muted2: #3A4F6A;
  --tgn-sky: #1A4789;
  --tgn-sky-soft: #D6E4F5;
  color-scheme: light;
}

html[data-theme="dark"],
html:not([data-theme]) {
  color-scheme: dark;
}

html[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, #163A72 0%, #0F2D5C 100%);
  border-right-color: rgba(255, 255, 255, 0.12);
}

/* Sidebar siempre sobre fondo oscuro: texto claro, independiente de --muted/--muted2 */
html[data-theme="light"] .sidebar-nav .nav-link {
  color: #D7E4F5;
}
html[data-theme="light"] .sidebar-nav .nav-link i {
  color: #B8CEE8;
}
html[data-theme="light"] .sidebar-nav .nav-link:hover:not(.active) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}
html[data-theme="light"] .sidebar-nav .nav-link:hover:not(.active) i {
  color: #ffffff;
}
html[data-theme="light"] .sidebar-nav .nav-link.active,
html[data-theme="light"] .sidebar-nav .nav-link.active:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border-left-color: #E30613;
}
html[data-theme="light"] .sidebar-nav .nav-link.active i {
  color: #ffffff;
}
html[data-theme="light"] .nav-section {
  color: #9BB4D4;
}
html[data-theme="light"] .sidebar-footer {
  border-top-color: rgba(255, 255, 255, 0.15);
}
html[data-theme="light"] .sidebar-footer .user-info strong {
  color: #ffffff;
}
html[data-theme="light"] .sidebar-footer .user-info small {
  color: #B8CEE8;
}
html[data-theme="light"] .sidebar .btn-outline-light {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.55);
}
html[data-theme="light"] .sidebar .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  border-color: #ffffff;
}
html[data-theme="light"] .nav-link-btn {
  color: #D7E4F5;
}
html[data-theme="light"] .nav-link-btn:hover:not(.active) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

html[data-theme="light"] .topbar {
  background: linear-gradient(90deg, #FFFFFF 0%, #E8F0FA 100%);
  border-bottom-color: rgba(227, 6, 19, 0.35);
}

html[data-theme="light"] .topbar-title { color: var(--text); }
html[data-theme="light"] .topbar-sub { color: var(--muted); }

html[data-theme="light"] .card-app {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 1px 3px rgba(15, 45, 92, 0.08);
}

html[data-theme="light"] .text-muted,
html[data-theme="light"] .form-text { color: var(--muted) !important; }

html[data-theme="light"] .btn-ghost {
  color: var(--tgn-blue);
  border-color: var(--border);
  background: #fff;
}
html[data-theme="light"] .btn-ghost:hover {
  background: var(--surface2);
  color: var(--tgn-blue-dark);
}

html[data-theme="light"] .table-dark-custom th {
  color: var(--muted2);
  background: var(--surface2);
}
html[data-theme="light"] .table-dark-custom td {
  color: var(--text);
  border-color: var(--border);
}

html[data-theme="light"] .form-control,
html[data-theme="light"] .form-select {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}
html[data-theme="light"] .form-control::placeholder { color: #8A9BB0; }

html[data-theme="light"] .alert-info {
  background: #E8F1FB;
  color: #0F2D5C;
  border-color: #B7CFE8;
}
html[data-theme="light"] .alert-warning {
  background: #FFF6E0;
  color: #6B4E00;
  border-color: #F0D48A;
}
html[data-theme="light"] .alert-success {
  background: #E8F8EE;
  color: #146C36;
  border-color: #A8DDB8;
}
html[data-theme="light"] .alert-danger {
  background: #FDECEC;
  color: #8B1212;
  border-color: #F0B4B4;
}

html[data-theme="light"] .cotiz-obs-text,
html[data-theme="light"] .cotiz-monto,
html[data-theme="light"] .text-body { color: var(--text) !important; }

.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  padding: 0;
}
.btn-theme-toggle:hover {
  background: rgba(43, 108, 176, 0.18);
  color: #fff;
}
html[data-theme="light"] .btn-theme-toggle:hover {
  color: var(--tgn-blue-dark);
}

/* Botones de aprobación visibles en tema oscuro y claro */
.apr-acciones .btn-success,
.apr-btn-ok.btn-success {
  background: #16A34A !important;
  border-color: #15803D !important;
  color: #fff !important;
  font-weight: 600;
}
.apr-acciones .btn-danger,
.apr-btn-no.btn-danger {
  background: #DC2626 !important;
  border-color: #B91C1C !important;
  color: #fff !important;
  font-weight: 600;
}
.panel-aprobacion-opcion {
  border: 1px solid var(--border);
}
.panel-aprobacion .card-title { margin-bottom: 0.75rem; }

.apr-decision {
  width: 100%;
  max-width: 440px;
}
.apr-decision-block { max-width: none; }
.apr-decision-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.apr-decision-obs {
  font-size: 13px;
  resize: vertical;
  min-height: 56px;
}
.apr-decision-hint { font-size: 11px; }
.apr-decision-btns .apr-btn,
.apr-decision-btns .btn { min-width: 110px; }

/* CotizApp v2.0 — watermark, PWA banner, tabbar global, login landing */
.app-watermark {
  position: fixed;
  right: 12px;
  bottom: 10px;
  z-index: 20;
  pointer-events: none;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted2);
  opacity: 0.45;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
body.modo-aprobador .app-watermark { bottom: 64px; }

.app-version-badge {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  margin: 8px 0 4px;
  letter-spacing: 0.04em;
}

.pwa-install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 1200;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1A4789, #2B6CB0);
  color: #fff;
  box-shadow: 0 10px 30px rgba(15, 45, 92, 0.35);
}
.pwa-install-banner-text { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.pwa-install-banner-text strong { font-size: 13px; }
.pwa-install-banner-actions { display: flex; gap: 6px; flex-shrink: 0; }
.pwa-install-banner .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.35); }

.exec-tabbar {
  display: none;
}
@media (max-width: 992px) {
  body.modo-aprobador .exec-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1100;
    background: var(--surface, #122240);
    border-top: 1px solid var(--border);
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    gap: 4px;
  }
  body.modo-aprobador .exec-tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    color: var(--muted2);
    text-decoration: none;
    padding: 6px 4px;
    border-radius: 10px;
  }
  body.modo-aprobador .exec-tabbar a i { font-size: 16px; }
  body.modo-aprobador .exec-tabbar a.active {
    color: var(--tgn-sky, #DCE9F7);
    background: rgba(43, 108, 176, 0.2);
  }
  body.modo-aprobador .content-area,
  body.modo-aprobador .main-content {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

.login-hero-points {
  list-style: none;
  padding: 20px 0 0;
  margin: 20px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  gap: 10px;
}
.login-hero-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.86);
}
.login-hero-points i { color: #7eb8ff; font-size: 15px; }
.login-version-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(43, 108, 176, 0.25);
  color: #7eb8ff;
  font-size: 11px;
  font-weight: 700;
}

