/* === CSS Variables — AWS Dark Space Theme === */
:root {
    --color-bg: #0a0a1a;
    --color-surface: rgba(20, 20, 40, 0.8);
    --color-surface-solid: #14142a;
    --color-surface-light: #1a1a2e;
    --color-orange: #ff9900;
    --color-orange-dark: #ec7211;
    --color-purple: #a855f7;
    --color-purple-dark: #7c3aed;
    --color-success: #10b981;
    --color-error: #ef4444;
    /* Cian: color de contraste para los controles del encabezado (selector de
       cohorte). Se diferencia del naranja y del púrpura de la marca. */
    --color-cyan: #22d3ee;
    --color-cyan-dark: #0891b2;
    --color-white: #ffffff;
    --color-text: #e2e8f0;
    --color-text-secondary: #94a3b8;
    --color-border: rgba(255, 153, 0, 0.1);
    --color-border-subtle: rgba(255, 255, 255, 0.08);
    --color-border-hover: rgba(255, 153, 0, 0.3);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-glow-orange: 0 0 30px rgba(255, 153, 0, 0.2);
    --shadow-glow-purple: 0 0 30px rgba(168, 85, 247, 0.2);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1200px;
}

/* === Reset & Base === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* === Star Particles Canvas === */
#stars-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* === Background Radial Gradients === */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 15% 20%, rgba(168, 85, 247, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 60%, rgba(255, 153, 0, 0.04) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(168, 85, 247, 0.03) 0%, transparent 40%);
    z-index: 0;
    pointer-events: none;
}

/* === Layout === */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* === IA Badge === */
.ia-badge {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: linear-gradient(135deg, var(--color-orange), var(--color-purple));
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.3);
    letter-spacing: 0.3px;
}

/* === Header === */
.header {
    padding: 3rem 0 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* El PNG del logo es cuadrado (1200x1200) pero el logo ocupa solo el 68% central:
   trae 203px transparentes arriba y 181px abajo. Eso generaba un hueco falso de
   ~60px entre el logo y el título. Se recorta con un contenedor de alto fijo y
   overflow hidden, sin tocar la imagen. */
.header__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 146px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.header__logo-img {
    display: block;      /* evita el hueco del baseline de una img inline */
    height: 206px;       /* el contenedor recorta el sobrante transparente */
    width: auto;
}

/* Variante del login, sin contenedor recortado */
.header__logo-img--sm {
    height: 150px;
}

.header__title {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--color-orange) 0%, var(--color-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    line-height: 1.1;
    /* Alto fijo de una línea para que el menú quede siempre a la misma altura
       en todas las páginas. Los títulos deben ser cortos (una sola línea): si
       alguno crece hasta partirse en dos, volvería a empujar la navegación. */
    min-height: 1.1em;
}

.header__subtitle {
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    font-weight: 400;
    /* Mismo motivo: se reserva una línea fija para el subtítulo. */
    min-height: 1.5em;
    line-height: 1.5;
}

/* === Two Column Layout === */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
    padding: 1rem 0 3rem;
}

/* === Cards === */
.card {
    background: var(--color-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    animation: fadeInUp 0.6s ease-out;
}

.card:hover {
    border-color: var(--color-border-hover);
    box-shadow: var(--shadow);
}

.card--form {
    border-color: rgba(255, 153, 0, 0.15);
}

.card--results {
    border-color: rgba(168, 85, 247, 0.15);
    min-height: 400px;
}

.card__badge {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.card__title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--color-white);
}

/* === Badges === */
.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge--orange {
    background: rgba(255, 153, 0, 0.2);
    color: var(--color-orange);
    border: 1px solid rgba(255, 153, 0, 0.3);
}

.badge--purple {
    background: rgba(168, 85, 247, 0.2);
    color: var(--color-purple);
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* === Form Elements === */
.form-group {
    margin-bottom: 1.75rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--color-text);
    font-size: 0.95rem;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
}

.form-select {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--color-surface-light);
    color: var(--color-text);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

.form-select:focus {
    outline: none;
    border-color: var(--color-orange);
    box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.15);
}

/* === Upload Area === */
.upload-area {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--color-surface-light);
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--color-orange);
    background: rgba(255, 153, 0, 0.03);
    box-shadow: inset 0 0 30px rgba(255, 153, 0, 0.03);
}

.upload-area__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-area__icon {
    font-size: 2rem;
    transition: var(--transition);
}

.upload-area:hover .upload-area__icon {
    transform: scale(1.1);
}

.upload-area__text {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.upload-area__formats {
    font-size: 0.7rem;
    color: var(--color-text-secondary);
    opacity: 0.6;
    padding: 0.2rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    margin-top: 0.25rem;
}

.upload-area__filename {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-orange);
}

.file-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* === Button === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1.05rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    position: relative;
    overflow: hidden;
}

.btn--primary {
    background: linear-gradient(135deg, var(--color-orange) 0%, var(--color-orange-dark) 100%);
    color: var(--color-white);
    letter-spacing: 0.3px;
}

.btn--primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn--primary:hover::before {
    left: 100%;
}

.btn--primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 153, 0, 0.35);
}

.btn--primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn--primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* === Selector de cohorte en el encabezado === */
/* Bloque de herramientas del encabezado (usuario/"Ver como" + cohorte),
   anclado arriba a la derecha. auth.js mete aquí el selector de cohorte. */
.header__tools {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    z-index: 5;
}

/* Selector de cohorte: va centrado debajo del menú y en cian, para que contraste
   con el naranja del resto. Muestra la cohorte activa, así que no hace falta un
   título aparte. */
.cohort-selector {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: 999px;
    padding: 0.25rem 0.3rem 0.25rem 0.7rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.cohort-selector:hover {
    border-color: rgba(34, 211, 238, 0.65);
    background: rgba(34, 211, 238, 0.13);
}

/* En pantallas angostas el bloque vuelve al flujo para no taparse con el título */
@media (max-width: 900px) {
    .header__tools {
        position: static;
        align-items: center;
        margin: 0 auto 1rem;
    }
    .cohort-selector { justify-content: center; }
}

.cohort-selector__label {
    font-size: 0.7rem;
    color: var(--color-cyan);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cohort-selector select,
.cohort-selector input {
    padding: 0.32rem 0.6rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--color-white);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    min-width: 150px;
    cursor: pointer;
}

.cohort-selector select:hover,
.cohort-selector input:hover {
    background: rgba(34, 211, 238, 0.12);
}

.cohort-selector select:focus-visible,
.cohort-selector input:focus-visible {
    outline: 2px solid var(--color-cyan);
    outline-offset: 1px;
}

.cohort-selector select option { background: #0e2b33; color: var(--color-white); }

.cohort-selector__btn {
    padding: 0.3rem 0.7rem;
    background: rgba(34, 211, 238, 0.16);
    border: 1px solid rgba(34, 211, 238, 0.5);
    border-radius: 999px;
    color: var(--color-cyan);
    font-size: 0.74rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.cohort-selector__btn:hover {
    background: rgba(34, 211, 238, 0.3);
    border-color: var(--color-cyan);
}

.cohort-selector__btn:focus-visible {
    outline: 2px solid var(--color-cyan);
    outline-offset: 2px;
}

/* === Menú principal de navegación (todas las páginas) === */
/* Barra de navegación tipo píldora: agrupa los enlaces en un contenedor con
   relieve para que no se vea plana. */
.main-nav {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding: 0.35rem;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 8px 24px rgba(0, 0, 0, 0.35);
}

.main-nav a {
    padding: 0.5rem 1.05rem;
    border-radius: 999px;
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.main-nav a:hover {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(-1px);
}

.main-nav a:focus-visible {
    outline: 2px solid var(--color-orange);
    outline-offset: 2px;
}

/* La pestaña activa se resalta con el degradado de la marca */
.main-nav a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--color-orange) 0%, var(--color-purple) 100%);
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(255, 153, 0, 0.35);
}

.main-nav a.active:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--color-orange) 0%, var(--color-purple) 100%);
}

/* Separador: divide los módulos de la cohorte de lo que es de la plataforma
   (Usuarios no depende de ninguna cohorte). */
.main-nav__sep {
    width: 1px;
    height: 1.5rem;
    background: rgba(255, 255, 255, 0.16);
    margin: 0 0.4rem;
    flex: none;
}

/* Usuarios: se distingue por ser administración de la plataforma, no un módulo
   del programa. */
.main-nav a.main-nav__platform {
    color: var(--color-cyan);
}

.main-nav a.main-nav__platform:hover {
    color: #fff;
    background: rgba(34, 211, 238, 0.16);
}

.main-nav a.main-nav__platform.active {
    color: #06222a;
    background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-cyan-dark) 100%);
    box-shadow: 0 4px 16px rgba(34, 211, 238, 0.35);
}

/* === DPI Tabs (mini menú tipo segmented control) === */
.dpi-tabs {
    display: inline-flex;
    gap: 0.35rem;
    margin: 1.5rem 0;
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

.dpi-tab {
    padding: 0.6rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.dpi-tab:hover {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.05);
}

.dpi-tab--active {
    color: #fff;
    background: linear-gradient(135deg, var(--color-orange) 0%, var(--color-orange-dark) 100%);
    box-shadow: 0 4px 14px rgba(255, 153, 0, 0.3);
}

.dpi-tab--active:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--color-orange) 0%, var(--color-orange-dark) 100%);
}

.btn__icon {
    font-size: 1.2rem;
}

/* === Results Placeholder === */
.results-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.results-placeholder__icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: pulse 2s ease-in-out infinite;
}

.results-placeholder__text {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

/* === Progress === */
.progress {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.progress__bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-orange), var(--color-purple));
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    position: relative;
}

.progress__bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress__text {
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.progress__detail {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

/* === Results === */
.results-summary {
    padding: 1.25rem;
    background: rgba(255, 153, 0, 0.05);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 153, 0, 0.15);
    line-height: 1.8;
}

.results-grid {
    display: grid;
    gap: 1rem;
}

.result-card {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: var(--transition);
    background: var(--color-surface-light);
}

.result-card:hover {
    border-color: rgba(168, 85, 247, 0.3);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.08);
    transform: translateY(-2px);
}

.result-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.result-card__filename {
    font-weight: 700;
    color: var(--color-white);
    font-size: 0.9rem;
}

.result-card__status {
    font-size: 0.7rem;
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-card__status--success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--color-success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.result-card__status--error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.result-card__preview {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
    white-space: pre-line;
}

.result-card__download {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--color-orange), var(--color-orange-dark));
    color: var(--color-white);
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
}

.result-card__download:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 153, 0, 0.3);
}

.result-card__error {
    font-size: 0.8rem;
    color: var(--color-error);
    font-style: italic;
}

/* === Error Box === */
.error-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.25rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius);
}

.error-box__icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.error-box__message {
    color: var(--color-error);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* === Tablas de datos === */
/* Base compartida por las tablas del cronograma, equipos, informes y usuarios.
   Entre ellas solo cambiaba el color de acento, así que ese es lo único que se
   parametriza: se pasa con las variables y la variante --cyan las cambia de golpe.
   Lo específico de cada página (banners, sub-filas, columnas fijas) se queda en
   la página, porque no se comparte. */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    --tabla-acento: rgba(255, 153, 0, 0.3);
    --tabla-solido: var(--color-orange);
    --tabla-sel: rgba(255, 153, 0, 0.14);
}

.data-table--cyan {
    --tabla-acento: rgba(34, 211, 238, 0.3);
    --tabla-solido: var(--color-cyan);
    --tabla-sel: rgba(34, 211, 238, 0.12);
}

.data-table th {
    padding: 0.6rem 0.5rem;
    text-align: left;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    border-bottom: 2px solid var(--tabla-acento);
    white-space: nowrap;
}

.data-table td {
    padding: 0.7rem 0.5rem;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border-subtle);
    vertical-align: top;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Para tablas de una línea por fila, donde alinear arriba se ve descolgado */
.data-table--centrado td {
    vertical-align: middle;
}

/* Fila seleccionable: al hacer clic se abre en el panel lateral */
.data-row {
    cursor: pointer;
}

.data-row:focus-visible {
    outline: 2px solid var(--tabla-solido);
    outline-offset: -2px;
}

.data-row--sel td {
    background: var(--tabla-sel) !important;
}

.data-row--sel td:first-child {
    box-shadow: inset 3px 0 0 var(--tabla-solido);
}

/* === Panel lateral (drawer) === */
/* Lo usan el cronograma y equipos. El atributo [hidden] necesita más
   especificidad que .drawer, porque el display: flex de la clase le gana y el
   panel quedaría visible de forma permanente. */
.drawer[hidden],
.drawer-overlay[hidden] {
    display: none;
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 90;
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 91;
    width: min(var(--drawer-ancho, 440px), 100vw);
    background: #12151b;
    border-left: 1px solid var(--drawer-borde, rgba(255, 153, 0, 0.28));
    box-shadow: -12px 0 32px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
}

/* Variante ancha y en cian, para formularios con varios campos por fila */
.drawer--ancho {
    --drawer-ancho: 1120px;
    --drawer-borde: rgba(34, 211, 238, 0.28);
    --drawer-foco: var(--color-cyan);
}

.drawer__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.drawer__title {
    margin: 0;
    flex: 1;
    color: var(--color-white);
    font-size: 1.02rem;
    font-weight: 800;
}

.drawer__close {
    width: 2rem;
    height: 2rem;
    flex: none;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-family: inherit;
}

.drawer__close:hover {
    color: var(--color-white);
    background: rgba(255, 255, 255, 0.12);
}

.drawer__close:focus-visible,
.drawer__foot button:focus-visible {
    outline: 2px solid var(--drawer-foco, var(--color-orange));
    outline-offset: 2px;
}

.drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1.25rem 1.25rem;
}

.drawer__foot {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
}

/* === Footer === */
.footer {
    margin-top: auto;
    padding: 2rem 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    border-top: 1px solid var(--color-border-subtle);
    position: relative;
    z-index: 1;
}

/* === Utilities === */
.hidden {
    display: none !important;
}

/* === Animations === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.95); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* === Responsive === */
@media (max-width: 768px) {
    .two-column {
        grid-template-columns: 1fr;
    }

    .header__title {
        font-size: 2rem;
    }

    .header__subtitle {
        font-size: 0.95rem;
    }

    .header__logo {
        height: 108px;
    }

    .header__logo-img {
        height: 150px;
    }

    .header__logo-img--sm {
        height: 115px;
    }

    .cohort-selector select,
    .cohort-selector input {
        min-width: 130px;
    }

    .card {
        padding: 1.5rem;
    }

    .card--results {
        min-height: auto;
    }

    .results-placeholder {
        padding: 2rem 1rem;
    }

    .result-card__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .ia-badge {
        bottom: 1rem;
        right: 1rem;
        font-size: 0.65rem;
        padding: 0.4rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 2rem 0 1.5rem;
    }

    .header__title {
        font-size: 1.6rem;
    }

    .upload-area {
        padding: 1.5rem 1rem;
    }
}
