/* WF-54 (1-dic-2026) · Estilo profesional compartido de listas operativas: Órdenes, Picking, Packing, Embarque.
   Marca CTI: navy #0B1B4B, lime #C4E000. Solo afecta a .fl-* (y .fl-skin en Órdenes); el resto del WMS no cambia. */

.fl-card {
  background: #fff;
  border: 1px solid var(--line, #d5dbe6);
  border-radius: 12px;
  padding: 0;
  margin: 0 0 1rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(11, 27, 75, 0.04);
}
.fl-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem 0.7rem;
  border-bottom: 1px solid #e8ecf3;
  border-left: 4px solid #c4e000;
}
.fl-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #0b1b4b;
  letter-spacing: 0.01em;
}
.fl-head .fl-head-meta {
  font-size: 0.8rem;
  color: #5b6b86;
}
.fl-head .fl-head-meta strong { color: #0b1b4b; }

/* Barra de filtros compacta */
.fl-filters {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.55rem 0.7rem;
  align-items: end;
  padding: 0.8rem 1.1rem 0.75rem;
  background: #f8f9fc;
  border-bottom: 1px solid #e8ecf3;
}
.fl-card .fl-filters label.field,
.fl-filters .field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #5b6b86;
  min-width: 0;
}
.fl-card .fl-filters .field input:not([type="checkbox"]):not([type="radio"]),
.fl-card .fl-filters .field select {
  height: 2.1rem;
  min-height: 0;
  padding: 0 0.55rem;
  font: 400 0.82rem/1.2 Poppins, system-ui, sans-serif;
  text-transform: none;
  letter-spacing: 0;
  color: #0b1b4b;
  background: #fff;
  border: 1px solid #cfd6e3;
  border-radius: 8px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.fl-filters .field input:focus,
.fl-filters .field select:focus {
  outline: none;
  border-color: #0b1b4b;
  box-shadow: 0 0 0 3px rgba(196, 224, 0, 0.45);
}
.fl-filters .fl-q { grid-column: span 2; }
.fl-filters .fl-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: flex-end;
  grid-column: -2 / -1;
}
.fl-filters .fl-actions .btn {
  height: 2.1rem;
  min-height: 0;
  padding: 0 0.95rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

/* Chips de filtros activos */
.fl-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  border-bottom: 1px solid #e8ecf3;
}
.fl-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  font-size: 0.75rem;
  color: #0b1b4b;
  background: #eef1f8;
  border: 1px solid #d9dfeb;
  border-radius: 999px;
  text-decoration: none;
}
.fl-chip:hover { background: #f4f9d6; border-color: #c4e000; }
.fl-chip-k { color: #5b6b86; font-weight: 600; }
.fl-chip-x { font-weight: 700; color: #5b6b86; }
.fl-chip-clear { font-size: 0.75rem; margin-left: 0.25rem; color: #1f3e8c; }

/* Conteo por estatus (pestañas compactas) */
.fl-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.6rem 1.1rem;
  border-bottom: 1px solid #e8ecf3;
}
.fl-count {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  color: #33415c;
  background: #fff;
  border: 1px solid #d9dfeb;
  border-radius: 999px;
  text-decoration: none;
}
.fl-count strong {
  font-variant-numeric: tabular-nums;
  color: #0b1b4b;
  font-weight: 600;
}
.fl-count.is-active {
  background: #0b1b4b;
  border-color: #0b1b4b;
  color: #fff;
}
.fl-count.is-active strong { color: #c4e000; }

/* Tabla uniforme */
.fl-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fl-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font: 400 0.78rem/1.35 Poppins, system-ui, sans-serif;
  color: #1c2a4a;
}
.fl-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.48rem 0.45rem;
  text-align: left;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5b6b86;
  background: #f3f5f9;
  border-bottom: 1px solid #dfe4ee;
  white-space: nowrap;
}
.fl-table tbody td {
  padding: 0.48rem 0.45rem;
  border-bottom: 1px solid #eef1f6;
  vertical-align: top;
  white-space: nowrap;
}
.fl-table tbody tr:nth-child(even) td { background: #fbfcfe; }
.fl-table tbody tr.fl-row-link { cursor: pointer; }
.fl-table tbody tr.fl-row-link:hover td,
.fl-table tbody tr.fl-row-link:focus td { background: #f7fbe3; }
.fl-table tbody tr.fl-row-link:focus { outline: 2px solid #c4e000; outline-offset: -2px; }
.fl-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.fl-table .fl-folio a,
.fl-table a.fl-folio {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0b1b4b;
  text-decoration: none;
}
.fl-table .fl-folio a:hover { text-decoration: underline; }
.fl-table td.fl-date { color: #33415c; font-variant-numeric: tabular-nums; }
.fl-table .fl-wrap { white-space: normal; min-width: 5rem; max-width: 9rem; overflow-wrap: anywhere; }
.fl-fecha, .fl-lugar { display: inline-flex; flex-direction: column; line-height: 1.25; }
.fl-hora, .fl-lugar-sub { font-size: 0.72rem; color: #5b6b86; }
.fl-lugar-sub.fl-muted { color: #8fa0b8; }
.fl-muted, .fl-empty-ref { color: #8fa0b8; }
.fl-empty-ref { font-style: italic; font-size: 0.76rem; }

.fl-client { display: inline-flex; flex-direction: column; text-decoration: none; color: inherit; line-height: 1.25; }
.fl-client .fl-code { font-weight: 600; color: #0b1b4b; font-variant-numeric: tabular-nums; }
.fl-client .fl-client-name { font-size: 0.72rem; color: #5b6b86; max-width: 9.5rem; overflow: hidden; text-overflow: ellipsis; }
a.fl-client:hover .fl-client-name { color: #1f3e8c; text-decoration: underline; }

.fl-refs { display: inline-flex; flex-wrap: wrap; gap: 0.2rem; max-width: 10rem; white-space: normal; }
.fl-ref {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.72rem;
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  background: #eef1f8;
  color: #1f3e8c;
  text-decoration: none;
  white-space: nowrap;
}
.fl-ref:hover { background: #e2e8f5; text-decoration: underline; }
.fl-ref-more { background: #fff; border: 1px dashed #cfd6e3; }

.fl-qty { display: inline-flex; flex-direction: column; align-items: flex-end; text-decoration: none; color: inherit; }
.fl-qty .fl-qty-u { font-variant-numeric: tabular-nums; white-space: nowrap; }
.fl-qty .fl-qty-u strong { color: #0b1b4b; font-weight: 600; }
.fl-qty abbr { text-decoration: none; font-size: 0.72rem; color: #5b6b86; font-weight: 600; }
.fl-qty .fl-qty-sub { font-size: 0.7rem; color: #5b6b86; white-space: normal; max-width: 8.5rem; text-align: right; }
a.fl-qty:hover .fl-qty-u strong { text-decoration: underline; }

/* Estatus como badge */
.fl-table .chip,
.fl-badge {
  text-transform: none;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.fl-table .chip::before,
.fl-badge::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}
.fl-table .chip-ok { background: #edf7e8; color: #2d6a1e; border-color: #cfe8c4; }
.fl-table .chip-status, .fl-table .chip-temp { background: #eaf0fb; color: #1f3e8c; border-color: #cfdcf3; }
.fl-table .chip-warn { background: #fdf4e3; color: #8a5a10; border-color: #f0dcb0; }
.fl-table .chip-off { background: #f1f3f6; color: #66758f; border-color: #dfe4ec; }

.fl-actions-cell { text-align: right; }
.fl-actions-cell .btn { height: 1.8rem; min-height: 0; padding: 0 0.7rem; font-size: 0.75rem; border-radius: 7px; }

/* Paginación */
.fl-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 1.1rem;
  font-size: 0.78rem;
  color: #5b6b86;
}
.fl-pager-info strong { color: #0b1b4b; font-variant-numeric: tabular-nums; }
.fl-pages { display: inline-flex; gap: 0.25rem; align-items: center; }
.fl-page {
  min-width: 1.9rem;
  height: 1.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9dfeb;
  border-radius: 7px;
  color: #0b1b4b;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  background: #fff;
}
.fl-page.is-current { background: #0b1b4b; color: #c4e000; border-color: #0b1b4b; font-weight: 600; }
.fl-page[aria-disabled="true"] { opacity: 0.4; }
.fl-page-gap { padding: 0 0.2rem; }

.fl-empty { padding: 1.6rem 1.1rem; text-align: center; color: #5b6b86; }
.fl-empty h3 { margin: 0 0 0.3rem; color: #0b1b4b; font-size: 0.95rem; }
.fl-error { margin: 0.75rem 1.1rem; }

/* Tarjetas en pantallas angostas (celular): la tabla se desplaza; el resto apila. */
@media (max-width: 720px) {
  .fl-filters { grid-template-columns: 1fr 1fr; }
  .fl-filters .fl-q, .fl-filters .fl-actions { grid-column: 1 / -1; }
  .fl-pager { flex-direction: column; align-items: flex-start; }
}

/* Órdenes: mismo acabado sobre su tabla y filtros existentes (sin cambiar su lógica). */
.fl-skin table.catalog thead th {
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5b6b86;
  background: #f3f5f9;
}
.fl-skin table.catalog td { font-size: 0.8rem; }
.fl-skin table.catalog .cell-qty { text-align: right; font-variant-numeric: tabular-nums; }
.fl-skin table.catalog tbody tr.row-link:hover td { background: #f7fbe3; }
.fl-skin .orders-filters { background: #f8f9fc; border: 1px solid #e8ecf3; border-radius: 10px; padding: 0.75rem 0.9rem; }
.fl-skin .orders-filters .field { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: #5b6b86; }
.fl-skin .orders-filters .field input,
.fl-skin .orders-filters .field select { text-transform: none; letter-spacing: 0; font-size: 0.82rem; font-weight: 400; color: #0b1b4b; }
.fl-skin .card-head { border-left: 4px solid #c4e000; padding-left: 0.7rem; }
.fl-skin .fl-chips { padding: 0.55rem 0; border-bottom: 0; }

.fl-table th:first-child, .fl-table td:first-child { padding-left: 1.1rem; }
.fl-table th:last-child, .fl-table td:last-child { padding-right: 1.1rem; }

/* WF-55 (1-dic-2026) · Existencias (portal y WMS): lote, caducidad con insignia, cantidades alineadas a la derecha. */
.ex-list .fl-table-wrap { max-height: 72vh; overflow: auto; }
.ex-list .fl-table { min-width: 64rem; }
.fl-nowrap { white-space: nowrap; }
.ex-desc-cell { min-width: 12rem; max-width: 19rem; white-space: normal !important; }
.ex-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.ex-code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.76rem; font-weight: 600; color: #0b1b4b; }
.ex-sku { display: inline-flex; align-items: center; gap: 0.45rem; color: inherit; text-decoration: none; }
a.ex-sku:hover .ex-code { text-decoration: underline; }
.ex-stack { display: inline-flex; flex-direction: column; gap: 0.12rem; line-height: 1.25; }
.ex-sub { font-size: 0.7rem; color: #5b6b86; font-weight: 400; }
.ex-faltante { color: #8a5a10; font-size: 0.74rem; font-style: italic; }
.ex-cad-cell { display: inline-flex; flex-direction: column; gap: 0.2rem; align-items: flex-start; }
.ex-fecha { font-variant-numeric: tabular-nums; color: #0b1b4b; font-weight: 500; }
.ex-num { color: #0b1b4b; font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums; }
.ex-num:hover { text-decoration: underline; }
.fl-badge.ex-cad::before { display: none; }
.fl-badge.ex-cad { padding: 0.08rem 0.5rem; font-size: 0.68rem; }
.ex-cad-vencido { background: #fdecec; color: #9b1c1c; border-color: #f4c7c7; }
.ex-cad-15 { background: #fff0e0; color: #9a4a00; border-color: #f6d3a8; }
.ex-cad-30 { background: #fdf4e3; color: #8a5a10; border-color: #f0dcb0; }
.ex-cad-60 { background: #f6fad4; color: #55640a; border-color: #dfe99a; }
.ex-cad-vigente { background: #edf7e8; color: #2d6a1e; border-color: #cfe8c4; }
.ex-card-fields .ex-cad-cell { flex-direction: row; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.ex-card .ex-desc { margin: 0.2rem 0 0.35rem; }
.ex-card-kardex { display: inline-block; margin: 0 0.85rem 0.6rem; font-size: 0.78rem; color: #1f3e8c; }
.ex-filters .fl-actions { display: flex; align-items: flex-end; gap: 0.4rem; }
@media (max-width: 720px) {
  .ex-list .fl-table { min-width: 56rem; }
}
.ex-card-extra { padding: 0 0.85rem 0.6rem; }
.ex-cards { display: none; gap: 0.65rem; padding: 0.7rem 1.1rem 1rem; }
@media (max-width: 720px) {
  .ex-desktop { display: none !important; }
  .ex-cards { display: grid; }
}
/* WF-55: más compacta para que Lote, Caducidad, Cantidad y Disponible / Reservado / Retenido entren sin desplazarse. */
.ex-list .fl-table thead th { letter-spacing: 0.03em; padding: 0.48rem 0.35rem; font-size: 0.62rem; }
.ex-list .fl-table tbody td { padding: 0.48rem 0.35rem; }
.ex-list .ex-sku img.sku-thumb { width: 26px; height: 26px; border-radius: 6px; }
.ex-list .ex-desc-cell { min-width: 10.5rem; max-width: 14rem; }
.ex-list .fl-table { min-width: 0; }
.ex-list .fl-qty .fl-qty-sub { max-width: 6rem; }
.ex-list .fl-table th:first-child, .ex-list .fl-table td:first-child { padding-left: 0.6rem; }
.ex-list .fl-table th:last-child, .ex-list .fl-table td:last-child { padding-right: 0.6rem; }
.ex-list .ex-desc-cell { min-width: 9.5rem; max-width: 12.5rem; }
.ex-list .fl-lugar { white-space: nowrap; }
.ex-list .fl-table .chip { padding: 0.1rem 0.45rem; }
.ex-card .ex-desc { display: -webkit-box !important; -webkit-line-clamp: 2; font-size: 0.86rem; font-weight: 600; color: #0b1b4b; }
.ex-card .ex-card-fields { grid-template-columns: 1fr 1fr; gap: 0.4rem 0.7rem; }
.ex-card .ex-card-fields dd { font-size: 0.82rem; }
.ex-card .ex-card-fields .ex-cad-cell { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
.ex-card .ex-card-fields > div { display: flex !important; flex-direction: column; gap: 0.1rem; min-width: 0; }
.ex-card .ex-card-fields dd { overflow-wrap: anywhere; font-weight: 600; color: #0b1b4b; }
.ex-card .ex-card-fields dt { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.04em; color: #5b6b86; }
