/* Ingredientes y Catálogos de sucursal (catalogos_pagina.php). Se carga después de platillos.css (estilo base .pl). */

/* Permisos especiales: body.sin-X oculta los elementos .perm-X */
body.sin-editar .perm-editar,
body.sin-enviar .perm-enviar,
body.sin-bitacora .perm-bitacora,
body.sin-editar_sucursal .perm-editar_sucursal { display: none !important; }

.pl .pl-toolbar { align-items: stretch; }
.pl .ctg-ayuda { flex: 1 1 320px; margin: 0; padding: 8px 12px; }
.pl .ctg-cargando { display: none; padding: 30px; text-align: center; color: #8a96a8; }
.pl .ctg-aviso { padding: 11px 14px; margin-bottom: 14px; border: 1px solid #f5c2c2; border-radius: 8px; background: #fdecec; color: #991b1b; }
.pl .ctg-error { padding: 10px 14px; margin-bottom: 14px; border: 1px solid #f5c2c2; border-radius: 8px; background: #fdecec; color: #991b1b; font-size: 13px; }
.pl .ctg-form { padding: 16px 18px; background: #fff; border: 1px solid #e3e8ef; border-radius: 10px; }

#tablaCatalogo .ctg-codigo { font-family: Consolas, monospace; color: #475569; white-space: nowrap; }
#tablaCatalogo td b { white-space: nowrap; }
.pl .ctg-falta { display: inline-block; padding: 0 7px; border: 1px dashed #f0c48a; border-radius: 999px; color: #b45309; font-family: 'Open Sans', sans-serif; font-size: 11px; font-weight: 700; }
.pl .ctg-tag { display: inline-block; padding: 0 7px; margin-left: 4px; border-radius: 999px; background: #f1f3f6; color: #64748b; font-size: 10px; font-weight: 800; text-transform: uppercase; vertical-align: 1px; }
.pl .ctg-sub { display: block; margin-top: 1px; font-size: 11px; color: #8a96a8; }
.pl .nowrap { white-space: nowrap; }
.pl .dt-toolbar { margin-bottom: 12px; }

/* Bitácora */
.pl .ctg-filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 260px)); gap: 12px; align-items: end; margin-bottom: 12px; }
.pl .ctg-filtro-btn { align-self: end; }
.pl .ctg-filtro-elemento { display: inline-block; padding: 5px 12px; margin-bottom: 10px; border-radius: 999px; background: #eff4ff; color: #1d4ed8; font-size: 12px; }
.pl .ctg-filtro-elemento a { margin-left: 6px; }

/* Sucursales del envío de varios */
.pl .ctg-sucs { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.pl .ctg-sucs label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 9px 11px; border: 1px solid #e3e8ef; border-radius: 8px; background: #fff; font-weight: 500; cursor: pointer; }
.pl .ctg-sucs label:has(input:checked) { border-color: #2563eb; background: #eff4ff; }
.pl .ctg-res td { vertical-align: top !important; }

/* Color del estado también dentro de las celdas (la regla de la tabla le ganaba) */
.pl .table td.estado-ok, .pl .table td .estado-ok { color: #15803d !important; font-weight: 700; }
.pl .table td.estado-error, .pl .table td .estado-error { color: #c02626 !important; font-weight: 700; }
.pl .table td.text-warning, .pl .table td .text-warning { color: #b45309 !important; font-weight: 700; }

/* Editor de receta (preparados) */
.pl .ctg-receta { margin-top: 6px; }
.pl .ctg-agregar-linea { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.pl .ctg-agregar-linea .ctg-al-insumo { flex: 1; min-width: 0; }
.pl .ctg-agregar-linea #recetaCantidad { width: 130px; flex: 0 0 130px; }
.pl .ctg-receta .pl-tabla-receta { margin-bottom: 6px; }
.pl .ctg-receta .pl-tabla-receta td .form-control { height: 30px !important; padding: 3px 8px; }
.pl .ctg-receta .ctg-cant-unidad { display: inline-block; width: 74px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.pl .ctg-receta .pl-form-seccion small { font-weight: 500; }

/* Matriz por sucursal (catalogos_matriz.js): conflicto = el envío fallaría (repetido en la sucursal o nombre con otro código) */
.pl-mx td.c.conf, .pl-mx-c.conf { background: #dc2626; }
.pl-mx td.c.conf .fa-ban { color: #fff; }
#panelMatriz { padding-top: 4px; }
