/* ============================================================
   Estilos comunes para listados en formato tarjeta
   Usado en: Inventario, Habilitados, Insumos, Bonos, Ajustes, Ventas
   ============================================================ */

.list-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.list-card {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.list-card:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* ---------- Fila de cabecera ---------- */
.list-row {
  display: grid;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
}

.list-col {
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.list-label {
  color: #6c757d;
  font-size: 0.82rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.list-valor {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.list-col.destacado .list-valor {
  color: #198754;
  font-weight: 700;
}

.list-col.acciones {
  display: flex;
  gap: 0.35rem;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.list-col.acciones .btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- Detalle colapsable ---------- */
.list-detalle {
  background: #f8f9fa;
  border-top: 1px solid #dee2e6;
  padding: 0.75rem 1rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
  .list-row {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.5rem 0.75rem;
    padding: 0.6rem 0.75rem;
  }

  .list-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .list-col.acciones {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
  }

  .list-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
}

/* ============================================================
   Submenús desplegables del sidebar
   ============================================================ */
.sidebar .menu-group {
  margin-bottom: 0.25rem;
}

.sidebar .menu-group-toggle {
  color: #c2c7d0;
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  border-radius: 0.35rem;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.15s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 1rem;
}

.sidebar .menu-group-toggle:hover {
  background: #2c3e50;
  color: #fff;
}

.sidebar .menu-group-toggle[aria-expanded="true"] {
  background: #2c3e50;
  color: #fff;
}

.sidebar .menu-group-toggle .chevron {
  transition: transform 0.2s;
  font-size: 0.75rem;
}

.sidebar .menu-group-toggle[aria-expanded="true"] .chevron {
  transform: rotate(90deg);
}

.sidebar .menu-group-items {
  padding-left: 0.5rem;
  margin-top: 0.25rem;
}

.sidebar .menu-group-items a {
  padding: 0.5rem 1rem 0.5rem 2rem;
  font-size: 0.9rem;
  color: #a8b3c2;
}

.sidebar .menu-group-items a:hover {
  background: #007bff;
  color: #fff;
}

.sidebar .menu-group-items a i {
  margin-right: 0.5rem;
  font-size: 0.85rem;
}

/* Submenús en offcanvas móvil */
.offcanvas-menu .menu-group-toggle {
  color: #c2c7d0;
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 1rem;
  border-radius: 0.35rem;
  cursor: pointer;
  font-weight: 500;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.offcanvas-menu .menu-group-toggle:hover,
.offcanvas-menu .menu-group-toggle[aria-expanded="true"] {
  background: #007bff;
  color: #fff;
}

.offcanvas-menu .menu-group-toggle .chevron {
  transition: transform 0.2s;
}

.offcanvas-menu .menu-group-toggle[aria-expanded="true"] .chevron {
  transform: rotate(90deg);
}

.offcanvas-menu .menu-group-items a {
  padding-left: 2rem;
  font-size: 0.9rem;
}

/* ============================================================
   Estilos unificados para tablas del Balance
   ============================================================ */
.table-balance thead th {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
  padding: 0.6rem 0.5rem;
  white-space: nowrap;
  background-color: #f1f3f5;
  border-bottom: 2px solid #dee2e6;
}

.table-balance thead th small {
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: none;
  color: #6c757d;
  letter-spacing: 0;
}

.table-balance thead th.text-end {
  text-align: right !important;
}

.table-balance thead th.text-center {
  text-align: center !important;
}

.table-balance tbody td {
  font-size: 0.85rem;
  vertical-align: middle;
  padding: 0.5rem;
}

.table-balance tbody td.fw-bold {
  font-weight: 600;
}

.table-balance tfoot th {
  font-size: 0.85rem;
  font-weight: 700;
  vertical-align: middle;
  padding: 0.6rem 0.5rem;
}

/* Columnas fijas para evitar desajustes */
.table-balance .col-empresa {
  min-width: 140px;
}

.table-balance .col-combustible {
  min-width: 150px;
}

.table-balance .col-numero {
  min-width: 90px;
}

.table-balance .col-badge {
  min-width: 80px;
}

.table-balance .col-fecha {
  min-width: 110px;
}
