/* ============================================
   BUSCAR FICHA — DISEÑO INSTITUCIONAL REFINADO
   RESPONSIVE: mobile · tablet · laptop · desktop
   ============================================ */

/* ── Variables ─────────────────────────────── */
:root {
    --verde:        #1a4731;
    --verde-med:    #256040;
    --verde-osc:    #0f2e1e;
    --verde-vivo:   #39a900;
    --verde-claro:  #e8f5ee;
    --verde-borde:  #b8dfc8;
    --blanco:       #ffffff;
    --gris-50:      #f8f9fa;
    --gris-100:     #f0f2f4;
    --gris-200:     #e2e6ea;
    --gris-300:     #cdd3da;
    --gris-400:     #9aa3af;
    --gris-500:     #6c757d;
    --gris-600:     #495057;
    --gris-700:     #343a40;
    --gris-800:     #212529;
    --rojo:         #c0392b;
    --rojo-claro:   #fdf0ef;
    --azul-claro:   #eaf2fb;
    --azul:         #1a5a9c;

    --sombra-xs:  0 1px 3px rgba(0,0,0,.07);
    --sombra-sm:  0 2px 8px rgba(0,0,0,.08);
    --sombra-md:  0 4px 16px rgba(0,0,0,.10);
    --sombra-lg:  0 8px 32px rgba(0,0,0,.12);

    --radio-sm:   6px;
    --radio-md:   10px;
    --radio-lg:   16px;
    --radio-xl:   22px;

    --trans: all .2s ease;
}

/* ── Reset base ─────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background: var(--gris-50);
    color: var(--gris-800);
    line-height: 1.55;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
}

a { text-decoration: none; }

/* ============================================
   TOPBAR
   ============================================ */
.ap-topbar {
    background: var(--verde);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 12px rgba(0,0,0,.25);
    border-bottom: 2px solid var(--verde-vivo);
}

.ap-topbar-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    gap: 1.5rem;
}

/* Logo */
.logo-link {
    display: flex;
    align-items: center;
    gap: .85rem;
    color: #fff;
    flex-shrink: 0;
    min-width: 0;
}

.logo-badge {
    width: 38px;
    height: 38px;
    background: var(--verde-vivo);
    border-radius: var(--radio-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-leaf-icon {
    width: 20px;
    height: 20px;
    color: #fff;
    stroke-width: 2.5;
}

.logo-texts {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.logo-name {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logo-name strong { font-weight: 700; }

.logo-sub {
    font-size: .68rem;
    color: rgba(255,255,255,.55);
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Nav */
.ap-nav {
    display: flex;
    gap: .25rem;
}

.nav-link {
    color: rgba(255,255,255,.75);
    font-size: .875rem;
    font-weight: 500;
    padding: .5rem .9rem;
    border-radius: var(--radio-sm);
    display: flex;
    align-items: center;
    gap: .4rem;
    transition: var(--trans);
    white-space: nowrap;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,.1);
}

.nav-ico {
    width: 15px;
    height: 15px;
    stroke-width: 2;
    flex-shrink: 0;
}

/* Botón volver */
.btn-volver {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: rgba(255,255,255,.85);
    font-size: .825rem;
    font-weight: 500;
    padding: .45rem 1rem;
    border-radius: var(--radio-sm);
    border: 1px solid rgba(255,255,255,.2);
    transition: var(--trans);
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-volver:hover {
    color: #fff;
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.35);
}

.ico-volver {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
    flex-shrink: 0;
}

/* ============================================
   MAIN
   ============================================ */
.ap-main {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
    min-height: calc(100vh - 140px);
}

/* ============================================
   HERO SECTION
   ============================================ */
.ap-hero {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    position: relative;
}

/* Eyebrow */
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: var(--verde-claro);
    color: var(--verde);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: .4rem 1rem;
    border-radius: 30px;
    border: 1px solid var(--verde-borde);
    margin-bottom: 1rem;
}

.eyebrow-ico {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
    flex-shrink: 0;
}

/* Título */
.ap-hero-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: clamp(1.4rem, 3.5vw, 2rem);
    font-weight: 400;
    color: var(--gris-800);
    line-height: 1.15;
    letter-spacing: -.02em;
    margin-bottom: .65rem;
}

.ap-hero-title em {
    font-style: italic;
    color: var(--verde);
}

.ap-hero-sub {
    font-size: .95rem;
    color: var(--gris-500);
    max-width: 520px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

/* ── Buscador ─────────────────────────────── */
.ap-search-form {
    max-width: 620px;
    margin: 0 auto 1.75rem;
}

.ap-search-wrap {
    display: flex;
    align-items: center;
    background: var(--blanco);
    border: 1.5px solid var(--gris-200);
    border-radius: var(--radio-xl);
    box-shadow: var(--sombra-md);
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}

.ap-search-wrap:focus-within {
    border-color: var(--verde);
    box-shadow: 0 0 0 4px rgba(26,71,49,.1), var(--sombra-md);
}

.ap-search-ico {
    flex-shrink: 0;
    margin: 0 .25rem 0 1.25rem;
    color: var(--gris-400);
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.ap-search-input {
    flex: 1;
    padding: .95rem .75rem;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-family: inherit;
    color: var(--gris-800);
    outline: none;
    min-width: 0;
}

.ap-search-input::placeholder { color: var(--gris-400); }

.ap-search-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--verde);
    color: #fff;
    border: none;
    padding: .75rem 1.5rem;
    margin: .3rem;
    border-radius: var(--radio-lg);
    font-size: .875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s, transform .15s;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 44px;
    touch-action: manipulation;
}

.ap-search-btn:hover:not(:disabled) {
    background: var(--verde-osc);
    transform: translateY(-1px);
}

.ap-search-btn:active { transform: translateY(0); }
.ap-search-btn:disabled { opacity: .65; cursor: not-allowed; }

.btn-arrow {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
    flex-shrink: 0;
}

.search-help {
    margin-top: .65rem;
    color: var(--gris-400);
    font-size: .75rem;
    text-align: center;
}

/* ── Hero features ────────────────────────── */
.hero-features {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem;
    background: var(--blanco);
    border: 1px solid var(--gris-200);
    border-radius: var(--radio-lg);
    padding: .65rem 1.25rem;
    box-shadow: var(--sombra-xs);
}

.hf-item {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .8rem;
    color: var(--gris-600);
    font-weight: 500;
}

.hf-ico {
    width: 15px;
    height: 15px;
    color: var(--verde);
    stroke-width: 2;
    flex-shrink: 0;
}

.hf-sep {
    width: 1px;
    height: 16px;
    background: var(--gris-200);
}

/* ============================================
   RESULTADO — scroll-margin para no quedar
   tapado por el topbar sticky
   ============================================ */
.ap-resultado {
    scroll-margin-top: 80px;
}

/* ============================================
   LOADING
   ============================================ */
.ap-loading {
    display: none;
    text-align: center;
    padding: 4rem;
}

.ap-loading.active { display: block; }

.spinner-ring {
    width: 44px;
    height: 44px;
    border: 3px solid var(--gris-200);
    border-top-color: var(--verde);
    border-radius: 50%;
    animation: spin .75s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   ERROR BOX
   ============================================ */
.ap-error-box {
    background: var(--rojo-claro);
    border: 1px solid #f5c6c2;
    border-left: 4px solid var(--rojo);
    padding: 1.5rem 1.75rem;
    border-radius: var(--radio-lg);
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    margin: 2rem 0;
}

.error-icon-wrap {
    width: 42px;
    height: 42px;
    background: #fce8e6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.error-svg {
    width: 20px;
    height: 20px;
    color: var(--rojo);
    stroke-width: 2;
}

.error-content strong {
    display: block;
    color: var(--rojo);
    font-size: .95rem;
    margin-bottom: .3rem;
}

.error-content p {
    font-size: .875rem;
    color: var(--gris-600);
}

.btn-intentar {
    margin-top: .85rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--blanco);
    border: 1px solid var(--rojo);
    color: var(--rojo);
    padding: .45rem 1rem;
    border-radius: var(--radio-sm);
    cursor: pointer;
    font-size: .825rem;
    font-family: inherit;
    font-weight: 500;
    transition: var(--trans);
    touch-action: manipulation;
}

.btn-intentar:hover { background: var(--rojo); color: #fff; }

/* ============================================
   FICHA INFO CARD
   ============================================ */
.ficha-info-card {
    background: var(--blanco);
    border: 1px solid var(--gris-200);
    border-radius: var(--radio-xl);
    box-shadow: var(--sombra-md);
    display: flex;
    align-items: stretch;
    margin: 2rem 0 1.5rem;
    overflow: hidden;
}

.ficha-info-left {
    background: var(--verde);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-width: 190px;
    text-align: center;
    flex-shrink: 0;
}

.ficha-numero-label {
    font-size: .65rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgba(255,255,255,.6);
}

.ficha-numero {
    font-family: 'DM Serif Display', serif;
    font-size: 2.25rem;
    font-weight: 400;
    color: #fff;
    letter-spacing: -.01em;
    line-height: 1.1;
}

.btn-copiar {
    background: rgba(255,255,255,.12);
    border: none;
    border-radius: var(--radio-sm);
    padding: .35rem .6rem;
    cursor: pointer;
    transition: var(--trans);
    margin-top: .25rem;
    display: flex;
    align-items: center;
    touch-action: manipulation;
}

.btn-copiar:hover { background: rgba(255,255,255,.22); }

.copy-ico {
    width: 14px;
    height: 14px;
    color: rgba(255,255,255,.8);
    stroke-width: 2;
}

.ficha-divider {
    width: 1px;
    background: var(--gris-200);
    align-self: stretch;
    flex-shrink: 0;
}

.ficha-info-right {
    flex: 1;
    padding: 1.75rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem 2rem;
    align-content: center;
    min-width: 0;
}

.ficha-dato {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    min-width: 0;
}

.fd-label {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--gris-400);
    display: flex;
    align-items: center;
    gap: .35rem;
}

.fd-ico {
    width: 12px;
    height: 12px;
    color: var(--verde);
    stroke-width: 2.5;
    flex-shrink: 0;
}

.fd-valor {
    font-size: .9rem;
    font-weight: 600;
    color: var(--gris-700);
    word-break: break-word;
}

/* ============================================
   STATS
   ============================================ */
.ap-stats {
    display: flex;
    gap: 1rem;
    margin: 0 0 1.25rem;
    flex-wrap: wrap;
}

.stat-item {
    background: var(--blanco);
    border: 1px solid var(--gris-200);
    border-radius: var(--radio-md);
    padding: .7rem 1.15rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    box-shadow: var(--sombra-xs);
    flex: 1 1 auto;
    min-width: 160px;
}

.stat-ico {
    width: 18px;
    height: 18px;
    color: var(--verde);
    stroke-width: 2;
    flex-shrink: 0;
}

.stat-label {
    display: block;
    font-size: .7rem;
    color: var(--gris-400);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.stat-value {
    display: block;
    font-size: .95rem;
    font-weight: 700;
    color: var(--gris-700);
}

/* ============================================
   JUICIO ACTIONS
   ============================================ */
.juicio-actions {
    margin: 0 0 1.25rem;
    display: flex;
    justify-content: flex-end;
}

.btn-juicio {
    display: inline-flex;
    align-items: center;
    gap: .75rem;
    padding: .7rem 1.35rem;
    border-radius: var(--radio-md);
    font-weight: 600;
    font-size: .875rem;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: var(--trans);
    touch-action: manipulation;
}

.btn-juicio--completo {
    background: var(--verde);
    color: #fff;
    box-shadow: 0 3px 10px rgba(26,71,49,.25);
}

.btn-juicio--completo:hover {
    background: var(--verde-osc);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(26,71,49,.3);
    color: #fff;
}

.juicio-ico {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
    flex-shrink: 0;
}

.btn-juicio__txt {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.btn-juicio__txt small {
    font-weight: 400;
    opacity: .75;
    font-size: .73rem;
}

/* ============================================
   MIS JUICIOS CARD
   ============================================ */
.mis-juicios-card {
    background: var(--blanco);
    border: 1.5px solid var(--verde-borde);
    border-radius: var(--radio-xl);
    padding: 1.75rem;
    margin: 0 0 1.5rem;
    box-shadow: var(--sombra-sm);
}

.mis-juicios-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.35rem;
    flex-wrap: wrap;
}

.mj-icon-wrap {
    width: 46px;
    height: 46px;
    background: var(--verde-claro);
    border-radius: var(--radio-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mj-icon {
    width: 22px;
    height: 22px;
    color: var(--verde);
    stroke-width: 2;
}

.mis-juicios-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gris-800);
    margin-bottom: .15rem;
}

.mis-juicios-sub {
    font-size: .82rem;
    color: var(--gris-500);
}

.mis-juicios-form { display: flex; flex-direction: column; gap: .85rem; }

.mis-juicios-input-wrap {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: var(--gris-50);
    border: 1.5px solid var(--gris-200);
    border-radius: var(--radio-md);
    padding: .45rem .45rem .45rem 1rem;
    transition: border-color .2s, box-shadow .2s;
    flex-wrap: wrap;
}

.mis-juicios-input-wrap:focus-within {
    border-color: var(--verde);
    box-shadow: 0 0 0 3px rgba(26,71,49,.1);
}

.mj-input-ico {
    width: 16px;
    height: 16px;
    color: var(--gris-400);
    stroke-width: 2;
    flex-shrink: 0;
}

.mj-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-family: inherit;
    color: var(--gris-800);
    outline: none;
    padding: .3rem 0;
    min-width: 140px;
}

.mj-input::placeholder { color: var(--gris-400); }

.mj-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: var(--verde);
    color: #fff;
    border: none;
    border-radius: var(--radio-sm);
    padding: .6rem 1.2rem;
    font-size: .85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--trans);
    touch-action: manipulation;
    min-height: 40px;
}

.mj-btn:hover { background: var(--verde-osc); transform: translateY(-1px); }
.mj-btn:active { transform: translateY(0); }

.mj-arr {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
    flex-shrink: 0;
}

.mj-nota {
    display: flex;
    align-items: flex-start;
    gap: .45rem;
    font-size: .78rem;
    color: var(--gris-500);
}

.mj-nota-ico {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    margin-top: 1px;
    color: var(--verde);
    stroke-width: 2;
}

/* ============================================
   TABLA DE PROGRAMACIÓN
   ============================================ */
.ap-tabla-card {
    background: var(--blanco);
    border: 1px solid var(--gris-200);
    border-radius: var(--radio-xl);
    box-shadow: var(--sombra-md);
    overflow: hidden;
    margin: 0 0 2rem;
}

.ap-tabla-header {
    padding: 1.25rem 1.5rem;
    background: var(--gris-50);
    border-bottom: 1px solid var(--gris-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: .85rem;
    flex-wrap: wrap;
}

.tabla-header-ico {
    width: 18px;
    height: 18px;
    color: var(--verde);
    stroke-width: 2;
    flex-shrink: 0;
}

.ap-tabla-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gris-800);
}

.ap-tabla-count {
    background: var(--verde-claro);
    color: var(--verde);
    border: 1px solid var(--verde-borde);
    padding: .2rem .75rem;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
}

.ap-tabla-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.ap-tabla {
    width: 100%;
    border-collapse: collapse;
}

.ap-tabla thead th {
    background: var(--gris-50);
    padding: .85rem 1rem;
    text-align: left;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--gris-500);
    border-bottom: 1px solid var(--gris-200);
    white-space: nowrap;
}

.ap-tabla tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--gris-100);
    vertical-align: top;
    font-size: .875rem;
}

.ap-tabla tbody tr:last-child td { border-bottom: none; }
.ap-tabla tbody tr:hover { background: var(--gris-50); }

/* Instructor cell */
.instructor-cell {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.instructor-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radio-sm);
    background: var(--verde-claro);
    color: var(--verde);
    font-size: .72rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid var(--verde-borde);
    letter-spacing: -.02em;
}

.instructor-nombre {
    font-weight: 600;
    color: var(--gris-700);
    font-size: .85rem;
    line-height: 1.3;
}

/* Contacto */
.contacto-info { display: flex; flex-direction: column; gap: .3rem; }

.contacto-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .8rem;
    border-radius: var(--radio-sm);
    padding: .2rem .55rem;
    white-space: nowrap;
}

.tel-chip  { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }
.mail-chip { background: var(--azul-claro); color: var(--azul); border: 1px solid #bee3f8; }

.chip-ico { width: 11px; height: 11px; stroke-width: 2.5; flex-shrink: 0; }

/* Competencia / Resultado */
.competencia-texto,
.resultado-texto {
    display: block;
    font-weight: 500;
    color: var(--gris-700);
    margin-bottom: .25rem;
    font-size: .85rem;
}

.competencia-codigo,
.resultado-codigo {
    font-size: .72rem;
    color: var(--gris-400);
}

/* Fechas */
.fecha-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .7rem;
    border-radius: var(--radio-sm);
    font-size: .8rem;
    font-weight: 600;
    white-space: nowrap;
}

.fecha-ico { width: 12px; height: 12px; stroke-width: 2.5; flex-shrink: 0; }

.fecha-inicio { background: var(--azul-claro); color: var(--azul);      border: 1px solid #bee3f8; }
.fecha-fin    { background: var(--gris-100);   color: var(--gris-600); border: 1px solid var(--gris-200); }

/* Tabla footer */
.ap-tabla-footer {
    padding: 1rem 1.5rem;
    background: var(--gris-50);
    border-top: 1px solid var(--gris-200);
    display: flex;
    align-items: flex-start;
    gap: .6rem;
}

.footer-ico { width: 14px; height: 14px; color: var(--gris-400); stroke-width: 2; flex-shrink: 0; margin-top: 2px; }
.footer-note { font-size: .8rem; color: var(--gris-500); line-height: 1.5; }

/* ============================================
   BIENVENIDA INICIAL
   ============================================ */
.ap-bienvenida-inicial {
    padding: 1rem 0 2rem;
}

.welcome-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.wg-item {
    background: var(--blanco);
    border: 1px solid var(--gris-200);
    border-radius: var(--radio-xl);
    padding: 1.75rem 1.5rem;
    box-shadow: var(--sombra-xs);
    transition: box-shadow .2s, transform .2s;
}

.wg-item:hover {
    box-shadow: var(--sombra-md);
    transform: translateY(-2px);
}

.wg-icon {
    width: 46px;
    height: 46px;
    background: var(--verde-claro);
    border: 1px solid var(--verde-borde);
    border-radius: var(--radio-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.wg-icon svg {
    width: 22px;
    height: 22px;
    color: var(--verde);
    stroke-width: 2;
}

.wg-item h3 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--gris-800);
    margin-bottom: .4rem;
}

.wg-item p {
    font-size: .83rem;
    color: var(--gris-500);
    line-height: 1.5;
}

.welcome-tip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    background: var(--verde-claro);
    border: 1px solid var(--verde-borde);
    border-radius: var(--radio-lg);
    padding: 1rem 1.5rem;
    font-size: .85rem;
    color: var(--verde);
    font-weight: 500;
    text-align: center;
    flex-wrap: wrap;
}

.tip-ico {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    flex-shrink: 0;
}

/* ============================================
   TOAST
   ============================================ */
.toast-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--gris-800);
    color: #fff;
    padding: .75rem 1.35rem;
    border-radius: var(--radio-md);
    font-size: .85rem;
    font-weight: 500;
    z-index: 9999;
    animation: slideIn .3s ease;
    box-shadow: var(--sombra-lg);
    max-width: calc(100vw - 3rem);
}

.toast-notification.error { background: var(--rojo); }

@keyframes slideIn {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ============================================
   FOOTER
   ============================================ */
.ap-footer {
    background: var(--gris-800);
    color: var(--gris-500);
    padding: 1.5rem 2rem;
}

.footer-content {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: .82rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--gris-300);
    font-weight: 600;
}

.footer-leaf {
    width: 15px;
    height: 15px;
    color: var(--verde-vivo);
    stroke-width: 2;
    flex-shrink: 0;
}

.footer-year { color: var(--gris-500); font-variant-numeric: tabular-nums; }

/* ═══════════════════════════════════════════════════════════════
   ALERTAS RESPONSIVE - SENA
   ═══════════════════════════════════════════════════════════════ */

.alertas-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 420px;
    width: calc(100% - 2rem);
    pointer-events: none;
}

.alerta {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    animation: alertaEntrada 0.3s ease;
    pointer-events: auto;
    border-left: 4px solid;
}

.alerta--error {
    background: #fef2f2;
    color: #991b1b;
    border-left-color: #dc2626;
}

.alerta--success {
    background: #f0fdf4;
    color: #166534;
    border-left-color: #16a34a;
}

.alerta--warning {
    background: #fffbeb;
    color: #92400e;
    border-left-color: #f59e0b;
}

.alerta--info {
    background: #eff6ff;
    color: #1e40af;
    border-left-color: #3b82f6;
}

.alerta__icono {
    font-size: 1.1rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.alerta__texto {
    flex: 1;
    word-break: break-word;
}

.alerta__cerrar {
    background: none;
    border: none;
    font-size: 1rem;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.alerta__cerrar:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.08);
}

@keyframes alertaEntrada {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ── Auto-cierre opcional ── */
.alerta {
    animation: alertaEntrada 0.3s ease, alertaFadeOut 0.3s ease 4.7s forwards;
}

@keyframes alertaFadeOut {
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* ═══════════════════════════════════════════════════════════════
   MEDIA QUERIES RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    .alertas-container {
        top: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
        max-width: none;
    }

    .alerta {
        padding: 0.875rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .alertas-container {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
    }

    .alerta {
        padding: 0.75rem 0.875rem;
        font-size: 0.82rem;
        gap: 0.5rem;
    }

    .alerta__icono {
        font-size: 1rem;
    }
}

/* ════════════════════════════════════════════
   RESPONSIVE — de mayor a menor
   ════════════════════════════════════════════ */

/* ── Accesibilidad: Reduce Motion ── */
@media (prefers-reduced-motion: reduce) {
    .alerta {
        animation: none;
    }
}

/* ── Laptop / desktop intermedio (≤1100px) ── */
@media (max-width: 1100px) {
    .ap-topbar-inner { gap: 1rem; }
    .ap-main { padding: 0 1.5rem 4rem; }
}

/* ── Tablet landscape (≤900px) ── */
@media (max-width: 900px) {
    .ap-topbar-inner { gap: .75rem; }
    .ap-nav { display: none; }
    .logo-sub { display: none; }

    .ap-main { padding: 0 1.25rem 3rem; }

    .ficha-info-right {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Tablet portrait (≤768px) ── */
@media (max-width: 768px) {
    .ap-topbar-inner {
        height: 60px;
        padding: 0 1rem;
    }

    .logo-name { font-size: .9rem; }

    .btn-volver { padding: .4rem .75rem; font-size: .78rem; }

    .ap-main { padding: 0 1rem 3rem; }

    .ap-hero { padding: 1.75rem .5rem 1.25rem; }

    .ap-hero-sub { font-size: .9rem; margin-bottom: 1.25rem; }

    /* Ficha card apilada */
    .ficha-info-card { flex-direction: column; }
    .ficha-divider { width: 100%; height: 1px; }

    .ficha-info-left {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1.25rem 1.5rem;
        min-width: 0;
    }

    .ficha-info-right {
        grid-template-columns: 1fr 1fr;
        padding: 1.25rem 1.5rem;
        gap: 1rem 1.5rem;
    }

    /* Hero features */
    .hero-features { gap: .4rem; padding: .55rem .85rem; }
    .hf-sep { display: none; }
    .hf-item { font-size: .75rem; }

    /* Tabla responsive — stacked cards */
    .ap-tabla thead { display: none; }

    .ap-tabla tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--gris-200);
        border-radius: var(--radio-lg);
        padding: .75rem 1rem;
        background: var(--blanco);
    }

    .ap-tabla tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: .5rem 0;
        border: none;
        border-bottom: 1px solid var(--gris-100);
        font-size: .82rem;
        gap: .75rem;
    }

    .ap-tabla tbody td:last-child { border-bottom: none; }

    .ap-tabla tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: .68rem;
        text-transform: uppercase;
        letter-spacing: .05em;
        color: var(--gris-400);
        flex-shrink: 0;
        padding-top: .15rem;
        min-width: 80px;
    }

    /* Juicio actions */
    .juicio-actions { justify-content: stretch; }
    .btn-juicio { width: 100%; justify-content: center; }

    /* Mis juicios */
    .mj-btn { width: 100%; justify-content: center; }

    /* Footer */
    .footer-content { flex-direction: column; text-align: center; gap: .5rem; }
}

/* ── Móvil (≤600px) ── */
@media (max-width: 600px) {
    .ap-topbar-inner { height: 56px; padding: 0 .875rem; }

    .logo-badge { width: 32px; height: 32px; border-radius: 5px; }
    .logo-leaf-icon { width: 16px; height: 16px; }
    .logo-name { font-size: .82rem; }

    .btn-volver span { display: none; }
    .btn-volver { padding: .4rem .6rem; }

    .ap-main { padding: 0 .875rem 2.5rem; }

    .ap-hero { padding: 1.5rem 0 1.25rem; }
    .ap-hero-sub { font-size: .85rem; }

    /* Buscador: icono buscar se oculta */
    .ap-search-ico { display: none; }
    .ap-search-input { padding: .95rem .75rem; }
    .ap-search-btn .btn-text { display: none; }
    .ap-search-btn { padding: .75rem .9rem; margin: .25rem; }

    /* Hero features en columnas de 2 */
    .hero-features {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: .5rem;
        width: 100%;
        text-align: left;
    }
    .hf-sep { display: none; }

    /* Ficha info */
    .ficha-info-left {
        flex-direction: column;
        align-items: center;
        padding: 1.25rem;
        text-align: center;
    }

    .ficha-numero { font-size: 1.75rem; }

    .ficha-info-right {
        grid-template-columns: 1fr;
        padding: 1.1rem 1.25rem;
        gap: .85rem;
    }

    /* Stats */
    .stat-item { min-width: 0; flex: 1 1 140px; }

    /* Mis juicios */
    .mis-juicios-card { padding: 1.25rem; }
    .mj-input { min-width: 100px; }

    /* Welcome grid */
    .welcome-grid { grid-template-columns: 1fr 1fr; gap: .85rem; }

    .wg-item { padding: 1.25rem 1rem; }
    .wg-item h3 { font-size: .88rem; }
    .wg-item p  { font-size: .78rem; }

    /* Toast */
    .toast-notification {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        text-align: center;
    }
}

/* ── Móvil muy pequeño (≤400px) ── */
@media (max-width: 400px) {
    .ap-main { padding: 0 .75rem 2rem; }

    .welcome-grid { grid-template-columns: 1fr; }

    .hero-features { grid-template-columns: 1fr; }

    .ap-hero-title { font-size: 1.3rem; }

    .ficha-info-right { grid-template-columns: 1fr; }

    .ap-tabla-footer { flex-direction: column; gap: .4rem; }
}
