/* ==========================================================================
   Línea Italia · hoja de estilos
   1. Tokens  2. Base  3. Utilidades  4. Componentes  5. Layout  6. Páginas
   ========================================================================== */

@font-face {
    font-family: "Montserrat";
    src: url("../fonts/montserrat-latin.woff2") format("woff2");
    font-weight: 400 700;
    font-style: normal;
    font-display: swap;
}

/* 1. Tokens ---------------------------------------------------------------- */
:root {
    --ink: #121212;
    --ink-2: #262626;
    --text: #1f1f1f;
    --muted: #5d5a56;
    --line: #e2ded7;
    --line-strong: #c9c3ba;
    --stone: #f5f3ef;
    --stone-2: #ebe7e0;
    --paper: #ffffff;
    --on-dark: #f2f0ec;
    --on-dark-muted: #b9b5ae;
    --wine: #5a1d1d;
    --wine-deep: #3a1111;
    --wine-bright: #7a2a2a;
    --gold: #d8c8a0;
    --success: #1e6a3c;
    --danger: #a3262a;
    --focus: #a0702a;

    --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --radius: 10px;
    --radius-lg: 18px;
    --radius-pill: 999px;
    --container: 1200px;
    --gutter: clamp(1rem, 4vw, 2rem);
    --section-y: clamp(4rem, 9vw, 7rem);
    --header-h: 72px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.05), 0 2px 8px rgb(0 0 0 / 0.04);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 12px 32px rgb(0 0 0 / 0.08);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / 0.06), 0 24px 56px rgb(0 0 0 / 0.14);
    --glass-dark: rgb(255 255 255 / 0.05);
    --glass-dark-line: rgb(255 255 255 / 0.1);
}

/* 2. Base ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 1rem);
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection { background: var(--wine); color: var(--paper); }

h1, h2, h3 {
    margin: 0 0 0.5em;
    color: var(--ink);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 4.8vw, 3.25rem); font-weight: 700; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); }
h3 { font-size: 1.125rem; }

p { margin: 0 0 1rem; text-wrap: pretty; }
img, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-underline-offset: 0.2em; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; }
[hidden] { display: none !important; }

:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

/* 3. Utilidades ------------------------------------------------------------ */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
.narrow { max-width: 820px; }
.muted { color: var(--muted); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 100;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    background: var(--paper);
    color: var(--ink);
    font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.icon {
    width: 1.25em;
    height: 1.25em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.icon--sm { width: 0.95em; height: 0.95em; }
.icon--fill { fill: currentColor; }

.eyebrow {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--wine);
}
.eyebrow::before {
    content: "";
    width: 2rem;
    height: 1px;
    background: currentColor;
}
.eyebrow--light { color: var(--on-dark-muted); }

.lead {
    font-size: 1.125rem;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--stone);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--muted);
    white-space: nowrap;
}

.badge--warn { margin-left: 0.4rem; border-color: #ecc9c9; background: #fbefef; color: var(--danger); }

/* Aparición al hacer scroll (la clase .reveal la agrega app.js).
   Se usa animación y no transición para no pisar los efectos hover de cada tarjeta. */
.reveal:not(.is-visible) { opacity: 0; }
.reveal.is-visible { animation: reveal 0.8s var(--ease) var(--reveal-delay, 0ms) backwards; }
@keyframes reveal {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: none; }
}

/* 4. Componentes ----------------------------------------------------------- */

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.65rem 1.35rem;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn .icon { transition: transform 0.2s var(--ease); }
.btn--primary {
    background: linear-gradient(180deg, #2a2a2a 0%, var(--ink) 100%);
    color: var(--paper);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08), 0 4px 14px rgb(0 0 0 / 0.16);
}
.btn--primary:hover {
    background: linear-gradient(180deg, var(--wine-bright) 0%, var(--wine-deep) 100%);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.12), 0 8px 22px rgb(90 29 29 / 0.32);
}
.btn--primary:hover .icon { transform: translateX(2px); }
.btn--ghost { background: var(--paper); border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); background: var(--stone); }
.btn--danger { background: transparent; border-color: #e3c4c4; color: var(--danger); }
.btn--danger:hover { border-color: var(--danger); background: #fbefef; }
.btn--outline-light {
    border-color: rgb(255 255 255 / 0.3);
    background: rgb(255 255 255 / 0.04);
    color: var(--paper);
}
.btn--outline-light:hover { border-color: var(--paper); background: rgb(255 255 255 / 0.1); }
.btn--light {
    background: var(--paper);
    color: var(--wine-deep);
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
}
.btn--light:hover { background: #f6eeee; transform: translateY(-1px); }
.btn--sm { min-height: 2.25rem; padding: 0.4rem 0.9rem; font-size: 0.8125rem; }
.btn--lg { min-height: 3.25rem; padding: 0.85rem 1.9rem; font-size: 1rem; }
.btn--block { width: 100%; }
.btn--square { width: 2.25rem; padding-inline: 0; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--paper);
    color: var(--ink);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn--dark { border-color: rgb(255 255 255 / 0.25); background: rgb(255 255 255 / 0.04); color: var(--paper); }
.icon-btn--dark:hover { border-color: var(--paper); background: var(--paper); color: var(--ink); }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0.4rem 0.9rem 0.4rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.back-link .icon { transition: transform 0.2s var(--ease); }
.back-link:hover { color: var(--ink); border-color: var(--line-strong); background: var(--stone); }
.back-link:hover .icon { transform: translateX(-3px); }

/* Formularios */
.form { display: grid; gap: 1.25rem; }
.form__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.field { display: grid; gap: 0.45rem; }
.field label {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: var(--ink);
}
.field__optional { font-weight: 400; color: var(--muted); }
.field__hint { margin: 0; font-size: 0.8125rem; color: var(--muted); }
.field__error { margin: 0; font-size: 0.8125rem; font-weight: 500; color: var(--danger); }

.field input,
.field select,
.field textarea,
.search input,
.select select {
    width: 100%;
    min-height: 3rem;
    padding: 0.7rem 0.95rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: #fcfbf9;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.field textarea { resize: vertical; min-height: 9rem; }
.field input::placeholder,
.field textarea::placeholder,
.search input::placeholder { color: #8b8781; }
.field input:hover,
.field select:hover,
.field textarea:hover,
.search input:hover,
.select select:hover { border-color: #a9a299; }
.field input:focus,
.field select:focus,
.field textarea:focus,
.search input:focus,
.select select:focus {
    outline: none;
    border-color: var(--wine);
    background: var(--paper);
    box-shadow: 0 0 0 4px rgb(90 29 29 / 0.12);
}
.field--error input,
.field--error textarea { border-color: var(--danger); }
.field input[type="file"] { padding: 0.55rem; min-height: auto; }
.field input[type="file"]::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.45rem 0.9rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--ink);
    color: var(--paper);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.password { position: relative; }
.password input { padding-right: 5.5rem; }
.password__toggle {
    position: absolute;
    top: 50%;
    right: 0.45rem;
    transform: translateY(-50%);
    padding: 0.35rem 0.7rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.password__toggle:hover { color: var(--ink); background: var(--stone-2); }

/* Avisos */
.notice {
    margin-bottom: 1.25rem;
    padding: 0.95rem 1.1rem;
    border: 1px solid;
    border-left-width: 4px;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    animation: rise 0.5s var(--ease) both;
}
.notice strong { display: block; }
.notice--success { border-color: #bcd9c6; border-left-color: var(--success); background: #eef6f0; color: #164d2c; }
.notice--error { border-color: #ecc9c9; border-left-color: var(--danger); background: #fbefef; color: #7c1d20; }

/* Panel */
.panel {
    padding: clamp(1.5rem, 3vw, 2.25rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}
.panel__title { font-size: 1.125rem; margin-bottom: 1.25rem; }
.panel__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Mi perfil: portada con foto, tarjetas de datos, seguridad y accesos */
.profile-hero {
    position: relative;
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}
.profile-hero__content {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.5rem 1.75rem;
    align-items: center;
    padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 3vw, 2.25rem);
}
.profile-avatar { position: relative; line-height: 0; }
.profile-avatar__img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border: 5px solid var(--paper);
    box-shadow: 0 12px 30px rgb(0 0 0 / 0.18);
}
.profile-avatar__img.avatar--initials { font-size: 2.75rem; }
.profile-avatar.is-preview .profile-avatar__img { box-shadow: 0 0 0 3px var(--gold), 0 12px 30px rgb(0 0 0 / 0.18); }
.profile-avatar__edit {
    position: absolute;
    right: 0.35rem;
    bottom: 0.35rem;
    display: grid;
    place-items: center;
    width: 2.6rem;
    height: 2.6rem;
    border: 3px solid var(--paper);
    border-radius: 50%;
    background: var(--ink);
    color: var(--paper);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s var(--ease);
}
.profile-avatar__edit:hover { background: var(--wine); transform: scale(1.08); }
.profile-avatar__edit:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.profile-avatar__edit .icon { width: 1.05rem; height: 1.05rem; }
.profile-hero__info { min-width: 0; }
.profile-hero__info .eyebrow { margin-bottom: 0.35rem; }
.profile-hero__info h1 { margin: 0 0 0.35rem; font-size: clamp(1.6rem, 3.2vw, 2.25rem); }
.profile-hero__role {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-weight: 500;
    color: var(--muted);
}
.profile-hero__role .badge { color: var(--wine); background: #f6eeee; border-color: #ecdcdc; }
.profile-hero__photo-actions { grid-column: 1 / -1; }
.photo-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    color: var(--muted);
}
.photo-hint[hidden] { display: none; }
.photo-hint > span { display: inline-flex; align-items: center; gap: 0.4rem; }
.photo-hint__remove {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: none;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--danger);
    cursor: pointer;
}
.photo-hint__remove:hover { background: #fbefef; }
.photo-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.85rem;
    padding: 0.6rem 0.6rem 0.6rem 1rem;
    border: 1px solid #ecd9b4;
    border-radius: var(--radius-pill);
    background: #fdf8f0;
    animation: rise 0.3s var(--ease);
}
.photo-bar[hidden] { display: none; }
.photo-bar__name { flex: 1; min-width: 0; overflow: hidden; font-size: 0.8125rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 0.9fr);
    gap: 1.25rem;
    align-items: start;
}
.profile-side { display: grid; gap: 1.25rem; }
.profile-card {
    padding: clamp(1.25rem, 2.5vw, 1.6rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}
.profile-card__title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 1.1rem;
    font-size: 1rem;
}
.profile-card__title .icon { width: 1.1rem; height: 1.1rem; color: var(--wine); }
.profile-card__note { margin: 1rem 0 0; font-size: 0.75rem; color: var(--muted); }
.profile-fields { display: grid; gap: 0.35rem; margin: 0; }
.profile-field {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.6rem;
    border-radius: 12px;
    transition: background-color 0.15s;
}
.profile-field:hover { background: var(--stone); }
.profile-field__icon {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 10px;
    background: var(--stone-2);
    color: var(--wine);
}
.profile-field__icon .icon { width: 1rem; height: 1rem; }
.profile-field dt { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.profile-field dd { margin: 0.1rem 0 0; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.profile-field dd a { color: var(--ink); text-decoration: none; }
.profile-field dd a:hover { color: var(--wine); text-decoration: underline; }
.profile-actions { display: grid; gap: 0.5rem; }
.profile-actions form { margin: 0; }
.profile-action {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.7rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
    color: var(--text);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}
.profile-action:hover { border-color: var(--line-strong); background: var(--stone); }
.profile-action > span:nth-child(2) { display: grid; flex: 1; gap: 0.05rem; }
.profile-action strong { font-size: 0.875rem; color: var(--ink); }
.profile-action small { font-size: 0.75rem; color: var(--muted); }
.profile-action > .icon { color: var(--muted); }
.profile-action--danger .profile-field__icon { background: #fbefef; color: var(--danger); }
.profile-action--danger:hover { border-color: #ecc9c9; background: #fdf6f6; }
.profile-links { display: grid; gap: 0.35rem; list-style: none; }
.profile-links a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}
.profile-links a .icon { width: 1rem; height: 1rem; color: var(--wine); }
.profile-links a:hover { background: var(--stone); color: var(--wine); }
@media (max-width: 1024px) {
    .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .profile-side { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .profile-hero__content { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
    .profile-hero__role { justify-content: center; }
    .photo-hint { justify-content: center; }
    .profile-grid,
    .profile-side { grid-template-columns: minmax(0, 1fr); }
}

.data-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 0;
}
.data-list > div {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius);
    background: var(--stone);
}
.data-list dt {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}
.data-list dd { margin: 0.25rem 0 0; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }

/* Barra de búsqueda y filtros */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.search { position: relative; flex: 1 1 280px; max-width: 460px; }
.search .icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}
.search input { padding-left: 2.75rem; border-radius: var(--radius-pill); }
.select { flex: 0 1 240px; }
.select select { border-radius: var(--radius-pill); cursor: pointer; }
.toolbar__count {
    margin: 0 0 0 auto;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-pill);
    background: var(--stone-2);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
}
.toolbar__count:empty { display: none; }

/* Tablas */
.table-wrap { position: relative; overflow-x: auto; }
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}
.table th {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid var(--line-strong);
    background: #faf9f6;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-align: left;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}
.table td {
    padding: 0.95rem 1.1rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.table tbody tr { transition: background-color 0.15s; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #faf8f5; }
.table__strong { font-weight: 600; color: var(--ink); min-width: 16rem; }
.table__actions { white-space: nowrap; text-align: right; }
.table__actions > * { display: inline-flex; vertical-align: middle; margin-left: 0.4rem; }
.table__empty { padding: 1rem; }

/* Avatares */
.avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--stone);
    border: 3px solid var(--paper);
    box-shadow: 0 0 0 1px var(--line), 0 6px 16px rgb(0 0 0 / 0.08);
}
.avatar--lg { width: 96px; height: 96px; }

/* Diálogos */
.dialog {
    width: min(760px, calc(100% - 2rem));
    max-height: min(90vh, 900px);
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px rgb(0 0 0 / 0.4);
    color: var(--text);
}
.dialog[open] { animation: dialog-in 0.35s var(--ease); }
.dialog--wide { width: min(1100px, calc(100% - 2rem)); }
.dialog::backdrop {
    background: rgb(10 10 10 / 0.65);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.dialog__header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem 1rem 1.5rem;
    border-bottom: 1px solid var(--line);
    background: rgb(255 255 255 / 0.9);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}
.dialog__header h2 { flex: 1; margin: 0; font-size: 1.125rem; }
.dialog__body { padding: 1.5rem; }
.dialog__body img { border-radius: var(--radius); }
.dialog__body--flush { padding: 0; }
.pdf-frame { width: 100%; height: 75vh; border: 0; }

/* Visor de PDF tipo libro (políticas, libros, organigrama) */
.dialog--pdf {
    display: flex;
    flex-direction: column;
    width: min(1400px, calc(100% - 2rem));
    height: min(94vh, 1100px);
    max-height: none;
    overflow: hidden;
    background: #1c1a19;
}
.dialog--pdf:not([open]) { display: none; }
.dialog--pdf .dialog__header h2 {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.flip-counter {
    margin: 0;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-pill);
    background: var(--stone);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.flip-counter:empty { display: none; }
.flip-viewer {
    position: relative;
    display: flex;
    flex: 1;
    min-height: 0;
    background:
        radial-gradient(70% 60% at 50% 45%, rgb(255 255 255 / 0.07), transparent 70%),
        linear-gradient(180deg, #2a2725 0%, #1a1817 100%);
}
.flip-stage {
    display: grid;
    flex: 1;
    min-width: 0;
    place-items: center;
    overflow: hidden;
}
.flip-stage .pdf-frame { width: 100%; height: 100%; }
.flipbook-box {
    max-width: 100%;
    filter: drop-shadow(0 24px 40px rgb(0 0 0 / 0.5));
    transition: transform 0.6s var(--ease);
}
.flip-page { background: var(--paper); overflow: hidden; }
.flip-page__canvas { display: block; width: 100%; height: 100%; }
.flip-page__loading {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--line-strong);
    background: linear-gradient(110deg, #f5f3ef 30%, #fbfaf8 50%, #f5f3ef 70%) 0 0 / 200% 100%;
    animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.flip-status { margin: 0; font-size: 0.9375rem; color: var(--on-dark-muted); }
.flip-nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid rgb(255 255 255 / 0.18);
    border-radius: 50%;
    background: rgb(0 0 0 / 0.45);
    color: var(--paper);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color 0.2s, border-color 0.2s;
}
.flip-nav:hover { background: var(--wine); border-color: var(--wine-bright); }
.flip-nav--prev { left: 1rem; }
.flip-nav--next { right: 1rem; }
@media (max-width: 640px) {
    .dialog--pdf { width: 100%; height: 100%; max-width: none; border-radius: 0; }
    .dialog__header-label { display: none; }
    .flip-nav { top: auto; bottom: 1rem; transform: none; }
}

@keyframes dialog-in {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: none; }
}
@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

/* 5. Layout ---------------------------------------------------------------- */
.container--wide { max-width: 1360px; }

/* El desenfoque va en ::before para no romper el menú móvil (position: fixed) */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    color: var(--on-dark);
}
.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: rgb(18 18 18 / 0.82);
    border-bottom: 1px solid rgb(255 255 255 / 0.06);
    -webkit-backdrop-filter: saturate(160%) blur(16px);
    backdrop-filter: saturate(160%) blur(16px);
    transition: background-color 0.3s, box-shadow 0.3s;
}
.site-header[data-scrolled]::before {
    background: rgb(14 14 14 / 0.9);
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
}
.scroll-progress {
    position: absolute;
    left: 0;
    bottom: -1px;
    z-index: 1;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--wine-bright), var(--gold));
    transform: scaleX(var(--progress, 0));
    transform-origin: left;
    pointer-events: none;
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: var(--header-h);
}
.brand { flex-shrink: 0; transition: opacity 0.2s; }
.brand:hover { opacity: 0.85; }
.brand img { width: auto; height: 34px; }

.site-nav { display: flex; align-items: center; gap: 1.5rem; }
.site-nav__links { display: flex; align-items: center; gap: 0.15rem; list-style: none; }
.site-nav__links a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.9rem;
    border-radius: var(--radius-pill);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: #cfcac2;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s, background-color 0.2s;
}
.site-nav__links a:hover { color: var(--paper); background: rgb(255 255 255 / 0.06); }
.site-nav__links a[aria-current="true"] { color: var(--paper); background: rgb(255 255 255 / 0.1); }

.site-nav__links .site-nav__feature {
    margin-left: 0.5rem;
    padding: 0.5rem 1.1rem;
    border: 1px solid rgb(216 200 160 / 0.35);
    background: linear-gradient(135deg, var(--wine-bright) 0%, var(--wine-deep) 100%);
    color: var(--paper);
    font-weight: 600;
    box-shadow: 0 4px 16px rgb(90 29 29 / 0.45);
    transition: box-shadow 0.2s, transform 0.2s var(--ease), border-color 0.2s;
}
.site-nav__links .site-nav__feature:hover {
    background: linear-gradient(135deg, #8a3232 0%, var(--wine) 100%);
    border-color: rgb(216 200 160 / 0.7);
    box-shadow: 0 6px 22px rgb(122 42 42 / 0.6);
    transform: translateY(-1px);
}

.account { position: relative; }
.account__trigger {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.3rem 0.8rem 0.3rem 0.3rem;
    border: 1px solid rgb(255 255 255 / 0.12);
    border-radius: var(--radius-pill);
    background: rgb(255 255 255 / 0.03);
    list-style: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
.account__trigger::-webkit-details-marker { display: none; }
.account__trigger:hover,
.account[open] .account__trigger { background: rgb(255 255 255 / 0.08); border-color: rgb(255 255 255 / 0.22); }
.account__avatar {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #fff 0%, var(--gold) 140%);
    color: var(--wine-deep);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}
.account__avatar--photo { object-fit: cover; border: 2px solid rgb(255 255 255 / 0.85); }
.account__name {
    max-width: 12rem;
    overflow: hidden;
    font-size: 0.8125rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.account__role {
    padding: 0.05rem 0.4rem;
    border: 1px solid rgb(74 222 128 / 0.5);
    border-radius: var(--radius-pill);
    background: rgb(34 197 94 / 0.16);
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #4ade80;
    white-space: nowrap;
}
.account__role-note {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #15803d;
}
.account__chevron { color: var(--on-dark-muted); transition: transform 0.25s var(--ease); }
.account[open] .account__chevron { transform: rotate(180deg); }
.account__menu {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    min-width: 250px;
    padding: 0.5rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
    color: var(--text);
    box-shadow: var(--shadow-lg);
    transform-origin: top right;
    animation: menu-in 0.2s var(--ease);
}
@keyframes menu-in {
    from { opacity: 0; transform: translateY(-6px) scale(0.97); }
    to { opacity: 1; transform: none; }
}
.account__menu form { margin: 0; }
.account__full {
    margin: 0 0 0.35rem;
    padding: 0.6rem 0.75rem 0.75rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--ink);
}
.account__item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 0.875rem;
    color: var(--text);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.account__item:hover { background: var(--stone); color: var(--wine); }

.nav-toggle {
    display: none;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 0.15);
    border-radius: 50%;
    background: rgb(255 255 255 / 0.04);
    color: var(--paper);
    cursor: pointer;
}
.nav-toggle__close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__close { display: block; }

@media (max-width: 1200px) {
    .nav-toggle { display: inline-grid; }
    .site-nav {
        position: fixed;
        inset: var(--header-h) 0 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
        padding: 0.5rem var(--gutter) 2rem;
        background: rgb(14 14 14 / 0.97);
        -webkit-backdrop-filter: blur(16px);
        backdrop-filter: blur(16px);
        overflow-y: auto;
    }
    .site-nav[data-open] { display: flex; animation: rise 0.3s var(--ease); }
    .site-nav__links { flex-direction: column; align-items: stretch; gap: 0; }
    .site-nav__links a {
        display: flex;
        padding: 1.05rem 0.25rem;
        border-bottom: 1px solid #262626;
        border-radius: 0;
        font-size: 1.0625rem;
    }
    .site-nav__links a:hover,
    .site-nav__links a[aria-current="true"] { background: transparent; color: var(--paper); }
    .site-nav__links a[aria-current="true"] { box-shadow: inset 3px 0 0 var(--gold); padding-left: 1rem; }
    .site-nav__links .site-nav__feature {
        justify-content: center;
        margin: 1.25rem 0 0;
        padding: 0.95rem 1rem;
        border-radius: var(--radius-pill);
    }
    .account__trigger { border-color: #262626; }
    .account__menu { position: static; margin-top: 0.75rem; box-shadow: none; animation: none; }
}

main:focus { outline: none; }

.section { padding-block: var(--section-y); }
.section--stone { background: var(--stone); }
.section__header { max-width: 720px; margin-bottom: clamp(2rem, 5vw, 3rem); }

/* Botón volver arriba */
.to-top {
    position: fixed;
    right: clamp(1rem, 3vw, 2rem);
    bottom: clamp(1rem, 3vw, 2rem);
    z-index: 40;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid rgb(255 255 255 / 0.15);
    border-radius: 50%;
    background: rgb(18 18 18 / 0.85);
    color: var(--paper);
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s var(--ease), background-color 0.2s;
}
.to-top[data-visible] { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--wine); }
/* Pantalla de transición a plataformas externas */
.page-conectando { background: #120606; }
.connect {
    position: relative;
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 1.5rem;
    overflow: hidden;
    background:
        radial-gradient(60% 50% at 80% 10%, rgb(216 200 160 / 0.18), transparent 60%),
        radial-gradient(120% 90% at 0% 0%, var(--wine-bright) 0%, var(--wine-deep) 55%, #120606 100%);
    color: var(--on-dark);
}
.connect::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgb(255 255 255 / 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent);
    mask-image: radial-gradient(70% 70% at 50% 50%, #000, transparent);
}
.connect__card {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 0.5rem;
    width: min(420px, 100%);
    text-align: center;
    animation: rise 0.6s var(--ease) both;
}
.connect__logo { width: 170px; margin-bottom: 2.25rem; opacity: 0.95; }
.connect__app { position: relative; display: grid; place-items: center; width: 120px; height: 120px; margin-bottom: 1.5rem; }
.connect__app img,
.connect__app-icon {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    border: 3px solid rgb(255 255 255 / 0.9);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 16px 40px rgb(0 0 0 / 0.4);
}
.connect__app-icon { display: grid; place-items: center; background: rgb(255 255 255 / 0.08); color: var(--gold); }
.connect__app-icon .icon { width: 2.5rem; height: 2.5rem; }
.connect__ring {
    position: absolute;
    inset: -14px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    animation: connect-ring 1.6s ease-out infinite;
}
@keyframes connect-ring {
    0% { transform: scale(0.85); opacity: 0.9; }
    100% { transform: scale(1.35); opacity: 0; }
}
.connect__title { margin: 0; font-size: clamp(1.4rem, 4vw, 1.75rem); color: var(--paper); }
.connect__text { margin: 0 0 1.25rem; font-size: 0.9375rem; color: #d9c9c9; }
.connect__bar {
    width: min(260px, 80%);
    height: 4px;
    overflow: hidden;
    border-radius: var(--radius-pill);
    background: rgb(255 255 255 / 0.12);
}
.connect__bar span {
    display: block;
    width: 40%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--gold), #fff3d6);
    animation: connect-bar 1.1s ease-in-out infinite;
}
@keyframes connect-bar {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(260%); }
}
.connect__fallback {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.75rem;
    padding: 0.5rem 1rem;
    border: 1px solid rgb(216 200 160 / 0.4);
    border-radius: var(--radius-pill);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gold);
    text-decoration: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s, background-color 0.2s;
}
.connect__fallback.is-visible { opacity: 1; visibility: visible; }
.connect__fallback:hover { background: rgb(216 200 160 / 0.12); }

/* Aviso flotante (toast): arriba a la derecha, bajo el encabezado */
.toast {
    position: fixed;
    top: calc(var(--header-h) + 1rem);
    right: clamp(1rem, 3vw, 2rem);
    z-index: 60;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    width: min(380px, calc(100vw - 2rem));
    padding: 1rem 1rem 1.1rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper);
    color: var(--text);
    box-shadow: 0 20px 50px rgb(0 0 0 / 0.18);
    animation: toast-in 0.45s var(--ease) both;
}
.page-login .toast { top: 1rem; }
.toast.is-leaving { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }
.toast__icon {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--wine-bright), var(--wine-deep));
    color: var(--gold);
}
.toast--info .toast__icon { background: var(--ink); color: var(--paper); }
.toast--error .toast__icon { background: var(--danger); color: var(--paper); }
.toast__icon .icon { width: 1.15rem; height: 1.15rem; }
.toast__body { display: grid; flex: 1; gap: 0.15rem; min-width: 0; padding-top: 0.1rem; }
.toast__body strong { font-size: 0.9375rem; color: var(--ink); }
.toast__body span { font-size: 0.8125rem; color: var(--muted); }
.toast__close {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.toast__close:hover { background: var(--stone); color: var(--ink); }
/* Barra que indica el tiempo restante */
.toast__timer {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--wine-bright), var(--gold));
    transform-origin: left;
    animation: toast-timer var(--toast-duracion, 5s) linear forwards;
}
.toast.is-paused .toast__timer { animation-play-state: paused; }
@keyframes toast-timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Con sesión, "volver arriba" va encima del botón de notificaciones */
.to-top--stacked { bottom: calc(clamp(1rem, 3vw, 2rem) + 4.25rem); }

/* Notificaciones: botón flotante + ventana emergente pegada al botón */
.notif {
    position: fixed;
    right: clamp(1rem, 3vw, 2rem);
    bottom: clamp(1rem, 3vw, 2rem);
    z-index: 45;
}
.notif__fab {
    position: relative;
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--wine-bright), var(--wine-deep));
    color: var(--paper);
    box-shadow: 0 12px 30px rgb(58 17 17 / 0.45), inset 0 1px 0 rgb(255 255 255 / 0.15);
    cursor: pointer;
    transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.notif__fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 16px 36px rgb(58 17 17 / 0.55); }
.notif__fab .icon { width: 1.4rem; height: 1.4rem; }
.notif:not(.is-open):has(.notif__badge:not([hidden])) .notif__fab .icon { animation: bell-ring 3s ease-in-out 1s infinite; transform-origin: top center; }
@keyframes bell-ring {
    0%, 72%, 100% { transform: rotate(0); }
    76% { transform: rotate(16deg); }
    80% { transform: rotate(-14deg); }
    84% { transform: rotate(9deg); }
    88% { transform: rotate(-5deg); }
}
.notif__badge {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    display: grid;
    place-items: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.35rem;
    border: 2px solid var(--paper);
    border-radius: var(--radius-pill);
    background: var(--gold);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--ink);
}
.notif__badge[hidden] { display: none; }
.notif__panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.85rem);
    display: flex;
    flex-direction: column;
    width: min(400px, calc(100vw - 2rem));
    max-height: min(70vh, 560px);
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--paper);
    color: var(--text);
    box-shadow: 0 24px 60px rgb(0 0 0 / 0.22);
    transform-origin: bottom right;
    animation: notif-in 0.25s var(--ease);
}
.notif__panel[hidden] { display: none; }
/* Pestaña que une la ventana con el botón */
.notif__panel::after {
    content: "";
    position: absolute;
    right: 1.35rem;
    bottom: -0.5rem;
    width: 0.9rem;
    height: 0.9rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--paper);
    transform: rotate(45deg);
}
@keyframes notif-in {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to { opacity: 1; transform: none; }
}
.notif__head {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1rem 0.75rem 1.25rem;
}
.notif__head h2 { flex: 1; margin: 0; font-size: 1.0625rem; }
.notif__read-all {
    padding: 0.3rem 0.7rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--wine);
    cursor: pointer;
}
.notif__read-all:hover { background: #f6eeee; }
.notif__close {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.notif__close:hover { background: var(--stone); color: var(--ink); }
.notif__tabs {
    display: flex;
    flex-shrink: 0;
    gap: 0.25rem;
    margin: 0 1.25rem 0.75rem;
    padding: 0.25rem;
    border-radius: var(--radius-pill);
    background: var(--stone);
}
.notif__tab {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    border: 0;
    border-radius: var(--radius-pill);
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.notif__tab:hover { color: var(--ink); }
.notif__tab[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-sm); }
.notif__tab-count {
    min-width: 1.2rem;
    padding: 0 0.35rem;
    border-radius: var(--radius-pill);
    background: var(--wine);
    font-size: 0.6875rem;
    line-height: 1.2rem;
    color: var(--paper);
    text-align: center;
}
.notif__tab-count--muted { background: var(--stone-2); color: var(--muted); }
.notif__tab-count:empty { display: none; }
/* Filtros por tipo: fila con scroll horizontal. El borde se difumina del lado
   donde quedan más filtros (clases has-more-left/right las pone app.js). */
.notif__filters {
    position: relative;
    flex-shrink: 0;
    border-bottom: 1px solid var(--line);
}
.notif__filters::before,
.notif__filters::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1;
    width: 2.75rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}
.notif__filters::before { left: 0; background: linear-gradient(to right, var(--paper) 35%, transparent); }
.notif__filters::after { right: 0; background: linear-gradient(to left, var(--paper) 35%, transparent); }
.notif__filters.has-more-left::before,
.notif__filters.has-more-right::after { opacity: 1; }
.notif__chips {
    position: relative;
    display: flex;
    gap: 0.4rem;
    padding: 0 1.25rem 0.7rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}
.notif__chips::-webkit-scrollbar { height: 6px; }
.notif__chips::-webkit-scrollbar-thumb { border-radius: 6px; background: var(--line-strong); }
.notif__chip {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--paper);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.notif__chip:hover { border-color: var(--line-strong); color: var(--ink); }
.notif__chip[aria-selected="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.notif__chip-count {
    min-width: 1.1rem;
    padding: 0 0.3rem;
    border-radius: var(--radius-pill);
    background: var(--wine);
    font-size: 0.625rem;
    line-height: 1.1rem;
    color: var(--paper);
    text-align: center;
}
.notif__chip-count:empty { display: none; }
.notif__chip[aria-selected="true"] .notif__chip-count { background: var(--gold); color: var(--ink); }
/* Solo la lista hace scroll; encabezado, pestañas y filtros quedan fijos */
.notif__list {
    flex: 1 1 auto;
    min-height: 8rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 0 0 20px 20px;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}
.notif__list::-webkit-scrollbar { width: 8px; }
.notif__list::-webkit-scrollbar-thumb { border: 2px solid var(--paper); border-radius: 8px; background: var(--line-strong); }
.notif__item:not(.is-new) .notif__body strong { font-weight: 600; color: var(--text); }
.notif__item:not(.is-new) .notif__icon { opacity: 0.7; }
.notif__item {
    position: relative;
    display: flex;
    gap: 0.8rem;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    text-decoration: none;
    transition: background-color 0.15s;
}
.notif__item:hover { background: var(--stone); }
.notif__item.is-new { background: #fdf8f0; }
.notif__item.is-new::after {
    content: "";
    position: absolute;
    top: 1.15rem;
    right: 1.1rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--wine);
}
.notif__icon {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 12px;
    background: var(--stone-2);
    color: var(--wine);
}
.notif__item--cumpleanos .notif__icon { background: var(--wine); color: var(--gold); }
.notif__icon .icon { width: 1.05rem; height: 1.05rem; }
.notif__body { display: grid; gap: 0.1rem; min-width: 0; padding-right: 0.9rem; font-size: 0.8125rem; }
.notif__body strong { font-size: 0.8125rem; color: var(--ink); }
.notif__text { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--muted); }
.notif__time { font-size: 0.6875rem; color: #8b8781; }
.notif__empty { display: grid; justify-items: center; gap: 0.5rem; margin: 0; padding: 2.25rem 1rem; font-size: 0.875rem; color: var(--muted); }
.notif__empty .icon { width: 1.75rem; height: 1.75rem; color: var(--line-strong); }

/* Pie de página */
.site-footer {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: #0b0b0b;
    color: #a19d96;
    font-size: 0.875rem;
    line-height: 1.6;
}
.site-footer::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgb(216 200 160 / 0.45) 50%, transparent);
}
.site-footer::after {
    content: "";
    position: absolute;
    right: -6rem;
    bottom: -8rem;
    z-index: -1;
    width: 28rem;
    aspect-ratio: 1;
    background: url("../img/brand/isotipo-blanco.webp") center / contain no-repeat;
    opacity: 0.025;
}
.site-footer a { text-decoration: none; transition: color 0.2s; }
.site-footer a:hover { color: var(--paper); }

.site-footer .container { max-width: 1440px; padding-inline: clamp(1rem, 4vw, 3rem); }
.site-footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr) minmax(0, 1.25fr) minmax(0, 1.2fr);
    gap: clamp(2rem, 5vw, 5rem);
    padding-block: clamp(3.5rem, 7vw, 5rem) clamp(2.5rem, 5vw, 3.5rem);
}
.site-footer__logo { width: 170px; margin-bottom: 1.35rem; }
.site-footer__about { max-width: 36ch; margin-bottom: 1.5rem; }
.site-footer__title {
    margin: 0 0 1.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--paper);
}

.social { display: flex; gap: 0.5rem; list-style: none; }
.social__link {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid rgb(255 255 255 / 0.12);
    border-radius: 50%;
    color: var(--on-dark);
    transition: background-color 0.25s, border-color 0.25s, color 0.25s, transform 0.25s var(--ease);
}
.social__link .icon { width: 1.05rem; height: 1.05rem; }
.site-footer .social__link:hover {
    border-color: var(--gold);
    background: var(--gold);
    color: var(--ink);
    transform: translateY(-2px);
}

.site-footer__links { display: grid; gap: 0.8rem; list-style: none; }
.site-footer__links a {
    position: relative;
    display: inline-flex;
    align-items: center;
    color: #a19d96;
}
.site-footer__links a::before {
    content: "";
    width: 0;
    height: 1px;
    margin-right: 0;
    background: var(--gold);
    transition: width 0.25s var(--ease), margin-right 0.25s var(--ease);
}
.site-footer__links a:hover::before { width: 0.85rem; margin-right: 0.5rem; }

.site-footer__contact { display: grid; gap: 1rem; list-style: none; }
.site-footer__contact li { display: flex; gap: 0.85rem; align-items: flex-start; }
.site-footer__contact a { color: var(--on-dark); overflow-wrap: anywhere; }
.site-footer__icon {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    margin-top: -0.2rem;
    border-radius: 10px;
    background: rgb(255 255 255 / 0.05);
    color: var(--gold);
}
.site-footer__icon .icon { width: 1rem; height: 1rem; }

.report-card {
    position: relative;
    padding: 1.5rem;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 0.08);
    border-radius: var(--radius-lg);
    background: linear-gradient(150deg, rgb(122 42 42 / 0.35) 0%, rgb(58 17 17 / 0.15) 60%, transparent 100%);
}
.report-card__icon {
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 1rem;
    border-radius: 12px;
    background: linear-gradient(145deg, var(--wine-bright), var(--wine-deep));
    color: var(--paper);
    box-shadow: 0 8px 20px rgb(90 29 29 / 0.4);
}
.report-card__icon .icon { width: 1.15rem; height: 1.15rem; }
.report-card__title {
    margin-bottom: 0.4rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--paper);
}
.report-card p { margin-bottom: 1rem; font-size: 0.8125rem; }
.site-footer .report-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gold);
}
.report-card__link .icon { transition: transform 0.25s var(--ease); }
.site-footer .report-card__link:hover { color: var(--paper); }
.report-card__link:hover .icon { transform: translateX(3px); }
.site-footer__ctpat { width: 150px; margin-top: 1.5rem; opacity: 0.55; transition: opacity 0.2s; }
.site-footer__ctpat:hover { opacity: 0.85; }

.site-footer__bottom { border-top: 1px solid rgb(255 255 255 / 0.07); }
.site-footer__bottom-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    padding-block: 1.4rem;
    font-size: 0.75rem;
    color: #7d7973;
}
.site-footer__bottom-inner p { margin: 0; }
.site-footer__meta { letter-spacing: 0.08em; text-transform: uppercase; }

@media (max-width: 1024px) {
    .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .site-footer__grid { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
    .site-footer__bottom-inner { flex-direction: column; align-items: flex-start; }
}

/* 6. Páginas --------------------------------------------------------------- */

/* Buzón de denuncias */
.buzon {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: var(--section-y);
    background:
        radial-gradient(70% 60% at 0% 0%, rgb(122 42 42 / 0.45), transparent 65%),
        radial-gradient(60% 50% at 100% 100%, rgb(90 29 29 / 0.3), transparent 70%),
        linear-gradient(135deg, #121212 0%, #222 100%);
    color: var(--on-dark-muted);
}
.buzon::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgb(255 255 255 / 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgb(255 255 255 / 0.03) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(80% 80% at 30% 40%, #000, transparent);
    mask-image: radial-gradient(80% 80% at 30% 40%, #000, transparent);
}
.page-buzon .buzon { min-height: calc(100vh - var(--header-h)); display: flex; align-items: center; }
.buzon__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(2.5rem, 6vw, 5rem);
    align-items: center;
}
.buzon__intro h1,
.buzon__intro h2 { color: var(--paper); font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 700; }
.buzon__intro .lead { color: var(--on-dark); font-weight: 500; font-size: 1.25rem; }
.buzon__mail {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--glass-dark-line);
    border-radius: var(--radius);
    background: var(--glass-dark);
}
.buzon__mail a { color: var(--paper); font-weight: 600; overflow-wrap: anywhere; }
.buzon__ctpat { width: 200px; margin-top: 2.25rem; opacity: 0.85; }

.form-card {
    position: relative;
    padding: clamp(1.75rem, 4vw, 2.75rem);
    border-radius: 22px;
    background: var(--paper);
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.08), 0 40px 90px rgb(0 0 0 / 0.45);
    color: var(--text);
    scroll-margin-top: calc(var(--header-h) + 1rem);
}
.form-card::before {
    content: "";
    position: absolute;
    inset: 0 2rem auto;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, var(--wine-bright), var(--gold));
}
.form-card__logo { width: 180px; margin: 0 auto 1.75rem; }

@media (max-width: 900px) {
    .page-buzon .buzon { min-height: 0; }
    .buzon__grid { grid-template-columns: minmax(0, 1fr); }
}

/* Login */
.page-login { background: var(--stone); }
.login {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: 100vh;
}
.login__media { position: relative; overflow: hidden; background: var(--ink); }
.login__media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: slow-zoom 20s ease-out both;
}
.login__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgb(18 18 18 / 0.85) 100%),
        linear-gradient(90deg, rgb(58 17 17 / 0.25), transparent 60%);
}
@keyframes slow-zoom {
    from { transform: scale(1.08); }
    to { transform: scale(1); }
}
.login__caption {
    position: absolute;
    left: clamp(1.5rem, 4vw, 3.5rem);
    right: clamp(1.5rem, 4vw, 3.5rem);
    bottom: clamp(1.5rem, 5vw, 3.5rem);
    z-index: 1;
    max-width: 30rem;
    animation: rise 0.8s 0.2s var(--ease) both;
}
.login__caption .eyebrow { color: var(--gold); }
.login__tagline {
    margin: 0;
    font-size: clamp(1.5rem, 2.8vw, 2.25rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--paper);
}
.login__panel {
    display: flex;
    flex-direction: column;
    padding: clamp(1.5rem, 4vw, 3rem);
    background: var(--paper);
}
.login__box {
    width: 100%;
    max-width: 400px;
    margin: auto;
    padding-block: 2rem;
    animation: rise 0.6s var(--ease) both;
}
.login__logo { width: 200px; margin-bottom: 2.75rem; }
.login__box h1 { font-size: 1.875rem; margin-bottom: 1.75rem; }
.login__box .btn--primary { min-height: 3.1rem; margin-top: 0.25rem; }
.login__forgot {
    display: inline-block;
    margin-top: 1.25rem;
    font-size: 0.875rem;
    color: var(--muted);
}
.login__forgot:hover { color: var(--wine); }

@media (max-width: 860px) {
    .login { grid-template-columns: 1fr; }
    .login__media { min-height: 240px; }
    .login__tagline { font-size: 1.35rem; }
}

/* Portal: encabezados de sección */
.heading {
    max-width: 780px;
    margin: 0 auto clamp(2.5rem, 5vw, 4rem);
    text-align: center;
}
.heading__mark { width: 40px; height: 40px; margin: 0 auto 1.25rem; opacity: 0.9; }
.heading h2,
.culture__intro h2,
.roman h2 {
    margin-bottom: 0;
    font-size: clamp(2.1rem, 4.6vw, 3.1rem);
    font-weight: 700;
    letter-spacing: -0.025em;
}
.heading__intro {
    max-width: 640px;
    margin: 1.1rem auto 0;
    font-size: 1.0625rem;
    color: var(--muted);
}
.heading--dark h2 { color: var(--paper); }
.heading--dark .heading__intro { color: var(--on-dark-muted); }
.heading--dark .eyebrow { color: var(--gold); }
.eyebrow--center { justify-content: center; }
.eyebrow--center::after {
    content: "";
    width: 2rem;
    height: 1px;
    background: currentColor;
}

/* Portal: fondos de sección (paleta y texturas del sitio original) */
.section--charcoal {
    position: relative;
    isolation: isolate;
    background: linear-gradient(100deg, #141414 0%, #1f1f1f 45%, #363636 100%);
    color: var(--on-dark-muted);
}
.section--charcoal::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(50% 60% at 85% 10%, rgb(216 200 160 / 0.08), transparent 70%);
}
.section--wine {
    background: radial-gradient(120% 70% at 50% 0%, #521b1b 0%, var(--wine-deep) 55%, #220909 100%);
    color: #dccaca;
}
.section--wine h3 { color: var(--paper); }
.section--marble {
    position: relative;
    isolation: isolate;
    background: var(--stone);
}
.section--marble::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: url("../img/portal/columnas.webp") center / cover no-repeat;
    opacity: 0.3;
}
/* Columnas y arco (parte superior de la foto) que se desvanecen a blanco, como el sitio original */
.section--roman {
    display: flex;
    align-items: center;
    min-height: clamp(420px, 56vh, 580px);
    padding-block: clamp(5rem, 10vw, 8rem) clamp(3rem, 6vw, 5rem);
    background:
        linear-gradient(180deg, rgb(255 255 255 / 0.12) 0%, rgb(255 255 255 / 0.35) 55%, var(--paper) 100%),
        url("../img/portal/presupuesto.webp") center 18% / cover no-repeat;
}
/* Cultura sube sobre el desvanecido de Control Presupuestal: el capitel queda dentro de la zona blanca */
.section--culture {
    position: relative;
    margin-top: clamp(-4rem, -4vw, -2rem);
    padding-top: 0;
    padding-bottom: clamp(2rem, 4vw, 3rem);
    background: transparent;
}

/* Portal: portada */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-top: clamp(3rem, 8vw, 6rem);
    padding-bottom: clamp(3rem, 6vw, 5rem);
    background:
        radial-gradient(60% 45% at 50% 0%, rgb(216 200 160 / 0.22), transparent 70%),
        linear-gradient(180deg, #fbfaf8 0%, var(--stone) 100%);
}
.hero::before,
.hero::after {
    content: "";
    position: absolute;
    top: 0;
    z-index: -1;
    width: min(34vw, 460px);
    height: 62%;
    background: url("../img/portal/columnas.webp") no-repeat;
    background-size: auto 100%;
    opacity: 0.5;
}
.hero::before {
    left: 0;
    background-position: left top;
    -webkit-mask-image: linear-gradient(90deg, #000 35%, transparent);
    mask-image: linear-gradient(90deg, #000 35%, transparent);
}
.hero::after {
    right: 0;
    background-position: right top;
    -webkit-mask-image: linear-gradient(270deg, #000 35%, transparent);
    mask-image: linear-gradient(270deg, #000 35%, transparent);
}
.hero__inner { text-align: center; }
.hero__inner > * { animation: rise 0.8s var(--ease) both; }
.hero__inner > :nth-child(2) { animation-delay: 0.08s; }
.hero__inner > :nth-child(3) { animation-delay: 0.16s; }
.hero__inner > :nth-child(4) { animation-delay: 0.24s; }
.hero__inner > :nth-child(5) { animation-delay: 0.32s; }
.hero__date {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 2rem;
    padding: 0.4rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: rgb(255 255 255 / 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
}
.hero__brand { margin: 0 0 1.75rem; }
.hero__brand img { width: min(600px, 86%); margin-inline: auto; }
.hero__welcome {
    margin: 0;
    font-size: clamp(1.125rem, 2.2vw, 1.375rem);
    color: var(--muted);
}
.hero__welcome strong { color: var(--ink); font-weight: 600; }
.hero .carousel { margin-top: clamp(2.5rem, 6vw, 4rem); }

/* Accesos rápidos */
.quick { margin-top: clamp(1.75rem, 4vw, 2.5rem); }
.quick__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
    list-style: none;
}
.quick__item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 1rem 0.4rem 0.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: rgb(255 255 255 / 0.75);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
    text-decoration: none;
    transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
}
.quick__icon {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--stone-2);
    color: var(--wine);
    transition: background-color 0.25s, color 0.25s;
}
.quick__icon .icon { width: 1rem; height: 1rem; }
.quick__item:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
}
.quick__item:hover .quick__icon { background: var(--wine); color: var(--paper); }

@media (max-width: 640px) {
    .quick__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); text-align: left; }
    .quick__item { width: 100%; font-size: 0.8125rem; }
}

/* Carrusel */
.carousel__track {
    position: relative;
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    padding: 0.5rem max(var(--gutter), calc((100% - var(--container)) / 2 + var(--gutter))) 1.25rem;
    scroll-padding-inline: max(var(--gutter), calc((100% - var(--container)) / 2 + var(--gutter)));
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__item { flex: 0 0 clamp(270px, 30vw, 420px); scroll-snap-align: start; }
/* Galería de portada: de orilla a orilla, foto activa centrada */
.carousel--gallery .carousel__track {
    padding-inline: 0;
    scroll-padding-inline: 0;
}
.carousel--gallery .carousel__controls { max-width: none; margin: 0 0 0.75rem; padding-inline: 5%; }
.carousel--gallery .carousel__item {
    flex-basis: clamp(240px, 26vw, 440px);
    scroll-snap-align: center;
}
.carousel--gallery .carousel__item {
    position: relative;
    margin: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--stone-2);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 14px 34px rgb(0 0 0 / 0.1);
}
.carousel--gallery .carousel__item::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.25);
    background: linear-gradient(180deg, transparent 60%, rgb(0 0 0 / 0.18));
    pointer-events: none;
}
.carousel--gallery .carousel__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s var(--ease);
}
.carousel--gallery .carousel__item:hover img { transform: scale(1.05); }
.carousel__controls { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 1rem; }

@media (max-width: 640px) {
    .carousel__item,
    .carousel--gallery .carousel__item { flex-basis: 72%; }
}

/* Titulares: nota destacada + lista de comunicados */
.news {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: stretch;
}
.news__featured {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 3rem;
    min-height: 360px;
    padding: clamp(1.75rem, 4vw, 2.75rem);
    overflow: hidden;
    border-radius: 24px;
    background:
        radial-gradient(90% 70% at 100% 0%, rgb(216 200 160 / 0.28), transparent 65%),
        linear-gradient(160deg, #fdfcfa 0%, var(--stone) 60%, var(--stone-2) 100%);
    box-shadow: 0 30px 70px rgb(0 0 0 / 0.4);
}
.news__featured::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--gold), var(--wine));
}
.news__featured::after {
    content: "";
    position: absolute;
    top: -2.5rem;
    right: -2.5rem;
    z-index: -1;
    width: 15rem;
    aspect-ratio: 1;
    background: url("../img/brand/isotipo-negro.webp") center / contain no-repeat;
    opacity: 0.05;
}
.news__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.news__date {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
}
.news__area {
    margin: 0 0 0.85rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--wine);
}
.news__lead {
    margin: 1.1rem 0 0;
    padding-top: 1.1rem;
    border-top: 1px solid var(--line-strong);
    font-size: 1rem;
    color: var(--muted);
}
.news__tag {
    padding: 0.3rem 0.85rem;
    border-radius: var(--radius-pill);
    background: var(--ink);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--paper);
}
.news__headline {
    margin: 0;
    font-size: clamp(1.5rem, 2.8vw, 2.1rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--ink);
}
.news__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.9rem;
    margin: 0;
    font-size: 0.8125rem;
    color: var(--on-dark-muted);
}
.news__meta strong {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
}
.news__meta span::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 0.9rem 0.2rem 0;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.6;
}

/* La lista no agranda la fila: su contenedor toma la altura de la nota destacada y la lista hace scroll */
.news__scroll { position: relative; min-height: 0; }
.news__list {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding-right: 0.75rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
    scrollbar-width: thin;
    scrollbar-color: rgb(216 200 160 / 0.45) transparent;
    -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(180deg, #000 calc(100% - 2.5rem), transparent);
}
.news__list::-webkit-scrollbar { width: 6px; }
.news__list::-webkit-scrollbar-thumb { border-radius: 6px; background: rgb(216 200 160 / 0.45); }
.news__item {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1.25rem;
    flex-shrink: 0;
    padding: 1.4rem 0.5rem 1.4rem 0;
    border-bottom: 1px solid var(--glass-dark-line);
}
.news__item:first-child { padding-top: 0.25rem; }
.news__item:last-child { border-bottom: 0; }
.news__item::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, var(--gold), transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s var(--ease);
}
.news__item:hover::after { transform: scaleX(1); }
.news__index {
    font-size: 1.75rem;
    font-weight: 300;
    line-height: 1;
    color: rgb(255 255 255 / 0.22);
    font-variant-numeric: tabular-nums;
    transition: color 0.3s;
}
.news__item:hover .news__index { color: var(--gold); }
.news__text {
    margin: 0.5rem 0 0;
    font-size: 0.9875rem;
    line-height: 1.6;
    color: #e4e0d9;
}

.news__item:last-child { padding-bottom: 2.5rem; }

@media (max-width: 900px) {
    .news { grid-template-columns: minmax(0, 1fr); }
    /* En una columna la lista tiene alto propio */
    .news__scroll { height: 420px; }
}

/* VTO */
.vto-feature {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: center;
    padding: clamp(1rem, 2.5vw, 1.5rem);
    border: 1px solid var(--glass-dark-line);
    border-radius: 24px;
    background: linear-gradient(135deg, rgb(255 255 255 / 0.06), rgb(0 0 0 / 0.2));
    box-shadow: 0 30px 70px rgb(0 0 0 / 0.3);
    scroll-margin-top: calc(var(--header-h) + 1rem);
}
.vto-feature__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-lg);
    background: #000;
    cursor: pointer;
}
.vto-feature__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease), opacity 0.3s;
}
.vto-feature__media:hover img { transform: scale(1.04); opacity: 0.8; }
.play-badge {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    width: 4.75rem;
    height: 4.75rem;
    margin: auto;
    border-radius: 50%;
    background: rgb(255 255 255 / 0.95);
    color: var(--wine-deep);
    box-shadow: 0 8px 30px rgb(0 0 0 / 0.35);
    transition: transform 0.3s var(--ease);
}
.play-badge::before {
    content: "";
    position: absolute;
    inset: -10px;
    border: 2px solid rgb(255 255 255 / 0.6);
    border-radius: 50%;
    animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
    0% { transform: scale(0.85); opacity: 0.9; }
    100% { transform: scale(1.35); opacity: 0; }
}
.play-badge .icon { width: 1.75rem; height: 1.75rem; margin-left: 0.2rem; }
.vto-feature__media:hover .play-badge { transform: scale(1.08); }
.vto-feature__title {
    margin-bottom: 1.25rem;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
}

.vto-year { text-align: center; }
.vto-year .eyebrow { color: var(--gold); }
.vto-year h2 {
    margin: 0;
    color: var(--paper);
    font-size: clamp(1.75rem, 3.6vw, 2.6rem);
    font-weight: 700;
}

.signatures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 2rem;
    margin-block: 2.5rem clamp(3rem, 6vw, 4rem);
    padding-block: 2.5rem;
    border-block: 1px solid var(--glass-dark-line);
    list-style: none;
}
.signature { display: grid; justify-items: center; gap: 0.75rem; text-align: center; }
.signature img { width: auto; height: 72px; object-fit: contain; }
.signature span {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--paper);
}

.goals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    list-style: none;
}
.goals { grid-auto-rows: 1fr; }
.goal {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 0.08);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgb(255 255 255 / 0.04), rgb(0 0 0 / 0.25));
    transition: transform 0.35s var(--ease), border-color 0.35s, box-shadow 0.35s;
}
.goal:hover {
    transform: translateY(-6px);
    border-color: rgb(216 200 160 / 0.3);
    box-shadow: 0 24px 50px rgb(0 0 0 / 0.35);
}
.goal__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.goal__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.8);
    transition: transform 0.8s var(--ease), filter 0.5s;
}
.goal:hover .goal__media img { transform: scale(1.06); filter: saturate(1); }
.goal__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgb(37 10 10 / 0.9));
}
.goal__number {
    position: absolute;
    left: 1.25rem;
    bottom: 0.75rem;
    z-index: 1;
    font-size: 2.5rem;
    font-weight: 300;
    line-height: 1;
    color: var(--paper);
}
.goal__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.35rem 1.5rem 1.5rem;
}
.goal__body h3 { margin-bottom: 0.5rem; font-size: 1.125rem; }
.goal__body p { margin-bottom: 0.75rem; font-size: 0.9375rem; }

/* Lista larga: se abre encima de la tarjeta para no alterar su altura */
.goal__more { margin-top: auto; }
.goal__toggle {
    position: relative;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.95rem;
    border: 1px solid rgb(216 200 160 / 0.4);
    border-radius: var(--radius-pill);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gold);
    list-style: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.goal__toggle::-webkit-details-marker { display: none; }
.goal__toggle:hover { background: var(--gold); color: var(--ink); }
.goal__toggle .icon { transition: transform 0.25s var(--ease); }
.goal__toggle-close,
.goal__more[open] .goal__toggle-open { display: none; }
.goal__more[open] .goal__toggle-close { display: inline; }
.goal__more[open] .goal__toggle .icon { transform: rotate(180deg); }
/* Abierto: el botón pasa a la esquina superior derecha, junto al título del panel */
.goal__more[open] .goal__toggle {
    position: absolute;
    top: 1.15rem;
    right: 1.25rem;
    background: var(--wine-deep);
}
.goal__more[open] .goal__toggle:hover { background: var(--gold); }
.goal__panel {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    overflow: hidden;
    background: linear-gradient(180deg, rgb(37 10 10 / 0.97), rgb(22 6 6 / 0.98));
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: rise 0.3s var(--ease);
}
.goal__panel-title {
    display: flex;
    align-items: center;
    min-height: 2.1rem;
    margin: 0 0 1rem;
    padding-right: 7rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
}
.goal__list {
    display: grid;
    flex: 1;
    align-content: start;
    gap: 0.6rem;
    min-height: 0;
    padding-right: 0.25rem;
    overflow-y: auto;
    list-style: none;
    font-size: 0.9375rem;
    color: var(--on-dark);
    scrollbar-width: thin;
    scrollbar-color: rgb(216 200 160 / 0.4) transparent;
}
.goal__list li {
    position: relative;
    padding: 0 0 0.6rem 1.25rem;
    border-bottom: 1px solid rgb(255 255 255 / 0.08);
}
.goal__list li:last-child { border-bottom: 0; }
.goal__list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--gold);
}

.dialog--video { width: min(1100px, calc(100% - 2rem)); background: #000; }
.dialog--video .dialog__header { background: rgb(18 18 18 / 0.9); border-color: #262626; }
.dialog--video .dialog__header h2 { color: var(--paper); }
.dialog--video .icon-btn { border-color: rgb(255 255 255 / 0.25); background: transparent; color: var(--paper); }
.dialog--video .icon-btn:hover { background: var(--paper); color: var(--ink); }
.dialog--video video { width: 100%; max-height: calc(90vh - 4rem); background: #000; }

/* Desarrollo organizacional */
/* 5 por fila; la última fila incompleta queda centrada (9 accesos = 5 + 4) */
.tiles {
    --tiles-cols: 5;
    --tiles-gap: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--tiles-gap);
    list-style: none;
}
.tiles > li { flex: 0 0 calc((100% - (var(--tiles-cols) - 1) * var(--tiles-gap)) / var(--tiles-cols)); }
@media (max-width: 1024px) {
    .tiles { --tiles-cols: 3; }
}
.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    height: 100%;
    padding: 2.25rem 1.25rem 1.75rem;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 0.9);
    border-radius: 20px;
    background: rgb(255 255 255 / 0.72);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 10px 30px rgb(0 0 0 / 0.06);
    color: var(--ink);
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.35s var(--ease), box-shadow 0.35s, border-color 0.35s;
}
.tile::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--wine-bright), var(--gold));
    transform: scaleX(0);
    transition: transform 0.4s var(--ease);
}
.tile__icon {
    display: grid;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(145deg, #fff, var(--stone-2));
    color: #7d7771;
    transition: background 0.3s, border-color 0.3s, color 0.3s, transform 0.4s var(--ease);
}
.tile__icon .icon { width: 2rem; height: 2rem; stroke-width: 1.4; }
.tile__title { font-size: 1.0625rem; font-weight: 600; }
/* Contador en la tarjeta (p. ej. cumpleañeros del día) */
.tile__badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: inline-flex;
    align-items: baseline;
    gap: 0.25rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--wine-bright), var(--wine-deep));
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--gold);
    box-shadow: 0 4px 12px rgb(90 29 29 / 0.3);
    animation: bell-pop 0.4s var(--ease) both;
}
.tile__badge strong { font-size: 0.875rem; color: var(--paper); }
@keyframes bell-pop { from { transform: scale(0); } to { transform: scale(1); } }
.tile__action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
    transition: color 0.2s;
}
.tile__action .icon { transition: transform 0.25s var(--ease); }
.tile:hover { transform: translateY(-6px); border-color: var(--paper); box-shadow: var(--shadow-lg); }
.tile:hover::after { transform: scaleX(1); }
.tile:hover .tile__icon {
    border-color: transparent;
    background: linear-gradient(145deg, var(--wine-bright), var(--wine-deep));
    color: var(--paper);
    transform: rotate(-4deg) scale(1.05);
}
.tile:hover .tile__action { color: var(--wine); }
.tile:hover .tile__action .icon { transform: translateX(3px); }

.videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
/* Carrusel de tutoriales: un video a la vez, todo visible sin scroll vertical.
   El modal tiene alto fijo y el video toma el espacio que queda libre. */
.dialog--tutoriales {
    display: flex;
    flex-direction: column;
    height: min(92vh, 860px);
    max-height: none;
    overflow: hidden;
}
.dialog--tutoriales:not([open]) { display: none; }
.dialog--tutoriales .dialog__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
    padding-block: 1rem;
}
.carousel--tutoriales {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}
.carousel--tutoriales .carousel__track {
    flex: 1;
    gap: 20px;
    min-height: 0;
    padding: 0;
    scroll-padding-inline: 0;
}
.carousel--tutoriales .carousel__item {
    display: flex;
    flex: 0 0 100%;
    flex-direction: column;
    min-height: 0;
    scroll-snap-align: start;
}
.tut-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.tut-bar__count { margin: 0; font-size: 0.875rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tut-bar__count strong { font-size: 1.25rem; color: var(--ink); }
.tut-bar__nav { display: flex; gap: 0.5rem; }
.tut-bar__select { flex: 1 1 280px; max-width: 460px; }
.tut-bar__select select {
    width: 100%;
    min-height: 2.6rem;
    padding: 0.45rem 2.25rem 0.45rem 1rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    background: var(--paper);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}
.tut-bar__select select:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px rgb(90 29 29 / 0.12); }
@media (max-width: 640px) {
    .tut-bar { flex-wrap: wrap; }
    .tut-bar__select { order: 3; flex-basis: 100%; max-width: none; }
}
.tut-slide { margin: 0; }
.tut-slide video {
    flex: 1;
    width: 100%;
    min-height: 0;
    object-fit: contain;
    border-radius: var(--radius-lg);
    background: var(--ink);
}
.tut-slide__meta {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.9rem;
    margin-top: 0.9rem;
}
.tut-slide__meta .badge { color: var(--wine); }
.tut-slide__title { flex: 1 1 auto; margin: 0; font-size: 1.125rem; }
.tut-slide__date {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--muted);
}
.tut-dots { display: flex; flex-shrink: 0; flex-wrap: wrap; justify-content: center; gap: 0.45rem; margin-top: 1rem; }
.tut-bar { flex-shrink: 0; }
@media (max-width: 640px) {
    .dialog--tutoriales { width: 100%; height: 100%; border-radius: 0; }
}
.tut-dots__dot {
    width: 0.6rem;
    height: 0.6rem;
    padding: 0;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--line-strong);
    cursor: pointer;
    transition: width 0.3s var(--ease), background-color 0.3s;
}
.tut-dots__dot:hover { background: var(--muted); }
.tut-dots__dot[aria-selected="true"] { width: 1.75rem; background: var(--wine); }

.videos + .videos__group { margin-top: 2rem; }
.videos__group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--wine);
}
.videos__group::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.video { margin: 0; }
.video video { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); background: var(--ink); }
.video figcaption { margin-top: 0.6rem; font-size: 0.875rem; font-weight: 600; }

/* Comercial */
/* Rejilla de 12 columnas: cada portal ocupa 3 (4 por fila). Con 7 portales los 3 primeros
   ocupan 4 columnas cada uno, así ambas filas llenan el mismo ancho y los de arriba son más grandes. */
.apps {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 2.75rem 1.5rem;
    max-width: 1000px;
    margin-inline: auto;
    list-style: none;
}
.apps > li { grid-column: span 3; }
.apps:has(> li:nth-child(7):last-child) > li:nth-child(-n+3) { grid-column: span 4; }
.apps:has(> li:nth-child(7):last-child) > li:nth-child(-n+3) .app__media { width: clamp(170px, 20vw, 250px); }
.app {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    color: var(--paper);
    text-align: center;
    text-decoration: none;
}
.app__media {
    width: clamp(140px, 15vw, 186px);
    aspect-ratio: 1;
    margin-bottom: 1rem;
    overflow: hidden;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.2), 0 0 0 9px rgb(255 255 255 / 0.03), 0 20px 40px rgb(0 0 0 / 0.35);
    transition: box-shadow 0.35s, transform 0.35s var(--ease);
}
.app__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.app__title { font-size: 1.125rem; font-weight: 600; }
.app__action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.8rem;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #bdb7ad;
    transition: color 0.25s, border-color 0.25s, background-color 0.25s;
}
.app:hover .app__media {
    transform: translateY(-4px);
    box-shadow: 0 0 0 2px var(--gold), 0 0 0 11px rgb(216 200 160 / 0.12), 0 26px 50px rgb(0 0 0 / 0.45);
}
.app:hover .app__media img { transform: scale(1.08); }
.app:hover .app__action { color: var(--ink); background: var(--gold); border-color: var(--gold); }

/* Control presupuestal */
.roman { text-align: center; }
.roman__logo { width: 190px; margin: 0 auto 2.5rem; }
.roman h2 {
    margin-bottom: 2rem;
    font-size: clamp(1.75rem, 3.2vw, 2.4rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #2e2c29;
}
.roman__text {
    max-width: 580px;
    margin: 2.25rem auto 0;
    font-size: 1rem;
    color: #3b3832;
}

/* Cultura: capitel centrado con el título sobrepuesto y los libros en fila */
.culture__intro { position: relative; margin-bottom: clamp(1.5rem, 3vw, 2.5rem); text-align: center; }
.culture__capital { width: clamp(160px, 16vw, 220px); margin: 0 auto; mix-blend-mode: multiply; }
.culture__intro h2 {
    position: relative;
    margin-top: 1rem;
    font-size: clamp(1.4rem, 2.4vw, 1.75rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #2e2c29;
}
.books {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem clamp(1.5rem, 3vw, 2.5rem);
    list-style: none;
}
.book {
    display: block;
    width: clamp(150px, 16vw, 210px);
    text-decoration: none;
    perspective: 900px;
}
.book__cover {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 3px 10px 10px 3px;
    box-shadow: 0 2px 4px rgb(0 0 0 / 0.12), 0 14px 28px rgb(0 0 0 / 0.16);
    transform-origin: left center;
    transition: transform 0.45s var(--ease), box-shadow 0.45s;
}
/* Lomo y brillo: efecto de libro en 3D */
.book__cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgb(0 0 0 / 0.22) 0, rgb(255 255 255 / 0.14) 3%, transparent 7%),
        linear-gradient(115deg, transparent 55%, rgb(255 255 255 / 0.18) 70%, transparent 85%);
    pointer-events: none;
}
.book__cover img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.book__action {
    z-index: 1;
    position: absolute;
    inset: auto 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 2rem 0.5rem 0.75rem;
    background: linear-gradient(180deg, transparent, rgb(18 18 18 / 0.85));
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--paper);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s, transform 0.3s var(--ease);
}
.book:hover .book__cover,
.book:focus-visible .book__cover {
    transform: translateY(-6px) rotateY(-8deg);
    box-shadow: 8px 6px 12px rgb(0 0 0 / 0.12), 18px 28px 44px rgb(0 0 0 / 0.22);
}
.book:hover .book__action,
.book:focus-visible .book__action { opacity: 1; transform: none; }

@media (max-width: 900px) {
    .books { display: grid; grid-template-columns: repeat(2, auto); justify-content: center; }
    .vto-feature { grid-template-columns: minmax(0, 1fr); text-align: center; }
}

@media (max-width: 640px) {
    .tiles { --tiles-cols: 2; --tiles-gap: 1rem; }
    .signatures { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
    .apps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 1rem; }
    .apps > li,
    .apps:has(> li:nth-child(7):last-child) > li:nth-child(-n+3) { grid-column: auto; }
    .apps:has(> li:nth-child(7):last-child) > li:nth-child(-n+3) .app__media { width: min(100%, 140px); }
    .tile { padding: 1.5rem 0.75rem 1.25rem; }
    .tile__icon { width: 3.75rem; height: 3.75rem; border-radius: 18px; }
    .tile__title { font-size: 0.9375rem; }
    .app__media { width: min(100%, 140px); }
    .signature img { height: 56px; }
}

/* Tabla con alto limitado (app.js fija el max-height a N renglones): scroll interno y encabezado fijo */
.table-wrap--scroll {
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}
.table-wrap--scroll thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    box-shadow: inset 0 -1px 0 var(--line-strong);
}

/* Políticas: va justo después de Cultura (mismo fondo blanco), por eso con menos espacio arriba */
.section--politicas { padding-top: clamp(1.5rem, 3vw, 2.5rem); }
.table-card {
    padding: clamp(1rem, 3vw, 2rem);
    border: 1px solid var(--line);
    border-radius: 24px;
    background: linear-gradient(180deg, var(--stone) 0%, #f0ede7 100%);
}
.table-card__admin { display: flex; justify-content: flex-end; margin-bottom: 1rem; }
.table-card .table-wrap {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}

/* Páginas internas: encabezado con resumen a la derecha */
.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem 2rem;
    margin-bottom: 2rem;
}
.page-head h1 { margin: 0; }
.page-head__stats { display: flex; gap: 0.75rem; margin: 0; }
.page-head__stats > div {
    min-width: 8rem;
    padding: 0.85rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}
.page-head__stats dt { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.page-head__stats dd { margin: 0.15rem 0 0; font-size: 1.75rem; font-weight: 700; line-height: 1.1; color: var(--ink); }
.toolbar--card {
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}
.toolbar--card .search { max-width: none; }
.toolbar--card .search input,
.toolbar--card .select select { border-color: transparent; background: var(--stone); }
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 3rem 1rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    color: var(--muted);
    text-align: center;
}
.empty-state .icon { width: 2rem; height: 2rem; color: var(--line-strong); }

/* Avatar con iniciales (cuando la persona no tiene foto) */
.avatar--initials {
    display: inline-grid;
    flex-shrink: 0;
    place-items: center;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--paper);
}
.avatar--lg.avatar--initials { font-size: 1.75rem; }
.avatar--tone-0 { background: linear-gradient(135deg, #7a2a2a, #3a1111); }
.avatar--tone-1 { background: linear-gradient(135deg, #3d3d3d, #121212); }
.avatar--tone-2 { background: linear-gradient(135deg, #b39762, #7d6436); }
.avatar--tone-3 { background: linear-gradient(135deg, #5d5a56, #2f2d2a); }
.avatar--tone-4 { background: linear-gradient(135deg, #8f4a3a, #4e2219); }
.avatar--tone-5 { background: linear-gradient(135deg, #6b6f5a, #3a3d2f); }

/* Gorrito de cumpleaños sobre el avatar */
.party { position: relative; display: inline-block; flex-shrink: 0; line-height: 0; }
.party__hat {
    position: absolute;
    left: 50%;
    bottom: 72%;
    width: 58%;
    height: auto;
    aspect-ratio: 40 / 48;
    transform: translateX(-30%) rotate(-14deg);
    transform-origin: bottom center;
    filter: drop-shadow(0 3px 4px rgb(0 0 0 / 0.25));
    animation: party-hat 2.6s ease-in-out infinite;
}
@keyframes party-hat {
    0%, 100% { transform: translateX(-30%) rotate(-14deg); }
    50% { transform: translateX(-30%) rotate(-6deg); }
}

/* Directorio */
.people {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
    list-style: none;
}
.person {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding: 1.4rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    transition: transform 0.3s var(--ease), box-shadow 0.3s, border-color 0.3s;
}
.person::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--wine-bright), var(--gold));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease);
}
.person:hover { transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow); }
.person:hover::before { transform: scaleX(1); }
.person__head { display: flex; align-items: center; gap: 1rem; }
.person .avatar { width: 64px; height: 64px; }
.person__body { min-width: 0; }
.person__name { margin: 0 0 0.15rem; font-size: 1rem; line-height: 1.3; }
.person__role { margin: 0; font-size: 0.8125rem; font-weight: 500; color: var(--muted); }
.person__dept {
    display: inline-block;
    margin: 0.4rem 0 0;
    padding: 0.15rem 0.6rem;
    border-radius: var(--radius-pill);
    background: #f6eeee;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--wine);
}
.person__contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}
.person__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    max-width: 100%;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    background: var(--stone);
    font-size: 0.8125rem;
    color: var(--text);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}
.person__link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person__link .icon { width: 0.95rem; height: 0.95rem; color: var(--wine); }
.person__link:hover { background: var(--wine); color: var(--paper); }
.person__link:hover .icon { color: var(--paper); }
.person__ext {
    margin-left: auto;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-pill);
    background: var(--ink);
    font-size: 0.75rem;
    color: var(--on-dark-muted);
}
.person__ext strong { color: var(--paper); }

/* Cumpleaños */
.month-nav { display: flex; align-items: center; gap: 0.5rem; }
.month-nav__current {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 10rem;
    justify-content: center;
    padding: 0.55rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--paper);
    font-size: 0.875rem;
    font-weight: 600;
}
.month-nav__current .icon { color: var(--wine); }

.bday-today {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 2rem;
    align-items: center;
    margin-bottom: 2rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    overflow: hidden;
    border-radius: 24px;
    background:
        radial-gradient(60% 80% at 100% 0%, rgb(216 200 160 / 0.3), transparent 60%),
        radial-gradient(120% 90% at 0% 0%, var(--wine-bright) 0%, var(--wine-deep) 60%, #1d0808 100%);
    color: #e9dcdc;
    box-shadow: 0 24px 60px rgb(58 17 17 / 0.3);
}
.bday-today h2 { margin: 0.25rem 0 0.5rem; color: var(--paper); font-size: clamp(1.75rem, 3.5vw, 2.5rem); }
.bday-today p { margin: 0; }
.bday-today__eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.bday-today__people {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem 1.5rem;
    padding-top: 2.5rem;
    list-style: none;
}
.bday-today__people li {
    display: grid;
    justify-items: center;
    gap: 0.35rem;
    max-width: 11rem;
    text-align: center;
}
.bday-today__people strong { margin-top: 0.5rem; font-size: 0.9375rem; color: var(--paper); line-height: 1.3; }
.bday-today__people span { font-size: 0.75rem; color: var(--on-dark-muted); }
.bday-today .avatar { border-color: rgb(255 255 255 / 0.9); box-shadow: 0 0 0 3px var(--gold), 0 12px 30px rgb(0 0 0 / 0.35); }

.birthdays {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    list-style: none;
}
.birthday {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    transition: transform 0.3s var(--ease), box-shadow 0.3s, opacity 0.3s;
}
.birthday:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.birthday .avatar { width: 56px; height: 56px; }
.birthday .avatar--initials { font-size: 1.1rem; }
.birthday__date {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 3.5rem;
    height: 3.75rem;
    border-radius: 14px;
    background: var(--stone);
    line-height: 1;
}
.birthday__day { font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.birthday__weekday { font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.birthday__body { min-width: 0; }
.birthday__name { margin: 0 0 0.15rem; font-size: 0.9375rem; line-height: 1.3; }
.birthday__meta { margin: 0 0 0.35rem; font-size: 0.8125rem; color: var(--muted); }
.birthday__body .badge { font-size: 0.6875rem; }
.birthday__flag {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-pill);
    background: var(--wine);
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--paper);
}
.birthday--hoy {
    border: 2px solid transparent;
    background:
        linear-gradient(var(--paper), var(--paper)) padding-box,
        linear-gradient(135deg, var(--wine-bright), var(--gold)) border-box;
    box-shadow: 0 16px 40px rgb(90 29 29 / 0.16);
}
.birthday--hoy .birthday__date { background: var(--wine); }
.birthday--hoy .birthday__day,
.birthday--hoy .birthday__weekday { color: var(--paper); }
.birthday--hoy .party { margin-top: 0.75rem; }
.birthday--pasado { opacity: 0.55; }
.birthday--pasado:hover { opacity: 1; }

@media (max-width: 760px) {
    .bday-today { grid-template-columns: minmax(0, 1fr); text-align: center; }
    .page-head__stats > div { min-width: 0; flex: 1; }
    .toolbar--card { border-radius: var(--radius-lg); }
}

/* Pantallas de administración: barra con botones a la derecha, tabla a todo el ancho */
.admin-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0 0 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--line);
}
.admin-toolbar__count { margin: 0; font-size: 0.9375rem; color: var(--muted); }
.admin-toolbar__count strong { font-size: 1.5rem; font-weight: 700; color: var(--ink); }
.admin-toolbar__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-left: auto; }
.admin-table {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--paper);
    box-shadow: var(--shadow-sm);
}
.table tbody tr.is-editing { background: #fbf4e8; box-shadow: inset 3px 0 0 var(--gold); }
.dialog--form { width: min(640px, calc(100% - 2rem)); }

/* Tablas tipo DataTables (app.js) */
.dt-bar,
.dt-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
}
.dt-bar { margin-bottom: 1rem; }
.dt-foot { margin-top: 1rem; }
.dt-length { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--muted); }
.dt-length select {
    min-height: 2.25rem;
    padding: 0.3rem 2rem 0.3rem 0.8rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    background: var(--paper);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}
.dt-search { position: relative; flex: 0 1 320px; }
.dt-search .icon { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.dt-search input {
    width: 100%;
    min-height: 2.5rem;
    padding: 0.5rem 1rem 0.5rem 2.4rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    background: var(--paper);
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.dt-search input:focus,
.dt-length select:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px rgb(90 29 29 / 0.12); }
.dt-info { margin: 0; font-size: 0.8125rem; color: var(--muted); }
.dt-pages { display: flex; align-items: center; gap: 0.3rem; }
.dt-pages button {
    display: inline-grid;
    place-items: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.6rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--paper);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.dt-pages button:hover:not(:disabled) { border-color: var(--ink); }
.dt-pages button[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.dt-pages button:disabled { opacity: 0.4; cursor: default; }
.dt-gap { padding: 0 0.25rem; color: var(--muted); }
.dt-empty td { padding: 2rem 1rem; text-align: center; color: var(--muted); }
th.dt-sortable { position: relative; padding-right: 1.75rem; cursor: pointer; user-select: none; transition: color 0.2s; }
th.dt-sortable:hover { color: var(--ink); }
th.dt-sortable::after {
    content: "↕";
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    letter-spacing: 0;
    opacity: 0.35;
}
th.dt-sortable[aria-sort="ascending"]::after { content: "↑"; opacity: 1; color: var(--wine); }
th.dt-sortable[aria-sort="descending"]::after { content: "↓"; opacity: 1; color: var(--wine); }
@media (max-width: 640px) {
    .dt-search { flex-basis: 100%; }
    .admin-toolbar__actions { width: 100%; }
    .admin-toolbar__actions .btn { flex: 1; }
}

/* Panel de categorías */
.cat-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; list-style: none; }
.cat-list__item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.4rem 0.3rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--stone);
    font-size: 0.8125rem;
    font-weight: 600;
}
.cat-list__item form { display: contents; }
.cat-list__count {
    min-width: 1.5rem;
    padding: 0 0.4rem;
    border-radius: var(--radius-pill);
    background: var(--paper);
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
}
.cat-list__remove {
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}
.cat-list__remove:hover { background: #fbefef; color: var(--danger); }
.cat-add { display: flex; gap: 0.5rem; }
.cat-add input {
    flex: 1;
    min-width: 0;
    min-height: 2.25rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-pill);
    background: #fcfbf9;
    font-size: 0.875rem;
}
.cat-add input:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px rgb(90 29 29 / 0.12); }
#dlg-categorias .cat-add { margin-bottom: 1.25rem; }
#dlg-categorias .field__hint { margin-top: 0.75rem; }

/* Modal de administradores: lista de usuarios con check */
.user-pick__search { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.user-pick__search .search { flex: 1; }
.user-pick {
    max-height: min(50vh, 420px);
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
}
.user-pick__list { list-style: none; }
.user-pick__list li + li { border-top: 1px solid var(--line); }
.user-pick__item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    cursor: pointer;
}
.user-pick__item:hover { background: var(--stone); }
.user-pick__item input { grid-row: span 2; width: 1.1rem; height: 1.1rem; accent-color: var(--wine); }
.user-pick__item .badge { grid-column: 3; grid-row: 1 / span 2; }
.user-pick__name { font-weight: 600; font-size: 0.9rem; color: var(--ink); }
.user-pick__meta { grid-column: 2; font-size: 0.8rem; color: var(--muted); overflow-wrap: anywhere; }
.user-pick__item:has(input:disabled) { cursor: default; opacity: 0.7; }
.user-pick .empty-state { padding: 1.5rem; }

/* Páginas internas (perfil, directorio, cumpleaños, administración, error) */
.page-perfil main,
.page-directorio main,
.page-cumpleanos main,
.page-politicas main,
.page-error main {
    background:
        radial-gradient(50% 40% at 100% 0%, rgb(216 200 160 / 0.18), transparent 70%),
        linear-gradient(180deg, #fbfaf8 0%, var(--stone) 100%);
}

/* Administración de contenido */
.admin-link { display: flex; justify-content: center; margin: -1.5rem 0 2rem; }
.culture__intro .admin-link { margin: 1rem 0 0; }
.admin-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 1rem;
    padding: 0.3rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-pill);
    background: var(--paper);
}
.admin-tabs a {
    padding: 0.4rem 0.95rem;
    border-radius: var(--radius-pill);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--muted);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}
.admin-tabs a:hover { color: var(--ink); background: var(--stone); }
.admin-tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.account__label {
    margin: 0.5rem 0 0.15rem;
    padding: 0.5rem 0.75rem 0;
    border-top: 1px solid var(--line);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

/* Error */
.error-page { padding-block: 3rem; }
