/* ==========================================================================
   Tema Transportes Buen Futuro - capa visual sobre AdminLTE 3
   Se carga DESPUES de adminlte.min.css. Solo estilos, sin cambios de logica.
   ========================================================================== */

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

:root {
  --bf-red: #e30613;
  --bf-red-600: #c40511;
  --bf-red-50: #fdecee;
  --bf-ink: #1d2128;
  --bf-ink-2: #3a404a;
  --bf-muted: #6b7280;
  --bf-line: #e5e7eb;
  --bf-line-2: #eef0f3;
  --bf-bg: #f3f4f7;
  --bf-surface: #ffffff;
  --bf-sidebar: #16191f;
  --bf-sidebar-2: #1f232b;
  --bf-sidebar-text: #b7bdc8;
  --bf-success: #16a34a;
  --bf-success-600: #15803d;
  --bf-danger: #dc2626;
  --bf-warning: #d97706;
  --bf-info: #2563eb;
  --bf-radius: 0;
  --bf-radius-sm: 0;
  --bf-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
  --bf-shadow-lg: 0 10px 30px rgba(16, 24, 40, .12);
  --bf-font: "Inter", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Base ---------- */
body,
.main-header .navbar-nav .nav-link,
.form-control,
.btn,
.table {
  font-family: var(--bf-font);
}
body {
  color: var(--bf-ink);
  font-size: .9rem;
  -webkit-font-smoothing: antialiased;
}
.content-wrapper {
  background: var(--bf-bg);
}
a {
  color: var(--bf-red);
}
a:hover {
  color: var(--bf-red-600);
}
::selection {
  background: var(--bf-red-50);
  color: var(--bf-ink);
}

/* ---------- Barra superior ---------- */
.main-header.navbar {
  background: var(--bf-surface);
  border-bottom: 1px solid var(--bf-line);
  box-shadow: none;
  min-height: 56px;
}
.main-header .navbar-nav .nav-link {
  color: var(--bf-ink-2);
  border-radius: var(--bf-radius-sm);
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 .8rem;
  transition: background .15s ease;
}
.main-header .navbar-nav .nav-link:hover {
  background: var(--bf-line-2);
  color: var(--bf-ink);
}
/* boton de panel lateral derecho sin panel asociado */
.main-header [data-widget="control-sidebar"] {
  display: none !important;
}

/* ---------- Menu lateral ---------- */
.main-sidebar,
.main-sidebar.sidebar-dark-gray {
  background: var(--bf-sidebar);
  box-shadow: 1px 0 0 rgba(255, 255, 255, .04);
}
.main-sidebar .bf-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  height: 57px; /* misma altura que la barra superior: la linea roja continua su borde */
  padding: 6px 14px;
  border-bottom: 3px solid var(--bf-red);
  transition: padding .2s ease;
}
.main-sidebar .bf-brand img {
  max-height: 40px;
  width: auto;
  max-width: 100%;
}
.main-sidebar .bf-brand .bf-brand-mini {
  display: none;
  max-height: 34px;
  border-radius: 0;
}
/* menu compacto: solo el monograma BF (el logo completo no cabe en 74px) */
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .bf-brand {
  padding: 6px 4px;
}
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .bf-brand .bf-brand-full {
  display: none;
}
.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .bf-brand .bf-brand-mini {
  display: block;
}
.sidebar {
  padding: 0 10px;
}
.sidebar .form-control-sidebar,
.sidebar .btn-sidebar {
  background: var(--bf-sidebar-2) !important;
  border: 1px solid rgba(255, 255, 255, .06) !important;
  color: #e5e7eb !important;
}
.sidebar .form-control-sidebar {
  border-radius: var(--bf-radius-sm) 0 0 var(--bf-radius-sm);
}
.sidebar .btn-sidebar {
  border-radius: 0 var(--bf-radius-sm) var(--bf-radius-sm) 0;
}
.sidebar .bf-menu-label {
  color: #6b7280;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 1rem .75rem .35rem;
}
.sidebar-collapse .main-sidebar:not(:hover) .bf-menu-label {
  visibility: hidden;
}
.nav-sidebar .nav-item > .nav-link {
  color: var(--bf-sidebar-text);
  border-radius: var(--bf-radius-sm);
  margin-bottom: 2px;
  font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav-sidebar .nav-item > .nav-link:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}
.nav-sidebar .nav-link .nav-icon {
  color: #8b93a1;
}
/* Pagina actual: unico elemento en rojo solido (opcion suelta o subopcion) */
.nav-sidebar > .nav-item > .nav-link.active:not([href="#"]),
[class*="sidebar-dark"] .nav-sidebar > .nav-item > .nav-link.active:not([href="#"]),
[class*="sidebar-dark"] .nav-treeview > .nav-item > .nav-link.active,
.nav-treeview > .nav-item > .nav-link.active {
  background: var(--bf-red) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(227, 6, 19, .30);
  font-weight: 600;
}
.nav-sidebar > .nav-item > .nav-link.active:not([href="#"]) .nav-icon,
.nav-treeview > .nav-item > .nav-link.active .nav-icon {
  color: #fff !important;
}
/* Categoria que contiene la pagina actual: sin relleno rojo, con acento lateral */
.nav-sidebar > .nav-item > .nav-link.active[href="#"],
[class*="sidebar-dark"] .nav-sidebar > .nav-item > .nav-link.active[href="#"] {
  background: rgba(255, 255, 255, .07) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 0 var(--bf-red);
  font-weight: 600;
}
.nav-sidebar > .nav-item > .nav-link.active[href="#"] .nav-icon {
  color: #ff5a63 !important;
}
/* Categoria abierta a mano (no contiene la pagina actual) */
.nav-sidebar .menu-open > .nav-link:not(.active) {
  background: rgba(255, 255, 255, .04);
  color: #fff;
}
/* Subopciones: sangria y linea guia que las une a su categoria */
.nav-treeview {
  margin: 2px 0 8px 17px;
  padding-left: 7px;
  border-left: 1px solid rgba(255, 255, 255, .12);
  width: auto;
}
.sidebar-collapse .main-sidebar:not(:hover) .nav-treeview {
  margin-left: 0;
  padding-left: 0;
  border-left: 0;
}
.nav-treeview > .nav-item > .nav-link {
  font-weight: 400;
  font-size: .86rem;
  color: #a3aab6;
  width: auto !important; /* AdminLTE fija el ancho; con la sangria se saldria del menu */
}
.nav-treeview > .nav-item > .nav-link .nav-icon {
  font-size: .8rem !important;
  color: #6b7280 !important;
}

/* ---------- Encabezado de contenido ---------- */
.content-header {
  padding: 10px .5rem 0;
}

/* ---------- Tarjetas ---------- */
.card {
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius);
  box-shadow: var(--bf-shadow);
  background: var(--bf-surface);
}
.card-secondary:not(.card-outline) > .card-header,
.card > .card-header.bg-gray,
.card-header {
  background: var(--bf-surface) !important;
  color: var(--bf-ink) !important;
  border-bottom: 1px solid var(--bf-line);
  border-radius: var(--bf-radius) var(--bf-radius) 0 0 !important;
  padding: .9rem 1.25rem;
  position: relative;
}
.card-secondary > .card-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0;
  background: var(--bf-red);
}
.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--bf-ink);
}
.card-header .btn-tool {
  color: var(--bf-muted) !important;
  border-radius: var(--bf-radius-sm);
}
.card-header .btn-tool:hover {
  background: var(--bf-line-2);
  color: var(--bf-ink) !important;
}
.card-body {
  padding: 1.25rem;
}
/* Las paginas meten tablas directamente dentro de .card: darles aire */
.card > table,
.card > form > table {
  margin: 1rem auto;
}

/* ---------- Tablas ---------- */
.table {
  color: var(--bf-ink);
  font-size: .85rem;
  border-collapse: separate;
  border-spacing: 0;
}
.table td,
.table th {
  border-color: var(--bf-line) !important;
  vertical-align: middle;
}
.table-sm td,
.table-sm th {
  padding: .45rem .6rem;
}
/* Fila de encabezado oscura usada en todos los listados */
.table thead th,
.table tr.bg-dark > th,
.table tr.bg-dark > td,
.table > tbody > tr.bg-dark > th,
.table > tbody > tr.bg-dark > td {
  background: #2b3039 !important;
  color: #f3f4f6 !important;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  border-color: #2b3039 !important;
  position: sticky;
  top: 0;
  z-index: 2;
}
.table tr.bg-dark b,
.table tr.bg-dark strong {
  font-weight: 600;
}
.table tr.bg-dark > :first-child,
.table thead tr > :first-child {
  border-top-left-radius: var(--bf-radius-sm);
}
.table tr.bg-dark > :last-child,
.table thead tr > :last-child {
  border-top-right-radius: var(--bf-radius-sm);
}
.table-hover tbody tr:hover,
.table-hover > tr:hover {
  background: #fff7f7;
}
.table-bordered {
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-sm);
}
.table-bordered tbody tr:nth-child(even):not(.bg-dark) {
  background: #fafbfc;
}
.table-bordered tbody tr:nth-child(even):not(.bg-dark):hover {
  background: #fff7f7;
}
.table td[align="right"],
.table th[align="right"] {
  font-variant-numeric: tabular-nums;
}
.table a .fa-edit,
.table a .fa-trash-alt,
.table a .fas,
.table a .far {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 0;
  transition: background .15s ease;
}
.table a:hover .fas,
.table a:hover .far {
  background: var(--bf-red-50);
}
.table .fa-trash-alt {
  color: var(--bf-danger);
}
/* Herramientas de listado (buenfuturo.js) */
.bf-table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  width: 98%;
  margin: .75rem auto .5rem;
}
.bf-search {
  position: relative;
  flex: 0 1 320px;
}
.bf-search .fa-search {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bf-muted);
  font-size: .8rem;
  pointer-events: none;
}
.bf-search .form-control {
  padding-left: 32px;
  min-height: 34px;
  background: #fff;
}
.bf-count {
  color: var(--bf-muted);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}
.table .bf-sortable {
  cursor: pointer;
  user-select: none;
}
.table .bf-sortable::after {
  content: "\2195";
  margin-left: 6px;
  opacity: .35;
  font-size: .75em;
}
.table .bf-sortable[data-bf-sort="asc"]::after {
  content: "\2191";
  opacity: 1;
}
.table .bf-sortable[data-bf-sort="desc"]::after {
  content: "\2193";
  opacity: 1;
}
.table .bf-sortable:hover {
  background: #383e49 !important;
}
.table td.bf-neg {
  color: var(--bf-danger) !important;
  font-weight: 500;
}
.table tr.bf-total-row,
.table-bordered tbody tr.bf-total-row:nth-child(even) {
  background: #f6f7f9;
  font-weight: 600;
}
.table tr:not(.bf-total-row) + tr.bf-total-row td {
  border-top: 2px solid #c9ced6 !important;
}
.btn.bf-sending {
  opacity: .65;
  cursor: progress;
}

/* Formularios (buenfuturo.js) */
.bf-date {
  min-width: 150px;
}
.bf-date-label {
  display: block;
  margin-bottom: .25rem;
}
.bf-form-alert {
  margin: .75rem;
}
.select2-container--bootstrap4 .select2-selection {
  border-color: #d1d5db;
  border-radius: var(--bf-radius-sm);
  min-height: 36px;
}
.select2-container--bootstrap4.select2-container--focus .select2-selection {
  border-color: var(--bf-red);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, .14);
}
.select2-container--bootstrap4 .select2-results__option--highlighted,
.select2-container--bootstrap4 .select2-results__option--highlighted.select2-results__option[aria-selected="true"] {
  background: var(--bf-red);
}
.is-invalid + .select2-container--bootstrap4 .select2-selection {
  border-color: var(--bf-danger);
}
.bf-toast {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bf-ink);
  color: #fff;
  padding: .7rem 1rem;
  border-radius: var(--bf-radius-sm);
  box-shadow: var(--bf-shadow-lg);
  font-weight: 500;
  transition: opacity .5s ease, transform .5s ease;
}
.bf-toast .fa-check-circle {
  color: #4ade80;
}
.bf-toast-hide {
  opacity: 0;
  transform: translateY(-8px);
}

/* Detalle de gastos por chofer (detalle_viajes_gastos.asp) */
.bf-gt {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.bf-gt .bf-kpis {
  order: -1;
}
.bf-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin: .5rem 0 1rem;
}
.bf-kpi {
  background: var(--bf-surface);
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius);
  padding: 12px 14px;
  box-shadow: var(--bf-shadow);
}
.bf-kpi span {
  display: block;
  color: var(--bf-muted);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.bf-kpi strong {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}
.bf-kpi-pos strong { color: #1d4ed8; }
.bf-kpi-neg strong { color: var(--bf-danger); }
.bf-gt .bf-table-tools {
  width: 100%;
  margin: 0 0 .5rem;
}
.bf-gt-table {
  font-size: .78rem;
  white-space: nowrap;
  margin-bottom: 0;
}
.bf-gt-table td,
.bf-gt-table th {
  padding: .35rem .5rem;
}
.bf-gt-table .bf-col-g {
  background-color: rgba(43, 48, 57, .025);
}
.bf-gt-table thead .bf-col-g,
.bf-gt-table thead .bf-col-caja {
  background-color: #343a44 !important;
}
.bf-gt-table tr.bf-trip td {
  border-top: 2px solid #d5d9df !important;
}
.bf-gt-table tr.bf-trip-cont td {
  color: var(--bf-ink-2);
}
.bf-gt-table .bf-cont {
  color: var(--bf-muted);
  padding-left: 12px;
  position: relative;
}
.bf-gt-table .bf-cont::before {
  content: "\21B3";
  position: absolute;
  left: 0;
}
.table td.bf-pos { color: #1d4ed8; }
.bf-gt-table tfoot td {
  background: #f6f7f9;
  font-weight: 600;
  border-top: 2px solid #c9ced6 !important;
}

/* Listados comunes (_listados.asp) */
.bf-list {
  padding: 1rem 1.25rem 1.25rem;
}
.bf-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.bf-list-search {
  position: relative;
  display: flex;
  gap: 8px;
  flex: 1 1 360px;
  max-width: 520px;
}
.bf-list-search .fa-search {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--bf-muted);
  font-size: .8rem;
  pointer-events: none;
}
.bf-list-search .form-control {
  padding-left: 34px;
}
.bf-list-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}
.bf-list-count {
  color: var(--bf-muted);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}
.bf-list-table {
  margin-bottom: 0;
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-sm);
}
.bf-list-table td {
  padding: .6rem .75rem;
}
.bf-list-table td a {
  color: var(--bf-ink);
  display: block;
}
.bf-list-table td a.bf-list-main {
  font-weight: 600;
}
.bf-list-table tbody tr:hover td a {
  color: var(--bf-red-600);
}
.bf-list-table .bf-list-go {
  color: var(--bf-muted) !important;
}
.bf-list-table tfoot td {
  background: #f6f7f9;
  font-weight: 600;
  border-top: 2px solid #c9ced6 !important;
}
.bf-list-empty {
  text-align: center;
  color: var(--bf-muted);
  padding: 2.5rem 1rem;
  border: 1px dashed #d1d5db;
  border-radius: var(--bf-radius);
}
.bf-list-empty .fa-inbox {
  font-size: 2rem;
  margin-bottom: .5rem;
  color: #c4c9d1;
}
.bf-list-empty p {
  margin: 0;
}
.bf-list-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.bf-list-pageinfo {
  color: var(--bf-muted);
  font-size: .82rem;
}
.pagination .page-link {
  color: var(--bf-ink-2);
  border-color: var(--bf-line);
}
.pagination .page-item:first-child .page-link {
  border-radius: var(--bf-radius-sm) 0 0 var(--bf-radius-sm);
}
.pagination .page-item:last-child .page-link {
  border-radius: 0 var(--bf-radius-sm) var(--bf-radius-sm) 0;
}
.pagination .page-item.active .page-link {
  background: var(--bf-red);
  border-color: var(--bf-red);
  color: #fff;
}
.pagination .page-link:hover {
  color: var(--bf-red-600);
  background: var(--bf-red-50);
}
/* Barra de letras A-Z de los listados */
td.cajita {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
td.cajita a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 28px;
  border-radius: 0;
  color: var(--bf-ink-2);
  font-size: .78rem;
  font-weight: 600;
}
td.cajita a:hover {
  background: var(--bf-red-50);
  color: var(--bf-red-600);
}

/* Tablas anchas: scroll horizontal dentro de la tarjeta en pantallas chicas */
@media (max-width: 991.98px) {
  .card {
    overflow-x: auto;
  }
}

/* ---------- Formularios ---------- */
.form-control,
.custom-select {
  border: 1px solid #d1d5db;
  border-radius: var(--bf-radius-sm);
  font-size: .875rem;
  min-height: 36px;
  color: var(--bf-ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus,
.custom-select:focus {
  border-color: var(--bf-red);
  box-shadow: 0 0 0 3px rgba(227, 6, 19, .14);
}
.form-control[readonly],
.form-control:disabled {
  background: #f6f7f9;
}
label,
.col-form-label {
  font-weight: 500;
  color: var(--bf-ink-2);
  font-size: .82rem;
}
.input-group-text {
  background: #f6f7f9;
  border-color: #d1d5db;
  border-radius: var(--bf-radius-sm);
  color: var(--bf-muted);
}

/* ---------- Botones ---------- */
.btn {
  border-radius: var(--bf-radius-sm);
  font-weight: 500;
  font-size: .875rem;
  padding: .45rem 1rem;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn-sm {
  padding: .25rem .6rem;
  font-size: .8rem;
}
.btn-success {
  background: var(--bf-success);
  border-color: var(--bf-success);
}
.btn-success:hover,
.btn-success:focus {
  background: var(--bf-success-600);
  border-color: var(--bf-success-600);
}
.btn-danger,
.btn-primary {
  background: var(--bf-red);
  border-color: var(--bf-red);
}
.btn-danger:hover,
.btn-danger:focus,
.btn-primary:hover,
.btn-primary:focus {
  background: var(--bf-red-600);
  border-color: var(--bf-red-600);
}
.btn:focus {
  box-shadow: 0 0 0 3px rgba(227, 6, 19, .18);
}
.btn.btn-tool {
  padding: .25rem .5rem;
}
input[type="submit"].btn,
input[type="button"].btn {
  min-height: 36px;
}

/* ---------- Varios ---------- */
.badge {
  border-radius: 0;
  font-weight: 600;
  padding: .3em .65em;
}
.alert {
  border-radius: var(--bf-radius-sm);
  border: 0;
}
.dropdown-menu {
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-sm);
  box-shadow: var(--bf-shadow-lg);
}
.modal-content {
  border: 0;
  border-radius: var(--bf-radius);
  box-shadow: var(--bf-shadow-lg);
}
.main-footer {
  background: transparent;
  border-top: 1px solid var(--bf-line);
  color: var(--bf-muted);
  font-size: .8rem;
  padding: .85rem 1.25rem;
}
.main-footer strong {
  color: var(--bf-ink-2);
}

/* ---------- Inicio (index.asp) ---------- */
.bf-hero {
  border-radius: var(--bf-radius);
  overflow: hidden;
  position: relative;
  min-height: 220px;
  background: var(--bf-sidebar) center / cover no-repeat;
  display: flex;
  align-items: flex-end;
  box-shadow: var(--bf-shadow);
  margin-bottom: 1.5rem;
}
.bf-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(22, 25, 31, .92) 0%, rgba(22, 25, 31, .55) 55%, rgba(22, 25, 31, .15) 100%);
}
.bf-hero-body {
  position: relative;
  z-index: 1;
  padding: 2rem;
  color: #fff;
}
.bf-hero-body h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 .25rem;
}
.bf-hero-body p {
  margin: 0;
  color: #d1d5db;
}
.bf-hero-tag {
  display: inline-block;
  background: var(--bf-red);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: 0;
  padding: .25rem .7rem;
  margin-bottom: .75rem;
}
.bf-section-title {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--bf-muted);
  margin: 0 0 .75rem;
}
.bf-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 1.5rem;
}
.bf-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bf-surface);
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius);
  padding: 16px;
  color: var(--bf-ink) !important;
  box-shadow: var(--bf-shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  text-decoration: none !important;
}
.bf-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--bf-shadow-lg);
  border-color: rgba(227, 6, 19, .35);
}
.bf-tile-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bf-red-50);
  color: var(--bf-red);
  font-size: 1.1rem;
}
.bf-tile-text strong {
  display: block;
  font-weight: 600;
  font-size: .92rem;
}
.bf-tile-text span {
  display: block;
  color: var(--bf-muted);
  font-size: .78rem;
}

/* ---------- Dashboard ejecutivo (index.asp) ---------- */
.bf-hero.bf-hero-sm {
  min-height: 150px;
}
.bf-hero.bf-hero-sm .bf-hero-body {
  padding: 1.5rem 2rem;
}
.bf-dash {
  margin-bottom: 1.5rem;
}
.bf-dash-kpis {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  margin: 0 0 1rem;
}
.bf-kpi small {
  display: block;
  margin-top: 4px;
  color: var(--bf-muted);
  font-size: .74rem;
  line-height: 1.3;
}
.bf-kpi.bf-kpi-warn {
  border-left: 4px solid var(--bf-red);
}
.bf-panel {
  background: var(--bf-surface);
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius);
  box-shadow: var(--bf-shadow);
  padding: 14px 16px 8px;
  margin-bottom: 14px;
  min-width: 0;
}
.bf-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.bf-panel-head h4 {
  font-size: .95rem;
  font-weight: 600;
  margin: 0;
  color: var(--bf-ink);
}
.bf-panel-head h4 .fas {
  color: var(--bf-muted);
  margin-right: 4px;
}
.bf-panel-head > span {
  color: var(--bf-muted);
  font-size: .76rem;
}
.bf-panel-note {
  color: var(--bf-ink-2);
  font-size: .82rem;
  margin: 0 0 6px;
}
.bf-dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}
.bf-dash-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 1199.98px) {
  .bf-dash-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
  .bf-dash-grid,
  .bf-dash-grid-3 { grid-template-columns: minmax(0, 1fr); }
}
.bf-dash-table {
  margin: 4px 0 8px;
  font-size: .82rem;
}
.bf-dash-table td {
  border-top: 1px solid var(--bf-line-2) !important;
  padding: .4rem .25rem;
}
.bf-dash-table tr:first-child td {
  border-top: 0 !important;
}
.bf-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 0;
  padding: 2px 8px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.bf-badge-crit { background: #fdecee; color: #a3040e; }
.bf-badge-warn { background: #fff4e0; color: #8a5300; }
.bf-badge-info { background: #eef2f7; color: var(--bf-ink-2); }
.bf-dash-ok,
.bf-dash-empty {
  color: var(--bf-muted);
  font-size: .84rem;
  margin: 10px 0 12px;
}
.bf-dash-ok .fa-check-circle { color: var(--bf-success); }
.bf-dash-more {
  font-size: .8rem;
  color: var(--bf-muted);
  margin: 0 0 8px;
}
.bf-dash-foot {
  color: var(--bf-muted);
  font-size: .76rem;
  margin: 4px 0 0;
}
.apexcharts-tooltip {
  border-radius: var(--bf-radius-sm) !important;
  box-shadow: var(--bf-shadow-lg) !important;
}

/* ---------- Login (default.asp) ---------- */
body.bf-login {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--bf-bg);
  margin: 0;
}
.bf-login-aside {
  flex: 1 1 50%;
  position: relative;
  background: var(--bf-sidebar) url("../../build/img/home.jpg") center / cover no-repeat;
  display: flex;
  align-items: flex-end;
}
.bf-login-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(22, 25, 31, .2) 0%, rgba(22, 25, 31, .9) 100%);
}
.bf-login-aside .bf-hero-body {
  padding: 3rem;
}
.bf-login-main {
  flex: 1 1 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 16px;
}
.bf-login-card {
  width: 100%;
  max-width: 380px;
}
.bf-login-card .bf-login-logo {
  display: block;
  max-width: 240px;
  height: auto;
  margin-bottom: 2rem;
}
.bf-login-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin: 0 0 .25rem;
}
.bf-login-card .bf-sub {
  color: var(--bf-muted);
  margin-bottom: 1.75rem;
}
.bf-login-card .form-control {
  min-height: 44px;
}
.bf-login-card .btn {
  min-height: 44px;
  font-weight: 600;
}
.bf-login-msg {
  background: var(--bf-red-50);
  color: var(--bf-red-600);
  border-radius: var(--bf-radius-sm);
  padding: .6rem .8rem;
  font-size: .85rem;
  margin-bottom: 1rem;
}
.bf-login-foot {
  color: var(--bf-muted);
  font-size: .78rem;
  margin-top: 2rem;
}
@media (max-width: 767.98px) {
  .bf-login-aside {
    display: none;
  }
}

/* ---------- Impresion ---------- */
@media print {
  .main-sidebar,
  .main-header,
  .main-footer,
  .card-tools {
    display: none !important;
  }
  .content-wrapper {
    margin-left: 0 !important;
    background: #fff;
  }
  .card {
    box-shadow: none;
    border: 0;
  }
}

/* ---------- Roles y permisos (admin_usuarios_edi.asp, admin_roles.asp) ---------- */
.bf-perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.bf-perm-mod {
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius-sm);
  padding: 10px 12px;
  background: var(--bf-surface);
}
.bf-perm-mod h6 {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--bf-muted);
  margin: 0 0 6px;
}
.bf-perm-item { padding: 3px 0; }
.bf-perm-item .custom-control-label { font-weight: 400; }
.bf-perm-inc {
  display: none;
  margin-left: 6px;
  font-size: .72rem;
  color: var(--bf-success-600);
}
.bf-perm-item.is-included .bf-perm-inc { display: inline; }
.bf-perm-item.is-included .custom-control-label { color: var(--bf-muted); }
.bf-rol-desc { display: block; margin-top: 4px; color: var(--bf-muted); font-size: .85rem; }

.bf-perm-matrix-wrap { overflow-x: auto; }
.bf-perm-matrix { width: 100%; border-collapse: separate; border-spacing: 0; }
.bf-perm-matrix th,
.bf-perm-matrix td {
  border-bottom: 1px solid var(--bf-line-2);
  padding: 6px 10px;
  vertical-align: middle;
}
.bf-perm-matrix thead th {
  position: sticky;
  top: 0;
  background: var(--bf-surface);
  border-bottom: 2px solid var(--bf-line);
  text-align: center;
  font-size: .82rem;
  white-space: nowrap;
}
.bf-perm-matrix thead th:first-child { text-align: left; }
.bf-perm-matrix thead th small { display: block; font-weight: 400; color: var(--bf-muted); }
.bf-perm-matrix td.bf-perm-cell { text-align: center; width: 1%; }
.bf-perm-matrix td.bf-perm-cell input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--bf-red); }
.bf-perm-matrix td.bf-perm-cell input:disabled { cursor: not-allowed; }
.bf-perm-matrix td code { font-size: .72rem; color: var(--bf-muted); background: none; padding: 0; }
.bf-perm-matrix tr.bf-perm-modrow td {
  background: var(--bf-bg);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--bf-muted);
}
.bf-perm-matrix tbody tr:not(.bf-perm-modrow):hover td { background: var(--bf-red-50); }
.bf-perm-actions { display: flex; gap: 8px; justify-content: center; margin-top: 4px; }
.bf-perm-actions .btn { padding: 0 6px; font-size: .75rem; line-height: 1.6; }

/* ---------- Analisis del negocio (analisis_*.asp) ---------- */
.bf-an { padding-top: 12px; }
.bf-an-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.bf-an-title { font-size: 1.35rem; font-weight: 700; margin: 0; color: var(--bf-ink); }
.bf-an-title .fas { color: var(--bf-red); margin-right: 6px; }
.bf-an-head p { margin: 2px 0 0; color: var(--bf-muted); font-size: .85rem; }
.bf-an-filtros {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  background: var(--bf-surface);
  border: 1px solid var(--bf-line);
  border-radius: var(--bf-radius);
  padding: 10px 14px;
  margin-bottom: 14px;
}
.bf-an-filtros-sm { border: 0; padding: 0; margin: 4px 0 10px; background: none; }
.bf-an-campo { display: flex; flex-direction: column; min-width: 150px; }
.bf-an-campo label { font-size: .72rem; font-weight: 600; color: var(--bf-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.bf-an-botones { flex-direction: row; gap: 6px; min-width: 0; }
.bf-an-aviso {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fff8eb;
  border: 1px solid #f5d9a8;
  color: #6b4500;
  border-radius: var(--bf-radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: .86rem;
}
.bf-an-aviso .fas { margin-top: 3px; }
.bf-an-nota { color: var(--bf-muted); font-size: .8rem; margin: 6px 0 8px; }
.bf-an-vacio { color: var(--bf-muted); margin: 10px 0; }
.bf-an-table { font-size: .84rem; margin-bottom: 4px; }
.bf-an-table td, .bf-an-table th { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bf-an-table td:first-child { white-space: normal; min-width: 180px; }
.bf-an-criterios { margin: 4px 0 18px; font-size: .84rem; color: var(--bf-ink-2); }
.bf-an-criterios summary { cursor: pointer; color: var(--bf-muted); font-weight: 600; }
.bf-an-criterios ul { margin: 8px 0 0; padding-left: 18px; }
.bf-an-criterios li { margin-bottom: 4px; }
@media (max-width: 575.98px) {
  .bf-an-campo { min-width: 0; flex: 1 1 140px; }
}

/* ---------- Nueva salida de viaje (nuevo_viaje.asp) ---------- */
.bf-nv { max-width: 980px; }
.bf-nv-step { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; }
.bf-nv-step b {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bf-red); color: #fff; font-size: .8rem; flex: none;
}
.bf-nv-step h5 { margin: 0; font-size: 1rem; font-weight: 600; color: var(--bf-ink); }
.bf-nv-step span { color: var(--bf-muted); font-size: .8rem; }
.bf-nv-section { border-top: 1px solid var(--bf-line-2); padding-top: 16px; margin-top: 18px; }
.bf-nv-section.is-disabled { opacity: .55; }
.bf-nv label.bf-nv-label { display: block; font-size: .78rem; font-weight: 600; color: var(--bf-ink-2); margin-bottom: 4px; }
.bf-nv-equipo { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 12px; }
.bf-nv-veh {
  border: 1px solid var(--bf-line); border-radius: var(--bf-radius-sm); padding: 10px 12px;
  display: flex; gap: 10px; align-items: center; background: var(--bf-surface);
}
.bf-nv-veh .fas { font-size: 1.3rem; color: var(--bf-muted); width: 26px; text-align: center; }
.bf-nv-veh span { display: block; font-size: .72rem; color: var(--bf-muted); text-transform: uppercase; letter-spacing: .04em; }
.bf-nv-veh strong { font-size: 1.05rem; letter-spacing: .03em; }
.bf-nv-veh.is-missing { border-color: var(--bf-red); background: var(--bf-red-50); }
.bf-nv-veh.is-missing strong { color: var(--bf-red-600); font-size: .9rem; letter-spacing: 0; }
.bf-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.bf-doc {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--bf-line); border-left-width: 4px; border-radius: var(--bf-radius-sm);
  padding: 10px 12px; background: var(--bf-surface);
}
.bf-doc > .fas { font-size: 1.15rem; margin-top: 2px; }
.bf-doc span { display: block; font-size: .72rem; color: var(--bf-muted); text-transform: uppercase; letter-spacing: .04em; }
.bf-doc strong { display: block; font-variant-numeric: tabular-nums; }
.bf-doc small { display: block; font-size: .78rem; }
.bf-doc-ok { border-left-color: var(--bf-success); }
.bf-doc-ok > .fas, .bf-doc-ok small { color: var(--bf-success-600); }
.bf-doc-warn { border-left-color: var(--bf-warning); }
.bf-doc-warn > .fas, .bf-doc-warn small { color: #b45309; }
.bf-doc-crit { border-left-color: var(--bf-danger); background: var(--bf-red-50); }
.bf-doc-crit > .fas, .bf-doc-crit small { color: var(--bf-danger); }
.bf-doc-none { border-left-color: #c9ced6; }
.bf-doc-none > .fas, .bf-doc-none small { color: var(--bf-muted); }
.bf-nv-opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.bf-nv-opcion { position: relative; margin: 0; }
.bf-nv-opcion input { position: absolute; opacity: 0; pointer-events: none; }
.bf-nv-opcion span {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--bf-line); border-radius: var(--bf-radius-sm);
  padding: 7px 14px; cursor: pointer; font-weight: 500; background: var(--bf-surface); user-select: none;
}
.bf-nv-opcion input:checked + span { border-color: var(--bf-red); background: var(--bf-red-50); color: var(--bf-red-600); }
.bf-nv-opcion input:focus-visible + span { outline: 2px solid var(--bf-red); outline-offset: 2px; }
.bf-nv-triplet { width: 100%; }
.bf-nv-triplet td { padding: 0 4px 0 0; }
.bf-nv-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--bf-line-2); }

/* ---------- Ubicacion actual (migas, las arma buenfuturo.js desde el menu) ---------- */
.bf-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--bf-muted);
  padding: 2px .5rem 4px;
}
.bf-crumb a { color: var(--bf-muted); }
.bf-crumb a:hover { color: var(--bf-red); }
.bf-crumb .bf-crumb-sep { color: #c3c8d0; }
.bf-crumb strong { color: var(--bf-ink); font-weight: 600; }

/* ---------- Mapas (analisis_mapa.asp, analisis_ubicaciones.asp) ---------- */
.bf-map { height: 520px; border-radius: var(--bf-radius-sm); border: 1px solid var(--bf-line); margin: 6px 0 10px; z-index: 0; }
.bf-map-lg { height: 620px; }
@media (max-width: 767.98px) { .bf-map, .bf-map-lg { height: 420px; } }
.bf-badge-ok { background: #e7f6ec; color: #166534; }
a.bf-badge:hover { text-decoration: none; filter: brightness(.96); }
#bf-mapa-tabla tbody tr { cursor: pointer; }
#bf-mapa-tabla tbody tr.is-sel td { background: var(--bf-red-50); }
.bf-ubi-tools { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.bf-ubi-tools input[type=search] { max-width: 240px; }
.bf-ubi { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 14px; align-items: start; }
@media (max-width: 991.98px) { .bf-ubi { grid-template-columns: minmax(0, 1fr); } }
.bf-ubi-mapa { position: sticky; top: 12px; }
.bf-ubi-scroll { max-height: 640px; overflow: auto; margin: -4px -6px; }
.bf-ubi-table { width: 100%; font-size: .84rem; border-collapse: collapse; }
.bf-ubi-table th { position: sticky; top: 0; background: var(--bf-surface); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--bf-muted); padding: 6px 8px; border-bottom: 2px solid var(--bf-line); }
.bf-ubi-table td { padding: 6px 8px; border-bottom: 1px solid var(--bf-line-2); vertical-align: top; }
.bf-ubi-table tbody tr { cursor: pointer; }
.bf-ubi-table tbody tr:hover td { background: var(--bf-bg); }
.bf-ubi-table tbody tr.is-sel td { background: var(--bf-red-50); }
.bf-ubi-sel { min-height: 46px; }
.bf-ubi-sel-head { display: flex; align-items: center; gap: 8px; }
.bf-ubi-res { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; max-height: 180px; overflow: auto; }
.bf-ubi-res-item { text-align: left; border: 1px solid var(--bf-line); background: var(--bf-surface); border-radius: var(--bf-radius-sm); padding: 5px 8px; font-size: .8rem; }
.bf-ubi-res-item:hover { border-color: var(--bf-red); background: var(--bf-red-50); }
.bf-ubi-res-item .fas { color: var(--bf-red); margin-right: 4px; }
.bf-ubi-sel-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.bf-ubi-aviso { font-size: .8rem; margin-top: 4px; min-height: 1em; }
.bf-ubi-aviso.is-ok { color: var(--bf-success-600); }
.bf-ubi-aviso.is-error { color: var(--bf-danger); }

/* ---------- Esquinas rectas en todo el sistema (2026-10-21) ----------
   Anula el redondeo de Bootstrap/AdminLTE. Los circulos (.img-circle, .rounded-circle) se mantienen. */
.card, .card-header, .card-footer, .card-body,
.btn, .btn-group > .btn, .form-control, .custom-select, .custom-file-label,
.input-group-text, .input-group > .form-control, .input-group > .custom-select,
.badge, .alert, .callout, .dropdown-menu, .dropdown-item, .modal-content,
.page-link, .page-item:first-child .page-link, .page-item:last-child .page-link,
.nav-pills .nav-link, .nav-tabs .nav-link, .list-group-item, .list-group-item:first-child, .list-group-item:last-child,
.info-box, .info-box .info-box-icon, .small-box, .progress, .toast, .tooltip-inner, .popover,
.select2-container--default .select2-selection--single, .select2-container--default .select2-selection--multiple, .select2-dropdown,
.main-sidebar .nav-link, .nav-sidebar .nav-link, .navbar-search-block .form-control,
.table, .table-responsive, .rounded, .rounded-sm, .rounded-lg, .rounded-top, .rounded-bottom, .rounded-left, .rounded-right {
  border-radius: 0 !important;
}
