/* Inventario de sucursal (inventarioMulti.php) */
.iv, .iv-modal {
  --iv-surface: #ffffff;
  --iv-fondo: #f6f7f9;
  --iv-borde: #e1e4e8;
  --iv-texto: #1f2328;
  --iv-texto-2: #57606a;
  --iv-muted: #8c959f;
  --iv-acento: #2a78d6;
  --iv-bueno: #1a7f37;
  --iv-malo: #cf222e;
  --iv-aviso: #9a6700;
  color: var(--iv-texto);
}
.iv [hidden] { display: none !important; }
.demo, #demo-setting { display: none !important; }
.iv .iv-muted, .iv-modal .iv-muted { color: var(--iv-muted); }

.iv-head { margin-bottom: 12px; }
.iv-head .page-title { margin: 0 0 2px; }
.iv-head p { margin: 0; }
.iv-card { background: var(--iv-surface); border: 1px solid var(--iv-borde); border-radius: 6px; padding: 14px 16px; margin-bottom: 14px; }

/* Barra */
.iv-barra { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; }
.iv-campo { display: flex; flex-direction: column; gap: 4px; }
.iv-campo > label { font-weight: 600; margin: 0; font-size: 12px; color: var(--iv-texto-2); }
.iv-campo-suc { flex: 1 1 240px; max-width: 340px; }
.iv-barra .select2-container .select2-selection--single { height: 32px; border-color: #ccc; }
.iv-barra .select2-container .select2-selection--single .select2-selection__rendered { line-height: 30px; }
.iv-barra .select2-container .select2-selection--single .select2-selection__arrow { height: 30px; }
.iv-acciones { display: flex; flex-wrap: wrap; gap: 6px; }
.iv-hora { flex-basis: 100%; }

/* Avisos */
.iv-aviso { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 6px; border: 1px solid #d4a72c; background: #fff8c5; margin-bottom: 10px; }
.iv-aviso .fa { margin-top: 3px; }
.iv-aviso.error { border-color: #f5a3a8; background: #ffebe9; color: #82071e; }
.iv-aviso.ok { border-color: #8ddb9e; background: #dafbe1; color: #116329; }

.iv-vacio { text-align: center; padding: 36px 16px; color: var(--iv-texto-2); }
.iv-vacio .fa { font-size: 34px; color: var(--iv-muted); margin-bottom: 10px; }
.iv-vacio p { margin: 0 0 4px; }

/* Estado del inventario */
.iv-estado-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.iv-estado-head h3 { margin: 0 0 4px; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.iv-estado-acc { display: flex; flex-wrap: wrap; gap: 6px; }
.iv-progreso { height: 8px; background: #eceef1; border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.iv-progreso > div { height: 100%; background: var(--iv-bueno); border-radius: 4px; transition: width .3s; }
.iv-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.iv-pill.ok { background: #dafbe1; color: #116329; }
.iv-pill.proceso { background: #fff4d6; color: var(--iv-aviso); }
.iv-pill.grande { font-size: 13px; padding: 3px 12px; }
.iv-nota { margin: 10px 0 0; font-size: 11px; }

/* Tablas */
.iv-tabla { width: 100%; border-collapse: collapse; font-size: 13px; }
.iv-tabla th, .iv-tabla td { padding: 7px 8px; border-bottom: 1px solid var(--iv-borde); vertical-align: middle; }
.iv-tabla thead th { background: var(--iv-fondo); font-size: 12px; font-weight: 600; color: var(--iv-texto-2); position: sticky; top: 0; z-index: 1; }
.iv-tabla tbody tr:hover td { background: #f8fafc; }
.iv-tabla .num { text-align: right; white-space: nowrap; }
.iv-tabla .col-acc { text-align: right; width: 1%; white-space: nowrap; }
.iv-tabla .col-estado { width: 1%; white-space: nowrap; font-size: 12px; }
.iv-tabla td small { display: block; color: var(--iv-muted); font-size: 11px; }
.iv-unidad { color: var(--iv-muted); font-size: 11px; }
.iv-sin-datos { text-align: center; padding: 22px !important; }
.iv-num input { width: 96px; padding: 4px 8px; border: 1px solid #d0d7de; border-radius: 4px; text-align: right; font-variant-numeric: tabular-nums; }
.iv-num input:focus { outline: none; border-color: var(--iv-acento); box-shadow: 0 0 0 2px rgba(42, 120, 214, .2); }
.iv-tabla tr[data-estado="ok"] .col-estado { color: var(--iv-bueno); }
.iv-tabla tr[data-estado="guardando"] .col-estado { color: var(--iv-acento); }
.iv-tabla tr[data-estado="error"] .col-estado { color: var(--iv-malo); }
.iv-tabla tr[data-estado="error"] .iv-num input { border-color: var(--iv-malo); }
.iv-tabla tr[data-estado="ok"] .iv-num input { border-color: #b7e1c1; background: #f3faf5; }
.iv-error-txt { font-size: 11px; }

/* Modales: alto fijo, encabezado y pie fijos, scroll solo en el cuerpo */
.iv-modal .modal-content { display: flex; flex-direction: column; max-height: 88vh; }
.iv-modal .modal-body { overflow-y: auto; flex: 1 1 auto; padding-top: 10px; }
.iv-modal .modal-header small { display: block; margin-top: 2px; }
.iv-modal .modal-footer { display: flex; align-items: center; justify-content: space-between; }
.iv-buscar { margin-bottom: 8px; height: 30px !important; }

@media (max-width: 767px) {
  .iv-campo-suc { flex-basis: 100%; max-width: none; }
  .iv-acciones .btn { flex: 1 1 auto; }
  .iv-num input { width: 76px; }
}

/* Revisión de secciones antes de iniciar */
.iv-revision { margin: 0 0 14px; font-size: 12px; }
.iv-revision.ok { color: var(--iv-bueno); }
.iv-faltan { margin: 6px 0 10px; padding-left: 18px; }
.iv-faltan li { margin-bottom: 2px; }

/* Verificar inventario (modal) */
.iv-modal [hidden] { display: none !important; }
.iv-pill.malo { background: #ffebe9; color: #82071e; }
.iv-malo { color: var(--iv-malo); }
.iv-ver-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.iv-ver-datos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 16px; margin: 0 0 14px;
  padding: 12px 14px; background: var(--iv-fondo); border: 1px solid var(--iv-borde); border-radius: 6px; }
.iv-ver-datos dt { font-size: 11px; font-weight: 600; color: var(--iv-texto-2); text-transform: uppercase; letter-spacing: .02em; }
.iv-ver-datos dd { margin: 2px 0 0; font-size: 13px; }
.iv-ver-cifras { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.iv-ver-cifras > div { border: 1px solid var(--iv-borde); border-radius: 6px; padding: 8px 10px; text-align: center; }
.iv-ver-cifras b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.iv-ver-cifras span { font-size: 11px; color: var(--iv-texto-2); }
.iv-ver-cifras .ok b { color: var(--iv-bueno); }
.iv-ver-cifras .proceso b { color: var(--iv-aviso); }
.iv-ver-cifras .malo b { color: var(--iv-malo); }
.iv-ver-sub { margin: 14px 0 6px; font-weight: 600; }
@media (max-width: 767px) {
  .iv-ver-cifras { grid-template-columns: repeat(2, 1fr); }
}

/* Pestañas de Verificar inventario */
.iv-tabs { display: flex; gap: 4px; margin: 10px 0 -15px; border-bottom: 1px solid var(--iv-borde); }
.iv-tabs button { background: none; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; padding: 6px 14px;
  font-size: 13px; color: var(--iv-texto-2); margin-bottom: -1px; }
.iv-tabs button:hover { color: var(--iv-texto); }
.iv-tabs button.activo { background: var(--iv-surface); border-color: var(--iv-borde); color: var(--iv-texto); font-weight: 600; }
.iv-ver-filtros { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-bottom: 14px; }
.iv-campo-corte { flex: 1 1 260px; }
