/* ==========================================================================
   VAMOS PUES! · Hoja de estilo única
   Paleta extraída del logo: azul marino profundo + amarillo + naranja.
   Mobile-first. Sin desborde horizontal a 320 px.
   ========================================================================== */

:root {
    /* MARCA (del logo) */
    --vp-marino:        #0d2242;
    --vp-marino-2:      #16305a;
    --vp-marino-3:      #1d3d70;
    --vp-amarillo:      #ffc107;
    --vp-amarillo-2:    #ffdb4d;
    --vp-naranja:       #f57c00;
    --vp-rojo:          #e53935;

    /* NEUTROS */
    --vp-blanco:        #ffffff;
    --vp-gris-50:       #f6f8fb;
    --vp-gris-100:      #eef2f8;
    --vp-gris-200:      #dfe6f0;
    --vp-gris-400:      #9aa8bd;
    --vp-gris-600:      #5d6b82;
    --vp-texto:         #14213a;

    /* ESTADO (fijos: mismo significado en todo el sistema) */
    --vp-verde:         #1e9e5a;
    --vp-ambar:         #e8a100;
    --vp-rojo-estado:   #d9403c;

    /* FORMA */
    --vp-r-sm:  10px;
    --vp-r:     14px;
    --vp-r-lg:  20px;
    --vp-r-xl:  26px;
    --vp-sombra: 0 4px 18px rgba(13, 34, 66, .10);
    --vp-sombra-lg: 0 12px 40px rgba(13, 34, 66, .18);

    --vp-fuente: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ---------- BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    overflow-x: clip;            /* no crea contenedor de scroll */
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--vp-fuente);
    color: var(--vp-texto);
    background: var(--vp-gris-50);
    font-size: 16px;
    line-height: 1.5;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

[hidden] { display: none !important; }
.oculto { display: none !important; }
.solo-lector {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--vp-marino-3); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.2; font-weight: 800; }
h1 { font-size: clamp(1.5rem, 5vw, 2rem); }
h2 { font-size: clamp(1.15rem, 4vw, 1.4rem); }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 .75rem; }

/* ---------- CONTENEDOR ---------- */
.vp-envoltura {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}
.vp-envoltura--angosta { max-width: 480px; }
.vp-envoltura--media   { max-width: 760px; }

/* ---------- LOGO ---------- */
.vp-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.vp-logo:hover { text-decoration: none; }
.vp-logo__img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.vp-logo__caja {
    width: 46px; height: 46px;
    display: grid; place-items: center;
    flex: 0 0 auto;
    overflow: hidden;
}
.vp-logo__caja--redonda { border-radius: 50%; }
.vp-logo__texto { display: flex; flex-direction: column; line-height: 1.05; }
.vp-logo__marca {
    font-weight: 900;
    font-size: 1.1rem;
    letter-spacing: .5px;
    text-transform: uppercase;
}
.vp-logo__bajada {
    font-size: .62rem;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    opacity: .75;
    font-weight: 700;
}

/* ---------- BOTONES (área táctil mínima 44px) ---------- */
.vp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 12px 20px;
    border: 0;
    border-radius: var(--vp-r);
    font-family: inherit;
    font-size: .95rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
    background: var(--vp-gris-100);
    color: var(--vp-texto);
    -webkit-tap-highlight-color: transparent;
}
.vp-btn:hover { text-decoration: none; }
.vp-btn:active { transform: scale(.98); }
.vp-btn:focus-visible { outline: 3px solid var(--vp-naranja); outline-offset: 2px; }
.vp-btn[disabled], .vp-btn--cargando { opacity: .55; pointer-events: none; }

.vp-btn--primario {
    background: linear-gradient(135deg, var(--vp-amarillo) 0%, var(--vp-naranja) 100%);
    color: var(--vp-marino);       /* texto oscuro: pasa contraste AA */
    box-shadow: 0 6px 18px rgba(245, 124, 0, .32);
}
.vp-btn--marino {
    background: var(--vp-marino);
    color: var(--vp-blanco);
    box-shadow: 0 6px 18px rgba(13, 34, 66, .25);
}
.vp-btn--claro {
    background: var(--vp-blanco);
    color: var(--vp-marino);
    box-shadow: var(--vp-sombra);
}
.vp-btn--fantasma {
    background: transparent;
    color: var(--vp-marino);
    box-shadow: inset 0 0 0 2px var(--vp-gris-200);
}
.vp-btn--peligro {
    background: var(--vp-rojo-estado);
    color: var(--vp-blanco);
}
.vp-btn--bloque { width: 100%; }
.vp-btn--grande { min-height: 54px; font-size: 1.05rem; }
.vp-btn--chico  { min-height: 38px; padding: 8px 14px; font-size: .85rem; }

/* ---------- TARJETAS ---------- */
.vp-tarjeta {
    background: var(--vp-blanco);
    border-radius: var(--vp-r-lg);
    padding: 18px;
    box-shadow: var(--vp-sombra);
    min-width: 0;
}
.vp-tarjeta--plana { box-shadow: none; border: 1px solid var(--vp-gris-200); }
.vp-tarjeta__titulo {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: 1.1px;
    color: var(--vp-gris-600);
    font-weight: 800;
    margin: 0 0 10px;
}

/* ---------- FORMULARIOS ---------- */
.vp-campo { margin-bottom: 16px; min-width: 0; }
.vp-campo:last-child { margin-bottom: 0; }

.vp-label {
    display: block;
    font-size: .82rem;
    font-weight: 800;
    color: var(--vp-gris-600);
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: .6px;
}
.vp-label .vp-opcional { text-transform: none; letter-spacing: 0; font-weight: 600; opacity: .65; }

.vp-input, .vp-select, .vp-textarea {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 1rem;              /* 16px: evita el zoom automático de iOS */
    color: var(--vp-texto);
    background: var(--vp-gris-50);
    border: 2px solid var(--vp-gris-200);
    border-radius: var(--vp-r);
    transition: border-color .15s, background .15s;
    max-width: 100%;
}
.vp-input:focus, .vp-select:focus, .vp-textarea:focus {
    outline: none;
    border-color: var(--vp-naranja);
    background: var(--vp-blanco);
}
.vp-input::placeholder { color: var(--vp-gris-400); }
.vp-textarea { min-height: 100px; resize: vertical; line-height: 1.45; }

.vp-ayuda { font-size: .78rem; color: var(--vp-gris-600); margin: 6px 0 0; }

.vp-error-campo {
    font-size: .8rem;
    color: var(--vp-rojo-estado);
    font-weight: 700;
    margin: 6px 0 0;
    display: none;
}
.vp-campo--error .vp-input,
.vp-campo--error .vp-select,
.vp-campo--error .vp-textarea { border-color: var(--vp-rojo-estado); background: #fff5f5; }
.vp-campo--error .vp-error-campo { display: block; }

/* checkbox / radio con área táctil cómoda */
.vp-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    cursor: pointer;
    font-size: .92rem;
    line-height: 1.45;
}
.vp-check input[type="checkbox"],
.vp-check input[type="radio"] {
    flex: 0 0 auto;
    width: 22px; height: 22px;
    margin: 1px 0 0;
    accent-color: var(--vp-naranja);
    cursor: pointer;
}

/* ---------- ALERTAS ---------- */
.vp-alerta {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--vp-r);
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.45;
}
.vp-alerta--error   { background: #fdecea; color: #8c1d18; border-left: 4px solid var(--vp-rojo-estado); }
.vp-alerta--ok      { background: #e7f6ed; color: #0d5c33; border-left: 4px solid var(--vp-verde); }
.vp-alerta--aviso   { background: #fff6e0; color: #7a4c00; border-left: 4px solid var(--vp-ambar); }
.vp-alerta--info    { background: #e8f0fb; color: #12365f; border-left: 4px solid var(--vp-marino-3); }

/* ---------- PASTILLAS DE ESTADO ---------- */
.vp-pastilla {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
    line-height: 1.6;
}
.vp-pastilla::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex: 0 0 auto;
}
.vp-pastilla--verde   { background: #e7f6ed; color: #16713f; }
.vp-pastilla--ambar   { background: #fff4d6; color: #8a5c00; }
.vp-pastilla--rojo    { background: #fdecea; color: #a01f1b; }
.vp-pastilla--gris    { background: var(--vp-gris-100); color: var(--vp-gris-600); }
.vp-pastilla--marino  { background: #e6ecf6; color: var(--vp-marino); }
.vp-pastilla--sin-punto::before { display: none; }

/* ---------- KPI ---------- */
.vp-rejilla {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
}
.vp-rejilla--2 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.vp-rejilla--kpi { grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); }

.vp-kpi {
    background: var(--vp-blanco);
    border-radius: var(--vp-r-lg);
    padding: 16px;
    box-shadow: var(--vp-sombra);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.vp-kpi__icono {
    width: 38px; height: 38px;
    border-radius: 11px;
    display: grid; place-items: center;
    font-size: 1.15rem;
    background: var(--vp-gris-100);
    color: var(--vp-marino);
    margin-bottom: 6px;
}
.vp-kpi__valor {
    font-size: clamp(1.3rem, 4.5vw, 1.7rem);
    font-weight: 900;
    line-height: 1.1;
    color: var(--vp-marino);
    word-break: break-word;
}
.vp-kpi__etiqueta {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--vp-gris-600);
    font-weight: 700;
}

/* ---------- TABLAS ---------- */
.vp-tabla-caja {
    background: var(--vp-blanco);
    border-radius: var(--vp-r-lg);
    box-shadow: var(--vp-sombra);
    overflow: hidden;
    min-width: 0;
}
.vp-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.vp-tabla th {
    text-align: left;
    padding: 12px 14px;
    background: var(--vp-gris-100);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .7px;
    color: var(--vp-gris-600);
    font-weight: 800;
    white-space: nowrap;
}
.vp-tabla td {
    padding: 12px 14px;
    border-top: 1px solid var(--vp-gris-100);
    vertical-align: middle;
}
.vp-tabla tbody tr:hover { background: var(--vp-gris-50); }
.vp-acciones-fila { display: flex; gap: 8px; flex-wrap: nowrap; }

/* ---------- VACÍO ---------- */
.vp-vacio {
    text-align: center;
    padding: 48px 20px;
    color: var(--vp-gris-600);
}
.vp-vacio__icono { font-size: 2.6rem; margin-bottom: 12px; opacity: .5; }
.vp-vacio h3 { color: var(--vp-texto); margin-bottom: 6px; }
.vp-vacio p { font-size: .9rem; margin: 0 auto; max-width: 340px; }

/* ---------- CABECERA APP MÓVIL ---------- */
.vp-cabecera {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--vp-marino);
    color: var(--vp-blanco);
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 12px rgba(13, 34, 66, .2);
}
.vp-cabecera__titulo { flex: 1; font-weight: 800; font-size: 1rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-cabecera__accion {
    width: 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: var(--vp-blanco);
    border: 0;
    cursor: pointer;
    font-size: 1.1rem;
    flex: 0 0 auto;
}

/* ---------- BARRA INFERIOR APP ---------- */
.vp-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    background: var(--vp-blanco);
    border-top: 1px solid var(--vp-gris-200);
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 20px rgba(13, 34, 66, .08);
}
.vp-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 58px;
    padding: 8px 4px;
    font-size: .66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--vp-gris-600);
    text-decoration: none;
    border: 0;
    background: none;
    cursor: pointer;
    font-family: inherit;
}
.vp-nav__item:hover { text-decoration: none; }
.vp-nav__item i { font-size: 1.2rem; }
.vp-nav__item--activo { color: var(--vp-naranja); }
.vp-con-nav { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

/* ---------- MAPA ---------- */
.vp-mapa {
    width: 100%;
    height: 320px;
    border-radius: var(--vp-r-lg);
    overflow: hidden;
    background: var(--vp-gris-200);
    position: relative;
    z-index: 0;
}
.vp-mapa--alto { height: 60dvh; min-height: 340px; }
.vp-mapa iframe, #mapa { width: 100%; height: 100%; border: 0; }

.vp-mapa__capa {
    position: absolute;
    left: 12px; right: 12px;
    bottom: 12px;
    z-index: 500;
    background: var(--vp-blanco);
    border-radius: var(--vp-r);
    padding: 14px;
    box-shadow: var(--vp-sombra-lg);
}

/* ---------- LOGIN / REGISTRO ---------- */
.vp-acceso {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
    background:
        radial-gradient(circle at 15% 0%, rgba(255, 193, 7, .22), transparent 45%),
        radial-gradient(circle at 85% 100%, rgba(245, 124, 0, .20), transparent 45%),
        linear-gradient(160deg, var(--vp-marino) 0%, #14305c 55%, var(--vp-marino-2) 100%);
}
.vp-acceso__caja {
    width: 100%;
    max-width: 430px;
    background: var(--vp-blanco);
    border-radius: var(--vp-r-xl);
    padding: 26px 22px;
    box-shadow: var(--vp-sombra-lg);
}
.vp-acceso__logo { display: flex; justify-content: center; margin-bottom: 18px; }
.vp-acceso__logo .vp-logo__caja { width: 76px; height: 76px; }
.vp-acceso__titulo { text-align: center; margin-bottom: 4px; font-size: 1.35rem; }
.vp-acceso__sub { text-align: center; color: var(--vp-gris-600); font-size: .88rem; margin-bottom: 22px; }
.vp-acceso__pie { text-align: center; font-size: .82rem; color: var(--vp-gris-600); margin-top: 18px; }

/* Selector de rol: 3 opciones, una sola decisión */
.vp-roles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}
.vp-rol {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 12px 4px;
    border-radius: var(--vp-r);
    border: 2px solid var(--vp-gris-200);
    background: var(--vp-gris-50);
    cursor: pointer;
    font-size: .74rem;
    font-weight: 800;
    color: var(--vp-gris-600);
    text-align: center;
    transition: all .15s;
}
.vp-rol i { font-size: 1.35rem; }
.vp-rol input { position: absolute; opacity: 0; pointer-events: none; }
.vp-rol:has(input:checked) {
    border-color: var(--vp-naranja);
    background: #fff8e8;
    color: var(--vp-marino);
}

/* ---------- INSTALAR APP (login) ---------- */
.vp-instalar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: var(--vp-r);
    background: var(--vp-gris-50);
    border: 1px dashed var(--vp-gris-200);
    width: 100%;
    border-width: 1px;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
}
.vp-instalar__icono { font-size: 1.3rem; color: var(--vp-naranja); flex: 0 0 auto; }
.vp-instalar__texto { min-width: 0; }
.vp-instalar__titulo { display: block; font-size: .84rem; font-weight: 800; color: var(--vp-texto); }
.vp-instalar__nota { display: block; font-size: .72rem; color: var(--vp-gris-600); }

/* ---------- PANTALLA DE ESTADO DEL CONDUCTOR ---------- */
.vp-estado-grande {
    border-radius: var(--vp-r-xl);
    padding: 22px 18px;
    text-align: center;
    color: var(--vp-blanco);
    margin-bottom: 16px;
}
.vp-estado-grande--activo   { background: linear-gradient(140deg, #1e9e5a 0%, #14734a 100%); }
.vp-estado-grande--gracia   { background: linear-gradient(140deg, #f5a623 0%, #d18400 100%); }
.vp-estado-grande--suspendido { background: linear-gradient(140deg, #d9403c 0%, #9c2723 100%); }
.vp-estado-grande--revision { background: linear-gradient(140deg, #5d6b82 0%, #3b4557 100%); }
.vp-estado-grande__titulo { font-size: 1.15rem; font-weight: 900; margin-bottom: 4px; }
.vp-estado-grande__sub { font-size: .86rem; opacity: .92; margin: 0; }
.vp-estado-grande__plazo { font-size: 2rem; font-weight: 900; margin: 10px 0 2px; letter-spacing: -.5px; }

/* ---------- INTERRUPTOR EN LÍNEA ---------- */
.vp-interruptor {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px;
    border-radius: var(--vp-r-lg);
    background: var(--vp-blanco);
    box-shadow: var(--vp-sombra);
    margin-bottom: 16px;
}
.vp-interruptor__texto strong { display: block; font-size: 1rem; }
.vp-interruptor__texto span { font-size: .8rem; color: var(--vp-gris-600); }

.vp-switch {
    position: relative;
    width: 64px; height: 36px;
    border-radius: 999px;
    background: var(--vp-gris-200);
    border: 0;
    cursor: pointer;
    flex: 0 0 auto;
    transition: background .2s;
}
.vp-switch::after {
    content: '';
    position: absolute;
    top: 4px; left: 4px;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--vp-blanco);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    transition: transform .2s;
}
.vp-switch[aria-checked="true"] { background: var(--vp-verde); }
.vp-switch[aria-checked="true"]::after { transform: translateX(28px); }

/* ---------- TARJETA DE VIAJE / OFERTA ---------- */
.vp-viaje-card {
    background: var(--vp-blanco);
    border-radius: var(--vp-r-lg);
    padding: 16px;
    box-shadow: var(--vp-sombra);
    margin-bottom: 12px;
    border-left: 5px solid var(--vp-naranja);
}
.vp-viaje-card__ruta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.vp-punto-ruta {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: .9rem;
    min-width: 0;
}
.vp-punto-ruta__marca {
    width: 12px; height: 12px;
    border-radius: 50%;
    flex: 0 0 auto;
    margin-top: 5px;
}
.vp-punto-ruta__marca--origen { background: var(--vp-verde); }
.vp-punto-ruta__marca--destino { background: var(--vp-rojo-estado); }
.vp-punto-ruta__texto { min-width: 0; }
.vp-punto-ruta__texto strong { display: block; font-weight: 800; }
.vp-punto-ruta__texto small { color: var(--vp-gris-600); font-size: .78rem; }

.vp-precio-grande {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.vp-precio-grande__usd { font-size: 1.6rem; font-weight: 900; color: var(--vp-marino); }
.vp-precio-grande__bs  { font-size: .95rem; font-weight: 700; color: var(--vp-gris-600); }

/* ---------- MODALES ---------- */
.vp-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    background: rgba(13, 34, 66, .55);
    padding: 0;
    overflow-y: auto;
}
.vp-modal.abierto { display: flex; }
.vp-modal__caja {
    width: 100%;
    max-width: 560px;
    background: var(--vp-blanco);
    border-radius: var(--vp-r-xl) var(--vp-r-xl) 0 0;
    padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
    max-height: 92dvh;
    overflow-y: auto;
    animation: vp-subir .22s ease-out;
}
@keyframes vp-subir { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }

.vp-modal__cab { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.vp-modal__titulo { flex: 1; font-size: 1.1rem; margin: 0; }
.vp-modal__cerrar {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 0;
    background: var(--vp-gris-100);
    color: var(--vp-gris-600);
    font-size: 1.2rem;
    cursor: pointer;
    flex: 0 0 auto;
    display: grid; place-items: center;
}
.vp-modal__pie {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.vp-modal__pie .vp-btn { flex: 1; }
/* Primario a la derecha (convención) */
.vp-modal__pie .vp-btn--primario,
.vp-modal__pie .vp-btn--marino { order: 2; }
.vp-modal__pie .vp-btn--fantasma { order: 1; }

@media (min-width: 620px) {
    .vp-modal { align-items: center; padding: 24px; }
    .vp-modal__caja { border-radius: var(--vp-r-xl); }
}

/* ---------- PANEL ADMIN ---------- */
.vp-admin {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    min-height: 100dvh;
}
.vp-lateral {
    background: var(--vp-marino);
    color: var(--vp-blanco);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    grid-row: 1;
    grid-column: 1;
}
/* El velo del menu movil se saca del flujo del grid: si queda como hijo
   del .vp-admin, ocupa una celda y empuja el contenido a la columna de 250px. */
.vp-velo { position: fixed; inset: 0; }
.vp-contenido { grid-row: 1; grid-column: 2; }
.vp-lateral__marca { margin-bottom: 22px; padding: 0 8px; }
.vp-lateral__marca .vp-logo__marca { color: var(--vp-blanco); font-size: 1rem; }
.vp-lateral__marca .vp-logo__bajada { color: var(--vp-amarillo); opacity: 1; }

.vp-menu { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.vp-menu__item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: var(--vp-r-sm);
    color: rgba(255, 255, 255, .82);
    font-size: .88rem;
    font-weight: 700;
    text-decoration: none;
    min-height: 44px;
    transition: background .15s;
}
.vp-menu__item:hover { background: rgba(255, 255, 255, .09); text-decoration: none; color: var(--vp-blanco); }
.vp-menu__item--activo { background: var(--vp-naranja); color: var(--vp-blanco); }
.vp-menu__item i { font-size: 1.05rem; width: 20px; text-align: center; }
.vp-menu__badge {
    margin-left: auto;
    background: var(--vp-rojo-estado);
    color: var(--vp-blanco);
    font-size: .68rem;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 999px;
    min-width: 20px;
    text-align: center;
}
.vp-menu__cierre { display: none; }

.vp-contenido { padding: 22px; min-width: 0; }
.vp-contenido__cab {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.vp-contenido__cab h1 { margin: 0; flex: 1; min-width: 0; }

.vp-hamburguesa {
    display: none;
    width: 44px; height: 44px;
    border-radius: var(--vp-r-sm);
    background: var(--vp-marino);
    color: var(--vp-blanco);
    border: 0;
    font-size: 1.2rem;
    cursor: pointer;
}

/* ---- RESPONSIVE DEL PANEL ---- */
@media (max-width: 900px) {
    .vp-admin { grid-template-columns: minmax(0, 1fr); }
    .vp-hamburguesa { display: grid; place-items: center; }
    .vp-lateral {
        position: fixed;
        inset: 0 auto 0 0;
        width: 280px;
        max-width: 82vw;
        z-index: 200;
        display: none;
        height: 100dvh;
        box-shadow: var(--vp-sombra-lg);
    }
    .vp-lateral.abierto { display: flex; }
    .vp-menu__cierre {
        display: grid; place-items: center;
        position: absolute; top: 14px; right: 12px;
        width: 40px; height: 40px;
        border-radius: 50%;
        border: 0;
        background: rgba(255, 255, 255, .15);
        color: var(--vp-blanco);
        font-size: 1.1rem;
        cursor: pointer;
    }
    .vp-velo {
        position: fixed;
        inset: 0;
        background: rgba(13, 34, 66, .5);
        z-index: 150;
        display: none;
    }
    .vp-velo.abierto { display: block; }
    .vp-contenido { padding: 16px 14px 40px; }
}

/* ---- TABLAS EN MÓVIL: se desliza la tabla, no la página ---- */
@media (max-width: 760px) {
    .vp-tabla-caja { overflow-x: auto; }
    .vp-tabla { min-width: 560px; }
    .vp-tabla--lectura { min-width: 0; }
}

@media (max-width: 560px) {
    .vp-rejilla--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .vp-kpi { padding: 13px; }
    .vp-kpi__icono { width: 32px; height: 32px; font-size: 1rem; }
    .vp-kpi__valor { font-size: 1.25rem; }
    .vp-kpi__etiqueta { font-size: .66rem; }
    .vp-contenido__cab h1 { font-size: 1.2rem; }
}

/* ---------- ERROR 403 / 404 ---------- */
.vp-error-body {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--vp-gris-50);
}
.vp-error-card {
    background: var(--vp-blanco);
    border-radius: var(--vp-r-xl);
    padding: 36px 26px;
    text-align: center;
    max-width: 420px;
    box-shadow: var(--vp-sombra);
}
.vp-error-code { font-size: 3.2rem; font-weight: 900; color: var(--vp-naranja); line-height: 1; }
.vp-error-card h1 { font-size: 1.2rem; margin: 10px 0 8px; }
.vp-error-card p { color: var(--vp-gris-600); font-size: .9rem; margin-bottom: 20px; }

/* ---------- IMPRESIÓN ---------- */
@media print {
    .vp-nav, .vp-cabecera, .vp-lateral, .vp-hamburguesa, .vp-btn { display: none !important; }
    .vp-contenido { padding: 0; }
    .vp-tarjeta, .vp-kpi, .vp-tabla-caja { box-shadow: none; border: 1px solid #ccc; }
    body { background: #fff; }
}

/* ---------- MOVIMIENTO REDUCIDO ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
