/* =====================================================================
 * Portal de reservas (acceso de solicitantes) - Estilos Metronic 8
 * Define las clases portal-* usadas por:
 *   - app/layouts/metronic_v8.php
 *   - app/views/public/*.php
 * Paleta institucional: #43519F (azul Tadeo)
 * ===================================================================== */

:root {
    --portal-primary: #43519f;
    --portal-primary-dark: #36417f;
    --portal-primary-light: #eef0fb;
    --portal-accent: #009ef7;
    --portal-surface: #ffffff;
    --portal-bg: #f5f6fb;
    --portal-border: #e4e6ef;
    --portal-radius: 0.85rem;
    --portal-shadow: 0 0.5rem 1.5rem rgba(67, 81, 159, 0.08);
}

/* ----------------------------------------------------------------------
 * Shell general (layout autenticado)
 * -------------------------------------------------------------------- */
.portal-shell {
    background: var(--portal-bg);
}

/* ----------------------------------------------------------------------
 * Header
 * -------------------------------------------------------------------- */
.portal-header {
    background: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-header-layout {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.portal-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.portal-header-brand img {
    max-height: 40px;
    object-fit: contain;
}

.portal-header-search {
    flex: 1 1 280px;
    max-width: 420px;
}

.portal-header-search__icon {
    border-top-left-radius: var(--portal-radius);
    border-bottom-left-radius: var(--portal-radius);
}

.portal-header-search__input {
    border-top-right-radius: var(--portal-radius);
    border-bottom-right-radius: var(--portal-radius);
}

.portal-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.portal-header-logout {
    white-space: nowrap;
}

/* Notificaciones (dropdown junto a la campana) */
.portal-notif-dropdown {
    position: relative;
}

.portal-notif-menu {
    width: 360px;
    max-width: calc(100vw - 2rem);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    overflow: hidden;
    margin-top: 0.5rem;
}

.portal-notif-header {
    border-bottom: 1px solid var(--portal-border);
    background: var(--portal-primary-light);
}

.portal-notif-body {
    max-height: 60vh;
    overflow-y: auto;
}

/* Centro de actividades (drawer) */
.portal-activities-drawer {
    z-index: 1100;
}

.portal-activities-header {
    border-bottom: 1px solid var(--portal-border);
    min-height: 64px;
}

.portal-activity-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.portal-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 0.25rem;
    border-bottom: 1px dashed var(--portal-border);
}

.portal-activity-item:last-child {
    border-bottom: 0;
}

.portal-activity-item__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 0.35rem;
    flex-shrink: 0;
}

.portal-activity-item__body {
    flex-grow: 1;
    min-width: 0;
}

.portal-header-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--portal-border);
}

/* Filtro de área */
.portal-area-switcher {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem 0.5rem 0.65rem;
    background: var(--portal-primary-light);
    border: 1px solid rgba(67, 81, 159, 0.25);
    border-radius: 999px;
    box-shadow: 0 0.25rem 0.75rem rgba(67, 81, 159, 0.1);
}

.portal-area-switcher__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--portal-primary);
    color: #fff;
    font-size: 1.05rem;
    flex-shrink: 0;
}

.portal-filter-select {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.portal-filter-select__label,
.portal-filter-static__label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--portal-primary);
}

.portal-area-select {
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 1rem;
    color: #1e1e2d;
    padding: 0 1.75rem 0 0;
    min-width: 180px;
    cursor: pointer;
}

.portal-area-select:focus {
    box-shadow: none;
    background: transparent;
}

.portal-filter-static {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.portal-filter-static__value {
    font-weight: 700;
    font-size: 1rem;
    color: #1e1e2d;
}

/* Accesos rápidos */
.portal-header-shortcuts {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.portal-header-categories {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(67, 81, 159, 0.12);
}

.portal-header-categories__lead {
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.portal-header-categories__eyebrow {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--portal-primary);
}

.portal-header-categories__area {
    font-size: 0.98rem;
    font-weight: 700;
    color: #1e1e2d;
}

.portal-header-categories__groups {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    flex: 1 1 auto;
}

.portal-header-categories__group {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 220px;
}

.portal-header-categories__title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.portal-header-categories__items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.portal-header-categories__item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #334155;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 0.35rem 0.9rem rgba(15, 23, 42, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.portal-header-categories__item:hover {
    transform: translateY(-1px);
    color: var(--portal-primary);
    border-color: color-mix(in srgb, var(--portal-category-color, var(--portal-primary)) 30%, #ffffff);
    box-shadow: 0 0.55rem 1.2rem rgba(15, 23, 42, 0.09);
}

.portal-header-categories__item--active {
    color: var(--portal-primary);
    background: color-mix(in srgb, var(--portal-category-color, var(--portal-primary)) 10%, #ffffff);
    border-color: color-mix(in srgb, var(--portal-category-color, var(--portal-primary)) 35%, #ffffff);
}

.portal-header-categories__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--portal-category-color, var(--portal-primary));
    flex: 0 0 10px;
}

.portal-header-categories__name {
    white-space: nowrap;
}

.portal-btn-practice,
.portal-btn-availability {
    font-weight: 600;
    color: var(--portal-primary);
    background: var(--portal-primary-light);
    border: 1px solid transparent;
}

.portal-btn-practice:hover,
.portal-btn-availability:hover {
    color: #fff;
    background: var(--portal-primary);
}

/* ----------------------------------------------------------------------
 * Footer
 * -------------------------------------------------------------------- */
.portal-footer {
    background: var(--portal-surface);
    border-top: 1px solid var(--portal-border);
    margin-top: auto;
}

/* ----------------------------------------------------------------------
 * Vistas de autenticación / contenido público (index, terminos, preguntas)
 * -------------------------------------------------------------------- */
.portal-login-bg {
    background: linear-gradient(135deg, var(--portal-primary) 0%, var(--portal-primary-dark) 100%);
}

.portal-auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-auth-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--portal-surface);
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: var(--portal-shadow);
    min-height: 520px;
}

.portal-auth-aside {
    background: var(--portal-primary);
}

.portal-auth-main {
    padding: 2.5rem 2.75rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.portal-auth-mobile-brand {
    display: none;
    text-align: center;
    margin-bottom: 1.5rem;
}

.portal-auth-flashes {
    margin-bottom: 1rem;
}

.portal-auth-card {
    width: 100%;
}

.portal-auth-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--portal-primary);
    background: var(--portal-primary-light);
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.85rem;
}

.portal-auth-form-title {
    font-weight: 700;
    color: #1e1e2d;
    margin-bottom: 0.35rem;
}

.portal-auth-form-subtitle {
    color: #99a1b7;
    margin-bottom: 1.75rem;
}

.portal-login-input {
    height: calc(1.5em + 1.55rem + 2px);
    border-radius: var(--portal-radius);
}

.portal-auth-password-wrap {
    position: relative;
}

.portal-auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--portal-primary);
    cursor: pointer;
}

.portal-login-submit {
    font-weight: 600;
    color: #fff;
    background: var(--portal-primary);
    border: none;
    border-radius: var(--portal-radius);
}

.portal-login-submit:hover {
    background: var(--portal-primary-dark);
    color: #fff;
}

/* ----------------------------------------------------------------------
 * Dashboard del solicitante (home/public)
 * -------------------------------------------------------------------- */
.portal-stat-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.portal-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--portal-shadow);
}

.portal-hero-card {
    border: none;
    border-radius: var(--portal-radius);
    background: linear-gradient(135deg, var(--portal-primary-light) 0%, #ffffff 100%);
    border-left: 4px solid var(--portal-primary);
}

/* Llamado a la acción: seleccionar área */
.portal-area-cta {
    border: none;
    border-radius: var(--portal-radius);
    background: linear-gradient(135deg, #fff7e6 0%, #ffffff 100%);
    border-left: 4px solid var(--portal-accent);
}

.portal-area-cta__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.85rem;
    background: var(--portal-primary);
    color: #fff;
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Grupos de categorías */
.portal-dashboard-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Dropdown de categorías en el header */
.portal-cat-menu {
    min-width: 320px;
    max-width: 460px;
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    box-shadow: 0 0.75rem 2rem rgba(0, 0, 0, 0.12);
}

.portal-cat-menu__group + .portal-cat-menu__group {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--portal-border);
}

.portal-cat-menu__title {
    display: block;
    font-weight: 700;
    color: #5e6278;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.72rem;
    margin-bottom: 0.5rem;
}

.portal-cat-menu__items {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.portal-cat-menu__item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.65rem;
    border-radius: 0.5rem;
    color: #3f4254;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
}

.portal-cat-menu__item:hover {
    background: var(--portal-primary-light);
    color: var(--portal-primary);
}

.portal-cat-menu__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Selector de área universitaria (pestañas/tarjetas) */
/* Selector de área universitaria (pestañas/tarjetas) */
.portal-area-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.portal-area-tab {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.1rem;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 999px;
    color: #5e6278;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.portal-area-tab:hover {
    border-color: var(--portal-primary);
    color: var(--portal-primary);
}

.portal-area-tab--active {
    background: var(--portal-primary);
    border-color: var(--portal-primary);
    color: #fff;
    box-shadow: 0 0.35rem 0.9rem rgba(67, 81, 159, 0.2);
}

.portal-area-tab--active:hover {
    color: #fff;
}

.portal-areas-card {
    border: none;
    border-radius: var(--portal-radius);
}

.portal-areas-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.portal-area-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.4rem;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    text-decoration: none;
    color: #5e6278;
    font-weight: 600;
    transition: all 0.15s ease;
    min-width: 160px;
    justify-content: center;
    text-align: center;
}

.portal-area-option:hover {
    border-color: var(--portal-primary);
    color: var(--portal-primary);
    box-shadow: 0 0.35rem 0.9rem rgba(67, 81, 159, 0.12);
    transform: translateY(-2px);
}

.portal-area-option__icon {
    font-size: 1.05rem;
}

.portal-area-option--active {
    background: var(--portal-primary);
    border-color: var(--portal-primary);
    color: #fff;
    box-shadow: 0 0.45rem 1.1rem rgba(67, 81, 159, 0.25);
}

.portal-area-option--active:hover {
    color: #fff;
}

/* Tarjetas grandes de categorías (color por categoría) */
.portal-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.portal-category-card {
    --portal-category-color: var(--portal-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 180px;
    padding: 1.75rem 1.25rem;
    border-radius: var(--portal-radius);
    background: var(--portal-category-color);
    color: #fff;
    text-decoration: none;
    text-align: center;
    box-shadow: var(--portal-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.portal-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.85rem 1.75rem rgba(0, 0, 0, 0.18);
    filter: brightness(1.05);
    color: #fff;
}

.portal-category-card__icon {
    font-size: 2.5rem;
    line-height: 1;
    opacity: 0.95;
}

.portal-category-card__label {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Variante compacta dentro del hero */
.portal-hero-categories__title {
    font-weight: 700;
    color: #5e6278;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.8rem;
    margin-bottom: 0.85rem;
}

.portal-category-grid--sm {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.85rem;
}

.portal-category-card--sm {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    min-height: 0;
    padding: 0.9rem 1.1rem;
    text-align: left;
}

.portal-category-card--sm .portal-category-card__icon {
    font-size: 1.35rem;
}

.portal-category-card--sm .portal-category-card__label {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
}

.portal-hero-hint {
    padding: 1rem 1.25rem;
    background: var(--portal-primary-light);
    border-radius: var(--portal-radius);
}

/* Reservas frecuentes */
.portal-frequent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.portal-frequent-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    background: var(--portal-primary-light);
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--portal-primary);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.portal-frequent-chip:hover {
    background: var(--portal-primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 0.35rem 0.9rem rgba(67, 81, 159, 0.2);
}

.portal-frequent-chip i {
    font-size: 0.95rem;
}

/* Cards de reservas (prestamos.php) */
.portal-reservations {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.portal-reservation-card {
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.15s ease;
}

.portal-reservation-card:hover {
    box-shadow: var(--portal-shadow);
}

.portal-reservation-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
    background: var(--portal-bg);
    border-bottom: 1px solid var(--portal-border);
}

.portal-reservation-card__dates {
    display: flex;
    gap: 1.5rem;
    flex-grow: 1;
}

.portal-reservation-card__status {
    flex-shrink: 0;
}

.portal-reservation-card__actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.portal-reservation-card__body {
    padding: 0.5rem 1.25rem 1rem;
    display: flex;
    flex-direction: column;
}

.portal-reservation-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px dashed var(--portal-border);
}

.portal-reservation-item:last-child {
    border-bottom: 0;
}

.portal-reservation-item__main {
    flex-grow: 1;
    min-width: 180px;
}

@media (max-width: 767.98px) {
    .portal-reservation-card__head {
        flex-direction: column;
        align-items: flex-start;
    }
    .portal-reservation-card__dates {
        gap: 1rem;
    }
}

/* Mi calendario (FullCalendar) */
.portal-calendar-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    display: inline-block;
}

#portal_calendario {
    --fc-border-color: var(--portal-border);
    --fc-today-bg-color: var(--portal-primary-light);
    --fc-button-bg-color: var(--portal-primary);
    --fc-button-border-color: var(--portal-primary);
    --fc-button-hover-bg-color: var(--portal-primary-dark);
    --fc-button-hover-border-color: var(--portal-primary-dark);
    --fc-button-active-bg-color: var(--portal-primary-dark);
    --fc-button-active-border-color: var(--portal-primary-dark);
}

#portal_calendario .fc-event {
    cursor: pointer;
    font-weight: 600;
    padding: 1px 4px;
}

#portal_calendario .fc-toolbar-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--portal-primary-dark);
    text-transform: capitalize;
}

/* Disponibilidad de agendas (calendario semanal legado) */
.twelve-columns {
    width: 100%;
}

.twelve-columns .thin {
    margin: 0 0 1rem;
    color: #1f2937;
    font-size: 1.05rem;
    font-weight: 700;
}

.agenda {
    position: relative;
    min-height: 520px;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    background: #fff;
    box-shadow: var(--portal-shadow);
    overflow-x: auto;
    overflow-y: hidden;
}

.agenda,
.agenda * {
    box-sizing: border-box;
}

.agenda-time {
    position: absolute;
    top: 84px;
    bottom: 0;
    left: 0;
    z-index: 3;
    width: 78px;
    margin: 0;
    padding: 0;
    list-style: none;
    border-right: 1px solid var(--portal-border);
    background: #f8fafc;
}

.agenda-time li {
    position: absolute;
    right: 0;
    left: 0;
    min-height: 1px;
    border-top: 1px dashed #d8deea;
    color: #64748b;
    font-size: 0.72rem;
}

.agenda-time li span {
    position: absolute;
    top: -0.62rem;
    left: 0.45rem;
    display: inline-block;
    padding: 0 0.2rem;
    background: #f8fafc;
    line-height: 1.15;
    white-space: nowrap;
}

.agenda-time li.blue span {
    color: var(--portal-primary);
    font-weight: 800;
}

.agenda-wrapper {
    display: grid;
    grid-template-columns: repeat(7, minmax(132px, 1fr));
    grid-template-rows: 44px minmax(0, 1fr);
    min-width: 1000px;
    height: 100%;
    margin-left: 78px;
}

.agenda-week-nav {
    grid-column: 1 / -1;
    grid-row: 1;
    margin: 0 !important;
    padding: 0 0.75rem;
    border-bottom: 1px solid var(--portal-border);
    background: #fff;
}

.agenda-week-nav .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.agenda-events {
    grid-row: 2;
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    border-right: 1px solid var(--portal-border);
    background: #fff;
}

.agenda-events:last-child {
    border-right: 0;
}

.agenda-header {
    display: flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    padding: 0 0.35rem;
    border-bottom: 1px solid var(--portal-border);
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
}

.agenda-day-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    background-image: linear-gradient(to bottom, rgba(226, 232, 240, 0.72) 1px, transparent 1px);
    background-size: 100% 8.333%;
}

.agenda-event,
.dark-big-stripes,
.agenda-now {
    position: absolute;
}

.agenda-event {
    right: 0.28rem;
    left: 0.28rem;
    z-index: 5;
    display: flex;
    min-height: 22px;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.15rem 0.25rem;
    overflow: hidden;
    border: 1px solid rgba(67, 81, 159, 0.16);
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
    color: #111827;
    text-align: center;
    text-decoration: none;
}

.agenda-event:hover,
.agenda-event:focus {
    z-index: 8;
    border-color: rgba(67, 81, 159, 0.34);
    color: #111827;
    text-decoration: none;
}

.agenda-event small {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-event .label {
    display: inline-flex;
    max-width: 100%;
    align-items: center;
    justify-content: center;
    padding: 0.26rem 0.42rem;
    border-radius: 0.35rem;
    font-size: 0.69rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
}

.agenda-event .label-success,
.label.label-success {
    border: 1px solid #a7f3d0;
    background: #ecfdf5;
    color: #047857;
}

.agenda-event .label-warning,
.label.label-warning {
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
}

.agenda-event .label-danger,
.label.label-danger {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.agenda-event .icon-plus-round {
    display: inline-flex;
    flex: 0 0 1rem;
    width: 1rem;
    height: 1rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--portal-primary);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 900;
    line-height: 1;
}

.agenda-event .icon-plus-round::before {
    content: "+";
}

.dark-big-stripes {
    right: 0.28rem;
    left: 0.28rem;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd5e1;
    border-radius: 0.45rem;
    background: repeating-linear-gradient(-45deg, #e5e7eb 0 8px, #f8fafc 8px 16px);
    color: #334155;
}

.dark-big-stripes h6 {
    margin: 0;
    padding: 0 0.25rem;
    overflow: hidden;
    color: #334155;
    font-size: 0.72rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-now {
    right: 0;
    left: 0;
    z-index: 9;
    height: 2px;
    background: #ef4444;
    pointer-events: none;
}

.agenda-now span {
    position: absolute;
    right: 0.35rem;
    top: -0.72rem;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 800;
    line-height: 1.1;
}

.from-before {
    top: 0;
}

.to-after {
    bottom: 0;
}

@media (max-width: 991.98px) {
    .agenda {
        min-height: 560px;
    }

    .agenda-wrapper {
        min-width: 920px;
    }
}

@media (max-width: 575.98px) {
    .agenda-time {
        width: 68px;
    }

    .agenda-wrapper {
        min-width: 860px;
        margin-left: 68px;
    }
}

/* Catálogo de recursos */
.portal-catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.portal-catalog-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    overflow: hidden;
    background: #fff;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.portal-catalog-card:hover {
    box-shadow: var(--portal-shadow);
    transform: translateY(-3px);
    border-color: var(--portal-category-color, var(--portal-primary));
    color: inherit;
}

.portal-catalog-card__media {
    height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-category-color, var(--portal-primary));
    color: #fff;
    font-size: 2.4rem;
    opacity: 0.95;
}

.portal-catalog-card__body {
    padding: 1rem 1.1rem 0.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.portal-catalog-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--portal-primary-dark);
    margin: 0;
}

.portal-catalog-card__location {
    font-size: 0.8rem;
    color: #7e8299;
    display: inline-flex;
    align-items: center;
}

.portal-catalog-card__desc {
    font-size: 0.82rem;
    color: #5e6278;
    margin: 0.15rem 0 0;
    line-height: 1.4;
}

.portal-catalog-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.portal-catalog-chip {
    display: inline-flex;
    align-items: center;
    background: var(--portal-primary-light);
    color: var(--portal-primary-dark);
    border-radius: 1rem;
    padding: 0.15rem 0.6rem;
    font-size: 0.74rem;
    font-weight: 600;
}

.portal-catalog-card__action {
    padding: 0.5rem 1.1rem 1.1rem;
}

@media (max-width: 575.98px) {
    .portal-catalog-grid {
        grid-template-columns: 1fr;
    }
}

/* Asistente de reserva (add.php) */
.portal-reserve-stepper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.portal-reserve-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 0;
    min-width: 90px;
    position: relative;
}

.portal-reserve-step:not(:last-child)::after {
    content: "";
    flex-grow: 1;
    height: 2px;
    background: var(--portal-border);
    margin-left: 0.25rem;
}

.portal-reserve-step__icon {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--portal-bg);
    border: 2px solid var(--portal-border);
    color: #a1a5b7;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.portal-reserve-step__label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #a1a5b7;
    white-space: nowrap;
}

.portal-reserve-step--done .portal-reserve-step__icon {
    background: var(--portal-primary);
    border-color: var(--portal-primary);
    color: #fff;
}

.portal-reserve-step--done .portal-reserve-step__label {
    color: var(--portal-primary-dark);
}

.portal-reserve-step--current .portal-reserve-step__icon {
    background: #fff;
    border-color: var(--portal-primary);
    color: var(--portal-primary);
    box-shadow: 0 0 0 4px var(--portal-primary-light);
}

.portal-reserve-step--current .portal-reserve-step__label {
    color: var(--portal-primary-dark);
}

/* Form groups dentro del asistente */
.portal-reserve .form-group {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--portal-border);
}

.portal-reserve .form-group:last-of-type {
    border-bottom: 0;
}

.portal-reserve .control-label,
.portal-reserve label.font-size-h5 {
    font-weight: 700;
    color: var(--portal-primary-dark);
    font-size: 0.95rem !important;
    margin-bottom: 0.6rem;
    display: block;
    padding-left: 0;
}

.portal-reserve select.form-control,
.portal-reserve input[type="date"].form-control {
    background-color: var(--portal-bg);
    border-color: var(--portal-bg);
    border-radius: 0.65rem;
    font-weight: 500;
    color: #4b5675;
    padding: 0.6rem 1rem;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.portal-reserve select.form-control:focus,
.portal-reserve input[type="date"].form-control:focus {
    background-color: #fff;
    border-color: var(--portal-primary);
}

/* Radios de hora como chips */
.portal-reserve label.radio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0.25rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--portal-border);
    border-radius: 0.6rem;
    background: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--portal-primary-dark);
    cursor: pointer;
    transition: all 0.12s ease;
    min-width: 4.5rem;
}

.portal-reserve label.radio:hover {
    border-color: var(--portal-primary);
    background: var(--portal-primary-light);
}

.portal-reserve label.radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    inset: 0;
    cursor: pointer;
}

.portal-reserve label.radio input[type="radio"]:checked ~ span,
.portal-reserve label.radio:has(input:checked) {
    background: var(--portal-primary);
    border-color: var(--portal-primary);
    color: #fff;
}

.portal-reserve label.radio.text-danger,
.portal-reserve label.radio input[type="radio"]:disabled {
    cursor: not-allowed;
}

.portal-reserve label.radio.text-danger {
    background: #fff5f8;
    border-color: #fdebf1;
    color: #f1416c;
    opacity: 0.7;
    text-decoration: line-through;
}

.portal-reserve label.radio > span {
    display: none;
}

.portal-category-chip {
    --portal-category-color: var(--portal-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.1rem;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: 999px;
    text-decoration: none;
    color: #1e1e2d;
    font-weight: 600;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.portal-category-chip:hover {
    border-color: var(--portal-category-color);
    box-shadow: 0 0.35rem 0.9rem rgba(67, 81, 159, 0.12);
    transform: translateY(-2px);
    color: var(--portal-category-color);
}

.portal-category-chip__dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--portal-category-color);
    flex-shrink: 0;
}

.portal-category-chip__label {
    font-size: 0.95rem;
}

.portal-category-chip__code {
    font-size: 0.72rem;
    font-weight: 600;
    color: #99a1b7;
    background: var(--portal-bg);
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
}

/* ----------------------------------------------------------------------
 * Indicadores (KPI cards)
 * -------------------------------------------------------------------- */
.portal-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.portal-kpi-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.4rem;
    background: var(--portal-surface);
    border: 1px solid var(--portal-border);
    border-radius: var(--portal-radius);
    box-shadow: var(--portal-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.portal-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.7rem 1.8rem rgba(67, 81, 159, 0.14);
}

.portal-kpi-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.75rem;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.portal-kpi-card__body {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.portal-kpi-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e1e2d;
}

.portal-kpi-card__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #99a1b7;
}

.portal-kpi-card--primary .portal-kpi-card__icon { color: var(--portal-primary); background: var(--portal-primary-light); }
.portal-kpi-card--info .portal-kpi-card__icon    { color: #009ef7; background: #e9f6ff; }
.portal-kpi-card--success .portal-kpi-card__icon { color: #50cd89; background: #e8fff3; }
.portal-kpi-card--danger .portal-kpi-card__icon  { color: #f1416c; background: #fff5f8; }

/* ----------------------------------------------------------------------
 * Próximas reservas
 * -------------------------------------------------------------------- */
.portal-upcoming-card {
    border: none;
    border-radius: var(--portal-radius);
}

.portal-upcoming-list {
    display: flex;
    flex-direction: column;
}

.portal-upcoming-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--portal-border);
}

.portal-upcoming-item:last-child {
    border-bottom: none;
}

.portal-upcoming-item__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 0.75rem;
    background: var(--portal-primary-light);
    color: var(--portal-primary);
    flex-shrink: 0;
}

.portal-upcoming-item__day {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
}

.portal-upcoming-item__month {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.portal-upcoming-item__info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1 1 auto;
    min-width: 0;
}

.portal-upcoming-item__title {
    font-weight: 600;
    color: #1e1e2d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-upcoming-item__meta {
    font-size: 0.82rem;
    color: #99a1b7;
}

.portal-upcoming-item__badge {
    flex-shrink: 0;
}

/* ----------------------------------------------------------------------
 * Responsive
 * -------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .portal-auth-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .portal-auth-aside {
        display: none !important;
    }

    .portal-auth-mobile-brand {
        display: block;
    }

    .portal-header-top,
    .portal-header-bottom {
        justify-content: center;
        text-align: center;
    }

    .portal-header-categories {
        flex-direction: column;
        align-items: stretch;
        text-align: left;
    }

    .portal-header-categories__lead {
        min-width: 0;
    }

    .portal-header-categories__groups {
        width: 100%;
    }

    .portal-header-categories__group {
        min-width: 0;
    }

    .portal-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .portal-category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
    }

    .portal-category-grid--sm {
        grid-template-columns: repeat(2, 1fr);
    }

    .portal-area-option {
        min-width: 0;
        flex: 1 1 calc(50% - 0.75rem);
    }
}
