/* Única hoja propia. Se carga después de Bootstrap. */
:root {
    --nido-ink: #202c40;
    --nido-muted: #627087;
    --nido-line: #e6ebf2;
    --nido-bg: #f4f6fa;
    --nido-brand: #127b69;
    --nido-brand-dark: #0c6153;
    --nido-sidebar: #142139;
    --nido-radius: 14px;
}
body {
    margin: 0;
    color: var(--nido-ink);
    background: var(--nido-bg);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: .9rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .h3, .h4, .h5, .h6 { color: var(--nido-ink); font-weight: 650; letter-spacing: -.025em; }
a { color: var(--nido-brand); }
.text-secondary { color: var(--nido-muted) !important; }
.ui-icon { display: inline-block; width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -.15em; }
.skip-link { position: fixed; top: -100px; left: 1rem; padding: .7rem 1rem; background: white; z-index: 1200; border-radius: 8px; }
.skip-link:focus { top: 1rem; }
/* Navegación administrativa. */
.app-sidebar { position: fixed; inset: 0 auto 0 0; width: 232px; display: flex; flex-direction: column; padding: 34px 18px 24px; background: var(--nido-sidebar); color: #fff; z-index: 1000; }
.sidebar-brand, .brand { display: flex; align-items: center; gap: 11px; text-decoration: none; font-size: 1.35rem; font-weight: 750; letter-spacing: -.04em; }
.sidebar-brand { color: #fff; padding: 0 12px; }
.sidebar-brand:hover { color: #fff; }
.brand-symbol { display: inline-flex; width: 40px; height: 42px; align-items: center; justify-content: center; background: #dff5ec; color: #106c58; border-radius: 12px; }
.brand-symbol .ui-icon { width: 27px; height: 27px; }
.sidebar-brand small, .brand small { display: block; font-size: .65rem; font-weight: 450; letter-spacing: .035em; margin-top: 1px; }
.sidebar-brand small { color: #b4c2d7; }
.sidebar-group-title { color: #91a2be; font-size: .65rem; font-weight: 650; text-transform: uppercase; letter-spacing: .15em; padding: 0 14px; margin: 52px 0 12px; }
.sidebar-link { display: flex; align-items: center; gap: 12px; color: #d1dcee; padding: 13px 14px; border-radius: 9px; font-size: .875rem; font-weight: 550; text-decoration: none; }
.sidebar-link.is-active { color: #fff; background: #28423f; box-shadow: inset 3px 0 #67c9ac; }
.sidebar-link:hover { background: #304744; color: #fff; }
.sidebar-link > .ui-icon { color: #8de0c4; width: 20px; height: 20px; }
.sidebar-link-arrow { margin-left: auto; opacity: .6; font-size: .75rem; }
.sidebar-bottom { margin-top: auto; padding: 20px 12px 0; border-top: 1px solid #2d3a51; display: flex; align-items: flex-start; gap: 9px; color: #d2dcec; font-size: .67rem; }
.sidebar-bottom small { display: block; color: #91a2be; margin-top: 4px; font-size: .64rem; }
.sidebar-bottom-dot { background: #82d0b4; width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.app-shell { min-height: 100vh; margin-left: 232px; display: flex; flex-direction: column; }
.app-topbar { min-height: 76px; padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: #fff; border-bottom: 1px solid var(--nido-line); }
.topbar-location { display: flex; align-items: center; gap: 13px; font-size: .75rem; }
.topbar-location a { color: #34445d; font-weight: 550; text-decoration: none; }
.topbar-section, .topbar-separator { color: var(--nido-muted); }
.topbar-separator { opacity: .5; }
.topbar-actions { display: flex; gap: 22px; align-items: center; }
.topbar-actions form { margin: 0; }
.account-label { display: flex; gap: 9px; align-items: center; color: #4d5c73; font-size: .75rem; }
.account-avatar { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: #eef3f8; border-radius: 50%; color: #667a96; }
.app-main { width: 100%; max-width: 1680px; margin: 0 auto; padding: 30px 32px 40px; flex: 1; }
.page-heading { margin-bottom: 24px; }
.page-eyebrow { color: var(--nido-muted); font-size: .68rem; letter-spacing: .06em; margin-bottom: 5px; }
.page-heading h1 { font-size: clamp(1.55rem, 2.3vw, 2rem); margin: 0; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.app-footer { display: flex; padding: 18px 32px; font-size: .68rem; color: #627087; border-top: 1px solid var(--nido-line); }
.menu-button, .sidebar-close, .sidebar-overlay, .app-nav-toggle { display: none; }
/* Botones y formularios. */
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: .65rem 1rem; border-radius: 8px; font-size: .8rem; font-weight: 600; line-height: 1.35; box-shadow: none; }
.btn-sm { padding: .48rem .7rem; font-size: .73rem; gap: 6px; border-radius: 7px; }
.btn-primary { --bs-btn-bg: var(--nido-brand); --bs-btn-border-color: var(--nido-brand); --bs-btn-color: #fff; --bs-btn-hover-bg: var(--nido-brand-dark); --bs-btn-hover-border-color: var(--nido-brand-dark); --bs-btn-active-bg: #095549; --bs-btn-active-border-color: #095549; --bs-btn-disabled-bg: var(--nido-brand); --bs-btn-disabled-border-color: var(--nido-brand); }
.btn-outline-secondary { --bs-btn-color: #52627b; --bs-btn-border-color: #dce3ec; --bs-btn-hover-bg: #f0f4f8; --bs-btn-hover-border-color: #cbd5e2; --bs-btn-hover-color: #27364e; --bs-btn-active-bg: #e7edf4; --bs-btn-active-border-color: #cbd5e2; --bs-btn-active-color: #27364e; background: #fff; }
.btn-outline-danger { --bs-btn-color: #b84343; --bs-btn-border-color: #e9cccc; --bs-btn-hover-bg: #a83939; --bs-btn-hover-border-color: #a83939; }
.btn:focus-visible, .sidebar-link:focus-visible, summary:focus-visible { outline: 3px solid #77bfae; outline-offset: 3px; box-shadow: none; }
.btn-icon { width: 33px; height: 33px; padding: 0; }
.form-label, .form-check-label { font-size: .8rem; font-weight: 550; }
.form-label { color: #46546b; margin-bottom: 7px; }
.form-control, .form-select { border-color: #dce3ec; border-radius: 8px; font-size: .875rem; padding: .65rem .8rem; color: var(--nido-ink); min-height: 43px; }
.form-control:focus, .form-select:focus { border-color: #65a999; box-shadow: 0 0 0 3px #127b6918; }
.form-control::placeholder { color: #627087; }
.form-control[readonly] { background: #f6f8fb; color: #56667e; }
.form-check-input[type="checkbox"], .form-check-input[type="radio"] { -webkit-appearance: checkbox; appearance: auto; accent-color: var(--nido-brand); background-image: none; cursor: pointer; width: 1.05em; height: 1.05em; margin-top: .35em; }
.form-select { appearance: auto; background-image: none; }
/* Tarjetas y tablas. */
.card { border: 1px solid var(--nido-line); border-radius: var(--nido-radius); box-shadow: 0 2px 5px #182d4b03; }
.card-body { padding: 1.4rem; }
.card > .table-responsive { border-radius: inherit; }
.table-card { overflow: hidden; }
.table-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 21px 22px; border-bottom: 1px solid var(--nido-line); }
.table-card-heading h2 { font-size: .95rem; font-weight: 650; margin: 0; }
.table-card-heading p { color: var(--nido-muted); font-size: .72rem; margin: 4px 0 0; }
.table-count { padding: 4px 10px; border: 1px solid #e3e9f0; background: #f8fafc; color: #64748b; font-size: .68rem; border-radius: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--nido-ink); --bs-table-border-color: var(--nido-line); font-size: .875rem; }
.table > :not(caption) > * > * { padding: 16px 14px; vertical-align: middle; }
.table thead { background: #eaf0f6; }
.table thead th { color: #35465e; font-size: .72rem; font-weight: 650; text-transform: uppercase; letter-spacing: .035em; line-height: 1.5; white-space: nowrap; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tbody tr:nth-child(even) { --bs-table-bg: #f5f8fc; }
.table tbody > tr > * { border-bottom-color: #dbe3ed; }
.table tbody th { font-weight: 550; }
.trips-table { min-width: 800px; }
.trips-table tr > :not(:first-child) { padding-left: 14px; padding-right: 14px; }
.trips-table tr > :not(:first-child):not(:last-child) { text-align: center; }
.table-responsive:focus-visible { outline: 3px solid #77bfae; outline-offset: -3px; }
.table-scroll-hint { display: none; }
.trip-identity { width: 32%; min-width: 240px; overflow-wrap: anywhere; }
.trip-identity strong { font-weight: 700; font-size: .95rem; display: block; color: #17263c; }
.trip-identity small { display: block; font-size: .82rem; color: #495b72; margin-top: 4px; }
.date-cell { white-space: nowrap; font-variant-numeric: tabular-nums; color: #36485f !important; }
.money-cell { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.count-cell { text-align: center; font-variant-numeric: tabular-nums; }
.count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; min-height: 28px; padding: 2px 6px; background: #edf2f8; border-radius: 7px; color: #344a65; font-size: .875rem; font-weight: 700; }
.count-pill-confirmed { background: #d8eee2; color: #15583e; }
.pending-amount { font-weight: 500; color: #52627b; }
.pending-amount.is-pending { font-weight: 700; color: #875408; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.table .badge { white-space: nowrap; }
.badge { font-size: .66rem; font-weight: 600; letter-spacing: .01em; padding: .5em .75em; border-radius: 6px; }
.badge.text-bg-success { color: #1d7658 !important; background: #e5f4ec !important; }
.badge.text-bg-secondary { color: #66768c !important; background: #edf1f6 !important; }
.badge.text-bg-warning { color: #8b5f16 !important; background: #fff2d7 !important; }
.badge.text-bg-info { color: #296a9c !important; background: #e6f1fb !important; }
.badge.text-bg-danger { color: #ac3e45 !important; background: #fbe8ea !important; }
.status-badge::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: .1em; }
.page-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 22px; }
.page-toolbar p { color: var(--nido-muted); font-size: .8rem; margin: 0; }
.table-help { display: flex; align-items: flex-start; gap: 8px; margin-top: 18px; color: #627087; font-size: .7rem; max-width: 950px; }
.table-help .ui-icon { margin-top: 3px; }
.table-help p { margin: 0; }
.summary-value { font-size: clamp(1.1rem, 2.3vw, 1.6rem); font-weight: 700; margin-top: 7px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
dt { font-weight: 550; }
dd { margin-top: 3px; }
.registration-notice { background: #f6f8fb; border: 1px solid var(--nido-line); border-radius: 10px; padding: 1rem; }
summary { cursor: pointer; font-size: .85rem; }
.alert { border-radius: 10px; font-size: .82rem; }
.empty-state { text-align: center; padding: 52px 24px; }
.empty-state-icon { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; border-radius: 18px; background: #e5f4ed; color: var(--nido-brand); font-size: 1.6rem; margin-bottom: 18px; }
/* Acceso e inscripción: presentación sencilla, sin menú administrativo. */
.public-shell { min-height: 100vh; display: flex; flex-direction: column; }
.public-header { background: #fff; border-bottom: 1px solid var(--nido-line); padding: 20px max(24px, calc((100vw - 980px) / 2)); }
.brand { color: var(--nido-ink); }
.brand small { color: var(--nido-muted); }
.public-main { width: 100%; max-width: 980px; margin: 0 auto; padding: 32px 24px 40px; flex: 1; }
.public-shell .app-footer { justify-content: center; }
.login-card { max-width: 450px; margin: 24px auto; }
.public-link { min-width: 240px; }
@media (max-width: 1100px) {
    .app-topbar { padding: 15px 24px; }
    .app-main { padding: 26px 24px 36px; }
    .account-label > span:last-child { display: none; }
    .topbar-actions { gap: 12px; }
}
@media (max-width: 767px) {
    .app-shell { margin-left: 0; }
    .app-sidebar { width: 252px; transform: translateX(-100%); visibility: hidden; }
    .app-nav-toggle { display: block; position: absolute; width: 1px; height: 1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .app-nav-toggle:checked ~ .app-sidebar { transform: translateX(0); visibility: visible; }
    .app-nav-toggle:checked ~ .sidebar-overlay { display: block; position: fixed; inset: 0; background: #101b3270; z-index: 990; }
    .app-nav-toggle:focus-visible ~ .app-shell .menu-button { outline: 3px solid #77bfae; outline-offset: 3px; }
    .menu-button, .sidebar-close { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; width: 34px; height: 34px; border-radius: 7px; }
    .menu-button { border: 1px solid var(--nido-line); color: #52627a; font-size: 1.15rem; }
    .sidebar-close { position: absolute; top: 11px; right: 8px; color: #b7c5d9; }
    .app-topbar { min-height: 68px; padding: 14px 16px; gap: 12px; }
    .topbar-location { gap: 9px; }
    .topbar-section, .topbar-separator, .account-label { display: none; }
    .logout-button { padding: .5rem .65rem; font-size: .68rem; }
    .app-main { padding: 24px 16px 30px; }
    .page-heading { margin-bottom: 21px; }
    .page-toolbar { align-items: flex-start; }
    .app-footer { padding: 16px; }
    .table-card-heading { padding: 18px 16px; }
    .table-scroll-hint { display: flex; align-items: center; gap: 5px; padding: 10px 14px; margin: 0; border-top: 1px solid var(--nido-line); color: var(--nido-muted); font-size: .68rem; }
    .public-main { padding: 24px 16px; }
    .public-header { padding: 16px; }
}
@media print {
    .app-sidebar, .app-topbar, .app-nav-toggle, .sidebar-overlay, .skip-link { display: none !important; }
    .app-shell { margin: 0; }
    .app-main { max-width: none; padding: 0; }
    body { background: #fff; }
}

/* Resumen compacto del detalle de viaje. */
.trip-overview-data { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) repeat(3, minmax(90px, .8fr)); gap: 24px; margin: 0; }
.trip-overview-data dt { color: #495b72; font-size: .78rem; font-weight: 500; }
.trip-overview-data dd { font-size: .875rem; font-weight: 600; margin: 4px 0 0; overflow-wrap: anywhere; }
.trip-enrollment { color: #495b72; }
.trip-enrollment summary { width: fit-content; font-size: .8rem; }
.trip-enrollment summary .ui-icon { vertical-align: middle; margin: 0 6px; }
.trip-enrollment-content { background: #fff; border: 1px solid var(--nido-line); border-radius: 10px; padding: 16px; margin-top: 12px; }
@media (min-width: 768px) and (max-width: 1199px) {
    .trip-overview-data { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .trip-overview-data > :nth-child(-n+2) { grid-column: span 3; }
    .trip-overview-data > :nth-child(n+3) { grid-column: span 2; }
}
@media (max-width: 767px) {
    .trip-overview-data { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

.page-heading-with-actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 24px; }
.page-heading-with-actions > div:first-child { min-width: 0; flex: 1 1 320px; }
.page-heading-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; max-width: 100%; }
.trip-summary-cards .card-body { text-align: center; justify-content: center; padding: 18px 16px; }
.trip-student-counts dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; width: 100%; }
.trip-student-counts dl > div { padding: 0 8px; }
.trip-student-counts dt { font-size: .75rem; color: #495b72; font-weight: 500; }
.trip-student-counts dd { font-size: clamp(1.1rem, 2.3vw, 1.6rem); font-weight: 700; margin: 7px 0 0; font-variant-numeric: tabular-nums; }
.trip-confirmed-count { border-left: 1px solid var(--nido-line); }
.trip-confirmed-count dt, .trip-confirmed-count dd { color: #15583e; }
@media (max-width: 767px) {
    .page-heading-actions { justify-content: flex-start; flex-shrink: 1; }
}

.page-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.page-title-line .badge { font-size: .75rem; flex-shrink: 0; }

/* Gestión de alumnos: filtros, orden y paginación. */
.reservation-filters { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 0; margin-bottom: 4px; border-bottom: 1px solid var(--nido-line); }
.reservation-filter { display: inline-flex; align-items: center; gap: 7px; color: #495b72; font-size: .82rem; text-decoration: none; padding: 7px 0; border-bottom: 2px solid transparent; }
.reservation-filter span { font-size: .72rem; border-radius: 5px; padding: 1px 6px; background: #e8edf4; color: #35465e; font-variant-numeric: tabular-nums; }
.reservation-filter.is-active { color: var(--nido-brand-dark); font-weight: 700; border-bottom-color: var(--nido-brand); }
.reservation-filter.is-active span { color: #15583e; background: #d8eee2; }
.reservation-filter:focus-visible { outline: 3px solid #77bfae; outline-offset: 3px; }
.reservation-filter-help { font-size: .75rem; color: #627087; margin: 8px 0 18px; }
.reservation-pagination { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 16px; }
.reservation-pagination > span:not(.btn) { font-size: .8rem; color: #495b72; font-variant-numeric: tabular-nums; }

/* Flecha de desplegable centrada, sin imágenes ni cambios en la CSP. */
.select-control { position: relative; width: 100%; min-width: 0; }
.select-control > .form-select { -webkit-appearance: none; appearance: none; background-image: none; padding-right: 2.5rem; }
.select-control::after { content: ""; position: absolute; top: 50%; right: 16px; width: 7px; height: 7px; border-right: 2px solid #52627b; border-bottom: 2px solid #52627b; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
@media (forced-colors: active) {
    .select-control > .form-select { -webkit-appearance: auto; appearance: auto; }
    .select-control::after { display: none; }
}

.trip-capacity-note { font-size: .75rem; color: #495b72; margin: 16px 0 0; }
.trip-editor input[type="date"] { background-color: #f8fafc; font-variant-numeric: tabular-nums; color-scheme: light; cursor: pointer; }
.trip-editor input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; padding: 4px; border-radius: 5px; background-color: #e5f4ec; }

.installment-editor-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 144px; align-items: end; gap: 16px; margin-bottom: 18px; }
.installment-editor-row > div { min-width: 0; }
.installment-editor-action { display: flex; justify-content: flex-end; }
.installment-editor-action .btn { min-height: 43px; white-space: nowrap; }
@media (max-width: 767px) {
    .installment-editor-row { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}

/* Ficha del alumno: cabecera y contactos compactos. */
.page-heading-with-context { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 1.35fr); align-items: center; gap: 24px; }
.page-heading-context { padding: 14px 18px; }
.page-heading-context h2 { font-size: .78rem; font-weight: 700; margin: 0 0 10px; }
.page-heading-context h2 span { font-size: .68rem; font-weight: 400; color: #627087; }
.page-heading-context dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; margin: 0; }
.page-heading-context dt { color: #627087; font-size: .68rem; font-weight: 500; }
.page-heading-context dd { font-size: .78rem; line-height: 1.4; margin: 2px 0 0; overflow-wrap: anywhere; }
.student-contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: stretch; }
.student-left-stack { display: grid; grid-template-rows: repeat(2, 1fr); gap: 18px; min-width: 0; }
.compact-contact-card { padding: 16px 18px; scroll-margin-top: 20px; }
.compact-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.compact-card-heading h2 { font-size: .9rem; font-weight: 700; margin: 0; }
.compact-card-heading .btn-icon { width: 28px; height: 28px; border-color: transparent; background: transparent; flex-shrink: 0; }
.compact-card-heading .btn-icon:hover { border-color: #dce3ec; background: #f0f4f8; }
.compact-contact-data { margin: 0; }
.compact-contact-data > div { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 10px; padding: 5px 0; border-bottom: 1px solid #edf1f6; }
.compact-contact-data > div:last-child { border-bottom: 0; }
.compact-contact-data dt { font-size: .73rem; color: #627087; font-weight: 500; line-height: 1.5; }
.compact-contact-data dd { font-size: .8rem; line-height: 1.5; margin: 0; overflow-wrap: anywhere; }
.compact-guardians { display: grid; gap: 16px; }
.compact-guardian h3 { font-size: .75rem; font-weight: 650; color: #35465e; margin: 0 0 6px; }
.compact-guardian + .compact-guardian { border-top: 1px solid var(--nido-line); padding-top: 12px; }
.compact-empty { font-size: .75rem; color: #627087; margin: 0; }
.student-reservation-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 24px 0 22px; }
#reservation-operation { scroll-margin-top: 20px; }
@media (max-width: 1199px) { .page-heading-with-context { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
@media (max-width: 767px) {
    .student-contact-grid { grid-template-columns: minmax(0, 1fr); }
    .page-heading-context dl { grid-template-columns: minmax(0, 1fr); }
}

/* Modales nativos de edición y cobro de la ficha. */
body.has-student-dialog { overflow: hidden; }
.student-dialog { width: min(760px, calc(100% - 32px)); max-width: none; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid var(--nido-line); border-radius: 14px; color: var(--nido-ink); background: #fff; box-shadow: 0 24px 80px #14213938; }
.student-dialog-wide { width: min(960px, calc(100% - 32px)); }
.student-dialog[open] { display: flex; flex-direction: column; }
.student-dialog::backdrop { background: #14213999; }
.student-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--nido-line); flex-shrink: 0; }
.student-dialog-header h2 { font-size: 1rem; font-weight: 700; margin: 0; }
.student-dialog-content { padding: 4px 20px 20px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.student-dialog[open]:not(:modal) { position: relative; margin: 20px auto; }
@media (max-width: 767px) {
    .student-left-stack { grid-template-rows: none; }
    .student-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); }
    .student-dialog-header { padding: 14px 16px; }
    .student-dialog-content { padding: 4px 16px 16px; }
}

.registration-step { color: var(--nido-brand-dark); font-size: .75rem; font-weight: 650; margin-bottom: 12px; }
.registration-access-note { background: #f5f8fc; border: 1px solid var(--nido-line); border-radius: 10px; padding: 16px; margin-bottom: 20px; max-width: 580px; }

.password-visibility[hidden] { display: none; }

/* Área del alumno y directorio de administración. */
.family-trip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.family-trip-grid .card { min-width: 0; }
.family-card-icon { color: var(--nido-brand); background: #e4f4ed; border-radius: 10px; padding: 10px; display: inline-flex; }
.family-card-icon .ui-icon { width: 24px; height: 24px; }
.family-trip-data { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; }
.family-trip-data dt { font-size: .75rem; color: var(--nido-muted); font-weight: 500; }
.family-trip-data dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.family-summary { text-align: center; }
.student-directory-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, .7fr) auto; gap: 16px; align-items: end; }
.student-account-note { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; }
@media (max-width: 767px) {
    .family-trip-grid, .student-directory-filters { grid-template-columns: minmax(0, 1fr); }
    .family-trip-data { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* En móvil, cuotas y movimientos se leen en tarjetas sin desplazamiento lateral. */
.family-mobile-records { display: none; }
@media (max-width: 767px) {
    .family-desktop-table { display: none; }
    .family-mobile-records { display: grid; gap: 12px; padding: 0; margin: 0; list-style: none; }
    .family-mobile-record { min-width: 0; padding: 16px; }
    .family-record-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
    .family-record-heading h3 { margin: 0; font-size: .95rem; }
    .family-record-heading .badge { white-space: normal; text-align: left; line-height: 1.4; }
    .family-record-date { margin: 6px 0 14px; color: var(--nido-muted); font-size: .8rem; }
    .family-record-amounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding-top: 12px; border-top: 1px solid var(--nido-line); }
    .family-record-amounts dt, .family-record-details dt { color: var(--nido-muted); font-size: .75rem; font-weight: 500; }
    .family-record-amounts dd { margin: 3px 0 0; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
    .family-record-value { font-size: 1.05rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
    .family-record-details { margin: 12px 0 0; }
    .family-record-details > div { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding-top: 5px; }
    .family-record-details dd { margin: 0; font-size: .8rem; overflow-wrap: anywhere; }
}

/* Bienvenida de inscripción: acceso existente y alta nueva separados. */
.enrollment-welcome-intro { color: var(--nido-muted); margin-bottom: 24px; }
.enrollment-welcome-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.enrollment-welcome-grid > section { min-width: 0; }
.enrollment-welcome-grid .btn { white-space: normal; }
@media (max-width: 767px) {
    .enrollment-welcome-grid { grid-template-columns: minmax(0, 1fr); }
}

.enrollment-welcome-primary { border-color: #8fc8b5; box-shadow: 0 0 0 1px #8fc8b52b; }

/* Accesos: título y formulario comparten una columna centrada. */
.public-main.public-login-main { max-width: 498px; }
.public-login-main > .page-heading { text-align: center; }
.public-login-main .page-title-line { justify-content: center; }

/* Vista previa del correo de inscripción, siempre como texto escapado. */
.email-preview-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Identificación del alumno y su reserva en el área familiar. */
.family-reservation-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 24px; }
.family-student-title { min-width: 0; margin: 0; font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }

/* Listado independiente para consulta e impresión. */
.trip-print-page { margin: 0; padding: 24px; background: #fff; color: #17212e; font: 14px/1.45 Arial, sans-serif; }
.trip-print-page h1 { font-size: 24px; margin: 0 0 8px; }
.trip-print-toolbar { margin-bottom: 24px; }
.trip-print-toolbar button { padding: 10px 18px; border: 0; border-radius: 6px; background: #347b6d; color: #fff; font: inherit; cursor: pointer; }
.trip-print-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.trip-print-table caption { text-align: left; margin-bottom: 10px; font-weight: bold; }
.trip-print-table th, .trip-print-table td { border: 1px solid #bcc5ce; padding: 8px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.trip-print-table th { background: #eef1f4; }
@page trip-list-normal { size: A4 portrait; margin: 12mm; }
@page trip-list-wide { size: A4 landscape; margin: 10mm; }
@media print {
    .trip-print-page { page: trip-list-normal; padding: 0; font-size: 10pt; }
    .trip-print-wide { page: trip-list-wide; font-size: 9pt; }
    .trip-print-toolbar { display: none !important; }
    .trip-print-table thead { display: table-header-group; }
    .trip-print-table tr { break-inside: avoid; page-break-inside: avoid; }
    .trip-print-table th, .trip-print-table td { padding: 5px; }
}

/* Cabecera del área familiar, sin navegación lateral. */
.family-shell { margin-left: 0; }
.family-shell .app-main { max-width: 1280px; }
.family-shell .app-topbar { width: 100%; max-width: 1280px; margin: 0 auto; }
.family-topbar-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--nido-ink); font-size: 1.3rem; font-weight: 750; text-decoration: none; flex-shrink: 0; }
.family-topbar-brand .family-brand-label small { color: var(--nido-muted); font-size: .85rem; font-weight: 500; margin-left: 6px; }
.family-topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 18px; min-width: 0; }
.family-topbar-actions form { margin: 0; flex-shrink: 0; }
.family-account-name { font-size: .95rem; font-weight: 600; overflow-wrap: anywhere; text-align: right; }
@media (max-width: 767px) {
    .family-shell .app-topbar { flex-wrap: wrap; }
    .family-topbar-actions { flex: 1 1 100%; justify-content: space-between; gap: 12px; }
    .family-account-name { text-align: left; }
}
