/* Panel del proveedor. Prefijo pv- para no chocar con styles.css ni con el
 * pa- del panel del cliente.
 *
 * Reunión del 17/08 (02:03:28, 02:07:49): "la vista del proveedor debe ser una
 * versión simplificada y limitada de la vista de administrador". Por eso las
 * medidas, los radios y la tipografía son los mismos que en panel.css: es el
 * mismo producto visto desde el otro lado del mostrador, no otra aplicación.
 * Lo que cambia es el contenido, no el lenguaje visual.
 */

.pv-overlay {
    /* Corta el encadenado del scroll: al llegar al final, la tienda de detrás
       no se pone a rodar sola. */
    overscroll-behavior: contain;
    position: fixed;
    inset: 0;
    z-index: 6100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
    background: rgba(15, 17, 21, .72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: pv-aparece .18s ease-out;
}
/* `safe center` y no `center` a secas: centrado, pero cuando la caja es más
   alta que la ventana —la rejilla de objetivos son doce meses— se pega arriba
   en vez de desbordar por los dos lados y dejar la cabecera fuera de alcance. */
.pv-overlay-detalle { z-index: 6200; align-items: safe center; }

@keyframes pv-aparece { from { opacity: 0 } to { opacity: 1 } }
@media (prefers-reduced-motion: reduce) { .pv-overlay { animation: none } }

.pv-caja {
    --pv-pad: 28px;
    width: 100%;
    max-width: 1140px;
    padding: 26px var(--pv-pad) 32px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
}
.pv-caja-detalle { max-width: 820px; }
.pv-caja.pv-ocupado { opacity: .55; pointer-events: none; }

.pv-cargando { padding: 48px; text-align: center; color: #6c757d; }
.pv-error { color: #e03131; padding: 24px 0; }

/* ── Cabecera ───────────────────────────────────────────────────────────── */
.pv-cabecera {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 22px;
}
.pv-logo {
    width: 46px; height: 46px;
    object-fit: contain;
    border-radius: 10px;
    background: #f5f5f7;
    padding: 4px;
    flex-shrink: 0;
}
.pv-titulos { flex: 1; min-width: 0; }
.pv-titulos h2 {
    font-size: 22px; font-weight: 700; letter-spacing: -.02em;
    margin: 0 0 4px; color: #1d1d1f;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pv-sub { font-size: 13px; color: #86868b; margin: 0; }

.pv-cerrar {
    width: 34px; height: 34px;
    border: 0; border-radius: 50%;
    background: #f0f0f4; color: #1d1d1f;
    font-size: 17px; line-height: 1; cursor: pointer;
    flex-shrink: 0;
}
.pv-cerrar:hover { background: #e4e4ea; }

/* Distintivos: verificado, plan y rol. Dicen de un vistazo con qué permisos
   estás mirando, que es la pregunta que más se hace en una cuenta compartida. */
.pv-chip {
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .05em;
    padding: 3px 8px; border-radius: 6px;
    background: #f0f0f4; color: #6e6e73;
    white-space: nowrap;
}
.pv-chip-verificado { background: #e7f1ff; color: #0071e3; }
.pv-chip-plan       { background: #f3ecff; color: #7c3aed; }
.pv-chip-rol        { background: #eaf7ef; color: #1a7f45; }

/* Aviso de alcance: un comercial tiene que saber que NO lo está viendo todo,
   o dará por hecho que la empresa vende menos de lo que vende. */
.pv-alcance {
    background: #fff8e6;
    border: 1px solid #ffe1a8;
    color: #7a5200;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 20px;
}

/* ── Resumen ────────────────────────────────────────────────────────────── */
.pv-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}
.pv-kpi {
    background: #f5f5f7;
    border-radius: 14px;
    padding: 16px 18px;
}
.pv-kpi-et {
    font-size: 12px; color: #86868b; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em;
    margin-bottom: 6px;
}
.pv-kpi-n {
    font-size: 26px; font-weight: 700; color: #1d1d1f;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

/* ── Filtros por estado ─────────────────────────────────────────────────── */
.pv-estados {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-bottom: 16px;
}
.pv-estado-btn {
    border: 1px solid var(--apple-border, #d2d2d7);
    background: #fff; color: #1d1d1f;
    border-radius: 20px; padding: 7px 14px;
    font: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 7px;
}
.pv-estado-btn:hover { border-color: #b9b9c0; }
.pv-estado-btn.es-activo {
    background: #1d1d1f; color: #fff; border-color: #1d1d1f;
}
.pv-estado-n {
    font-size: 11px; font-weight: 700;
    background: rgba(0, 0, 0, .07); color: inherit;
    border-radius: 20px; padding: 1px 7px;
    font-variant-numeric: tabular-nums;
}
.pv-estado-btn.es-activo .pv-estado-n { background: rgba(255, 255, 255, .22); }

.pv-buscador {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--apple-border, #d2d2d7);
    border-radius: 12px;
    font: inherit; font-size: 15px;
    margin-bottom: 16px;
    box-sizing: border-box;
}

/* ── Tabla de pedidos ───────────────────────────────────────────────────── */
.pv-tabla-caja { overflow-x: auto; }
.pv-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 720px;
}
.pv-tabla th {
    text-align: left;
    font-size: 11px; font-weight: 700; color: #86868b;
    text-transform: uppercase; letter-spacing: .05em;
    padding: 10px 12px;
    border-bottom: 1px solid #e8e8ed;
    white-space: nowrap;
}
.pv-tabla td {
    padding: 12px;
    border-bottom: 1px solid #f2f2f7;
    vertical-align: middle;
}
.pv-tabla tbody tr { cursor: pointer; }
.pv-tabla tbody tr:hover { background: #fafafc; }
.pv-num { font-weight: 600; color: #1d1d1f; white-space: nowrap; }
.pv-der { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv-tenue { color: #86868b; font-size: 12.5px; }

/* Pastilla de estado. El color es información, no decoración: en un almacén se
   mira la columna entera de un vistazo para saber qué queda por preparar. */
.pv-pastilla {
    display: inline-block;
    font-size: 12px; font-weight: 600;
    padding: 4px 10px; border-radius: 20px;
    white-space: nowrap;
}
.pv-p-pendiente  { background: #fff4e6; color: #b45309; }
.pv-p-preparando { background: #e7f1ff; color: #0058b0; }
.pv-p-enviado    { background: #f3ecff; color: #6d28d9; }
.pv-p-entregado  { background: #eaf7ef; color: #15803d; }
.pv-p-cancelado  { background: #fdecea; color: #c1121f; }

.pv-vacio { padding: 40px; text-align: center; color: #86868b; }

/* ── Ficha de un pedido ─────────────────────────────────────────────────── */
.pv-ficha-datos {
    background: #f5f5f7;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 18px;
    font-size: 14px;
}
.pv-ficha-datos p { margin: 0 0 6px; }
.pv-ficha-datos p:last-child { margin-bottom: 0; }

.pv-acciones {
    display: flex; flex-wrap: wrap; gap: 10px;
    align-items: center;
    margin-top: 18px;
}
.pv-select {
    padding: 11px 14px;
    border: 1px solid var(--apple-border, #d2d2d7);
    border-radius: 12px;
    font: inherit; font-size: 14px; font-weight: 600;
    background: #fff; cursor: pointer;
}
.pv-btn {
    border: 0; border-radius: 12px;
    padding: 11px 18px;
    font: inherit; font-size: 14px; font-weight: 600;
    background: #1d1d1f; color: #fff;
    cursor: pointer;
}
.pv-btn:hover:not(:disabled) { background: #000; }
.pv-btn:disabled { opacity: .5; cursor: default; }
.pv-btn-sec { background: #f0f0f4; color: #1d1d1f; }
.pv-btn-sec:hover:not(:disabled) { background: #e4e4ea; }

.pv-aviso { font-size: 13px; color: #6e6e73; margin: 10px 0 0; }

/* ── Secciones ──────────────────────────────────────────────────────────── */
.pv-seccion { margin-top: 30px; }
.pv-seccion h3 {
    font-size: 15px; font-weight: 700; color: #1d1d1f;
    margin: 0 0 12px;
    display: flex; align-items: baseline; gap: 8px;
}
.pv-seccion h3 small { font-size: 12px; font-weight: 400; color: #86868b; }

@media (max-width: 700px) {
    .pv-caja { --pv-pad: 18px; padding: 20px var(--pv-pad) 26px; border-radius: 16px; }
    .pv-overlay { padding: 12px 8px; }
    .pv-titulos h2 { font-size: 19px; }
}

/* ── Zonas de reparto y tarifas ──────────────────────────────────────────────
   La pantalla que más pesa del panel: sin fila en cobertura_proveedor para una
   provincia, el proveedor no sale en la tienda de los restaurantes de allí.   */

.pv-z-barra {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    padding: 11px 16px;
    background: #f7fbff;
    border: 1px solid rgba(0, 113, 227, .2);
    border-radius: 14px;
    font-size: 13.5px;
    color: #1d1d1f;
}
.pv-z-barra span { margin-right: auto; }

.pv-aviso-suave {
    background: #fff8e6;
    border-color: rgba(200, 150, 0, .25);
    color: #6b5200;
}

.pv-campos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}
.pv-campo { display: flex; flex-direction: column; gap: 5px; }
.pv-campo > span { font-size: 13px; font-weight: 600; color: #1d1d1f; }
.pv-campo input {
    padding: 10px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.pv-campo input:focus {
    border-color: #0071e3;
    box-shadow: 0 0 0 3.5px rgba(0, 113, 227, .15);
}
.pv-campo small { font-size: 11.5px; color: #86868b; line-height: 1.35; }

.pv-z-acciones { display: flex; gap: 8px; margin-bottom: 12px; }

/* 52 provincias: rejilla que se adapta, y con scroll propio para que el botón
   de guardar no se vaya al fondo de todo. */
.pv-z-rejilla {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
    border: 1px solid #e8e8ed;
    border-radius: 12px;
}

.pv-z-prov {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 9px;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
    transition: background .15s ease;
}
.pv-z-prov:hover { background: #f5f5f7; }
.pv-z-prov.es-marcada { background: #f0f6ff; font-weight: 600; }
.pv-z-prov input { accent-color: #0071e3; cursor: pointer; flex-shrink: 0; }
.pv-z-prov span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Cada ficha de la rejilla ahora es provincia + (si tiene) su desplegable de
   subzonas, así que el grid pinta este contenedor y no la etiqueta suelta. */
.pv-z-item { display: flex; flex-direction: column; opacity: 1; }

/* Contador/botón para desplegar las subzonas de una provincia. Un número
   pequeño en vez de una flecha: dice de un vistazo cuántas hay marcadas sin
   tener que abrir el desplegable. */
.pv-z-desplegar {
    flex-shrink: 0;
    min-width: 20px; height: 20px;
    padding: 0 5px;
    border: 1px solid #d2d2d7;
    border-radius: 7px;
    background: #fff;
    color: #6e6e73;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    cursor: pointer;
}
.pv-z-desplegar:hover { border-color: #0071e3; color: #0071e3; }

.pv-z-subzonas {
    overflow: hidden;
    padding: 2px 9px 8px 31px;
}
.pv-z-subzonas .pv-tenue { margin: 0 0 6px; font-size: 11.5px; }

.pv-z-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.pv-z-chip {
    --chip-color: #0071e3;
    padding: 4px 10px;
    border: 1.5px solid var(--chip-color);
    border-radius: 999px;
    background: #fff;
    color: var(--chip-color);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.pv-z-chip:hover { background: color-mix(in srgb, var(--chip-color) 12%, #fff); }
.pv-z-chip.es-marcada { background: var(--chip-color); color: #fff; }

/* ── Equipo ──────────────────────────────────────────────────────────────── */
.pv-campo select {
    padding: 11px 14px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    font: inherit; font-size: 14px;
    background: #fff; cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.pv-campo select:focus { border-color: #0071e3; box-shadow: 0 0 0 3.5px rgba(0, 113, 227, .15); }

.pv-eq-lista { display: flex; flex-direction: column; gap: 10px; }

.pv-eq-fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid #e8e8ed;
    border-radius: 14px;
}
.pv-eq-fila.es-revocada { opacity: .6; }

.pv-eq-persona { display: flex; align-items: center; gap: 12px; min-width: 0; }

.pv-eq-avatar {
    flex-shrink: 0;
    width: 38px; height: 38px;
    border-radius: 50%;
    background: #0071e3;
    color: #fff;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.pv-eq-info { min-width: 0; }
.pv-eq-nombre { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-weight: 650; }
.pv-eq-zonas { margin-top: 2px; }

.pv-chip-revocado { background: #fdecec; color: #c0392b; }

.pv-eq-acciones { display: flex; gap: 8px; flex-shrink: 0; }

.pv-btn-peligro { background: #fdecec; color: #c0392b; }
.pv-btn-peligro:hover:not(:disabled) { background: #fadada; }

.pv-eq-revocados { margin-top: 12px; }
.pv-eq-revocados summary { cursor: pointer; color: #6e6e73; font-size: 13px; font-weight: 600; }
.pv-eq-revocados .pv-eq-lista { margin-top: 10px; }

/* El formulario de invitar/editar cuelga justo debajo de su fila (o del botón
   "+ Invitar"), no en un modal encima del modal: es un ajuste rápido, no una
   pantalla nueva. */
.pv-eq-editor:not([hidden]) {
    margin-top: 10px;
    padding: 14px;
    border: 1px solid #e8e8ed;
    border-radius: 14px;
    background: #fafafc;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pv-eq-zona { display: flex; flex-direction: column; gap: 8px; }

.pv-z-rejilla-compacta { max-height: 220px; }

.pv-eq-form-acciones {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}
.pv-eq-form-acciones .pv-tenue { margin-right: auto; }

@media (max-width: 640px) {
    .pv-z-rejilla { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); max-height: 260px; }
    .pv-z-barra { flex-wrap: wrap; }
    .pv-z-barra span { width: 100%; }
    .pv-eq-fila { flex-direction: column; align-items: stretch; }
    .pv-eq-acciones { width: 100%; }
    .pv-eq-acciones button { flex: 1; }
}

/* ── Catálogo ─────────────────────────────────────────────────────────────
   La pantalla del "encargado de productos" que Josep separó del gestor en la
   reunión del 28/08. Reutiliza .pv-campo/.pv-campos del formulario de equipo:
   es el mismo panel, no otra aplicación. */

.pv-cat-filtros {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.pv-cat-filtros .pv-buscador { flex: 1 1 240px; margin: 0; }
.pv-cat-filtros .pv-select   { flex: 0 0 auto; }

/* Con scroll propio, por lo mismo que la rejilla de provincias: con 119
   referencias la caja crecía a 9.405 px y el botón de "Nueva referencia" se iba
   al fondo del todo. */
.pv-cat-lista {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(60vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
}

/* Nombre elástico, y precio y stock en columnas fijas: así los importes quedan
   alineados de arriba abajo y se comparan de un vistazo. */
.pv-cat-fila {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 110px auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e8e8ed;
    border-radius: 14px;
}

.pv-cat-info   { min-width: 0; }
.pv-cat-nombre {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-weight: 600; color: #1d1d1f;
}

.pv-cat-precio { text-align: right; font-variant-numeric: tabular-nums; }
.pv-cat-precio strong { font-size: 15px; }
.pv-cat-antes  { color: #86868b; text-decoration: line-through; font-size: 13px; }
.pv-cat-stock  { text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; }

.pv-chip-oferta  { background: #fdecef; color: #c2185b; }
.pv-chip-agotado { background: #fdecec; color: #b3261e; }

.pv-cat-form   { display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 2px; }
.pv-cat-oferta {
    display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
}
.pv-cat-oferta .pv-campo { flex: 0 1 200px; }

.pv-campo select {
    padding: 10px 12px;
    border: 1px solid #d2d2d7;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    background: #fff;
    outline: none;
}
.pv-campo select:focus {
    border-color: #0071e3;
    box-shadow: 0 0 0 3.5px rgba(0, 113, 227, .15);
}

.pv-check {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; color: #1d1d1f;
    padding-bottom: 10px;
    cursor: pointer;
}
.pv-check input { width: 16px; height: 16px; accent-color: #0071e3; cursor: pointer; }

/* En móvil la rejilla de cuatro columnas no cabe: el precio y el stock pasan a
   ser una línea más bajo el nombre. */
@media (max-width: 640px) {
    .pv-cat-fila {
        grid-template-columns: minmax(0, 1fr) auto;
        row-gap: 8px;
    }
    .pv-cat-info    { grid-column: 1 / -1; }
    .pv-cat-precio  { text-align: left; }
    .pv-cat-stock   { text-align: right; }
    .pv-eq-acciones { grid-column: 1 / -1; }
}

/* ── Objetivos y logro ────────────────────────────────────────────────────
   Los cuatro recuadros de la pantalla de inicio del documento de Josep:
   objetivo, acumulado, % y barra. */

.pv-objetivos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.pv-obj {
    border: 1px solid #e8e8ed;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.pv-obj-et {
    font-size: 11px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: #6e6e73;
}
.pv-obj-meta  { font-size: 12.5px; color: #6e6e73; }
.pv-obj-cifra {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 8px; margin-top: 2px;
}
.pv-obj-cifra strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.pv-obj-pct {
    font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
    padding: 2px 8px; border-radius: 6px;
    background: #f0f0f4; color: #48484d;
    white-space: nowrap;
}
.pv-obj-pct.es-logrado { background: #eaf7ef; color: #1a7f45; }
.pv-obj-sub { font-size: 12px; color: #86868b; }

.pv-obj-barra {
    height: 6px; border-radius: 999px; background: #ececf1;
    overflow: hidden; margin-top: 6px;
}
.pv-obj-barra > span {
    display: block; height: 100%; border-radius: 999px;
    background: #0071e3;
    transition: width .4s ease;
}
@media (prefers-reduced-motion: reduce) { .pv-obj-barra > span { transition: none } }

/* Rejilla de meses × rutas */
.pv-obj-tabla th[scope="row"] { text-align: left; white-space: nowrap; font-weight: 600; }
.pv-obj-tabla td { padding: 4px 6px; }
.pv-obj-in {
    width: 100%; min-width: 110px;
    padding: 7px 10px;
    border: 1px solid #d2d2d7;
    border-radius: 8px;
    font-family: inherit; font-size: 14px;
    text-align: right; font-variant-numeric: tabular-nums;
    outline: none;
}
.pv-obj-in:focus {
    border-color: #0071e3;
    box-shadow: 0 0 0 3.5px rgba(0, 113, 227, .15);
}
.pv-obj-suma td {
    text-align: right; font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #6e6e73;
}
.pv-obj-tabla tfoot { border-top: 2px solid #e8e8ed; }

/* Reparto de la venta por procedencia, bajo cada recuadro de logro. */
.pv-obj-proc {
    display: flex; flex-direction: column; gap: 1px;
    margin-top: 8px; padding-top: 8px;
    border-top: 1px solid #f0f0f4;
    font-size: 11.5px; color: #6e6e73;
    font-variant-numeric: tabular-nums;
}
.pv-obj-proc span { display: flex; justify-content: space-between; gap: 8px; }
.pv-obj-proc i { font-style: normal; color: #86868b; }

/* ── Rutas (el rutero) ────────────────────────────────────────────────────── */
.pv-vista {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.pv-vista label { font-size: 13px; font-weight: 600; color: #6e6e73; }

.pv-ru-lista { display: flex; flex-direction: column; gap: 8px; }
.pv-ru-fila {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e8e8ed;
    border-radius: 14px;
}
.pv-ru-fila.es-archivada { opacity: .6; }
.pv-ru-info { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pv-ru-nombre {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-weight: 600; color: #1d1d1f;
}
.pv-ru-punto { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pv-ru-prefijos { display: flex; flex-wrap: wrap; gap: 5px; }

/* Una ruta sin prefijos no casa con ningún pedido: existe y no hace nada.
   Se avisa en rojo porque es un error silencioso, no una opción. */
.pv-ru-sinprefijos { font-size: 12px; color: #c1121f; }

.pv-ru-cifras { display: flex; gap: 18px; }
.pv-ru-cifras div { display: flex; flex-direction: column; text-align: right; }
.pv-ru-cifras strong { font-size: 15px; font-variant-numeric: tabular-nums; }

@media (max-width: 700px) {
    .pv-ru-fila { grid-template-columns: minmax(0, 1fr); }
    .pv-ru-cifras { justify-content: flex-start; }
    .pv-ru-cifras div { text-align: left; }
}

/* ── Segmentos ────────────────────────────────────────────────────────────── */

/* Los recuadros de logro pasan a ser botones: el que esté marcado manda sobre
   el desglose de segmentos, como la casilla del documento. */
.pv-obj {
    font: inherit;
    text-align: left;
    cursor: pointer;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.pv-obj:hover { border-color: #c7c7cf; }
.pv-obj.es-marcado {
    border-color: #1d1d1f;
    box-shadow: 0 0 0 1px #1d1d1f;
}
.pv-obj:focus-visible { outline: 2px solid #0071e3; outline-offset: 2px; }

.pv-seg { margin-bottom: 22px; }
.pv-seg-total {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 10px 0 12px;
    border-bottom: 1px solid #e8e8ed;
    margin-bottom: 10px;
    font-size: 14px; color: #6e6e73;
}
.pv-seg-total strong { font-size: 18px; color: #1d1d1f; font-variant-numeric: tabular-nums; }

.pv-seg-fila {
    display: grid;
    grid-template-columns: minmax(120px, 1.2fr) minmax(60px, 2fr) 62px 110px;
    align-items: center;
    gap: 12px;
    padding: 7px 0;
    font-size: 14px;
}
.pv-seg-nombre { font-weight: 600; color: #1d1d1f; }
/* La sangría es el rango: nivel 1 a ras, los subsegmentos dentro. */
.pv-seg-n2 { font-size: 13px; }
.pv-seg-n2 .pv-seg-nombre { padding-left: 16px; font-weight: 500; color: #48484d; }
.pv-seg-n3 { font-size: 13px; }
.pv-seg-n3 .pv-seg-nombre { padding-left: 32px; font-weight: 400; color: #6e6e73; }

.pv-seg-barra { height: 6px; border-radius: 999px; background: #ececf1; overflow: hidden; }
.pv-seg-barra i { display: block; height: 100%; background: #0071e3; border-radius: 999px; }
.pv-seg-n2 .pv-seg-barra i { background: #6ba4ee; }
.pv-seg-n3 .pv-seg-barra i { background: #a8c8f5; }

.pv-seg-pct { text-align: right; font-variant-numeric: tabular-nums; color: #6e6e73; }
.pv-seg-eur { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.pv-seg-vacios { margin-top: 10px; }

@media (max-width: 640px) {
    .pv-seg-fila { grid-template-columns: minmax(0, 1fr) 58px 100px; }
    .pv-seg-barra { display: none; }
}

/* ── Mi zona ──────────────────────────────────────────────────────────────
   El match geográfico del 02/09 en pantalla. Mismas medidas que .pv-ru-fila
   para que las dos listas del panel se lean igual. */

.pv-mk-resumen {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 4px 0 18px;
}
.pv-mk-dato {
    display: flex; flex-direction: column; gap: 2px;
    padding: 14px 16px;
    border: 1px solid #e8e8ed;
    border-radius: 14px;
}
/* "Por captar" es el número por el que se paga la provincia: es el que hay
   que mirar primero, así que se marca como el recuadro activo del cabezal. */
.pv-mk-dato-destacado { border-color: #1d1d1f; }
.pv-mk-num { font-size: 26px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }

.pv-mk-filtros { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 10px; }
.pv-mk-chip {
    border: 1px solid #e8e8ed;
    background: #fff;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px; font-weight: 600; color: #6e6e73;
    cursor: pointer;
}
.pv-mk-chip.es-activo { background: #1d1d1f; border-color: #1d1d1f; color: #fff; }
.pv-mk-select {
    border: 1px solid #e8e8ed; border-radius: 999px;
    padding: 7px 12px; font-size: 13px; font-weight: 600; color: #1d1d1f;
    background: #fff; cursor: pointer; margin-left: auto;
}

.pv-mk-lista { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.pv-mk-fila {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e8e8ed;
    border-radius: 14px;
}
/* Quien no compra todavía va en gris claro: la lista se recorre buscando
   huecos, no clientes. */
.pv-mk-fila:not(.es-cliente) { background: #fbfbfd; }
.pv-mk-info { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pv-mk-nombre {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-weight: 600; color: #1d1d1f;
}
.pv-mk-cifras { text-align: right; }
.pv-mk-importe { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pv-mk-sin { font-style: italic; }
.pv-mk-nota { margin-top: 16px; }

.pv-chip-cliente   { background: #eaf7ef; color: #1a7f45; }
.pv-chip-potencial { background: #fff4e5; color: #8a5300; }
.pv-chip-segmento  { background: #f0f0f5; color: #6e6e73; }

@media (max-width: 640px) {
    .pv-mk-resumen { grid-template-columns: 1fr; }
    .pv-mk-fila { grid-template-columns: minmax(0, 1fr); }
    .pv-mk-cifras { text-align: left; }
    .pv-mk-select { margin-left: 0; width: 100%; }
}

/* ── Pedido en nombre del cliente ──────────────────────────────────────────
   El comercial en la puerta del restaurante (02/09). Mismas medidas que
   .pv-mk-fila: las dos listas del panel se leen igual. */

.pv-mk-pedir {
    margin-top: 8px;
    border: 1px solid #1d1d1f;
    background: #1d1d1f;
    color: #fff;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 12.5px; font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.pv-mk-pedir:hover { background: #000; }

/* La lista se acota y hace su propio scroll, como `.pv-cat-lista`.
 *
 * Sin esto la caja crecía con la lista: medido en móvil, 6.896 px de alto para
 * una ventana de 812. El overlay acababa desplazándose entero, el pie con el
 * total y el botón de enviar quedaban a seis pantallas de distancia y la
 * cabecera se perdía por arriba. El catálogo, con 597 filas, ocupa 754 px
 * porque hace justo esto. */
.pv-pd-lista {
    display: flex; flex-direction: column; gap: 6px;
    margin-top: 12px;
    max-height: min(60vh, 560px);
    overflow-y: auto;
    /* El rebote del scroll no arrastra la página de detrás. */
    overscroll-behavior: contain;
}
.pv-pd-fila {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid #e8e8ed;
    border-radius: 12px;
}
/* Lo que ya está en el pedido se marca: con sesenta productos en pantalla,
   el comercial tiene que ver de un vistazo qué lleva puesto. */
.pv-pd-fila.es-elegido { border-color: #1d1d1f; background: #fafafa; }
.pv-pd-info { min-width: 0; }
.pv-pd-nombre { font-weight: 600; color: #1d1d1f; font-size: 14px; }
.pv-pd-cant { display: flex; align-items: center; gap: 6px; }
.pv-pd-menos, .pv-pd-mas {
    width: 30px; height: 30px;
    border: 1px solid #e8e8ed; background: #fff;
    border-radius: 8px; font-size: 16px; line-height: 1;
    cursor: pointer; color: #1d1d1f;
}
.pv-pd-num {
    width: 54px; height: 30px; text-align: center;
    border: 1px solid #e8e8ed; border-radius: 8px;
    font-size: 14px; font-variant-numeric: tabular-nums;
    /* Sin las flechas del navegador: al lado de − y + son tres controles
       para lo mismo y en móvil no se acierta a ninguno. */
    -moz-appearance: textfield;
}
.pv-pd-num::-webkit-outer-spin-button,
.pv-pd-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.pv-pd-pie {
    position: sticky; bottom: 0;
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap;
    margin-top: 18px; padding: 14px 0 4px;
    background: #fff;
    border-top: 1px solid #e8e8ed;
}
.pv-pd-resumen { font-weight: 700; font-size: 15px; }
.pv-pd-error {
    margin-top: 14px; padding: 10px 14px;
    background: #fdecec; color: #b3261e;
    border-radius: 10px; font-size: 13.5px;
}

.pv-pd-hecho { text-align: center; padding: 40px 20px; }
.pv-pd-tic {
    width: 56px; height: 56px; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: #eaf7ef; color: #1a7f45;
    font-size: 26px; font-weight: 700;
}
.pv-pd-hecho h2 { margin: 0 0 6px; }
.pv-pd-hecho .pv-btn { margin-top: 18px; }

@media (max-width: 640px) {
    .pv-pd-fila { grid-template-columns: minmax(0, 1fr); }
    .pv-pd-cant { justify-content: flex-end; }
    .pv-pd-pie { flex-direction: column; align-items: stretch; }
    .pv-pd-pie .pv-btn { width: 100%; }
}

/* ── WhatsApp ─────────────────────────────────────────────────────────────
   Josep, 07/09 (00:21:30): "un acceso rápido a WhatsApp desde la plataforma".
   Aparece donde ya se enseña el teléfono del cliente —la ficha del pedido y la
   lista de Mi zona— y solo ahí: en Mi zona los negocios que todavía no compran
   no traen teléfono del servidor, y ese silencio es deliberado.

   Verde de marca sobre fondo claro para que se reconozca de un vistazo, pero
   en tamaño de enlace y no de botón: al lado del `tel:` son dos maneras de
   hacer lo mismo y ninguna debe pesar más que el dato. */
.pv-wa {
    display: inline-flex; align-items: center; gap: 5px;
    margin-left: 8px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #e9f8ef;
    color: #128c3e;
    font-size: 12.5px; font-weight: 600;
    text-decoration: none;
    vertical-align: middle;
    white-space: nowrap;
}
.pv-wa:hover { background: #d8f2e2; color: #0e7132; }
.pv-wa svg { flex-shrink: 0; }

/* Los dos filtros de la cabecera —ruta y segmento— en una sola línea. Cada uno
   trae su propio `.pv-vista`, que ya no lleva el margen inferior: lo pone el
   contenedor una vez, o quedaría un hueco doble entre ellos. */
.pv-filtros-vista {
    display: flex; align-items: center; gap: 10px 22px; flex-wrap: wrap;
    margin-bottom: 16px;
}
.pv-filtros-vista .pv-vista { margin-bottom: 0; }

/* El aviso de "aquí no hay objetivo con el que comparar". Ámbar y no rojo: no
   es un error, es que la pregunta cambió. */
.pv-obj-aviso {
    margin: 0 0 12px;
    padding: 10px 14px;
    background: #fff8e6;
    border: 1px solid #f3e2b3;
    border-radius: 12px;
    font-size: 13px; color: #6b5312;
}

/* "· 2 festivos" debajo del objetivo diario: subrayado de puntos para que se
   vea que hay algo que leer al pasar el ratón, sin llamar más la atención que
   la cifra que tiene encima. */
.pv-obj-fest {
    border-bottom: 1px dotted currentColor;
    cursor: help;
}
