/* ==========================================================
   Portada del administrador (/menu) — REMAR Gestión
   Menú lateral verde oscuro, tarjetas blancas suaves y acentos verde REMAR.
   ========================================================== */

.ap {
    --ap-oscuro: #0b3b1c;
    --ap-oscuro-2: #14602f;
    --ap-verde: #2e9b3f;
    --ap-lima: #9bd13a;
    --ap-fondo: #f3f8ee;
    --ap-texto: #14301c;
    --ap-suave: #6b7c70;
    --ap-linea: #e3ecdc;
    display: grid;
    grid-template-columns: 270px 1fr;
    min-height: 100vh;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--ap-texto);
    background: var(--ap-fondo);
}

.ap *, .ap *::before, .ap *::after { box-sizing: border-box; }
.ap a { color: inherit; text-decoration: none; }
.ap-ico { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ---------- menú lateral ---------- */
.ap-side {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
    padding: 1.4rem 1rem 1rem;
    color: #fff;
    background:
        radial-gradient(circle at 0% 100%, rgba(155, 209, 58, .28) 0, transparent 55%),
        linear-gradient(180deg, var(--ap-oscuro) 0%, var(--ap-oscuro-2) 100%);
    overflow-y: auto;
}
.ap-side__logo { display: flex; align-items: center; gap: .6rem; padding: 0 .4rem 1.2rem; }
.ap-side__logo img { height: 54px; width: auto; }
.ap-side__logo span { font-size: 1.05rem; font-weight: 600; letter-spacing: .06em; color: var(--ap-lima); text-transform: uppercase; }

.ap-nav { display: flex; flex-direction: column; gap: .25rem; }
.ap-nav__item {
    display: flex; align-items: center; gap: .75rem;
    width: 100%; padding: .72rem .9rem;
    border: 0; border-radius: 14px; cursor: pointer;
    background: transparent; color: rgba(255, 255, 255, .88);
    font: inherit; font-size: .95rem; font-weight: 500; text-align: left;
    transition: background .18s, color .18s;
}
.ap-nav__item:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.ap-nav__item.activo { background: linear-gradient(90deg, var(--ap-lima), #c6e86a); color: var(--ap-oscuro); font-weight: 700; box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
.ap-nav__grupo span { flex: 1; }
.ap-chevron { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform .2s; opacity: .7; }
.ap-nav__grupo.abierto .ap-chevron { transform: rotate(180deg); }
.ap-nav__grupo.abierto { background: rgba(255, 255, 255, .08); color: #fff; }
.ap-nav__sub { display: flex; flex-direction: column; margin: 0 0 .3rem 1.55rem; padding-left: .8rem; border-left: 2px solid rgba(155, 209, 58, .45); }
.ap-nav__sub a { padding: .42rem .6rem; border-radius: 8px; font-size: .86rem; color: rgba(255, 255, 255, .8); }
.ap-nav__sub a:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.ap-side__pie { margin-top: auto; padding-top: 1rem; border-top: 1px solid rgba(255, 255, 255, .15); }

/* ---------- zona principal ---------- */
.ap-main { min-width: 0; display: flex; flex-direction: column; }
.ap-top {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 1rem;
    padding: .85rem 2rem;
    background: rgba(243, 248, 238, .9); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--ap-linea);
}
.ap-burger { display: none; border: 0; background: #fff; border-radius: 12px; width: 42px; height: 42px; cursor: pointer; color: var(--ap-oscuro); box-shadow: 0 2px 8px rgba(20, 60, 30, .12); }
.ap-burger .ap-ico { margin: auto; }

.ap-buscar { position: relative; flex: 1; max-width: 520px; display: flex; align-items: center; gap: .6rem; padding: 0 1rem; height: 46px; background: #fff; border: 1px solid var(--ap-linea); border-radius: 999px; box-shadow: 0 2px 10px rgba(20, 60, 30, .06); }
.ap-buscar .ap-ico { color: var(--ap-suave); }
.ap-buscar input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: .93rem; color: var(--ap-texto); min-width: 0; }
.ap-buscar:focus-within { border-color: var(--ap-verde); box-shadow: 0 0 0 3px rgba(46, 155, 63, .15); }
.ap-buscar__res { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: #fff; border-radius: 16px; box-shadow: 0 14px 36px rgba(20, 60, 30, .2); padding: .4rem; z-index: 30; }
.ap-buscar__res a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .6rem .8rem; border-radius: 10px; }
.ap-buscar__res a:hover { background: var(--ap-fondo); }
.ap-buscar__res small { color: var(--ap-suave); }
.ap-buscar__vacio { padding: .8rem; color: var(--ap-suave); font-size: .9rem; }

.ap-user { margin-left: auto; display: flex; align-items: center; gap: .7rem; }
.ap-user__avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--ap-verde), var(--ap-oscuro-2)); color: #fff; font-weight: 700; font-size: .9rem; }
.ap-user__txt { display: flex; flex-direction: column; line-height: 1.2; }
.ap-user__txt small { color: var(--ap-suave); }

.ap-contenido { padding: 1.6rem 2rem 2.5rem; display: flex; flex-direction: column; gap: 1.4rem; }

/* ---------- bienvenida ---------- */
.ap-bienvenida { position: relative; overflow: hidden; padding: .2rem 0 .2rem 1rem; border-left: 4px solid var(--ap-verde); }
.ap-bienvenida h1 { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2.15rem); font-weight: 800; letter-spacing: -.01em; }
.ap-bienvenida h1 span { color: var(--ap-verde); }
.ap-bienvenida p { margin: .3rem 0 0; color: var(--ap-suave); max-width: 640px; }
.ap-hoja { position: absolute; right: -10px; top: -20px; width: 300px; height: 120px; fill: rgba(46, 155, 63, .12); pointer-events: none; }

/* ---------- tarjetas de cifras ---------- */
.ap-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.ap-stat { display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.2rem; background: #fff; border-radius: 20px; box-shadow: 0 4px 18px rgba(20, 60, 30, .07); transition: transform .18s, box-shadow .18s; position: relative; overflow: hidden; }
.ap-stat:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(20, 60, 30, .14); }
.ap-stat__ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #3fb24f, var(--ap-oscuro-2)); box-shadow: 0 8px 16px rgba(46, 155, 63, .3); flex-shrink: 0; }
.ap-stat__ico .ap-ico { width: 26px; height: 26px; }
.ap-stat__txt { display: flex; flex-direction: column; }
.ap-stat__txt small { color: var(--ap-suave); font-size: .85rem; }
.ap-stat__txt strong { font-size: 1.7rem; font-weight: 800; line-height: 1.15; }
.ap-stat { flex-wrap: wrap; }
.ap-stat .ap-chip { flex-basis: 100%; width: fit-content; margin-top: .1rem; }

.ap-chip { display: inline-block; padding: .22rem .65rem; border-radius: 999px; font-size: .76rem; font-weight: 700; color: #1b7a2d; background: #e2f5e0; white-space: nowrap; }
.ap-chip.aviso { color: #9a5b00; background: #fff0cf; }

/* ---------- filas y tarjetas ---------- */
.ap-fila { display: grid; gap: 1rem; }
.ap-fila--2 { grid-template-columns: 1.6fr 1fr; }
.ap-fila--3 { grid-template-columns: 1fr 1fr 1fr; }
.ap-card { background: #fff; border-radius: 22px; padding: 1.2rem 1.3rem 1.3rem; box-shadow: 0 4px 18px rgba(20, 60, 30, .07); min-width: 0; }
.ap-card__cab { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.ap-card__cab > div:first-child { color: var(--ap-verde); display: grid; place-items: center; }
.ap-card__cab > div:first-child .ap-ico { width: 26px; height: 26px; }
.ap-card__cab h2 { margin: 0; font-size: 1.08rem; font-weight: 700; }
.ap-card__cab small { color: var(--ap-suave); }
.ap-card__cab .ap-chip { margin-left: auto; }
.ap-nada { color: var(--ap-suave); margin: .6rem 0; }

/* gráfica */
.ap-grafica svg { width: 100%; height: auto; display: block; }
.ap-g-rejilla { stroke: var(--ap-linea); stroke-dasharray: 3 4; }
.ap-g-eje { fill: var(--ap-suave); font-size: 11px; }
.ap-g-valor { fill: var(--ap-oscuro-2); font-size: 11px; font-weight: 700; }
.ap-g-linea { fill: none; stroke: var(--ap-verde); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ap-g-punto { fill: #fff; stroke: var(--ap-verde); stroke-width: 3; }

/* accesos rápidos */
.ap-rapidos { display: grid; grid-template-columns: repeat(4, 1fr); gap: .7rem; }
.ap-rapido { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; text-align: center; padding: .9rem .4rem; border-radius: 16px; background: var(--ap-fondo); border: 1px solid var(--ap-linea); font-size: .78rem; font-weight: 600; color: var(--ap-texto); transition: all .18s; min-height: 86px; }
.ap-rapido .ap-ico { width: 26px; height: 26px; color: var(--ap-verde); }
.ap-rapido:hover { background: #fff; border-color: var(--ap-verde); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(46, 155, 63, .18); }

/* listas */
.ap-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ap-lista li + li { border-top: 1px solid var(--ap-linea); }
.ap-lista a { display: flex; align-items: center; gap: .75rem; padding: .65rem .2rem; border-radius: 10px; }
.ap-lista a:hover { background: var(--ap-fondo); }
.ap-lista span:last-child { display: flex; flex-direction: column; min-width: 0; }
.ap-lista strong { font-size: .93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-lista small { color: var(--ap-suave); }
.ap-punto { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ap-punto.rojo { background: #e0533f; }
.ap-punto.azul { background: #3b82d6; }
.ap-iniciales { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #e2f5e0; color: #1b7a2d; font-weight: 700; font-size: .8rem; flex-shrink: 0; }
.ap-vermas { display: inline-block; margin-top: .7rem; font-weight: 700; font-size: .88rem; color: var(--ap-verde); }

/* tarjeta de marca */
.ap-marca { position: relative; overflow: hidden; border-radius: 22px; padding: 1.4rem; color: #fff; background:
    radial-gradient(circle at 100% 0%, rgba(155, 209, 58, .4) 0, transparent 50%),
    linear-gradient(150deg, var(--ap-oscuro) 0%, var(--ap-oscuro-2) 100%);
    box-shadow: 0 10px 26px rgba(11, 59, 28, .35); display: flex; flex-direction: column; justify-content: center; gap: .4rem; }
.ap-marca img { height: 64px; width: auto; align-self: flex-start; }
.ap-marca h3 { margin: .3rem 0 0; font-size: 1.3rem; font-weight: 800; }
.ap-marca p { margin: 0; color: rgba(255, 255, 255, .82); font-size: .92rem; }
.ap-marca a { align-self: flex-start; margin-top: .6rem; padding: .55rem 1.1rem; border-radius: 999px; background: #fff; color: var(--ap-oscuro); font-weight: 700; font-size: .88rem; }
.ap-marca a:hover { background: var(--ap-lima); }

.ap-velo { display: none; }

/* ---------- pantallas medianas y móvil ---------- */
@media (max-width: 1180px) {
    .ap-stats { grid-template-columns: repeat(2, 1fr); }
    .ap-fila--2 { grid-template-columns: 1fr; }
    .ap-fila--3 { grid-template-columns: 1fr 1fr; }
    .ap-marca { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .ap { grid-template-columns: 1fr; }
    .ap-side { position: fixed; z-index: 50; left: 0; top: 0; width: 280px; max-width: 86vw; transform: translateX(-105%); transition: transform .25s; }
    .ap-side.abierto { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
    .ap-velo { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 40; }
    .ap-burger { display: grid; }
    .ap-top { padding: .7rem 1rem; }
    .ap-user__txt { display: none; }
    .ap-contenido { padding: 1.1rem 1rem 2rem; }
}

@media (max-width: 620px) {
    .ap-stats { grid-template-columns: 1fr 1fr; gap: .7rem; }
    .ap-stat { flex-wrap: wrap; padding: .9rem; }
    .ap-stat .ap-chip { margin-left: 0; }
    .ap-stat__txt strong { font-size: 1.4rem; }
    .ap-fila--3 { grid-template-columns: 1fr; }
    .ap-rapidos { grid-template-columns: repeat(2, 1fr); }
    .ap-hoja { display: none; }
}

/* ==========================================================
   Animaciones y hojas (verde y blanco mandan; unos toques de color)
   ========================================================== */

.ap { --ap-azul: #2f86c9; --ap-ambar: #f0a020; --ap-coral: #ea6a4f; --ap-morado: #8a63d2; }

/* entrada escalonada de las piezas */
@keyframes ap-sube { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ap-entra-izq { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.ap-top { animation: ap-sube .5s .1s both; }
.ap-bienvenida { animation: ap-sube .6s .15s both; }
.ap-stat { animation: ap-sube .6s both; }
.ap-stat:nth-child(1) { animation-delay: .25s; } .ap-stat:nth-child(2) { animation-delay: .33s; }
.ap-stat:nth-child(3) { animation-delay: .41s; } .ap-stat:nth-child(4) { animation-delay: .49s; }
.ap-fila--2 > .ap-card:nth-child(1) { animation: ap-sube .6s .55s both; }
.ap-fila--2 > .ap-card:nth-child(2) { animation: ap-sube .6s .65s both; }
.ap-fila--3 > :nth-child(1) { animation: ap-sube .6s .75s both; }
.ap-fila--3 > :nth-child(2) { animation: ap-sube .6s .85s both; }

/* fondo con brillos suaves que respiran */
.ap::before {
    content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
    background:
        radial-gradient(circle at 78% 8%, rgba(155, 209, 58, .20) 0, transparent 38%),
        radial-gradient(circle at 20% 95%, rgba(46, 155, 63, .14) 0, transparent 40%);
    animation: ap-respira 9s ease-in-out infinite alternate;
}
@keyframes ap-respira { from { opacity: .55; transform: scale(1); } to { opacity: 1; transform: scale(1.06); } }
.ap-main { position: relative; z-index: 1; }

/* menú lateral: degradado vivo y brillo en «Inicio» */
.ap-side { z-index: 5; background-size: 100% 100%, 100% 220%; animation: ap-entra-izq .6s cubic-bezier(.16, 1, .3, 1) both, ap-fondo-menu 14s ease-in-out infinite alternate; }
@keyframes ap-fondo-menu { from { background-position: 0 0, 0 0; } to { background-position: 0 0, 0 100%; } }
.ap-nav__item.activo::after { content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); animation: ap-brillo 4.5s ease-in-out infinite; }
.ap-nav__item.activo { position: relative; overflow: hidden; }
@keyframes ap-brillo { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.ap-nav__item { transition: background .18s, color .18s, transform .18s; }
.ap-nav__item:hover { transform: translateX(3px); }
.ap-nav__sub { animation: ap-sube .25s both; }
.ap-side__logo img { animation: ap-flota 5s ease-in-out infinite; }
@keyframes ap-flota { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-2deg); } }

/* hojas */
.ap-leaf { position: absolute; width: 28px; height: 28px; display: block; }
.ap-leaf__cuerpo { fill: currentColor; }
.ap-leaf__vena { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: .7; stroke-linecap: round; }

.ap-hojas { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.ap-hojas .ap-leaf { top: -40px; opacity: 0; color: var(--ap-verde); animation: ap-cae 16s linear infinite; }
.ap-hojas .h1 { left: 34%; width: 22px; height: 22px; animation-duration: 17s; animation-delay: 1s; }
.ap-hojas .h2 { left: 48%; color: var(--ap-lima); width: 30px; height: 30px; animation-duration: 21s; animation-delay: 5s; }
.ap-hojas .h3 { left: 61%; width: 18px; height: 18px; animation-duration: 15s; animation-delay: 9s; }
.ap-hojas .h4 { left: 72%; color: #55b44a; animation-duration: 23s; animation-delay: 3s; }
.ap-hojas .h5 { left: 84%; color: var(--ap-lima); width: 20px; height: 20px; animation-duration: 19s; animation-delay: 12s; }
.ap-hojas .h6 { left: 92%; width: 26px; height: 26px; animation-duration: 25s; animation-delay: 7s; }
.ap-hojas .h7 { left: 41%; color: #7cc65a; width: 16px; height: 16px; animation-duration: 18s; animation-delay: 14s; }
@keyframes ap-cae {
    0% { transform: translate(0, -40px) rotate(0); opacity: 0; }
    8% { opacity: .55; }
    25% { transform: translate(38px, 25vh) rotate(90deg); }
    50% { transform: translate(-30px, 52vh) rotate(210deg); }
    75% { transform: translate(34px, 78vh) rotate(300deg); opacity: .45; }
    100% { transform: translate(-10px, 108vh) rotate(380deg); opacity: 0; }
}

.ap-side__hojas { position: relative; flex-shrink: 0; height: 90px; margin-top: auto; pointer-events: none; }
.ap-side__hojas .ap-leaf { color: rgba(155, 209, 58, .5); transform-origin: 50% 100%; animation: ap-mece 5s ease-in-out infinite alternate; }
.ap-side__hojas .s1 { left: 6px; bottom: 6px; width: 54px; height: 54px; }
.ap-side__hojas .s2 { left: 62px; bottom: 0; width: 38px; height: 38px; color: rgba(255, 255, 255, .22); animation-delay: -2s; }
.ap-side__hojas .s3 { left: 112px; bottom: 10px; width: 66px; height: 66px; color: rgba(155, 209, 58, .32); animation-delay: -3.5s; }
.ap-side__pie { margin-top: .4rem; }
@keyframes ap-mece { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }

.ap-bienv-hojas { position: absolute; right: 0; top: 0; width: 280px; height: 100%; pointer-events: none; }
.ap-bienv-hojas .ap-leaf { color: rgba(46, 155, 63, .2); transform-origin: 50% 100%; animation: ap-mece 6s ease-in-out infinite alternate; }
.ap-bienv-hojas .b1 { right: 20px; top: -4px; width: 86px; height: 86px; }
.ap-bienv-hojas .b2 { right: 110px; top: 18px; width: 54px; height: 54px; color: rgba(155, 209, 58, .38); animation-delay: -2s; }
.ap-bienv-hojas .b3 { right: 168px; top: 4px; width: 36px; height: 36px; animation-delay: -4s; }

.ap-marca__hojas { position: absolute; inset: 0; pointer-events: none; }
.ap-marca__hojas .ap-leaf { color: rgba(155, 209, 58, .3); transform-origin: 50% 100%; animation: ap-mece 5.5s ease-in-out infinite alternate; }
.ap-marca__hojas .m1 { right: 14px; bottom: 8px; width: 92px; height: 92px; }
.ap-marca__hojas .m2 { right: 96px; bottom: -6px; width: 54px; height: 54px; color: rgba(255, 255, 255, .16); animation-delay: -2.5s; }
.ap-marca { background-size: 100% 100%, 160% 160%; animation: ap-sube .6s .95s both, ap-fondo-marca 10s ease-in-out infinite alternate; }
@keyframes ap-fondo-marca { from { background-position: 0 0, 0% 0%; } to { background-position: 0 0, 100% 100%; } }
.ap-marca > :not(.ap-marca__hojas) { position: relative; }
.ap-marca img { animation: ap-flota 5s ease-in-out infinite; }

/* tarjetas de cifras: cada una con su color de apoyo (el verde sigue mandando) */
.ap-stat__ico { transition: transform .3s; }
.ap-stat:hover .ap-stat__ico { transform: rotate(-8deg) scale(1.08); }
.ap-stat::after { content: ''; position: absolute; right: -26px; bottom: -34px; width: 100px; height: 100px; border-radius: 50%; background: radial-gradient(circle, var(--c, rgba(46, 155, 63, .16)) 0, transparent 70%); transition: transform .4s; pointer-events: none; }
.ap-stat:hover::after { transform: scale(1.5); }
.ap-stat--shield .ap-stat__ico { background: linear-gradient(135deg, #4ba3e0, #1f6fb0); box-shadow: 0 8px 16px rgba(47, 134, 201, .32); }
.ap-stat--shield { --c: rgba(47, 134, 201, .16); }
.ap-stat--car .ap-stat__ico { background: linear-gradient(135deg, #f6b73c, #e08a00); box-shadow: 0 8px 16px rgba(240, 160, 32, .32); }
.ap-stat--car { --c: rgba(240, 160, 32, .18); }
.ap-stat--building .ap-stat__ico { background: linear-gradient(135deg, #8bd24a, #3a9a3e); }
.ap-stat--building { --c: rgba(155, 209, 58, .22); }
.ap-stat__txt strong { animation: ap-sube .7s .5s both; }

/* accesos rápidos de varios colores */
.ap-rapido:nth-child(4n+1) { --c: var(--ap-verde); }
.ap-rapido:nth-child(4n+2) { --c: var(--ap-azul); }
.ap-rapido:nth-child(4n+3) { --c: var(--ap-ambar); }
.ap-rapido:nth-child(4n+4) { --c: var(--ap-coral); }
.ap-rapido .ap-ico { color: var(--c, var(--ap-verde)); transition: transform .25s; }
.ap-rapido:hover { border-color: var(--c); box-shadow: 0 10px 22px color-mix(in srgb, var(--c) 28%, transparent); }
.ap-rapido:hover .ap-ico { transform: scale(1.2) rotate(-6deg); }
.ap-rapido { animation: ap-pop .5s both; }
.ap-rapido:nth-child(1) { animation-delay: .8s; } .ap-rapido:nth-child(2) { animation-delay: .86s; } .ap-rapido:nth-child(3) { animation-delay: .92s; } .ap-rapido:nth-child(4) { animation-delay: .98s; }
.ap-rapido:nth-child(5) { animation-delay: 1.04s; } .ap-rapido:nth-child(6) { animation-delay: 1.1s; } .ap-rapido:nth-child(7) { animation-delay: 1.16s; } .ap-rapido:nth-child(8) { animation-delay: 1.22s; }
@keyframes ap-pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }

/* listas: iniciales de colores y entrada */
.ap-lista li:nth-child(5n+1) .ap-iniciales { background: #e2f5e0; color: #1b7a2d; }
.ap-lista li:nth-child(5n+2) .ap-iniciales { background: #e1effa; color: #1f6fb0; }
.ap-lista li:nth-child(5n+3) .ap-iniciales { background: #fff0cf; color: #9a5b00; }
.ap-lista li:nth-child(5n+4) .ap-iniciales { background: #fde6e0; color: #b4402a; }
.ap-lista li:nth-child(5n+5) .ap-iniciales { background: #ece4fa; color: #5f3fb0; }
.ap-lista li { animation: ap-entra-izq .45s both; }
.ap-lista li:nth-child(1) { animation-delay: 1s; } .ap-lista li:nth-child(2) { animation-delay: 1.08s; } .ap-lista li:nth-child(3) { animation-delay: 1.16s; }
.ap-lista li:nth-child(4) { animation-delay: 1.24s; } .ap-lista li:nth-child(5) { animation-delay: 1.32s; }
.ap-lista a { transition: background .18s, transform .18s; }
.ap-lista a:hover { transform: translateX(4px); }
.ap-punto.rojo { animation: ap-late 1.8s ease-in-out infinite; }
@keyframes ap-late { 0%, 100% { box-shadow: 0 0 0 0 rgba(224, 83, 63, .5); } 50% { box-shadow: 0 0 0 7px rgba(224, 83, 63, 0); } }

/* chips y cabeceras */
.ap-chip.aviso { animation: ap-late-ambar 2.4s ease-in-out infinite; }
@keyframes ap-late-ambar { 0%, 100% { box-shadow: 0 0 0 0 rgba(240, 160, 32, .5); } 50% { box-shadow: 0 0 0 7px rgba(240, 160, 32, 0); } }
.ap-card { transition: transform .22s, box-shadow .22s; }
.ap-card:hover { transform: translateY(-3px); box-shadow: 0 14px 32px rgba(20, 60, 30, .13); }
.ap-card__cab > div:first-child { animation: ap-flota 6s ease-in-out infinite; }
.ap-vermas { transition: letter-spacing .2s; }
.ap-vermas:hover { letter-spacing: .03em; }

/* gráfica: la línea se dibuja sola */
.ap-g-linea { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ap-dibuja 1.4s .7s ease-out forwards; }
@keyframes ap-dibuja { to { stroke-dashoffset: 0; } }
.ap-g-area { opacity: 0; animation: ap-aparece 1s 1.2s ease-out forwards; }
@keyframes ap-aparece { to { opacity: 1; } }
.ap-g-punto { opacity: 0; transform-box: fill-box; transform-origin: center; animation: ap-pop-punto .45s both; }
@keyframes ap-pop-punto { 0% { opacity: 0; transform: scale(0); } 70% { opacity: 1; transform: scale(1.35); } 100% { opacity: 1; transform: scale(1); } }
.ap-g-valor { opacity: 0; animation: ap-aparece .5s 1.6s forwards; }

/* título de bienvenida con brillo verde */
.ap-bienvenida h1 span { background: linear-gradient(90deg, #1b7a2d, #6cc04a, #1b7a2d); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ap-brilla-texto 6s linear infinite; }
@keyframes ap-brilla-texto { to { background-position: -200% 0; } }

@media (max-width: 900px) {
    .ap-hojas .ap-leaf { display: none; }
    .ap-bienv-hojas { width: 150px; opacity: .8; }
    .ap-side { animation: none; }
    .ap-side { transition: transform .25s; }
}

/* quien prefiere menos movimiento lo ve todo quieto */
@media (prefers-reduced-motion: reduce) {
    .ap *, .ap *::before, .ap *::after { animation: none !important; transition: none !important; }
    .ap-g-linea { stroke-dashoffset: 0; } .ap-g-area, .ap-g-punto, .ap-g-valor { opacity: 1; }
    .ap-hojas { display: none; }
}


/* ===== Iconos de colores en los submenús ===== */
.ap-c-verde { --ic: #9bd13a; }
.ap-c-azul { --ic: #5bb8ff; }
.ap-c-naranja { --ic: #ffab4a; }
.ap-c-morado { --ic: #b99cff; }
.ap-c-rojo { --ic: #ff7b7b; }
.ap-c-teal { --ic: #3fe0c5; }
.ap-c-rosa { --ic: #ff8fc1; }
.ap-nav__sub a { display: flex; align-items: center; gap: .6rem; }
.ap-nav__sub a .ap-ico {
    width: 30px; height: 30px; padding: 6px; border-radius: 9px; flex-shrink: 0;
    color: var(--ic, #9bd13a);
    background: color-mix(in srgb, var(--ic, #9bd13a) 20%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ic, #9bd13a) 35%, transparent);
    transition: transform .25s, background .25s, box-shadow .25s;
    animation: ap-ico-pop .45s calc(var(--i, 0) * 45ms) both, ap-ico-latido 3.6s calc(var(--i, 0) * 260ms + 1s) ease-in-out infinite;
}
.ap-nav__sub a span { line-height: 1.25; }
.ap-nav__sub a:hover .ap-ico {
    transform: scale(1.15) rotate(-8deg);
    background: color-mix(in srgb, var(--ic, #9bd13a) 38%, transparent);
    box-shadow: 0 0 14px color-mix(in srgb, var(--ic, #9bd13a) 55%, transparent), inset 0 0 0 1px var(--ic, #9bd13a);
}
@keyframes ap-ico-pop { from { opacity: 0; transform: scale(.3) rotate(-30deg); } 60% { transform: scale(1.15) rotate(6deg); } to { opacity: 1; transform: none; } }
@keyframes ap-ico-latido {
    0%, 82%, 100% { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ic, #9bd13a) 35%, transparent); }
    91% { box-shadow: 0 0 12px color-mix(in srgb, var(--ic, #9bd13a) 60%, transparent), inset 0 0 0 1px var(--ic, #9bd13a); }
}
@media (prefers-reduced-motion: reduce) { .ap-nav__sub a .ap-ico { animation: none; } }

/* Aviso de ITV por vencer en la portada: tarjeta blanca como las demás */
.ap-itv { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; padding: 1rem 1.3rem; border-radius: 20px; text-decoration: none; color: var(--ap-oscuro, #12401f); background: #fff; box-shadow: 0 4px 18px rgba(20, 60, 30, .07); position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s; animation: ap-sube .6s .3s both; }
.ap-itv::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: linear-gradient(180deg, #ffab4a, #e53935); }
.ap-itv::after { content: ''; position: absolute; right: -40px; top: -50px; width: 190px; height: 190px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 140, 60, .16) 0, transparent 70%); pointer-events: none; }
.ap-itv:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(20, 60, 30, .14); color: var(--ap-oscuro, #12401f); }
.ap-itv__ico { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; color: #fff; flex-shrink: 0; background: linear-gradient(135deg, #ffab4a, #e53935); box-shadow: 0 8px 16px rgba(229, 80, 50, .3); animation: ap-itv-late 2.4s 1s ease-in-out infinite; }
.ap-itv__ico .ap-ico { width: 26px; height: 26px; }
.ap-itv__txt { display: flex; flex-direction: column; flex: 1; position: relative; z-index: 1; }
.ap-itv__txt strong { font-size: 1.05rem; font-weight: 800; }
.ap-itv__txt small { color: var(--ap-suave); font-size: .85rem; }
.ap-itv__num { min-width: 3rem; padding: .3rem .8rem; text-align: center; border-radius: 14px; font-size: 1.6rem; font-weight: 800; line-height: 1.2; color: #c62828; background: #fdeaea; position: relative; z-index: 1; }
.ap-itv__ir { display: inline-flex; align-items: center; gap: .4rem; padding: .55rem 1.1rem; border-radius: 999px; font-weight: 700; font-size: .9rem; color: #fff; background: linear-gradient(135deg, #3fb24f, #1f7a31); box-shadow: 0 6px 14px rgba(46, 155, 63, .3); position: relative; z-index: 1; transition: transform .18s; }
.ap-itv__ir .ap-ico { width: 1.1em; height: 1.1em; transition: transform .2s; }
.ap-itv:hover .ap-itv__ir .ap-ico { transform: translateX(4px); }
@keyframes ap-itv-late { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08) rotate(-4deg); } }
@media (max-width: 700px) { .ap-itv { flex-wrap: wrap; } .ap-itv__txt { flex-basis: 60%; } }
@media (prefers-reduced-motion: reduce) { .ap-itv, .ap-itv__ico { animation: none; } }
