/* public/css/components/accordion.css */
.ui-accordion {
    border: 1px solid var(--gf-border, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.ui-accordion__summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
}

.ui-accordion__summary::-webkit-details-marker {
    display: none;
}

.ui-accordion__content {
    border-top: 1px solid var(--gf-border, #e5e7eb);
}

.ui-accordion__caret {
    color: var(--gf-text-muted, #64748b);
    transition: transform 0.2s ease;
}

.ui-accordion[open] .ui-accordion__caret {
    transform: rotate(180deg);
}

/* public/css/components/alumno-form.css */
/* Alumno edit compact card layout */
#alumno-edit-form.alumno-edit-form {
    width: 100%;
    padding: 1rem 1.25rem;
}

.alumno-panel {
    min-width: 0;
}

.alumno-panel.is-active {
    display: block;
}

.alumno-general-layout,
.alumno-tab-card-grid {
    display: grid;
    gap: 0.85rem;
    align-items: start;
    min-width: 0;
}

.alumno-general-layout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.alumno-tab-card-grid--two {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.alumno-card-stack {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

.alumno-panel .general-card {
    margin: 0;
    padding: 1rem;
    min-width: 0;
}

.alumno-panel .general-card__header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.6rem;
}

.alumno-panel .general-card__title {
    gap: 0.45rem;
    font-size: 0.95rem;
}

.alumno-panel .general-card__title .material-symbols-outlined {
    font-size: 1.25rem;
}

.alumno-panel .general-card__grid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
}

.alumno-panel .grid {
    gap: 0.65rem;
}

.alumno-panel .form-group {
    gap: 0.25rem;
    margin-bottom: 0;
}

.alumno-panel .form-group label,
.alumno-panel .form-group__label {
    margin-bottom: 0.25rem;
    font-size: 0.72rem;
    line-height: 1.2;
}

.alumno-panel input:not([type="checkbox"]):not([type="file"]),
.alumno-panel select,
.alumno-panel textarea,
.alumno-panel .form-control {
    width: 100%;
    max-width: 100%;
    min-height: 38px;
    padding: 0.55rem 0.75rem;
}

.alumno-panel textarea {
    min-height: 90px;
    resize: vertical;
}

#panel-general .profile-upload .avatar--xl {
    width: 48px;
    height: 48px;
    margin-bottom: 0.65rem !important;
}

#panel-general .profile-upload .btn--file {
    margin-bottom: 0.75rem !important;
}

#panel-general .profile-upload > div:last-child {
    margin-top: 0.75rem !important;
}

#panel-general .checkbox-premium {
    min-height: 24px;
}

.alumno-tab-card {
    height: 100%;
}

.alumno-tab-card .general-card__grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alumno-search-strip {
    margin-bottom: 0;
}

.alumno-table-wrapper {
    min-width: 0;
}

.alumno-table-wrapper--fit {
    max-height: clamp(260px, 46vh, 430px);
    overflow: auto;
}

.alumno-compact-table {
    min-width: 0;
}

.alumno-compact-table thead th,
.alumno-compact-table tbody td {
    vertical-align: middle;
    white-space: normal;
}

.alumno-compact-table td,
.alumno-compact-table th {
    overflow-wrap: anywhere;
}

#tabla-grupos-matricular th,
#tabla-grupos-matricular td {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
}

#tabla-grupos-matricular td:nth-child(2) {
    min-width: 145px;
}

#tabla-grupos-matricular .badge {
    white-space: nowrap;
}

@media (max-width: 1400px) {
    .alumno-general-layout {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .alumno-panel .general-card {
        padding: 0.9rem;
    }

    .alumno-panel input:not([type="checkbox"]):not([type="file"]),
    .alumno-panel select,
    .alumno-panel textarea,
    .alumno-panel .form-control {
        min-height: 36px;
        padding: 0.5rem 0.7rem;
    }
}

/* Empresas tab layout */
.alumno-empresas-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.alumno-empresas-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 1100px) {
    .alumno-general-layout,
    .alumno-tab-card-grid--two,
    .alumno-empresas-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* public/css/components/autocomplete.css */
/**
 * ============================================================================
 *    AUTOCOMPLETE COMPONENT
 * ============================================================================
 * Componente de autocompletado con tokens CSS centralizados.
 * Permite buscar y seleccionar de una lista o agregar nuevos valores.
 * 
 * Tokens requeridos: design-tokens.css
 * ============================================================================
 */

/* -----------------------------------------------------------------------------
   Wrapper
   ----------------------------------------------------------------------------- */
.autocomplete-wrapper {
    position: relative;
    width: var(--autocomplete-width);
}

/* -----------------------------------------------------------------------------
   Input
   ----------------------------------------------------------------------------- */
.autocomplete-input {
    width: 100%;
    padding: var(--autocomplete-padding-y) var(--autocomplete-padding-right-icon) var(--autocomplete-padding-y) var(--autocomplete-padding-x);
    border: var(--border-width) solid var(--autocomplete-border);
    border-radius: var(--autocomplete-radius);
    font-size: var(--autocomplete-font-size);
    transition: all var(--autocomplete-transition);
    background-color: white;
}

.autocomplete-input:focus {
    outline: none;
    border-color: var(--autocomplete-focus-border);
    box-shadow: var(--autocomplete-focus-ring);
}

.autocomplete-input::placeholder {
    color: var(--autocomplete-placeholder-color);
}

/* -----------------------------------------------------------------------------
   Clear button
   ----------------------------------------------------------------------------- */
.autocomplete-clear {
    position: absolute;
    right: var(--autocomplete-clear-right);
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--autocomplete-clear-color);
    cursor: pointer;
    padding: var(--autocomplete-clear-padding);
    display: none;
    font-size: var(--autocomplete-clear-size);
    line-height: 1;
    transition: color var(--autocomplete-transition);
}

.autocomplete-clear:hover {
    color: var(--autocomplete-clear-hover-color);
}

.autocomplete-wrapper.has-value .autocomplete-clear {
    display: block;
}

/* -----------------------------------------------------------------------------
   Dropdown
   ----------------------------------------------------------------------------- */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: var(--autocomplete-dropdown-margin-top);
    background-color: var(--autocomplete-dropdown-bg);
    border: var(--border-width) solid var(--autocomplete-dropdown-border);
    border-radius: var(--autocomplete-dropdown-radius);
    box-shadow: var(--autocomplete-dropdown-shadow);
    max-height: var(--autocomplete-dropdown-max-height);
    overflow-y: auto;
    z-index: var(--autocomplete-dropdown-z-index);
    display: none;
}

.autocomplete-dropdown.is-open {
    display: block;
}

/* Aplica al dropdown tanto dentro del wrapper (modo normal) como con la clase suelta
   en el body (modo portal: el dropdown lleva la clase --course-search inyectada). */
.autocomplete-wrapper--course-search .autocomplete-dropdown,
.autocomplete-dropdown.autocomplete-wrapper--course-search {
    width: min(720px, calc(100vw - 2rem));
    max-height: 380px;
}

.autocomplete-wrapper--course-search .autocomplete-item,
.autocomplete-dropdown.autocomplete-wrapper--course-search .autocomplete-item {
    min-height: 42px;
}

.autocomplete-wrapper--course-search .autocomplete-item__text,
.autocomplete-dropdown.autocomplete-wrapper--course-search .autocomplete-item__text {
    white-space: normal;
    line-height: 1.35;
}

/* Modo portal: el dropdown se monta en <body>; necesita z-index muy alto para superar
   cualquier stacking context que pueda haber en la página (cards, modales, etc.). */
.autocomplete-dropdown--portal {
    z-index: 9999;
}

/* -----------------------------------------------------------------------------
   Items
   ----------------------------------------------------------------------------- */
.autocomplete-item {
    padding: var(--autocomplete-item-padding-y) var(--autocomplete-item-padding-x);
    cursor: pointer;
    transition: background-color var(--transition-fast);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--autocomplete-item-gap);
    font-size: var(--autocomplete-item-font-size);
}

.autocomplete-item:hover,
.autocomplete-item.is-active {
    background-color: var(--autocomplete-item-hover-bg);
}

.autocomplete-item__text {
    flex: 1;
    color: var(--autocomplete-item-text-color);
}

/* Badge de count */
.autocomplete-item__count {
    font-size: var(--autocomplete-count-font-size);
    color: var(--autocomplete-count-color);
    background-color: var(--autocomplete-count-bg);
    padding: var(--space-1) var(--autocomplete-count-padding-x);
    border-radius: var(--autocomplete-count-radius);
    margin-left: var(--autocomplete-item-gap);
}

/* -----------------------------------------------------------------------------
   Item "new" (crear nuevo)
   ----------------------------------------------------------------------------- */
.autocomplete-item--new {
    border-top: var(--border-width) solid var(--autocomplete-new-border);
    background-color: var(--autocomplete-new-bg);
    color: var(--autocomplete-new-color);
    font-weight: var(--font-weight-medium);
}

.autocomplete-item--new:hover {
    background-color: var(--autocomplete-new-hover-bg);
}

.autocomplete-item--new::before {
    content: "+ ";
    margin-right: var(--space-1);
}

/* -----------------------------------------------------------------------------
   Estados vacío y loading
   ----------------------------------------------------------------------------- */
.autocomplete-empty {
    padding: var(--space-3);
    text-align: center;
    color: var(--autocomplete-empty-color);
    font-size: var(--autocomplete-font-size);
}

.autocomplete-loading {
    padding: var(--space-3);
    text-align: center;
    color: var(--autocomplete-loading-color);
    font-size: var(--autocomplete-font-size);
}

/* -----------------------------------------------------------------------------
   Scrollbar personalizado
   ----------------------------------------------------------------------------- */
.autocomplete-dropdown::-webkit-scrollbar {
    width: var(--autocomplete-scrollbar-width);
}

.autocomplete-dropdown::-webkit-scrollbar-track {
    background: var(--autocomplete-scrollbar-track);
    border-radius: var(--radius-sm);
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
    background: var(--autocomplete-scrollbar-thumb);
    border-radius: var(--radius-sm);
}

.autocomplete-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-500);
}

/* -----------------------------------------------------------------------------
   Variante compacta
   ----------------------------------------------------------------------------- */
.autocomplete-wrapper--compact .autocomplete-input {
    padding: var(--space-1) var(--space-2) var(--space-1) var(--space-2);
    font-size: var(--text-sm);
}

.autocomplete-wrapper--compact .autocomplete-item {
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-sm);
}

.autocomplete-wrapper--compact .autocomplete-dropdown {
    max-height: 200px;
}

/* -----------------------------------------------------------------------------
   Variante con icono
   ----------------------------------------------------------------------------- */
.autocomplete-wrapper--icon .autocomplete-input {
    padding-left: var(--space-8);
}

.autocomplete-wrapper--icon .autocomplete-icon {
    position: absolute;
    left: var(--space-2);
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-gray-400);
    pointer-events: none;
}

/* -----------------------------------------------------------------------------
   Error state
   ----------------------------------------------------------------------------- */
.autocomplete-wrapper.has-error .autocomplete-input {
    border-color: var(--danger-text);
}

.autocomplete-wrapper.has-error .autocomplete-input:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* -----------------------------------------------------------------------------
   Disabled state
   ----------------------------------------------------------------------------- */
.autocomplete-wrapper.is-disabled .autocomplete-input {
    background-color: var(--color-gray-100);
    color: var(--color-gray-500);
    cursor: not-allowed;
}

/* -----------------------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .autocomplete-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        margin-top: 0;
        max-height: 50vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
    
    .autocomplete-item {
        padding: var(--space-3);
    }
}

/* public/css/components/breadcrumbs.css */
/**
 * ============================================================================
 *    BREADCRUMBS COMPONENT
 * ============================================================================
 * Componente de migas de pan con tokens CSS centralizados.
 * Diseño compacto para topbar.
 * 
 * Tokens requeridos: design-tokens.css
 * ============================================================================
 */

/* -----------------------------------------------------------------------------
   Contenedor principal
   ----------------------------------------------------------------------------- */
.breadcrumbs {
    display: flex;
    align-items: center;
    font-size: var(--breadcrumbs-font-size);
    color: var(--breadcrumbs-color);
    margin-bottom: var(--breadcrumbs-margin-bottom);
    line-height: var(--breadcrumbs-line-height);
    flex-wrap: wrap;
    gap: var(--breadcrumbs-gap);
}

/* -----------------------------------------------------------------------------
   Items
   ----------------------------------------------------------------------------- */
.breadcrumbs__item {
    display: inline-flex;
    align-items: center;
}

/* -----------------------------------------------------------------------------
   Links
   ----------------------------------------------------------------------------- */
.breadcrumbs__link {
    color: var(--breadcrumbs-link-color);
    text-decoration: var(--breadcrumbs-link-text-decoration);
    transition: color var(--breadcrumbs-link-transition);
}

.breadcrumbs__link:hover {
    color: var(--breadcrumbs-link-hover-color);
}

/* -----------------------------------------------------------------------------
   Separator
   ----------------------------------------------------------------------------- */
.breadcrumbs__separator {
    margin-left: var(--breadcrumbs-sep-margin-x);
    margin-right: var(--breadcrumbs-sep-margin-x);
    color: var(--breadcrumbs-sep-color);
    font-size: var(--breadcrumbs-sep-font-size);
    display: flex;
    align-items: center;
}

/* -----------------------------------------------------------------------------
   Current (página actual)
   ----------------------------------------------------------------------------- */
.breadcrumbs__current {
    color: var(--breadcrumbs-current-color);
    font-weight: var(--breadcrumbs-current-weight);
}

/* -----------------------------------------------------------------------------
   Breadcrumb Steps (para wizard/matrículas)
   ----------------------------------------------------------------------------- */
.breadcrumb-step {
    background-color: var(--breadcrumbs-step-bg);
    border: var(--border-width) solid var(--breadcrumbs-step-border);
    border-radius: var(--breadcrumbs-step-radius);
    color: var(--breadcrumbs-step-color);
    cursor: pointer;
    padding: var(--breadcrumbs-step-padding-y) var(--breadcrumbs-step-padding-x);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.breadcrumb-step:hover {
    background-color: var(--breadcrumbs-step-hover-bg);
}

.breadcrumb-step.active {
    background-color: var(--breadcrumbs-step-active-bg);
    border-color: var(--breadcrumbs-step-active-border);
    color: var(--breadcrumbs-step-active-color);
}

.breadcrumb-step.completed {
    background-color: var(--color-success-50);
    border-color: var(--color-success-300);
    color: var(--color-success-700);
}

.breadcrumb-step.pending {
    background-color: var(--color-gray-100);
    border-color: var(--color-gray-200);
    color: var(--color-gray-400);
}

/* -----------------------------------------------------------------------------
   Variante inversa (fondo oscuro)
   ----------------------------------------------------------------------------- */
.breadcrumbs--inverse {
    color: var(--color-gray-300);
}

.breadcrumbs--inverse .breadcrumbs__link {
    color: var(--color-gray-300);
}

.breadcrumbs--inverse .breadcrumbs__link:hover {
    color: white;
}

.breadcrumbs--inverse .breadcrumbs__separator {
    color: var(--color-gray-500);
}

.breadcrumbs--inverse .breadcrumbs__current {
    color: white;
}

/* -----------------------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .breadcrumbs {
        font-size: var(--text-xs);
    }
    
    .breadcrumb-step {
        padding: var(--space-1) var(--space-2);
        font-size: var(--text-xs);
    }
}

/* public/css/components/calendar.css */
/**
 * ============================================================================
 *    CALENDAR COMPONENT
 * ============================================================================
 * Componente de calendario mensual con tokens CSS centralizados.
 * Diseñado para 1920x1080 - toda información visible sin scroll.
 * 
 * Tokens requeridos: design-tokens.css
 * ============================================================================
 */

/* -----------------------------------------------------------------------------
   Viewport & Layout principal
   ----------------------------------------------------------------------------- */
.calendar-viewport {
    height: var(--calendar-viewport-height);
    min-height: var(--calendar-viewport-min-height);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.calendar-layout-page {
    height: var(--calendar-viewport-height);
    margin-bottom: 0;
}

.calendar-layout-page__header {
    display: flex;
    flex-direction: column;
    gap: var(--calendar-layout-gap);
}

.calendar-layout-page__body {
    overflow: hidden;
}

.calendar-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--calendar-content-padding);
}

/* -----------------------------------------------------------------------------
   Calendar Grid
   ----------------------------------------------------------------------------- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: var(--calendar-grid-rows);
    gap: var(--calendar-grid-gap);
    background: var(--color-gray-200);
    border: var(--border-width) solid var(--color-gray-200);
    border-radius: var(--calendar-grid-radius);
    height: 100%;
}

/* -----------------------------------------------------------------------------
   Day Headers (Lun, Mar, Mié...)
   ----------------------------------------------------------------------------- */
.calendar-day-header {
    background: var(--calendar-header-bg);
    padding: var(--calendar-header-padding-y) var(--calendar-header-padding-x);
    text-align: center;
    font-weight: var(--calendar-header-weight);
    font-size: var(--calendar-header-font-size);
    color: var(--calendar-header-color);
}

.calendar-day-header.weekend {
    background: var(--calendar-header-weekend-bg);
    color: var(--calendar-header-weekend-color);
}

/* -----------------------------------------------------------------------------
   Day Cells
   ----------------------------------------------------------------------------- */
.calendar-day {
    background: var(--calendar-day-bg);
    min-height: var(--calendar-day-min-height);
    padding: var(--calendar-day-padding);
    position: relative;
    transition: var(--transition-base);
    overflow-x: hidden;
    overflow-y: auto;
}

/* Celda clicable para crear festivo */
.calendar-day:not(.empty) {
    cursor: pointer;
}

.calendar-day.empty {
    background: var(--calendar-day-empty-bg);
}

.calendar-day.weekend {
    background: var(--calendar-day-weekend-bg);
}

.calendar-day.today {
    background: var(--calendar-day-today-bg);
}

.calendar-day.festivo {
    background: var(--calendar-day-festivo-bg);
}

.calendar-day.festivo .day-number {
    color: var(--danger-text);
}

/* Drag over state */
.calendar-day.drag-over {
    background: var(--info-bg);
    box-shadow: inset 0 0 0 2px var(--info-text);
}

/* -----------------------------------------------------------------------------
   Day Number
   ----------------------------------------------------------------------------- */
.day-number {
    font-weight: var(--calendar-daynum-font-weight);
    margin-bottom: var(--calendar-daynum-margin);
    font-size: var(--calendar-daynum-font-size);
    color: var(--calendar-daynum-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.day-number .today-indicator {
    width: var(--calendar-daynum-today-size);
    height: var(--calendar-daynum-today-size);
    background: var(--primary-500);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-sm);
}

/* -----------------------------------------------------------------------------
   Festivo Label
   ----------------------------------------------------------------------------- */
.festivo-label {
    font-size: var(--calendar-festivo-font-size);
    color: var(--calendar-festivo-color);
    background: var(--calendar-festivo-bg);
    padding: var(--calendar-festivo-padding-y) var(--calendar-festivo-padding-x);
    border-radius: var(--calendar-festivo-radius);
    display: inline-block;
    margin-bottom: var(--space-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    cursor: pointer;
    transition: var(--transition-base);
}

.festivo-label:hover {
    filter: brightness(0.95);
}

.calendar-day .day-number {
    cursor: pointer;
}

/* -----------------------------------------------------------------------------
   Session Items
   ----------------------------------------------------------------------------- */
.session-item {
    background: var(--calendar-session-bg);
    border-left: var(--calendar-session-border-left) solid var(--calendar-session-border);
    padding: var(--calendar-session-padding-y) var(--calendar-session-padding-x);
    margin-bottom: var(--calendar-session-margin-bottom);
    font-size: var(--calendar-session-font-size);
    border-radius: var(--calendar-session-radius);
    cursor: pointer;
    transition: var(--transition-base);
}

.session-item:hover {
    filter: brightness(0.95);
    transform: translateX(2px);
}

.session-item.realizada {
    background: var(--calendar-session-realizada-bg);
    border-left-color: var(--calendar-session-realizada-border);
}

.session-item.cancelada {
    background: var(--calendar-session-cancelada-bg);
    border-left-color: var(--calendar-session-cancelada-border);
    opacity: var(--calendar-session-cancelada-opacity);
}

.session-item.evento {
    background: var(--calendar-session-evento-bg);
    border-left-color: var(--calendar-session-evento-border);
}

.session-item.extraordinary {
    background: var(--calendar-session-extra-bg);
    border-left-color: var(--calendar-session-extra-border);
}

.session-item.on-festivo {
    border-left-color: var(--warning-500);
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.25);
}

/* Session time & group */
.session-time {
    font-weight: var(--calendar-sess-time-weight);
    color: var(--calendar-sess-time-color);
    display: flex;
    align-items: center;
    gap: var(--calendar-sess-time-gap);
    font-size: var(--calendar-sess-time-size);
}

.session-group {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--calendar-sess-group-color);
    font-size: var(--calendar-sess-group-size);
}

/* -----------------------------------------------------------------------------
   Calendar Navigation
   ----------------------------------------------------------------------------- */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--calendar-nav-padding);
    background: var(--calendar-nav-bg);
    border: var(--border-width) solid var(--calendar-nav-border);
    border-radius: var(--calendar-nav-radius);
    margin-bottom: var(--space-2);
}

.calendar-month-title {
    font-size: var(--calendar-title-size);
    font-weight: var(--calendar-title-weight);
    color: var(--calendar-title-color);
}

/* -----------------------------------------------------------------------------
   Legend
   ----------------------------------------------------------------------------- */
.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--calendar-legend-gap);
    padding: var(--calendar-legend-padding-y) 0;
    font-size: var(--calendar-legend-font-size);
    color: var(--calendar-legend-color);
    border-bottom: var(--border-width) solid var(--calendar-legend-border);
    margin-bottom: var(--space-3);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.legend-dot {
    width: var(--calendar-dot-size);
    height: var(--calendar-dot-size);
    border-radius: 50%;
}

.legend-dot.regular {
    background: var(--info-text);
}

.legend-dot.extraordinary {
    background: var(--warning-text);
}

.legend-dot.realizada {
    background: var(--success-text);
}

.legend-dot.cancelada {
    background: var(--danger-text);
}

.legend-dot.today {
    background: var(--warning-400);
    border: var(--border-width) solid var(--warning-500);
}

.calendar-counter {
    margin-left: auto;
    font-weight: var(--font-weight-medium);
    color: var(--color-gray-700);
}

.calendar-toolbar-actions {
    display: flex;
    gap: var(--calendar-toolbar-gap);
    flex-wrap: wrap;
}

/* -----------------------------------------------------------------------------
   Back to group bar
   ----------------------------------------------------------------------------- */
.calendar-back-to-group {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--calendar-bar-padding);
    background: var(--calendar-bar-bg);
    border-radius: var(--calendar-bar-radius);
    margin: var(--calendar-bar-margin);
}

.calendar-back-to-group__return {
    background: var(--color-gray-50);
    color: var(--primary-700);
    font-weight: var(--font-weight-semibold);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    transition: var(--transition-base);
}

.calendar-back-to-group__return:hover {
    transform: translateX(-2px);
}

.calendar-back-to-group__meta {
    color: var(--color-gray-100);
    font-size: var(--text-sm);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.calendar-back-to-group__all {
    color: var(--color-gray-100);
    border-color: var(--primary-300);
}

.calendar-back-to-group__all:hover {
    background: var(--primary-500);
    color: var(--color-gray-100);
}

/* -----------------------------------------------------------------------------
   Active filter chip
   ----------------------------------------------------------------------------- */
.calendar-active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--calendar-filter-chip-gap);
    padding: var(--calendar-filter-chip-padding);
    margin-bottom: var(--space-2);
    font-size: var(--calendar-filter-chip-font-size);
    background: var(--info-bg);
    border: var(--border-width) solid var(--info-border);
    border-radius: var(--radius-full);
    color: var(--info-text);
}

.calendar-active-filter-chip .chip-remove,
.calendar-active-filter-chip .chip-link {
    display: inline-flex;
    align-items: center;
    color: inherit;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
    text-decoration: none;
}

.calendar-active-filter-chip .chip-remove:hover,
.calendar-active-filter-chip .chip-link:hover {
    opacity: 1;
}

/* -----------------------------------------------------------------------------
   Filters bar
   ----------------------------------------------------------------------------- */
.calendar-filters-bar {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 0;
    flex-wrap: wrap;
}

.calendar-filters-toggle-compact {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    background: var(--calendar-filter-btn-bg);
    border: var(--border-width) solid var(--calendar-filter-btn-border);
    color: var(--calendar-filter-btn-color);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: var(--transition-base);
    white-space: nowrap;
}

.calendar-filters-toggle-compact:hover {
    background: var(--color-gray-200);
    border-color: var(--color-gray-400);
}

.calendar-filters-toggle-compact .toggle-icon {
    transition: transform var(--transition-fast);
    font-size: var(--text-xs);
}

.calendar-filters-toggle-compact .toggle-icon.rotated {
    transform: rotate(180deg);
}

/* Inline filters */
.calendar-filters-inline {
    display: none;
    align-items: center;
    gap: var(--space-1);
    flex-wrap: wrap;
    flex: 1;
}

.filter-select-compact {
    padding: var(--space-1) var(--space-2);
    border: var(--border-width) solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    background: white;
    font-size: var(--text-sm);
    color: var(--color-gray-700);
    min-width: var(--calendar-filter-select-min-width);
    max-width: var(--calendar-filter-select-max-width);
    cursor: pointer;
}

.filter-select-compact:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(130, 3, 3, 0.1);
}

/* -----------------------------------------------------------------------------
   Nav + Legend merged bar
   ----------------------------------------------------------------------------- */
.calendar-nav-legend-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    gap: var(--space-1);
    flex-wrap: wrap;
}

.calendar-nav-compact {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.calendar-month-title-compact {
    font-weight: var(--calendar-compact-title-weight);
    font-size: var(--calendar-compact-title-size);
    color: var(--color-gray-800);
    min-width: 120px;
    text-align: center;
}

.calendar-legend-compact {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    color: var(--color-gray-600);
    flex-wrap: wrap;
}

.legend-dot-inline {
    width: var(--calendar-dot-size);
    height: var(--calendar-dot-size);
    border-radius: 50%;
    display: inline-block;
    margin-left: var(--space-1);
}

.legend-dot-inline.regular { background: var(--primary-500); }
.legend-dot-inline.extraordinary { background: var(--warning-500); }
.legend-dot-inline.realizada { background: var(--success-500); }
.legend-dot-inline.cancelada { background: var(--danger-500); }
.legend-dot-inline.today { background: var(--gray-800); }

.calendar-counter-compact {
    margin-left: var(--space-2);
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-700);
}

/* -----------------------------------------------------------------------------
   Compact filter bar (v1.4)
   ----------------------------------------------------------------------------- */
.calendar-filter-select {
    padding: var(--space-1) var(--space-2);
    border: var(--border-width) solid var(--color-gray-300);
    border-radius: var(--radius-sm);
    background: white;
    font-size: var(--text-sm);
    min-width: 100px;
    max-width: none;
}

.calendar-filter-select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(130, 3, 3, 0.1);
}

/* -----------------------------------------------------------------------------
   Legacy styles (deprecated v1.4, kept for compat)
   ----------------------------------------------------------------------------- */
.calendar-breadcrumb__clear { margin-left: auto; }
.calendar-filters-container { display: none; }
.calendar-filters-content { display: none; }
.calendar-filters--collapsed { display: none; }

/* -----------------------------------------------------------------------------
   Responsive - diseñado para tablet HD
   ----------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .calendar-viewport {
        height: auto;
        overflow: visible;
    }

    .calendar-content {
        overflow: visible;
        padding: var(--space-2);
    }

    .calendar-back-to-group {
        flex-direction: column;
        align-items: stretch;
        margin: calc(-1 * var(--space-2)) calc(-1 * var(--space-2)) var(--space-2) calc(-1 * var(--space-2));
    }

    .calendar-back-to-group__meta {
        justify-content: flex-start;
        font-size: var(--text-sm);
    }

    .calendar-nav {
        padding: var(--space-2);
    }

    .calendar-legend {
        gap: var(--space-3);
        padding: var(--space-2) 0;
        font-size: var(--text-xs);
    }
}

/* -----------------------------------------------------------------------------
   Responsive móvil
   ----------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .calendar-grid {
        grid-template-columns: 1fr;
    }
    
    .calendar-day-header {
        display: none;
    }
    
    .session-item {
        font-size: var(--text-sm);
    }
}

/* public/css/components/contact-card.css */
.contact-list {
    display: grid;
    gap: 1rem;
}

.contact-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    transition: var(--transition-base);
    overflow: hidden;
}

.contact-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-300);
}

.contact-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-50) 0%, white 100%);
    border-bottom: 1px solid var(--gray-100);
    gap: 1rem;
    flex-wrap: wrap;
}

.contact-card__info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 200px;
}

.contact-card__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-100);
    color: var(--primary-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.contact-card__name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 1rem;
}

.contact-card__role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--gray-100);
    color: var(--gray-600);
}

.contact-card__badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.contact-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    border: 1px solid transparent;
}

.contact-card__badge--billing {
    background: var(--success-50);
    color: var(--success-700);
    border-color: var(--success-200);
}

.contact-card__badge--billing.is-active {
    background: var(--success-600);
    color: white;
    border-color: var(--success-700);
}

.contact-card__badge--diploma {
    background: var(--warning-50);
    color: var(--warning-700);
    border-color: var(--warning-200);
}

.contact-card__badge--diploma.is-active {
    background: var(--warning-600);
    color: white;
    border-color: var(--warning-700);
}

.contact-card__badge input {
    display: none;
}

.contact-card__badge:hover {
    transform: scale(1.02);
    filter: brightness(0.95);
}

.contact-card__body {
    padding: 1.25rem;
}

.contact-card__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.contact-card__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.contact-card__field--full {
    grid-column: 1 / -1;
}

.contact-card__field label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.contact-card__field-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gray-700);
    font-size: 0.9rem;
}

.contact-card__field-value i {
    color: var(--primary-500);
    font-size: 1rem;
    width: 18px;
}

.contact-card__field-value input,
.contact-card__field-value select,
.contact-card__field-value textarea {
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.contact-card__field-value input:focus,
.contact-card__field-value select:focus,
.contact-card__field-value textarea:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.contact-card__actions {
    display: flex;
    align-items: center;
    padding-left: 0.5rem;
}

.contact-card__remove {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--gray-400);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    font-size: 1.25rem;
}

.contact-card__remove:hover {
    background: var(--danger-50);
    color: var(--danger-600);
}

@media (max-width: 900px) {
    .contact-card__header {
        align-items: flex-start;
    }

    .contact-card__actions {
        padding-left: 0;
    }
}

/* public/css/components/course-content-redesign.css */
/**
 * Rediseño de la pestaña de Contenido de Cursos
 * Objetivo: Visualización Full HD (1920x1080) sin scroll vertical.
 */

.course-content-panel .general-card {
    padding: 1.5rem 2rem;
    height: calc(100vh - 280px); /* Ajuste dinámico para cabera/tabs/footer */
    display: flex;
    flex-direction: column;
}

.course-content-panel .general-card__header {
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.course-content-panel .general-card__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto 1fr;
    gap: 1.25rem;
    flex: 1;
    min-height: 0;
}

/* Forzado de filas para mantener altura controlada */
.course-content-panel .form-group {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.course-content-panel .form-group label {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
    flex-shrink: 0;
}

/* Editores Rich (Quill) con altura fija ajustada */
.course-content-panel .rich-editor-container {
    flex: 1;
    min-height: 120px;
    max-height: 150px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--gray-300) !important; /* Borde gris consistente */
}

.course-content-panel .ql-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Ajuste específico para Descripción de Diploma (más corta) */
.course-content-panel .form-group[data-field="diploma_description"] .rich-editor-container {
    max-height: 100px;
    min-height: 80px;
    border: 1px solid var(--gray-300) !important;
}

/* Unificación Software + Descripción */
.software-unified-group {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--gray-300);
    border-radius: 0.5rem;
    background: white;
    overflow: hidden;
    min-height: 200px;
}

.software-unified-group .software-select-header {
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-300);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.software-unified-group .software-select-header label {
    margin: 0;
    font-weight: 600;
    white-space: nowrap;
}

.software-unified-group select.form-control {
    border: 0;
    background: transparent;
    padding: 0;
    height: auto;
    font-weight: 500;
}

.software-unified-group .rich-editor-container {
    border: 0 !important;
    border-radius: 0 !important;
    max-height: none !important;
}

/* Posicionamiento en Grid */
.course-content-panel .form-group[data-field="description"] { grid-column: 1; grid-row: 1; }
.course-content-panel .form-group[data-field="objectives"] { grid-column: 2; grid-row: 1; }
.course-content-panel .form-group[data-field="didactic_material"] { grid-column: 3; grid-row: 1; }

.course-content-panel .software-unified-group { grid-column: 1; grid-row: 2; }
.course-content-panel .form-group[data-field="complexity_level"] { grid-column: 2; grid-row: 2; }
.course-content-panel .form-group[data-field="diploma_description"] { grid-column: 3; grid-row: 2; }

@media (max-height: 900px) {
    .course-content-panel .general-card {
        height: calc(100vh - 220px);
    }
    .course-content-panel .rich-editor-container {
        max-height: 100px;
        min-height: 100px;
    }
}

/* public/css/components/curso-form.css */
/* Curso edit form: simple card organization, no overflow surprises */
#curso-edit-form,
#curso-edit-form *,
#curso-create-form,
#curso-create-form * {
    min-width: 0;
}

#curso-edit-form .curso-general-layout,
#curso-edit-form .curso-content-layout,
#curso-edit-form .curso-costs-layout,
#curso-create-form .curso-costs-layout {
    display: grid;
    gap: 1rem;
    align-items: start;
}

#curso-edit-form .curso-general-layout {
    grid-template-columns: minmax(0, 2fr) minmax(20rem, 0.95fr);
}

#curso-edit-form .curso-content-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(20rem, 0.95fr);
}

#curso-edit-form .curso-costs-layout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

#panel-modulo.curso-costs-panel .curso-costs-layout {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    align-items: start;
}

.layout-page__header-nav .curso-master-nav-toggle {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.curso-master-nav-toggle__label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    color: var(--gray-700);
    background: var(--surface-card, #fff);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-xs, none);
}

.curso-master-nav-toggle__label:hover {
    border-color: var(--primary-200);
    background: var(--primary-50);
    color: var(--primary-900);
}

.curso-master-nav-toggle__label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    margin: 0;
    flex: 0 0 auto;
}

#curso-edit-form .curso-general-main,
#curso-edit-form .curso-general-sidebar,
#curso-edit-form .curso-content-column,
#curso-create-form .curso-content-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#curso-edit-form .curso-card,
#curso-create-form .curso-card {
    margin-bottom: 0;
    padding: 1rem 1.1rem;
    overflow: visible;
}

#panel-modulo .curso-modules-card {
    width: 100%;
    max-width: none;
    height: 100%;
    overflow: visible;
}

#panel-modulo .curso-modules-card {
    min-height: 24rem;
}

#panel-modulo .curso-content-column,
#panel-modulo #master-modules-container,
#panel-modulo .curso-modules-card .general-card__grid {
    width: 100%;
    max-width: none;
    overflow: visible;
}

#curso-edit-form .curso-card .general-card__header {
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
}

#curso-edit-form .curso-card .general-card__grid {
    gap: 0.85rem;
}

#curso-edit-form .curso-content-panel .curso-card .general-card__grid,
#curso-edit-form .curso-material-card .general-card__grid,
#curso-edit-form .curso-control-card .general-card__grid,
#curso-edit-form .curso-stats-card .general-card__grid,
#curso-edit-form .curso-certification-card .general-card__grid,
#curso-edit-form .curso-costs-panel .curso-card .general-card__grid {
    display: flex;
    flex-direction: column;
}

#curso-edit-form input:not([type="checkbox"]),
#curso-edit-form select,
#curso-edit-form textarea,
#curso-edit-form .form-control,
#curso-create-form input:not([type="checkbox"]),
#curso-create-form select,
#curso-create-form textarea,
#curso-create-form .form-control {
    width: 100%;
    max-width: 100%;
}

#curso-edit-form .curso-info-card .general-card__grid > .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#curso-edit-form .curso-control-card .alert {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 1rem;
    line-height: 1.45;
}

#curso-edit-form .curso-stats-card .stats-mini {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

/* Rich editors: bounded content with inner scroll instead of cards growing/overflowing. */
#curso-edit-form .curso-content-panel .rich-editor-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    resize: none;
    border: 1px solid var(--gray-300) !important;
    border-radius: var(--radius) !important;
    background: var(--surface-card);
}

#curso-edit-form .curso-content-panel .ql-toolbar {
    flex: 0 0 auto;
    padding: 0.35rem 0.5rem !important;
}

#curso-edit-form .curso-content-panel .ql-container {
    flex: 1 1 auto;
    min-height: 0;
    max-height: 8.5rem;
    overflow-y: auto;
}

#curso-edit-form .curso-content-panel .ql-editor {
    min-height: 6.5rem !important;
    padding: 0.75rem 0.9rem !important;
    line-height: 1.45 !important;
}

#curso-edit-form .curso-program-card .ql-container {
    max-height: 9rem;
}

#curso-edit-form .curso-software-card .ql-container {
    max-height: 8rem;
}

/* Material selector: dropdown participates in layout, so it does not spill over cards. */
#curso-edit-form .curso-material-card .material-selector {
    display: flex;
    flex-direction: column;
    position: relative;
}

#curso-edit-form #materiales-input {
    order: 1;
    margin-bottom: 0;
}

#curso-edit-form .curso-material-card .material-dropdown {
    position: static;
    order: 2;
    margin-top: 0.5rem;
    max-height: 12rem;
    z-index: auto;
    box-shadow: var(--shadow-md);
}

#curso-edit-form #selected-materials {
    order: 3;
}

#curso-edit-form .selected-materials-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.55rem;
}

#curso-edit-form .material-tag {
    max-width: 100%;
}

#curso-edit-form .material-tag__text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#curso-edit-form .curso-certification-card .rounded-lg {
    margin-bottom: 0;
}

#panel-modulo #master-modules-container {
    margin-top: 0 !important;
}

#panel-modulo .curso-modules-editor {
    width: 100%;
    overflow: visible;
}

#panel-modulo .curso-modules-rows {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

#panel-modulo .curso-modules-grid {
    display: grid;
    width: 100%;
    grid-template-columns: 44px minmax(20rem, 2.3fr) minmax(5.5rem, 0.55fr) minmax(8.5rem, 0.8fr) minmax(8.5rem, 0.8fr) minmax(20rem, 1.55fr) 44px;
    column-gap: 0.85rem;
    row-gap: 0.75rem;
    align-items: center;
}

#panel-modulo .curso-modules-grid--header {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray-600);
    background: var(--gray-50);
    padding: 0.85rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: 0.85rem;
    margin-bottom: 0.75rem;
}

#panel-modulo .curso-modules-grid--header > div {
    min-width: 0;
}

#panel-modulo .modulo-row {
    position: relative;
    padding: 0.25rem 0;
}

#panel-modulo .modulo-row:has(.ts-wrapper.dropdown-active) {
    z-index: 30;
}

#panel-modulo .modulo-row > div {
    min-width: 0;
}

#panel-modulo .modulo-orden,
#panel-modulo .modulo-actions-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

#panel-modulo .modulo-profesor-cell {
    position: relative;
    z-index: 20;
    overflow: visible;
}

#panel-modulo .curso-modules-grid input.form-control,
#panel-modulo .curso-modules-grid input[type="text"],
#panel-modulo .curso-modules-grid input[type="number"] {
    min-height: 2.75rem;
}

#panel-modulo .curso-modules-grid .ts-wrapper,
#panel-modulo .curso-modules-grid .ts-wrapper.single,
#panel-modulo .curso-modules-grid .ts-control {
    width: 100%;
}

#panel-modulo .curso-modules-grid .ts-control {
    min-height: 2.75rem;
    border-radius: 0.75rem;
    padding: 0.55rem 0.75rem;
}

#panel-modulo .curso-modules-grid .ts-dropdown {
    z-index: 9999;
}

.curso-modulo-profesor-dropdown.ts-dropdown {
    z-index: 9999;
    min-width: 18rem;
    max-height: 18rem;
    overflow-y: auto;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
}

.curso-modulo-profesor-dropdown.ts-dropdown .dropdown-input {
    min-height: 2.5rem;
}

.curso-modulo-profesor-dropdown.ts-dropdown .option {
    padding: 0.6rem 0.75rem;
}

@media (max-width: 1400px) {
    #curso-edit-form .curso-content-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #curso-edit-form .curso-content-column:nth-child(3) {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 1200px) {
    #curso-edit-form .curso-general-layout,
    #curso-edit-form .curso-costs-layout,
    #curso-create-form .curso-costs-layout {
        grid-template-columns: 1fr;
    }

    #panel-modulo.curso-costs-panel .curso-costs-layout {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    #panel-modulo .curso-modules-editor {
        overflow-x: auto;
        overflow-y: visible;
    }

    #panel-modulo .curso-modules-grid {
        min-width: 960px;
    }
}

@media (max-width: 900px) {
    #curso-edit-form .curso-content-layout,
    #curso-edit-form .curso-content-column:nth-child(3) {
        display: flex;
        flex-direction: column;
    }
}

@media (max-width: 700px) {
    #curso-edit-form .curso-info-card .general-card__grid > .grid {
        grid-template-columns: 1fr;
    }
}

/* public/css/components/dashboard.css */
/* ==========================================================================
   Dashboard Component — Google Material Design 3 × Corporate (#8B1D1D)
   Optimizado para Full HD (1920×1080). Scoped to #dashboard-container.
   ========================================================================== */

/* ── Tipografía del dashboard: Roboto Flex ── */
#dashboard-container,
.widget-drawer {
    font-family: 'Roboto Flex', 'Inter', system-ui, sans-serif;
}

/* ── Layout wrapper ── */
.dashboard-container {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.dashboard-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* ── Dashboard: encoge cuando el panel lateral está abierto ── */
#dashboard-container {
    transition: padding-right 0.56s cubic-bezier(0.2, 1.1, 0.24, 1);
}

#dashboard-container.has-drawer-open {
    padding-right: 360px;
}

@media (max-width: 1200px) {
    #dashboard-container.has-drawer-open {
        padding-right: 0;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DASHBOARD HEADER — Saludo + Personalizar
   ═══════════════════════════════════════════════════════════════════════════ */
.dashboard-greeting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    gap: 1rem;
}

.dashboard-greeting__text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dashboard-greeting__title {
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--google-text-primary, #202124);
    line-height: 1.3;
    font-family: 'Roboto Flex', 'Inter', system-ui, sans-serif;
}

.dashboard-greeting__subtitle {
    font-size: 0.875rem;
    color: var(--google-text-secondary, #5F6368);
    font-weight: 400;
}

.dashboard-greeting__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Personalizar button — Google style */
.btn-customize {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: white;
    border: 1px solid var(--google-border, #E0E0E0);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--google-text-secondary, #5F6368);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    line-height: 1;
}

.btn-customize:hover {
    background: var(--google-surface, #F8F9FA);
    border-color: var(--color-brand-500, #8B1D1D);
    color: var(--color-brand-500, #8B1D1D);
    box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

.btn-customize .material-symbols-outlined {
    font-size: 1.125rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   KPI CARDS GRID
   ═══════════════════════════════════════════════════════════════════════════ */
.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 1600px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 1200px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Individual KPI card */
.kpi-card {
    background: white;
    border: 1px solid var(--google-border, #E0E0E0);
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: default;
    overflow: hidden;
}

.kpi-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Icon wrapper */
.kpi-card__icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.375rem;
    transition: transform 0.2s;
}

/* Icon color variants */
.kpi-card__icon-wrap--brand {
    background: var(--google-brand-soft, rgba(139,29,29,0.08));
    color: var(--color-brand-500, #8B1D1D);
}
.kpi-card__icon-wrap--blue {
    background: var(--info-bg, #eff6ff);
    color: var(--info-text, #2563eb);
}
.kpi-card__icon-wrap--green {
    background: var(--success-bg, #ecfdf5);
    color: var(--success-text, #059669);
}
.kpi-card__icon-wrap--orange {
    background: var(--warning-bg, #fffbeb);
    color: var(--warning-text, #d97706);
}

/* Content */
.kpi-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.kpi-card__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--google-text-secondary, #5F6368);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-card__value {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--google-text-primary, #202124);
    line-height: 1.15;
    letter-spacing: -0.01em;
    font-family: 'Roboto Flex', 'Inter', system-ui, sans-serif;
}

.kpi-card__trend-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.125rem;
}

.kpi-card__trend {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    padding: 0.1rem 0.375rem;
}

.kpi-card__trend--up {
    color: #137333;
    background: #e6f4ea;
}

.kpi-card__trend--down {
    color: #c5221f;
    background: #fce8e6;
}

.kpi-card__trend .material-symbols-outlined {
    font-size: 0.875rem;
    font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 20;
}

.kpi-card__secondary {
    font-size: 0.75rem;
    color: var(--google-text-secondary, #5F6368);
    opacity: 0.85;
}

/* ── Edit mode ── */
#dashboard-container.is-editing .kpi-card {
    border: 2px dashed var(--color-brand-300, #f8b4b4);
    cursor: grab;
}

#dashboard-container.is-editing .kpi-card:active {
    cursor: grabbing;
}

.kpi-card .widget-controls {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
}

.kpi-card .widget-controls.hidden {
    display: none;
}

/* drag-over state */
.kpi-card.drag-over {
    border-color: var(--color-brand-500, #8B1D1D);
    background: var(--google-brand-soft, rgba(139,29,29,0.04));
}

/* ═══════════════════════════════════════════════════════════════════════════
   QUICK ACTIONS — Row with centered icons (Google style)
   ═══════════════════════════════════════════════════════════════════════════ */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.875rem;
}

.action-card {
    background: white;
    border: 1px solid var(--google-border, #E0E0E0);
    border-radius: 16px;
    padding: 1.375rem 1rem 1.125rem;
    text-align: center;
    text-decoration: none;
    color: var(--google-text-secondary, #5F6368);
    transition: box-shadow 0.2s, border-color 0.2s, background 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    position: relative;
}

.action-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.09);
    border-color: var(--color-brand-300, #f8b4b4);
    background: var(--google-brand-soft, rgba(139,29,29,0.04));
    color: var(--color-brand-500, #8B1D1D);
}

.action-card__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.action-card__icon {
    font-size: 2rem;
    color: var(--color-brand-500, #8B1D1D);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: var(--google-brand-soft, rgba(139,29,29,0.08));
    border-radius: 50%;
    transition: background 0.2s, transform 0.2s;
}

.action-card:hover .action-card__icon {
    background: rgba(139,29,29,0.14);
    transform: scale(1.06);
}

.action-card__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--google-text-primary, #202124);
    line-height: 1.3;
    font-family: 'Roboto Flex', 'Inter', system-ui, sans-serif;
}

/* Edit mode for action cards */
#dashboard-container.is-editing .action-card {
    border: 2px dashed var(--color-brand-300, #f8b4b4);
    cursor: grab;
}

.action-card .widget-controls {
    position: absolute;
    top: 0.375rem;
    right: 0.375rem;
    display: flex;
    gap: 0.25rem;
}

.action-card .widget-controls.hidden {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   WIDGET DRAWER — Brand color overrides (animation handled by style.css)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Drawer sub-element: font & header refinements */
.widget-drawer__header h3 {
    font-family: 'Roboto Flex', 'Inter', system-ui, sans-serif;
    color: var(--google-text-primary, #202124);
}

.drawer-tabs {
    display: flex;
    gap: 0.25rem;
    background: var(--google-surface, #F8F9FA);
    border-radius: 8px;
    padding: 0.25rem;
}

.tab-btn {
    flex: 1;
    padding: 0.375rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--google-text-secondary, #5F6368);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    font-family: inherit;
}

.tab-btn.active {
    background: white;
    color: var(--color-brand-500, #8B1D1D);
    box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}

.widget-drawer__content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.drawer-tab-content {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.drawer-tab-content.hidden {
    display: none;
}

.widget-item-preview {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--google-surface, #F8F9FA);
    border: 1px solid var(--google-border, #E0E0E0);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}

.widget-item-preview:hover {
    background: var(--google-brand-soft, rgba(139,29,29,0.06));
    border-color: var(--color-brand-300, #f8b4b4);
}


/* ═══════════════════════════════════════════════════════════════════════════
   LEGACY — stat-card (usado en otras vistas, no tocar)
   ═══════════════════════════════════════════════════════════════════════════ */
.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    cursor: default;
}

.stat-card__icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card__icon-wrapper--blue   { background-color: var(--info-bg);    color: var(--info-text); }
.stat-card__icon-wrapper--green  { background-color: var(--success-bg); color: var(--success-text); }
.stat-card__icon-wrapper--orange { background-color: var(--warning-bg); color: var(--warning-text); }
.stat-card__icon-wrapper--red    { background-color: var(--danger-bg);  color: var(--danger-text); }

.stat-card__content { flex: 1; }

.stat-card__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    margin-bottom: 0.125rem;
}

.stat-card__label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════════════════
   FACTURACIÓN TOOLBAR (usada en otras páginas)
   ═══════════════════════════════════════════════════════════════════════════ */
.facturacion-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
}

.toolbar-left  { display: flex; align-items: center; gap: 0.75rem; flex: 1; }
.toolbar-right { display: flex; align-items: center; gap: 0.5rem; }

.search-group {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-group i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

.search-group .form-control { padding-left: 2.5rem; }

#filter-facturado { width: auto; min-width: 160px; max-width: 200px; }

.dashboard-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── residual from style.css stat-card base ── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    border: 1px solid var(--gray-200); 
    display: flex;
    align-items: center;
    cursor: default;
}

/* stat-card: métricas informativas, NO clicables - sin hover, shadow ni elevación */

.stat-card__icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card__icon-wrapper--blue {
    background-color: var(--info-bg);
    color: var(--info-text);
}

.stat-card__icon-wrapper--green {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.stat-card__icon-wrapper--orange {
    background-color: var(--warning-bg);
    color: var(--warning-text);
}

.stat-card__icon-wrapper--red {
    background-color: var(--danger-bg);
    color: var(--danger-text);
}

.stat-card__content {
    flex: 1;
}

.stat-card__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
    margin-bottom: 0.125rem;
}

.stat-card__label {
    font-size: 0.875rem;
    color: var(--gray-500);
    font-weight: 500;
}

/* Quick Actions */
.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.action-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    text-align: center;
    text-decoration: none;
    color: var(--gray-700);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.action-card:hover {
    border-color: var(--primary-300);
    background-color: var(--primary-50);
    color: var(--primary-700);
}

/* Toolbar de facturación - Filtros compactos */
.facturacion-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-group {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-group i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

.search-group .form-control {
    padding-left: 2.5rem;
}

/* Select de filtro - ancho automático ajustado al contenido */
#filter-facturado {
    width: auto;
    min-width: 160px;
    max-width: 200px;
}

.action-card__icon {
    font-size: 2rem;
    color: var(--primary-500);
    margin-bottom: 0.25rem;
}

.action-card:hover .action-card__icon {
    color: var(--primary-600);
}

.action-card__title {
    font-weight: 600;
    font-size: 0.9rem;
}

.dashboard-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* public/css/components/email-panel.css */
/* Panel Email - mejoras UX sin romper estética corporativa */

/* Email Filter Bar - Premium Google Analytics Style */
.email-index-filter-bar {
    --filter-bar-bg: #ffffff;
    --filter-bar-border: #e2e8f0;
    --filter-chip-bg: #f8fafc;
    --filter-chip-hover: #f1f5f9;
    --filter-chip-active-bg: #eff6ff;
    --filter-chip-active-border: #3b82f6;
    --filter-chip-active-text: #1d4ed8;
    
    background: var(--filter-bar-bg);
    border: 1px solid var(--filter-bar-border);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.email-index-filter-bar .filters__row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.email-index-filter-bar__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.email-index-filter-bar__search {
    flex: 1;
    min-width: 200px;
    max-width: 320px;
    height: 40px;
    padding: 0 1rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.875rem;
    color: #1e293b;
    transition: all 0.2s ease;
}

.email-index-filter-bar__search:focus {
    outline: none;
    background: #fff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.email-index-filter-bar__search::placeholder {
    color: #94a3b8;
}

.email-index-filter-bar__menu {
    margin-left: auto;
}

/* Filter Chips - Premium Style */
.filters__chips {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 32px;
    padding: 0 0.875rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-chip:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.filter-chip--quick {
    background: #f1f5f9;
    border-color: transparent;
    color: #334155;
    font-weight: 600;
}

.filter-chip--quick:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.filter-chip--quick[data-filter="ultimos7dias"]:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.filter-chip--quick[data-filter="errors"]:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.filter-chip--quick[data-filter="pending"]:hover {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #b45309;
}

.filter-chip--clear {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
    text-decoration: none;
}

.filter-chip--clear:hover {
    background: #fecaca;
    border-color: #f87171;
}

.filter-chip__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.6875rem;
    font-weight: 700;
}

/* Dynamic Filters Container - Premium */
.email-index-filter-bar .dynamic-filters-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.email-index-filter-bar .dynamic-filter {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 0.5rem 0 0.75rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.email-index-filter-bar .dynamic-filter:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}

.email-index-filter-bar .dynamic-filter__label {
    font-size: 0.6875rem;
    font-weight: 700;
    color: #1d4ed8;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.email-index-filter-bar .dynamic-filter__input,
.email-index-filter-bar .dynamic-filter__select {
    border: none;
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1e293b;
    padding: 0;
    outline: none;
    min-width: 80px;
}

.email-index-filter-bar .dynamic-filter__input::placeholder {
    color: #94a3b8;
}

.email-index-filter-bar .dynamic-filter__input[type="date"] {
    min-width: 110px;
}

.email-index-filter-bar .dynamic-filter__input[type="number"] {
    min-width: 60px;
    max-width: 80px;
}

.email-index-filter-bar .dynamic-filter__remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: #dbeafe;
    color: #3b82f6;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.email-index-filter-bar .dynamic-filter__remove:hover {
    background: #3b82f6;
    color: #fff;
}

/* Filters Submit Row */
.filters__submit-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f1f5f9;
}

.email-index-filter-bar .btn.btn--primary {
    height: 36px;
    padding: 0 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 8px;
}

/* Email tabs */
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0 1.5rem;
    margin-top: 0.25rem;
    padding: 0.35rem;
    background: var(--gray-100);
    border-radius: 12px;
}

.email-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--gray-600);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
}

.email-tab:hover {
    color: var(--gray-800);
    background: var(--gray-50);
}

.email-tab.is-active {
    background: var(--gray-50);
    color: var(--gray-900);
    font-weight: 600;
}

.email-tab__badge {
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--warning-bg);
    color: var(--warning-text);
}

.email-tab-pane {
    display: none;
}

.email-tab-pane.is-active {
    display: block;
}

#email-ux-toast {
    display: none;
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 1200;
    min-width: 260px;
    max-width: 420px;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.email-card__header:hover {
    background: #f9fafb;
}

.email-card__header:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: -2px;
}

.email-card__body {
    transition: all 0.2s ease-in-out;
}

.email-compose-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1rem;
}

.email-compose-main {
    min-width: 0;
}

.email-compose-sidebar {
    min-width: 0;
}

@media (max-width: 1200px) {
    .email-compose-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .email-compose-sidebar {
        order: -1;
    }
}

.is-spinning {
    animation: email-panel-spin 1s linear infinite;
}

@keyframes email-panel-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* public/css/components/filters.css */
/* Utilities */
.hidden {
    display: none !important;
}

/* Dynamic Filters Component */

.filters {
    --filters-height: 28px; /* Altura única de TODOS los controles del filtro */
    --filters-bg: #ffffff;
    --filters-border: #e2e8f0;
    --filters-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    --filters-radius: 12px;
    
    margin: 0 0 0.75rem 0; /* Subido más hacia arriba */
    padding: 0.5rem 0.75rem;
    background: var(--filters-bg);
    border: 1px solid var(--filters-border);
    border-radius: var(--filters-radius);
    box-shadow: var(--filters-shadow);
    transition: all 0.2s ease;
}

.filters__main {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Reducido de 1rem */
    width: 100%;
}

.filters:focus-within {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.filters__row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: nowrap;
}

.filters__search {
    position: relative;
    display: flex;
    align-items: center;
    flex: 0 0 14rem; /* Reducido de 20rem a 14rem */
    min-width: 0;
}

.filters__search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--gray-400);
    font-size: 1.1rem;
    pointer-events: none;
    z-index: 1;
}

.filters__search-input {
    width: 100%;
    height: var(--filters-height);
    min-height: var(--filters-height);
    padding: 0 0.75rem 0 2rem; /* Más compacto */
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 100px; /* Pill style */
    font-size: 0.8125rem;
    color: var(--gray-800);
    transition: all 0.2s ease;
}

.filters__search-input:focus {
    outline: none;
    background: white;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb, 130, 3, 3), 0.1);
}

.filters__search-input::placeholder {
    color: var(--gray-400);
}

.filters__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    overflow: visible;
}

.filters__menu {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.filters__menu-container,
.table-columns-container {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.filters__pill {
    display: inline-flex;
    align-items: center;
    height: var(--filters-height); /* Unificado con el resto de controles */
    padding: 0 0.65rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 100px;
    gap: 0.35rem;
    color: var(--gray-700);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.filters__pill:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.filters__pill--add {
    color: var(--primary-600);
    border-color: var(--primary-100);
    background: var(--primary-50);
}

.filters__pill--add:hover {
    background: var(--primary-100);
    border-color: var(--primary-200);
}

.filters__pill-icon {
    color: var(--gray-400);
    font-size: 1rem;
}

.filters__pill-label {
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.filters__pill-select {
    border: none;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-900);
    padding: 0;
    outline: none;
    cursor: pointer;
}

.filters__menu-trigger-caret {
    margin-left: 0.25rem;
    color: var(--gray-400);
    font-size: 0.8rem;
}



.filters__menu-trigger-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: var(--btn-filter-icon-bg);
    color: var(--btn-filter-icon-color);
    flex-shrink: 0;
}

.filters__menu-trigger-text {
    flex: 1;
    text-align: left;
}

.filters__menu-trigger-caret {
    color: var(--color-gray-500);
    transition: transform var(--transition-base);
}

.filters__menu-trigger[aria-expanded="true"] .filters__menu-trigger-caret {
    transform: rotate(180deg);
}

.filters__dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.65rem;
    width: 18rem;
    background: white;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
    overflow: visible;
    animation: fadeIn 0.2s ease;
}

.filters__dropdown.filters__dropdown--portal {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    margin-top: 0;
    width: min(18rem, calc(100vw - 2rem));
    max-height: calc(100vh - 2rem);
    overflow: hidden;
}

.filters__dropdown.filters__dropdown--portal .filters__dropdown-panel {
    max-height: inherit;
    overflow-y: auto;
}

/* Inline dropdown for calendar/multiple selects */
.filters__dropdown--inline {
    position: relative;
    width: auto;
    display: none;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-3);
    margin-top: var(--space-2);
}

.filters__dropdown--inline.is-visible {
    display: flex;
}

.filters__dropdown--inline .filters__input {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
}

/* Filters input (select) */
.filters__input {
    height: var(--btn-filter-height);
    padding: var(--space-1) var(--space-3);
    border: var(--border-width) solid var(--btn-filter-border);
    border-radius: var(--filters-control-radius);
    background-color: var(--btn-filter-bg);
    color: var(--btn-filter-color);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all var(--transition-base);
}

.filters__input:hover {
    border-color: var(--btn-filter-hover-border);
}

.filters__input:focus {
    outline: none;
    border-color: var(--btn-filter-active-border);
    box-shadow: var(--btn-filter-active-ring);
}

.filters__dropdown-panel {
    padding: 0.7rem;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.filters__dropdown-header {
    display: none;
    padding: 0.35rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.filters__dropdown-header--spaced {
    margin-top: 0;
}

.dynamic-filters-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    overflow: visible;
    scrollbar-width: none; /* Firefox */
}

.dynamic-filters-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.dynamic-filter {
    display: inline-flex;
    align-items: center;
    height: var(--filters-height); /* Unificado con el resto de controles */
    padding: 0 0.35rem 0 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 100px;
    gap: 0.35rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dynamic-filter:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.dynamic-filter--range {
    gap: 0.5rem;
}

.dynamic-filter__label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.dynamic-filter__input,
.dynamic-filter__select {
    border: none;
    background: transparent;
    display: inline-flex;
    align-items: center;
    height: auto;
    min-height: 0; /* No heredar la altura inflada de .is-compact input/select */
    min-width: 7rem;
    font-size: 0.8rem; /* Más pequeño */
    font-weight: 600;
    color: var(--gray-900);
    padding: 0;
    outline: none;
    cursor: pointer;
}

/* style.css define `input[type="text"],…,select,textarea { padding: 0.625rem; line-height: 1.5 }`
   (especificidad 0,1,1) que GANA a `.dynamic-filter__input` (0,1,0) e inflaba el input de
   Temática a 44px. Subimos la especificidad a (0,2,0) para neutralizarlo dentro del chip. */
.dynamic-filter .dynamic-filter__input,
.dynamic-filter .dynamic-filter__select {
    padding-top: 0;
    padding-bottom: 0;
    min-height: 0;
    height: auto;
    line-height: 1.2;
}

.dynamic-filter__input::placeholder {
    color: var(--gray-400);
}

.dynamic-filter__input[type="date"] {
    min-width: 8.5rem;
}

.dynamic-filter__input[type="number"] {
    min-width: 5.5rem;
}

.dynamic-filter__select {
    appearance: none;
}

.dynamic-filter__remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dynamic-filter__remove:hover {
    background: var(--danger-100);
    color: var(--danger-600);
}

/* === Estado: control segmentado (pestañas unidas), multi-selección === */
.dynamic-filter--status.status-filter-chip {
    height: auto;
    min-height: var(--filters-height);
    padding: 0;
    background: transparent;
    border: none;
    gap: 0.5rem;
    align-items: center;
    max-width: 100%;
}

.dynamic-filter--status.status-filter-chip:hover {
    background: transparent;
    border: none;
}

.status-filter-chip__options {
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    flex-wrap: nowrap;
    min-width: 0;
    height: var(--filters-height);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    overflow: hidden;
    background: var(--gray-50);
}

.status-filter-chip__option {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    cursor: pointer;
}

.status-filter-chip__option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.status-filter-chip__option span {
    display: inline-flex;
    align-items: center;
    padding: 0 0.7rem;
    border: none;
    border-left: 1px solid var(--gray-200);
    border-radius: 0;
    background: transparent;
    color: var(--gray-600);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.status-filter-chip__option:first-child span {
    border-left: none;
}

.status-filter-chip__option:hover span {
    background: var(--gray-100);
    color: var(--primary-700);
}

.status-filter-chip__option input:checked + span {
    background: var(--primary-600);
    color: #fff;
    border-left-color: var(--primary-700);
}

.status-filter-chip__option input:focus-visible + span {
    outline: 2px solid rgba(var(--primary-rgb, 130, 3, 3), 0.35);
    outline-offset: -2px;
}

/* Bloque de acciones (Filtros, Columnas) alineado a la derecha de la barra.
   margin-left:auto lo empuja al final de su línea aunque la barra haga wrap. */
.filters__trailing {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* En grupos el contenedor de filtros ocupa todo el ancho disponible para que
   el bloque de acciones pueda alinearse a la derecha. */
#group-filters-form .dynamic-filters-container {
    flex: 1 1 auto;
    width: 100%;
    row-gap: 0.6rem;
}

.filters__actions-group {
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Reducido de 0.75rem */
    flex: 1;
    min-width: 0;
}
.filters__dropdown-panel {
    padding: 0.5rem;
    max-height: min(24rem, 70vh);
    overflow-y: auto;
}

.filters__dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-700);
    border-radius: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filters__dropdown-item:hover {
    background: var(--gray-50);
    color: var(--primary-600);
}

.filters__dropdown-item--checkbox {
    justify-content: flex-start;
    padding: 0.5rem 0.75rem;
    gap: 0.75rem;
}

.filters__dropdown-item--checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-600);
    cursor: pointer;
}


.filters__dropdown-item i {
    font-size: 1.1rem;
    color: var(--gray-400);
}

.filters__clear {
    padding: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--danger-600);
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.filters__clear:hover {
    background: var(--danger-50);
}


@media (max-width: 900px) {
    #course-filters-form .filters__row,
    #profesor-filters-form .filters__row,
    #group-filters-form .filters__row,
    #alumnos-filters-form .filters__row,
    #cliente-filters-form .filters__row,
    #factura-filters-form .filters__row {
        flex-wrap: wrap;
    }

    .filters__search,
    .filters__menu,
    .filters__menu-trigger,
    .filters__row > .filters__search-input {
        width: 100%;
        min-width: 0;
        flex: 1 1 100%;
    }

    .dynamic-filters-container,
    #group-filters-form .dynamic-filter {
        width: 100%;
    }

    .dynamic-filters-container {
        flex-wrap: wrap;
    }

    .filters__dropdown {
        width: min(100%, 22rem);
    }
}

/* === Multi-select (TomSelect): chip compacto + dropdown profesional === */
.dynamic-filter--multi {
    height: var(--filters-height);
    min-height: var(--filters-height);
    padding: 0 0.3rem 0 0.75rem;
    border-radius: 100px; /* pill, coherente con el resto de la barra */
    max-width: 100%;
    white-space: nowrap;
    /* NO usar overflow:hidden aquí: recortaría el dropdown de TomSelect.
       El recorte de tags se hace en .ts-control. */
    overflow: visible;
}

.dynamic-filter--multi .ts-wrapper {
    min-width: 0;
    margin: 0;
}

.dynamic-filter--multi .ts-control {
    border: none !important;
    background: transparent !important;
    padding: 0 1.1rem 0 0 !important;
    min-height: unset !important;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-900);
    font-family: inherit;
    line-height: 1.2;
    box-shadow: none !important;
    cursor: pointer;
    flex-wrap: nowrap;
    overflow: hidden;
}

/* El plugin dropdown_input mueve el input al dropdown.
   El residual en el control lo colapsamos para que no ocupe espacio ni muestre cursor. */
.dynamic-filter--multi .ts-control > input {
    width: 0 !important;
    min-width: 0 !important;
    flex: 0 0 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
}

/* Placeholder visual en el pill cuando no hay items seleccionados.
   TomSelect añade .has-items al wrapper cuando hay selección. */
.dynamic-filter--multi .ts-wrapper:not(.has-items) .ts-control[data-placeholder]::before {
    content: attr(data-placeholder);
    color: var(--gray-500);
    font-size: 0.8rem;
    font-weight: 600;
    pointer-events: none;
    line-height: 1.2;
    white-space: nowrap;
}

/* Cuando el dropdown está abierto: pill con estado activo sutil */
.dynamic-filter--multi:has(.ts-wrapper.dropdown-active) {
    background: var(--gray-100);
    border-color: var(--primary-300);
}

/* Nunca mostrar borde/sombra en el wrapper dentro del pill */
.dynamic-filter--multi .ts-wrapper.focus .ts-control,
.dynamic-filter--multi .ts-wrapper.input-active .ts-control {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* Tags seleccionados: compactos, con elipsis si el nombre es largo */
.dynamic-filter--multi .ts-wrapper.multi .ts-control > .item {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.05rem 0.1rem 0.05rem 0.4rem;
    margin: 0 3px 0 0;
    border-radius: 5px;
    background-color: var(--primary-50);
    color: var(--primary-700);
    border: 1px solid var(--primary-200);
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dynamic-filter--multi .ts-wrapper.plugin-remove_button .ts-control > .item {
    overflow: visible;
    padding-right: 0.35rem;
}

.dynamic-filter--multi .ts-wrapper.plugin-remove_button .item .remove {
    border-left: 1px solid var(--primary-200);
    color: var(--primary-600);
    padding: 0 0.25rem;
    margin-left: 0.25rem;
}

.dynamic-filter--multi .ts-wrapper.plugin-remove_button .item .remove:hover {
    background-color: var(--primary-200);
    color: var(--primary-800);
}

/* Dropdown profesional — aplica tanto dentro del pill como en body (dropdownParent:'body') */
.dynamic-filter--multi .ts-dropdown,
.cal-filter-dropdown.ts-dropdown {
    font-size: 0.78rem;
    min-width: 240px;
    margin-top: 6px;
    padding: 4px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    background: #fff;
    overflow: hidden;
    z-index: 9999 !important;
}

.dynamic-filter--multi .ts-dropdown .option,
.cal-filter-dropdown.ts-dropdown .option {
    padding: 7px 10px;
    border-radius: 6px;
    color: var(--gray-700);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dynamic-filter--multi .ts-dropdown .option:hover,
.dynamic-filter--multi .ts-dropdown .option.active,
.cal-filter-dropdown.ts-dropdown .option:hover,
.cal-filter-dropdown.ts-dropdown .option.active {
    background: var(--primary-50);
    color: var(--primary-700);
}

.dynamic-filter--multi .ts-dropdown .option.selected,
.cal-filter-dropdown.ts-dropdown .option.selected {
    background: var(--primary-100);
    color: var(--primary-800);
    font-weight: 600;
}

/* Buscador interno (plugin dropdown_input) */
.dynamic-filter--multi .ts-dropdown .dropdown-input-wrap,
.cal-filter-dropdown.ts-dropdown .dropdown-input-wrap {
    padding: 2px 2px 6px;
}

.dynamic-filter--multi .ts-dropdown .dropdown-input,
.cal-filter-dropdown.ts-dropdown .dropdown-input {
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.78rem;
    outline: none;
}

.dynamic-filter--multi .ts-dropdown .dropdown-input:focus,
.cal-filter-dropdown.ts-dropdown .dropdown-input:focus {
    border-color: var(--primary-300);
}

.dynamic-filter--multi .ts-dropdown .no-results,
.cal-filter-dropdown.ts-dropdown .no-results {
    padding: 8px 10px;
    color: var(--gray-500);
}

.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}

.input-warning {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 1px #f59e0b !important;
}

/* public/css/components/form-sections.css */
/* Form Sections Component */
.form-section {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.form-section__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section__content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.25rem;
}

.form-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

/* Full width modifier for grid items */
.form-group--full {
    grid-column: 1 / -1;
}

/* Auto-update field effects */
.field-updated {
    animation: fieldHighlight 2s ease-out;
}

@keyframes fieldHighlight {
    0% {
        background-color: var(--success-bg);
        border-color: var(--success-border);
    }
    100% {
        background-color: transparent;
        border-color: var(--gray-300);
    }
}

/* Loading state for selects */
select.loading {
    opacity: 0.6;
    cursor: wait;
    background-image: linear-gradient(45deg, transparent 25%, rgba(0,0,0,.05) 25%, rgba(0,0,0,.05) 50%, transparent 50%, transparent 75%, rgba(0,0,0,.05) 75%, rgba(0,0,0,.05));
    background-size: 20px 20px;
    animation: loading-stripes 1s linear infinite;
}

@keyframes loading-stripes {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 20px 0;
    }
}

/* Readonly fields styling */
.readonly-field,
input[readonly],
input[readonly].field-updated {
    background-color: var(--gray-50, #f9fafb);
    color: var(--gray-600, #4b5563);
    cursor: not-allowed;
    border-color: var(--gray-200, #e5e7eb);
}

.readonly-field:focus,
input[readonly]:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Date range picker - override readonly cursor to allow selection */
#date_range_picker[readonly] {
    cursor: pointer;
}

/* Form control inputs - show normal cursor even when marked as readonly */
/* But exclude end_date_display which is truly calculated and readonly */
.form-control.readonly-field:not(#end_date_display),
input[readonly].form-control:not(#end_date_display) {
    cursor: text;
}

/* End date display - keep readonly cursor since it's auto-calculated */
#end_date_display[readonly] {
    cursor: not-allowed;
}

/* Button warning variant for price editing */
.btn--warning {
    color: white;
    border-color: #d97706;
}

/* Price fields styling */
.price-field[readonly] {
    background-color: var(--gray-50, #f9fafb);
    cursor: not-allowed;
}

/* FUNDAE section styling */
.fundae-section {
    margin-top: 1rem;
    border-top: 2px solid var(--primary, #3b82f6);
    padding-top: 1rem;
}

.fundae-section .form-section {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid var(--primary, #3b82f6);
}

.fundae-section .form-section__title {
    color: var(--primary, #3b82f6);
}

/* ============================================
   PANELES EXPANDIBLES
   ============================================ */

.panel--expandable {
    overflow: hidden;
}

.panel__header--collapsible {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
    padding: 1rem;
    margin: -1rem -1rem 0 -1rem;
    border-radius: 0.375rem 0.375rem 0 0;
}

.panel__header--collapsible:hover {
    background-color: var(--gray-50);
}

.panel__header--collapsible h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.panel__toggle-icon {
    display: inline-block;
    width: 1.25rem;
    text-align: center;
    color: var(--primary);
    transition: transform 0.3s ease;
    font-size: 0.875rem;
}

.panel__content--collapsed {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: max-height 0.3s ease, opacity 0.2s ease, transform 0.2s ease;
}

.panel__content--expanded {
    max-height: 1000px;
    opacity: 1;
    transform: translateY(0);
    transition: max-height 0.4s ease, opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
}

/* Lista expandible */
.expandable-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.expandable-list__item {
    border-bottom: 1px solid var(--gray-100);
}

.expandable-list__item:last-child {
    border-bottom: none;
}

.expandable-list__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease, padding-left 0.2s ease;
}

.expandable-list__link:hover {
    background-color: var(--gray-50);
    padding-left: 0.5rem;
}

.expandable-list__content {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.expandable-list__primary {
    flex: 1;
}

.expandable-list__secondary {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.expandable-list__price {
    font-weight: 600;
    color: var(--primary-600);
}

.expandable-list__status {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
    font-weight: 600;
}

.expandable-list__status.status--confirmada {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success, #16a34a);
}

.expandable-list__status.status--pendiente {
    background: rgba(251, 191, 36, 0.15);
    color: var(--warning, #d97706);
}

.expandable-list__status.status--cancelada {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger, #dc2626);
}

.expandable-list__details {
    padding: 0 1rem 1rem 1rem;
    background: var(--gray-50);
    border-radius: 0 0 0.375rem 0.375rem;
    display: none;
}

.expandable-list__item:hover .expandable-list__details {
    display: block;
}

.expandable-list__detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.expandable-list__detail-row:last-child {
    border-bottom: none;
}

.expandable-list__label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    min-width: 100px;
}

.expandable-list__value {
    font-size: 0.875rem;
    color: var(--gray-900);
}

.expandable-list__name {
    font-weight: 600;
    color: var(--gray-900);
}

.expandable-list__main small {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.expandable-list__arrow {
    color: var(--gray-400);
    font-weight: 600;
    transition: transform 0.2s ease, color 0.2s ease;
}

/* =============================
   SMART HELPERS & SUMMARY CARDS
   ============================= */
.smart-chip {
    font-size: 0.75rem;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-600);
}

.smart-chip[data-variant="error"] {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger, #b91c1c);
}

.input-with-action {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.input-with-action input {
    flex: 1;
}

.schedule-builder {
    border: 1px dashed var(--gray-200);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    background: var(--gray-50);
}

.schedule-builder__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.schedule-builder__label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
}

.schedule-builder__days {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.schedule-day {
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    padding: 0.3rem 0.65rem;
    background: white;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.schedule-day.is-active {
    background: var(--primary-50, #eef2ff);
    border-color: var(--primary-400, #818cf8);
    color: var(--primary-700, #4338ca);
    font-weight: 600;
}

.schedule-builder__time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.schedule-builder__divider {
    color: var(--gray-400);
}

.schedule-builder__toolbar {
    margin-left: auto;
    display: flex;
    gap: 0.25rem;
}

.schedule-builder__preview {
    font-size: 0.9rem;
    color: var(--gray-600);
    padding-top: 0.25rem;
    border-top: 1px dashed var(--gray-200);
}

.smart-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
}

.smart-summary-card {
    background: white;
    border: 1px solid var(--gray-100);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.smart-summary__eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gray-500);
    margin: 0 0 0.35rem;
}

.smart-summary__title {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    color: var(--gray-900);
}

.smart-summary__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.smart-summary__stats div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.smart-summary__stats dt {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin: 0;
}

.smart-summary__stats dd {
    margin: 0;
    font-weight: 600;
    color: var(--gray-900);
}

.smart-meta-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.smart-meta-list li {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.smart-meta-list span {
    color: var(--gray-500);
}

.smart-meta-list strong {
    color: var(--gray-900);
}

.expandable-list__link:hover .expandable-list__arrow {
    transform: translateX(4px);
    color: var(--primary);
}

.expandable-list__main {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.expandable-list__main strong {
    font-weight: 500;
    color: var(--gray-900);
}

.expandable-list__main small {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.expandable-list__arrow {
    color: var(--gray-400);
    font-weight: 600;
    transition: transform 0.2s ease, color 0.2s ease;
}

/* Animación de carga suave */
.panel--expandable {
    animation: fadeInPanel 0.3s ease-out;
}

@keyframes fadeInPanel {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ajustes para paneles colapsados */
.panel__content--collapsed + .panel__footer {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .panel__header--collapsible {
        padding: 0.75rem;
    }
    
    .expandable-list__link {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .expandable-list__arrow {
        align-self: flex-end;
    }
}

/* public/css/components/form-validation.css */
/* Form Validation Component */

/* Valid State */
input.is-valid, 
select.is-valid, 
textarea.is-valid {
    border-color: var(--success-text);
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23059669' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Invalid State */
input.is-invalid, 
select.is-invalid, 
textarea.is-invalid,
input:invalid,
select:invalid,
textarea:invalid {
    border-color: var(--danger-text);
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc2626'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linecap='round' d='M5.8 3.6h.4L6 6.5zM6 8.2af.6.6 0 110-1.2.6.6 0 010 1.2z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Error Message */
.form-error-msg {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--danger-text);
}

/* Animation for error appearance */
.form-error-msg {
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* public/css/components/fundae-document-list.css */
/* =============================================================
   FUNDAE DOCUMENT LIST / PANEL - REDESIGN (Material Design)
   ============================================================= */

.fundae-documentation-card {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    max-height: none !important;
}

.fundae-documentation-card .general-card__grid {
    padding: 0 !important;
    flex: 1 !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.fundae-company-list {
    display: grid;
    gap: 0.75rem;
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 1rem !important;
}

.fundae-company-list::-webkit-scrollbar {
    width: 6px;
}

.fundae-company-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.fundae-company-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.fundae-company-list::-webkit-scrollbar-thumb:hover {
    background: var(--gf-primary);
}

.fundae-company-panel {
    border: 1px solid var(--gf-border);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.fundae-company-panel__summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    background: #fff;
    transition: background 0.2s ease;
}

.fundae-company-panel__summary:hover {
    background: #f8fafc;
}

.fundae-company-panel[open] > .fundae-company-panel__summary {
    background: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
}

.fundae-company-panel__summary::-webkit-details-marker {
    display: none;
}

.fundae-company-panel__content {
    padding: 1rem;
    background: #fbfcfe;
    max-height: 400px;
    overflow-y: auto;
}

.fundae-company-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

.fundae-company-panel__identity {
    min-width: 0;
}

.fundae-company-panel__header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

.fundae-company-panel__header p {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fundae-company-panel__summary-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fundae-company-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 0.75rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border: 1px solid transparent;
}

.fundae-company-chip--neutral {
    color: #475569;
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.fundae-company-chip--warning {
    color: #92400e;
    background: #fef3c7;
    border-color: #fcd34d;
}

.fundae-company-chip--success {
    color: #065f46;
    background: #d1fae5;
    border-color: #6ee7b7;
}

.fundae-company-panel__progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid #e2e8f0;
    margin-left: 0.25rem;
}

.fundae-company-panel__progress strong {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--gf-primary);
}

.fundae-company-panel__progress span {
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
}

.fundae-document-list {
    display: grid;
    gap: 0.75rem;
}

.fundae-doc-category {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 0.5rem;
}

.fundae-doc-category__summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: #f8fafc;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.fundae-doc-category__title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.fundae-doc-category__meta {
    font-size: 0.7rem;
    font-weight: 700;
    color: #94a3b8;
}

.fundae-doc-category__body {
    padding: 0.75rem;
    display: grid;
    gap: 0.5rem;
    background: #fff;
}

.fundae-document-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    padding: 0.6rem 0.85rem;
    transition: all 0.2s ease;
}

.fundae-document-row:hover {
    border-color: var(--gf-primary);
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.08);
}

/* Eliminado borde rojo para pendientes */
.fundae-document-row.is-pending {
    border-left: none;
}

.fundae-document-row.is-partial {
    border-left: 4px solid #f59e0b;
}

.fundae-document-row.is-valid {
    border-left: 4px solid #10b981;
}

.fundae-document-row.is-external-custody {
    border-left: 4px solid var(--color-info-500, #3b82f6);
}

.fundae-external-custody-toggle input {
    width: 14px;
    height: 14px;
    accent-color: var(--color-brand-500);
    cursor: pointer;
}

.fundae-document-row__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.fundae-document-row__label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #334155;
    margin: 0;
}

.fundae-document-row__form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fundae-document-row__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.fundae-document-row__status-label {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 500;
    margin-right: 0.5rem;
    white-space: nowrap;
}

.fundae-document-row.is-valid .fundae-document-row__status-label {
    color: #10b981;
}

.fundae-document-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f1f5f9;
    color: #475569;
    border: 1px solid transparent;
}

.fundae-document-action-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.fundae-document-action-btn .material-symbols-outlined {
    font-size: 1.1rem;
}

.fundae-document-action-btn--view {
    background: #eff6ff;
    color: #2563eb;
}

.fundae-document-action-btn--view:hover {
    background: #dbeafe;
}

.fundae-document-action-btn--disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f8fafc;
    color: #94a3b8;
}

.fundae-document-row__file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* public/css/components/grupo-form.css */
/* =============================================================
   GRUPO CREATE EXPERIENCE - REFINED
   ============================================================= */

:root {
    --gf-bg: #F8FAFC;
    --gf-card-bg: #FFFFFF;
    --gf-border: #E2E8F0;
    --gf-primary: #BE123C; /* Red-ish color from screenshot */
    --gf-primary-light: #FFF1F2;
    --gf-text-main: #1E293B;
    --gf-text-muted: #64748B;
    --gf-radius: 12px;
    --gf-radius-sm: 8px;
    --gf-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.grupo-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.grupo-form.layout-page {
    gap: 1rem;
    height: 100%;
    min-height: 0;
}

.grupo-form .layout-page__body {
    overflow: hidden;
    min-height: 0;
}

.grupo-edit-tabs-shell {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.grupo-edit-tabs-shell .grupo-tabs {
    flex-shrink: 0;
    margin-bottom: 0.75rem;
}

#grupo-edit-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Hero Section — inline: título + botones en la misma fila */
.grupo-form__hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.grupo-form__hero .grupo-form__intro {
    flex: 1;
    min-width: 0;
}

.grupo-form__intro p.grupo-form__eyebrow {
    font-size: 0.875rem;
    color: var(--gf-text-muted);
    margin: 0 0 0.25rem 0;
}

.grupo-form__intro h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gf-text-main);
    margin: 0;
}

.grupo-form__hero .grupo-form__actions {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    flex-shrink: 0;
    display: flex;
    gap: 0.5rem;
}

/* Compact content tab for curso create/edit to fit full content at 1920x1080 */
.course-content-panel .general-card {
    padding: 0.75rem;
}

.course-content-panel .general-card__grid {
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 0.5rem 0.75rem;
}

.course-content-panel .form-group {
    grid-column: auto !important;
}

.course-content-panel .form-group.course-content-full {
    grid-column: 1 / -1 !important;
}

.course-content-panel .ql-toolbar {
    padding: 0.25rem !important;
}

.course-content-panel .rich-editor-container {
    display: flex;
    flex-direction: column;
    min-height: 160px;
    resize: vertical;
    overflow: auto;
}

.course-content-panel .rich-editor-container .ql-container {
    flex: 1 1 auto;
    overflow: auto;
}

.course-content-panel .ql-editor {
    min-height: 116px !important;
    height: 100%;
    padding: 0.4rem 0.55rem !important;
    line-height: 1.3 !important;
}

.course-content-panel .ql-editor.ql-blank::before {
    left: 0.625rem !important;
    right: 0.625rem !important;
}

/* Tabs Navigation */
.grupo-tabs {
    display: flex;
    background: #F1F5F9;
    padding: 0.35rem;
    border-radius: var(--gf-radius);
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}

.grupo-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: var(--gf-text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: var(--gf-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.grupo-tab i {
    font-size: 1.1rem;
}

.grupo-tab:hover {
    color: var(--gf-text-main);
    background: rgba(255,255,255,0.5);
}

.grupo-tab.is-active {
    background: white;
    color: var(--gf-text-main);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    font-weight: 600;
}

/* Form Body */
.grupo-form__body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

#grupo-edit-form.grupo-form__body {
    flex: 1;
    min-height: 0;
}

.grupo-panel,
.grupo-tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

#grupo-edit-form .grupo-tab-panel {
    flex: 1;
    min-height: 0;
    overflow: visible;
}

.grupo-form:has(#panel-facturacion.is-active) .layout-page__body,
.layout-page__body.layout-page__body--facturacion-active {
    overflow-y: auto;
    overflow-x: hidden;
}

#grupo-edit-form:has(#panel-facturacion.is-active),
#grupo-edit-form.grupo-edit-form--facturacion-active {
    display: block;
    flex: 0 0 auto;
    min-height: auto;
}

#grupo-edit-form:has(#panel-facturacion.is-active) #panel-facturacion,
#grupo-edit-form.grupo-edit-form--facturacion-active #panel-facturacion,
#grupo-edit-form #panel-facturacion.is-active {
    display: block;
    flex: 0 0 auto;
    min-height: auto;
    height: auto;
    overflow: visible;
    align-self: stretch;
    padding-top: 0;
}

#grupo-edit-form:has(#panel-facturacion.is-active) #panel-facturacion .grupo-facturacion,
#grupo-edit-form.grupo-edit-form--facturacion-active #panel-facturacion .grupo-facturacion,
#grupo-edit-form #panel-facturacion.is-active .grupo-facturacion {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius);
    overflow: hidden;
    background: var(--gf-card-bg);
    box-shadow: var(--gf-shadow);
}

.grupo-panel.is-active,
.grupo-tab-panel.is-active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* General Stack */
.grupo-general-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Keep diplomas visible on Full HD by limiting the students table height. */
#panel-alumnos .table-container--compact {
    max-height: clamp(220px, 34vh, 360px);
    overflow: auto;
}

#panel-alumnos .table-container--compact thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
}

/* Compact professor panels to fit key fields in a single desktop viewport */
.profesor-compact-panel .general-card {
    padding: 1rem;
}

.profesor-compact-panel .general-card__header {
    margin-bottom: 1rem;
}

.profesor-general-stack .general-card__grid,
.profesor-facturacion-stack .general-card__grid {
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 0.75rem 1rem;
    align-items: start;
}

.profesor-general-stack .form-control,
.profesor-facturacion-stack .form-control {
    padding: 0.625rem 0.8rem;
}

.profesor-general-stack .form-group.profesor-rich-compact .ql-toolbar {
    padding: 0.25rem !important;
}

.profesor-general-stack .form-group.profesor-rich-compact .ql-editor {
    min-height: 96px !important;
    padding: 0.5rem 0.625rem !important;
    line-height: 1.3 !important;
}

.profesor-general-stack .form-group.profesor-rich-compact .ql-editor.ql-blank::before {
    left: 0.625rem !important;
    right: 0.625rem !important;
}

.profesor-cursos-selected {
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-bottom: 1px solid var(--color-border);
}

.profesor-cursos-selected__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.profesor-cursos-selected__count {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    color: #374151;
}

.profesor-cursos-selected__count .ph-check-circle {
    color: #10b981;
}

.profesor-cursos-selected__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.profesor-curso-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.6rem;
    max-width: 22rem;
}

.profesor-curso-chip span:nth-child(2) {
    max-width: 12rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profesor-cursos-selected__more {
    margin-top: 0.45rem;
    font-size: 0.8rem;
    color: #64748b;
}

.profesor-cursos-toolbar {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

.profesor-cursos-toolbar__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.profesor-cursos-toolbar__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.profesor-cursos-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-top: 1px solid var(--color-border);
}

.profesor-cursos-footer__info {
    font-size: 0.875rem;
    color: #6b7280;
}

.profesor-cursos-pagination {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0;
}

.profesor-cursos-pagination .pagination-link {
    min-width: 2.15rem;
    height: 2.15rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: #fff;
    color: #374151;
    font-size: 0.875rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.6rem;
    cursor: pointer;
}

.profesor-cursos-pagination .pagination-link.is-active {
    background: #7f1d1d;
    border-color: #7f1d1d;
    color: #fff;
}

.profesor-cursos-pagination .pagination-link:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.profesor-cursos-pagination .pagination-ellipsis {
    color: #6b7280;
    padding: 0 0.2rem;
}

.profesor-cursos-search-input {
    max-width: 420px;
}

.profesor-cursos-table-wrap {
    max-height: none;
    overflow: visible;
}

.profesor-general-stack .form-group.profesor-text-compact textarea.form-control {
    min-height: 96px;
    max-height: 96px;
}

.profesor-general-stack .form-group.profesor-span-2,
.profesor-facturacion-stack .form-group.profesor-span-2 {
    grid-column: span 2;
}

.profesor-general-stack .form-group.profesor-span-3,
.profesor-facturacion-stack .form-group.profesor-span-3 {
    grid-column: span 3;
}

/* Two-column full-width row for description + observations */
.profesor-general-stack .profesor-two-col-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
}

@media (max-width: 640px) {
    .profesor-general-stack .profesor-two-col-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1400px) {
    .profesor-general-stack .general-card__grid,
    .profesor-facturacion-stack .general-card__grid {
        grid-template-columns: repeat(3, minmax(180px, 1fr));
    }
}

@media (max-width: 992px) {
    .profesor-general-stack .general-card__grid,
    .profesor-facturacion-stack .general-card__grid {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }

    .profesor-cursos-toolbar__row {
        flex-direction: column;
        align-items: stretch;
    }

    .profesor-cursos-toolbar__meta {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .profesor-cursos-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .profesor-cursos-pagination {
        justify-content: center;
    }

    .profesor-cursos-search-input {
        max-width: 100%;
    }

    .profesor-general-stack .form-group.profesor-span-2,
    .profesor-general-stack .form-group.profesor-span-3,
    .profesor-facturacion-stack .form-group.profesor-span-2,
    .profesor-facturacion-stack .form-group.profesor-span-3 {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .profesor-general-stack .general-card__grid,
    .profesor-facturacion-stack .general-card__grid {
        grid-template-columns: 1fr;
    }
}

/* General Card */
.general-card {
    background: var(--gf-card-bg);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius);
    padding: 1.5rem;
    box-shadow: var(--gf-shadow);
}

.general-card__header {
    margin-bottom: 1.5rem;
}

.general-card__icon-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

/* Header left group: keep icon + actions together */
.general-card__header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

/* Place actions to the right inside header */
.general-card__header > .header-actions {
    margin-left: auto;
}

.header-action-masa {
    margin-left: 0; /* handled by gap in .header-actions */
}

.general-card__icon-wrapper i {
    color: var(--gf-primary);
    font-size: 1.25rem;
}

.general-card__icon-wrapper span {
    font-weight: 600;
    color: var(--gf-text-main);
    font-size: 1rem;
}

.general-card__description {
    color: var(--gf-text-muted);
    font-size: 0.9rem;
    margin: 0;
    padding-left: 2rem; /* Align with text start */
}

/* Grid Layout */
.general-card__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Form Controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gf-text-main);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.form-group label i {
    color: var(--gf-text-muted);
    font-size: 0.9rem;
    cursor: help;
}

.form-control {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-sm);
    background: #F8FAFC;
    color: var(--gf-text-main);
    font-size: 0.95rem;
    transition: all 0.2s;
    overflow-x: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

textarea.form-control {
    white-space: normal;
    overflow-x: auto;
    resize: vertical;
}

.form-control:focus {
    outline: none;
    border-color: var(--gf-primary);
    background: white;
    box-shadow: 0 0 0 3px var(--gf-primary-light);
}

.form-control::placeholder {
    color: #94A3B8;
}

/* Select Wrapper for custom arrow if needed, 
   but native select styling is usually sufficient with appearance: none */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.6rem;
    height: 0.6rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    pointer-events: none;
}

select.form-control {
    appearance: none;
    padding-right: 2.5rem;
}

/* Input Icon Wrapper */
.input-icon-wrapper {
    position: relative;
}

.input-icon-wrapper::after {
    content: ''; /* Calendar icon placeholder if needed */
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    /* Add icon here if desired */
}

/* Footer Actions */
.grupo-form__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gf-border);
    margin-top: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--gf-radius-sm);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

/* Button styles now consolidated in style.css */

@media (max-width: 640px) {
    .grupo-tabs {
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .grupo-tab {
        min-width: 120px;
    }
}

/* =============================================================
   LEGACY / OTHER TABS SUPPORT
   ============================================================= */

.grupo-panel__header {
    margin-bottom: 1.5rem;
}

.grupo-panel__eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gf-text-muted);
    margin-bottom: 0.35rem;
}

.grupo-panel__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.grupo-panel__columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    align-items: flex-start;
}

.grupo-panel__stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.grupo-panel__card {
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius);
    padding: 1.25rem;
    background: var(--gf-bg);
}

/* Schedule Builder Buttons */
.schedule-builder__days {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.schedule-day {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    border: 1px solid var(--gf-border);
    background: white;
    color: var(--gf-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.schedule-day:hover {
    border-color: var(--gf-primary);
    color: var(--gf-primary);
    background: var(--gf-primary-light);
}

.schedule-day.is-selected {
    background: var(--gf-primary);
    color: white;
    border-color: var(--gf-primary);
    box-shadow: 0 2px 4px rgba(190, 18, 60, 0.2);
}

.schedule-builder__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.schedule-builder__time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.schedule-builder__time input {
    padding: 0.5rem;
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-sm);
}

/* Insight Card */
.insight-card {
    background: #F0F9FF;
    border: 1px solid #BAE6FD;
    border-radius: var(--gf-radius);
    padding: 1.5rem;
}

.insight-card__eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #0369A1;
    margin-bottom: 0.5rem;
}

.insight-card h3 {
    color: #0C4A6E;
    margin: 0 0 1rem 0;
}

.insight-card__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.insight-card__stats dt {
    font-size: 0.8rem;
    color: #0369A1;
}

.insight-card__stats dd {
    font-weight: 600;
    color: #0C4A6E;
    margin: 0;
}

/* =============================================================
   FORM EXTRAS (ECONOMY & ACTIONS)
   ============================================================= */

.input-with-action {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-action input {
    padding-right: 8rem; /* Space for button */
}

.input-with-action button {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    background: white;
    border: 1px solid var(--gf-border);
    border-radius: 6px;
    color: var(--gf-text-muted);
    cursor: pointer;
}

.input-with-action button:hover {
    color: var(--gf-primary);
    border-color: var(--gf-primary);
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.85rem 1rem;
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-sm);
    background: white;
    transition: all 0.2s;
}

.checkbox-wrapper:hover {
    border-color: var(--gf-primary);
    background: #FFF1F2; /* Light red tint */
}

.checkbox-wrapper input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    accent-color: var(--gf-primary);
    cursor: pointer;
}

.checkbox-wrapper span {
    font-size: 0.95rem;
    color: var(--gf-text-main);
    font-weight: 500;
}

.checkbox-wrapper--simple {
    display: inline-flex;
    width: auto;
    padding: 0.35rem 0;
    border: 0;
    background: transparent;
    border-radius: 0;
}

.checkbox-wrapper--simple:hover {
    border: 0;
    background: transparent;
}

.checkbox-wrapper--simple span {
    font-weight: 600;
}

/* Aula create/edit compact layout: keep all blocks inline in one row when possible, two max */
.aula-inline-stack {
    display: grid;
    grid-template-columns: repeat(3, minmax(250px, 1fr));
    gap: 0.9rem;
}

.aula-inline-stack .general-card {
    padding: 1rem;
}

.aula-inline-stack .general-card__header {
    margin-bottom: 0.85rem;
}

.aula-inline-stack .general-card__grid {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 0.7rem;
}

.aula-inline-stack .form-control {
    padding: 0.625rem 0.8rem;
}

@media (max-width: 1400px) {
    .aula-inline-stack {
        grid-template-columns: repeat(2, minmax(260px, 1fr));
    }
}

@media (max-width: 900px) {
    .aula-inline-stack {
        grid-template-columns: 1fr;
    }

    .aula-inline-stack .general-card__grid {
        grid-template-columns: 1fr;
    }
}

.form-hint {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--gf-text-muted);
}

/* Input Group Styles */
.input-group {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius-sm);
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.input-group:focus-within {
    border-color: var(--gf-primary);
    box-shadow: 0 0 0 3px rgba(190, 18, 60, 0.1);
}

.input-group .form-control {
    border: none;
    border-radius: 0;
    flex: 1;
    margin: 0;
}

.input-group .form-control:focus {
    box-shadow: none;
    border-color: transparent;
}

.input-group .btn {
    border: none;
    border-radius: 0;
    padding: 0.5rem 0.75rem;
    background: #F8FAFC;
    color: var(--gf-text-muted);
    border-left: 1px solid var(--gf-border);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
}

.input-group .btn:active {
    background: #CBD5E1;
}

.input-group .input-group-text {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--gf-bg-light);
    border-left: 1px solid var(--gf-border);
    border-radius: 0 calc(var(--gf-radius-sm) - 1px) calc(var(--gf-radius-sm) - 1px) 0;
    font-size: 0.875rem;
    color: var(--gf-text-muted);
    font-weight: 500;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--gf-text-muted);
    line-height: 1.4;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5e7eb;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--gf-primary, #BE123C);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(190, 18, 60, 0.2);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Tooltip styles */
.tooltip-trigger {
    position: relative;
    display: inline-flex;
}

.tooltip-trigger[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: #1f2937;
    color: white;
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: 0.375rem;
    z-index: 1000;
    margin-bottom: 0.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.tooltip-trigger[title]:hover::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    z-index: 1000;
}

/* ================================================
   PROFESOR FACTURACIÓN - Full Width Stack
   ================================================ */

.profesor-facturacion-stack {
    background: var(--gf-card-bg, #fff);
    border: 1px solid var(--gf-border, #e5e7eb);
    border-radius: var(--gf-radius, 12px);
    box-shadow: var(--gf-shadow, 0 1px 3px rgba(0, 0, 0, 0.08));
    padding: 1.5rem;
}

.facturacion-header {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.facturacion-header span {
    font-weight: 600;
    font-size: 1.1rem;
    color: #1e293b;
}

.facturacion-header p {
    margin: 0;
    font-size: 0.875rem;
    color: #64748b;
}

.facturacion-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 0;
}

.facturacion-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.facturacion-card__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
}

.facturacion-card__header i {
    color: var(--primary-500);
    font-size: 1rem;
}

.facturacion-card__header span {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e293b;
}

.facturacion-card__body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row + .form-row {
    margin-top: 0;
}

.form-col {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-col--full {
    grid-column: 1 / -1;
}

.form-col label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

.form-col .form-control,
.form-col .select-wrapper .form-control {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-col .form-control:focus,
.form-col .select-wrapper .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-col .select-wrapper {
    margin: 0;
}

.form-col .select-wrapper::after {
    right: 0.75rem;
}

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

    .form-row {
        grid-template-columns: 1fr;
    }

    .facturacion-card__body {
        padding: 1rem;
    }
}

/* public/css/components/invoice-form.css */
.invoice-page {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.invoice-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
}

.invoice-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(460px, 0.98fr);
    gap: 1rem;
    align-items: start;
}

.invoice-layout--manual-create {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.invoice-layout--document-editor {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
}

/* Create-editor: two-column, 50/50 balanced layout */
.invoice-layout--create-editor {
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}

/* Viewer column: the A4 document defines its own height; avoid nested scrollbars. */
.invoice-create-editor__viewer {
    min-width: 0;
    max-height: none;
    overflow: visible;
    padding-right: 0;
}

.invoice-create-editor__viewer .invoice-preview-panel {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.invoice-create-editor__viewer .invoice-preview-panel__canvas {
    background: transparent;
    border-radius: 0;
    padding: 0;
    min-height: 0;
    overflow: visible !important;
    height: auto;
}

/* Sidebar: sticky with independent scroll */
.invoice-create-editor__sidebar {
    position: sticky;
    top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding-right: 0.5rem;
}

.invoice-create-editor__sidebar .general-card {
    padding: 0.875rem;
}

.invoice-create-editor__sidebar .general-card__header {
    margin-bottom: 0.75rem;
}

.invoice-create-editor__sidebar .general-card__grid {
    gap: 0.75rem;
}

.invoice-sidebar-settings {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.invoice-sidebar-settings__field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0;
}

.invoice-sidebar-settings__label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted, #667085);
}

.invoice-sidebar-type-select,
.invoice-sidebar-payment-select {
    min-height: 40px;
}

/* Hidden fields: off-screen but submitted and accessible to JS */
.invoice-create-editor__fields {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
}

.invoice-layout__main,
.invoice-layout__aside {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.invoice-form-tabs-content {
    min-width: 0;
}

.invoice-layout--manual-create .invoice-layout__aside {
    display: none;
}

.invoice-manual-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.invoice-recipient-dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.95fr);
    gap: 1rem;
    align-items: start;
}

.invoice-recipient-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
}

.invoice-recipient-grid__type {
    grid-column: 1 / -1;
}

.invoice-recipient-grid__client,
.invoice-recipient-grid__fiscal {
    grid-column: 1 / -1;
}

.invoice-recipient-grid__student,
.invoice-recipient-grid__rectificativa {
    grid-column: 1 / -1;
}

@media (min-width: 768px) {
    .invoice-recipient-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr);
        gap: 1.5rem;
    }
    
    .invoice-recipient-grid__type,
    .invoice-recipient-grid__client,
    .invoice-recipient-grid__fiscal {
        grid-column: 1;
    }
    
    .invoice-recipient-grid__student,
    .invoice-recipient-grid__rectificativa {
        grid-column: 2;
        grid-row: 1 / -1; /* span all rows — más robusto que span 4 hardcodeado */
        background: var(--surface-muted, #f8fafc);
        border: 1px solid var(--border-subtle, #e4e7ec);
        border-radius: 12px;
        padding: 1.25rem;
        transition: opacity 0.3s ease, transform 0.3s ease;
        animation: slideInRight 0.3s ease forwards;
    }

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

.invoice-recipient-grid__guidance {
    grid-column: 1 / -1;
}

.invoice-recipient-note {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-muted, #667085);
}

.invoice-associated-students-card {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 0;
}

.invoice-associated-students-card .form-group-premium {
    min-width: 0;
}

.invoice-associated-students-card .ts-wrapper,
.invoice-associated-students-card .ts-control {
    min-width: 0;
}

.invoice-layout__aside {
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 112px);
    overflow-y: auto;
}

.invoice-layout--document-editor .invoice-layout__aside {
    display: none;
    position: static;
    top: auto;
}

.invoice-layout--manual-create .invoice-recipient-dashboard,
.invoice-layout--manual-create .invoice-recipient-grid {
    grid-template-columns: 1fr;
}

.invoice-layout--manual-create .invoice-recipient-grid__type,
.invoice-layout--manual-create .invoice-recipient-grid__client,
.invoice-layout--manual-create .invoice-recipient-grid__group,
.invoice-layout--manual-create .invoice-recipient-grid__notes,
.invoice-layout--manual-create .invoice-recipient-grid__fiscal,
.invoice-layout--manual-create .invoice-recipient-grid__rectificativa,
.invoice-layout--manual-create .invoice-recipient-grid__dates,
.invoice-layout--manual-create .invoice-recipient-grid__number,
.invoice-layout--manual-create .invoice-recipient-grid__payment {
    grid-column: 1 / -1;
}

.invoice-layout--manual-create .form-group__help {
    display: none;
}

.invoice-layout--document-editor .form-group__help {
    display: none;
}

.invoice-layout--document-editor:has([data-tab-panel="destinatario"].is-active) {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.invoice-layout--document-editor:has([data-tab-panel="destinatario"].is-active) .invoice-layout__aside {
    display: none;
}

/* Operativa tab: single full-width column, independent of document-editor layout */
.invoice-layout--document-editor:has([data-tab-panel="operativa"].is-active) {
    grid-template-columns: minmax(0, 1fr);
}

.form-section {
    border: 1px solid var(--border-subtle, #e4e7ec);
    border-radius: 16px;
    padding: 1.25rem;
    background: var(--surface-elevated, #fff);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-section__header,
.form-section > header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.form-section__header h2,
.form-section > header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.form-section__header p,
.form-section > header p {
    margin: 0.35rem 0 0;
    color: var(--text-muted, #667085);
    font-size: 0.9rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.form-grid label,
.invoice-summary label,
.invoice-discount-panel label,
.invoice-pdf-block label,
.invoice-cancel-form label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-muted, #475467);
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.invoice-summary input,
.invoice-summary select,
.invoice-discount-panel input,
.invoice-discount-panel textarea,
.invoice-pdf-block textarea,
.invoice-pdf-block select,
.invoice-cancel-form textarea {
    width: 100%;
}

.invoice-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.35rem;
}

.invoice-inline-actions--end {
    justify-content: flex-end;
}

.invoice-lines {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.invoice-table-wrapper {
    overflow-x: auto;
}

.invoice-lines__table,
.invoice-linked-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.invoice-lines__table th,
.invoice-lines__table td,
.invoice-linked-table th,
.invoice-linked-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-subtle, #e4e7ec);
    vertical-align: top;
}

.invoice-lines__table thead th,
.invoice-linked-table thead th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #98a2b3);
    background: var(--surface-muted, #f8fafc);
}

.invoice-lines__table input {
    width: 100%;
    min-height: 42px;
}

.invoice-line__subtotal {
    display: block;
    font-size: 0.95rem;
    color: var(--text-strong, #101828);
}

.invoice-line__meta {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.78rem;
    color: var(--text-muted, #667085);
}

.invoice-pdf-blocks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.invoice-pdf-block {
    border: 1px dashed var(--border-strong, #d0d5dd);
    border-radius: 14px;
    padding: 1rem;
    background: rgba(69, 114, 246, 0.03);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.invoice-summary,
.invoice-discount-panel,
.invoice-detail-card {
    border: 1px solid var(--border-subtle, #e4e7ec);
    border-radius: 16px;
    padding: 1.25rem;
    background: var(--surface-elevated, #fff);
}

.invoice-summary header,
.invoice-discount-panel header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.invoice-summary header h3,
.invoice-discount-panel header h3 {
    margin: 0;
    font-size: 1rem;
}

.invoice-summary header p,
.invoice-discount-panel header p {
    margin: 0.3rem 0 0;
    color: var(--text-muted, #667085);
    font-size: 0.85rem;
}

.invoice-summary dl {
    margin: 0 0 1rem;
    padding: 0;
}

.invoice-summary dl > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.45rem;
    color: var(--text-muted, #475467);
}

.invoice-summary__total {
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-subtle, #e4e7ec);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-strong, #101828);
}

.invoice-summary__actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.invoice-summary__actions .btn {
    width: 100%;
    justify-content: center;
}

.invoice-summary__manual-discount {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle, #e4e7ec);
}

.invoice-discount-panel {
    background: rgba(69, 114, 246, 0.04);
}

.invoice-discount-panel__helper {
    font-size: 0.85rem;
    color: var(--text-muted, #475467);
    margin: 0;
}

.invoice-secondary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.invoice-detail-card--full {
    grid-column: 1 / -1;
}

.invoice-detail-card--accent {
    background: linear-gradient(135deg, #fffbeb 0%, #fff7d6 100%);
    border-color: #f3d98c;
}

.invoice-detail-card--danger {
    background: #fff7f7;
    border-color: #f2b8b8;
}

.invoice-detail-card .general-card__header {
    margin-bottom: 1rem;
}

.invoice-detail-card__label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #98a2b3);
}

.invoice-detail-card__content {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.invoice-detail-card__intro {
    margin: 0;
    color: var(--text-muted, #667085);
}

.invoice-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.invoice-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.invoice-tag-list li {
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-muted, #475467);
    font-size: 0.85rem;
}

.invoice-linked-table td a {
    font-weight: 600;
}

.invoice-linked-table td small {
    display: block;
    margin-top: 0.2rem;
    color: var(--text-muted, #667085);
}

.invoice-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.invoice-history-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 0.85rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--border-subtle, #e4e7ec);
}

.invoice-history-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.invoice-history-item__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(69, 114, 246, 0.08);
    color: var(--primary-600, #4572f6);
}

.invoice-history-item__body {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.invoice-history-item__body p {
    margin: 0;
    color: var(--text-muted, #667085);
}

.invoice-history-item__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.invoice-history-item__header span {
    font-size: 0.8rem;
    color: var(--text-muted, #98a2b3);
    white-space: nowrap;
}

.invoice-hero-actions__form {
    display: inline-flex;
}

.invoice-empty {
    color: var(--text-muted, #667085);
}

@media (max-width: 1200px) {
    .invoice-layout {
        grid-template-columns: 1fr;
    }

    .invoice-layout__aside {
        position: static;
    }

    .invoice-recipient-dashboard {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1500px) {
    .invoice-layout {
        grid-template-columns: minmax(0, 1fr) minmax(400px, 0.92fr);
    }

    .invoice-layout--manual-create {
        grid-template-columns: 1fr;
        grid-template-areas:
            "preview"
            "controls";
    }

    .invoice-layout--manual-create .invoice-layout__main {
        max-width: none;
    }

    .invoice-layout--manual-create .invoice-layout__aside {
        position: static;
    }
}

@media (max-width: 900px) {
    .invoice-secondary-grid {
        grid-template-columns: 1fr;
    }

    .invoice-detail-card--full {
        grid-column: auto;
    }

    .invoice-recipient-grid {
        grid-template-columns: 1fr;
    }
}

.invoice-preview-panel {
    border: 1px solid var(--border-subtle, #e4e7ec);
    border-radius: 18px;
    background: var(--surface-elevated, #fff);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.invoice-preview-panel {
    padding: 1rem;
}

.invoice-preview-panel__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0.85rem;
}

.invoice-preview-panel__actions {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.invoice-preview-panel__header h2 {
    margin: 0;
    font-size: 1rem;
}

.invoice-preview-panel__header p {
    margin: 0.25rem 0 0;
    color: var(--text-muted, #667085);
    font-size: 0.82rem;
}

.invoice-preview-panel__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(69, 114, 246, 0.18);
    background: rgba(69, 114, 246, 0.08);
    color: var(--primary-600, #4572f6);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.invoice-preview-panel__badge:hover {
    background: rgba(69, 114, 246, 0.14);
    border-color: rgba(69, 114, 246, 0.28);
    transform: translateY(-1px);
}

.invoice-preview-panel__canvas {
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    border-radius: 16px;
    padding: 1rem;
    overflow: auto;
    height: clamp(640px, calc(100vh - 300px), 1120px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
}

.invoice-preview-sheet {
    min-height: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    flex: 0 0 auto;
}

.invoice-preview-sheet__placeholder {
    margin: 0;
    color: var(--text-muted, #667085);
    font-size: 0.9rem;
}

.invoice-preview {
    display: flex;
    justify-content: center;
    transform-origin: top center;
    width: auto;
    flex: 0 0 auto;
    align-self: flex-start; /* evita que el flex-stretch del sheet infle scrollHeight y cause el loop de escala */
    margin-inline: auto;
}

.invoice-preview-panel[data-scale-mode="page"] .invoice-preview-panel__canvas {
    overflow: hidden;
}

.invoice-preview-panel[data-scale-mode="width"] .invoice-preview-panel__canvas {
    overflow-x: hidden;
    overflow-y: auto;
}

.invoice-preview__page {
    width: 794px;
    max-width: 794px;
    min-height: 0; /* was 1123px — causaba scroll loop: syncPreviewScale() leía scrollHeight que crecía con contenido, realimentando el cálculo de escala */
    height: auto;
    padding: 1.65rem 1.65rem 1.25rem;
    background: #fff;
    color: #111827;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.12);
    border-radius: 28px;
    box-sizing: border-box;
}

.invoice-preview__header {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    gap: 1.4rem;
    align-items: start;
}

.invoice-preview__brand-wrap {
    display: block;
}

.invoice-preview__logo {
    display: block;
    width: 220px;
    height: auto;
    max-height: 58px;
    margin-bottom: 0.35rem;
    object-fit: contain;
}

.invoice-preview__company-name {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.invoice-preview__company-line {
    font-size: 10px;
    line-height: 1.45;
    color: #111827;
}

.invoice-preview__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.55rem;
    width: 100%;
    max-width: 385px;
    margin-left: auto;
}

.invoice-preview__meta--hybrid {
    width: 100%;
}

.invoice-preview__meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    width: 100%;
}

.invoice-preview__top-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    width: 100%;
}

.invoice-preview__group {
    display: inline-flex;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.06);
    font-size: 0.72rem;
    font-weight: 700;
}

.invoice-preview__title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-align: right;
    margin-bottom: 10px;
    white-space: nowrap;
}

.invoice-preview__doc-table,
.invoice-preview__client-grid,
.invoice-preview__detail-grid,
.invoice-preview__economic-table,
.invoice-preview__totals {
    width: 100%;
    border-collapse: collapse;
}

.invoice-preview__client-meta-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.55fr);
    gap: 1.1rem;
    align-items: start;
    margin-top: 0.4rem;
}

.invoice-preview__doc-table td,
.invoice-preview__totals td {
    border: 1px solid #d1d5db;
    padding: 7px 8px;
    font-size: 12px;
}

.invoice-preview__doc-label,
.invoice-preview__totals-label {
    background: #f3f4f6;
    font-weight: 700;
    text-transform: uppercase;
    color: #4b5563;
}

.invoice-preview__doc-value,
.invoice-preview__totals-value {
    text-align: right;
    font-weight: 600;
}

.invoice-preview__doc-inline-button {
    appearance: none;
    display: inline;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-align: right;
    padding: 0;
    margin: 0;
    cursor: default;
}

.invoice-preview__doc-inline-button:focus-visible {
    outline: 1px solid rgba(69, 114, 246, 0.45);
    outline-offset: 2px;
}

.invoice-preview__doc-value--control {
    padding: 0.2rem 0.25rem;
}

.invoice-preview__client-box,
.invoice-preview__detail-box {
    margin-top: 14px;
    border: 1px solid #d1d5db;
    border-radius: 0;
    background: transparent;
    padding: 12px 14px;
}

.invoice-preview__client-box {
    margin-top: 0;
}

.invoice-preview__doc-box {
    min-width: 0;
}

.invoice-preview__field-slot-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 0.7rem;
}

.invoice-preview__notes-slot {
    margin-top: 0.65rem;
}

.invoice-preview__editor-section {
    margin-top: 0.8rem;
}

.invoice-preview__section-title {
    margin-bottom: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #6b7280;
}

.invoice-preview__client-grid td,
.invoice-preview__detail-grid td {
    padding: 3px 0;
    font-size: 10px;
    vertical-align: top;
}

.invoice-preview__client-box .invoice-preview__client-grid {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.invoice-preview__client-label {
    width: 112px;
    font-weight: 700;
    color: #374151;
}

.invoice-preview__client-value {
    min-width: 0;
    color: #111827;
}

.invoice-preview__client-name-button {
    appearance: none;
    display: inline;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: inherit;
    line-height: inherit;
    text-align: left;
    padding: 0;
    margin: 0;
    cursor: default;
}

.invoice-preview__client-name-button:focus-visible {
    outline: 1px solid rgba(69, 114, 246, 0.45);
    outline-offset: 2px;
}

.invoice-preview__detail-label {
    width: 118px;
    font-weight: 700;
    color: #374151;
}

.invoice-preview__detail-label--empty {
    color: transparent;
}

.invoice-preview__economic-table {
    margin-top: 1.2rem;
    table-layout: fixed;
}

.invoice-preview__economic-col--concept {
    width: 42%;
}

.invoice-preview__economic-col--base {
    width: 16%;
}

.invoice-preview__economic-col--vat-percent {
    width: 10%;
}

.invoice-preview__economic-col--vat {
    width: 14%;
}

.invoice-preview__economic-col--total {
    width: 14%;
}

.invoice-preview__economic-col--actions {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
}

.invoice-preview__economic-table th {
    background: #111827;
    color: #fff;
    padding: 9px 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    vertical-align: middle;
}

.invoice-preview__economic-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 8px;
    font-size: 10px;
    vertical-align: middle;
}

.invoice-preview__doc-table .invoice-preview__control--compact {
    min-height: 26px;
    padding: 0.2rem 0.35rem;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    font-weight: 600;
}

.invoice-preview__totals td {
    font-size: 10px;
}

.invoice-preview__line-input,
.invoice-preview__line-value {
    font-family: Arial, Helvetica, sans-serif;
}

.invoice-preview__economic-table th:first-child {
    text-align: left;
}

.invoice-preview__economic-table td:first-child {
    text-align: left;
}

.invoice-preview__economic-table th:not(:first-child),
.invoice-preview__economic-table td:not(:first-child) {
    text-align: right;
    white-space: nowrap;
}

.invoice-preview__economic-table th:last-child,
.invoice-preview__economic-table td:last-child {
    padding: 9px 4px;
    text-align: center;
}

.invoice-preview__totals {
    width: 44%;
    margin-left: auto;
    margin-top: 1.35rem;
    table-layout: fixed;
}

.invoice-preview__totals-label {
    width: 64%;
}

.invoice-preview__totals-value {
    width: 36%;
    white-space: nowrap;
}

.invoice-preview__totals-grand .invoice-preview__totals-label,
.invoice-preview__totals-grand .invoice-preview__totals-value {
    background: #111827;
    color: #fff;
}

.invoice-preview__footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.85fr);
    gap: 1.25rem;
    align-items: end;
    margin-top: 1.6rem;
}

.invoice-preview__footer-left {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.invoice-preview__footer-right {
    text-align: right;
}

.invoice-preview__payment {
    border: 1px solid #e5e7eb;
    background: #fafafa;
    padding: 0.75rem 1rem;
    font-size: 10px;
    line-height: 1.35;
    border-radius: 4px;
}

.invoice-preview__payment-title {
    margin-bottom: 0.3rem;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.invoice-preview__footer-brand {
    text-align: right;
}

.invoice-preview__footer-image {
    max-width: 176px;
    width: 100%;
    height: auto;
}

.invoice-preview__footer-legal,
.invoice-preview__legal {
    font-size: 0.58rem;
    line-height: 1.35;
    color: #4b5563;
}

.invoice-preview__footer-legal {
    margin-top: 0.75rem;
}

.invoice-preview__legal {
    margin-top: 0.15rem;
}

/* .invoice-preview--controlled .invoice-preview__page: min-height:auto ya no es necesario — el base tiene min-height:0 */

.invoice-preview__editor-box {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.55rem;
}

.invoice-preview__editor-box--meta {
    grid-template-columns: minmax(150px, 0.5fr);
    align-items: end;
    align-self: flex-start;
    width: min(180px, 100%);
    margin-top: 0.55rem;
}

.invoice-preview__editor-box--client,
.invoice-preview__editor-box--stacked {
    grid-template-columns: 1fr;
}

.invoice-preview__control-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.invoice-preview__control-group--full {
    grid-column: 1 / -1;
}

.invoice-preview__control-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

.invoice-preview__control,
.invoice-preview__line-input {
    width: 100%;
    min-height: 38px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #111827;
    border-radius: 12px;
    padding: 0.45rem 0.6rem;
    font-size: 0.88rem;
    line-height: 1.3;
}

.invoice-preview__control:focus,
.invoice-preview__line-input:focus {
    outline: 2px solid rgba(69, 114, 246, 0.22);
    outline-offset: 1px;
    border-color: #4572f6;
}

.invoice-preview__control--textarea {
    min-height: 84px;
    max-height: 132px;
    resize: vertical;
}

.invoice-preview__control--compact {
    min-height: 34px;
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}

.invoice-preview__inline-select[hidden] {
    display: none;
}

/* Client name search widget inside the preview viewer */
.invoice-preview__inline-search {
    width: min(320px, 100%);
}

.invoice-preview__inline-search[hidden] {
    display: none;
}

.invoice-preview__client-search-wrap {
    position: relative;
}

.invoice-preview__client-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.invoice-preview__client-dropdown-item {
    padding: 0.4rem 0.7rem;
    font-size: 0.82rem;
    cursor: pointer;
    line-height: 1.3;
    list-style: none;
}

.invoice-preview__client-dropdown-item:hover {
    background: #f0f4ff;
    color: #1e3a8a;
}

.invoice-preview__client-dropdown-empty {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    color: #9ca3af;
    list-style: none;
}

/* CIF/NIF inline search inside the client data table */
.invoice-preview__cif-cell {
    vertical-align: top;
}

.invoice-preview__cif-search {
    display: block;
    width: min(220px, 100%);
    min-height: 28px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #111827;
    border-radius: 8px;
    padding: 0.2rem 0.5rem;
    font-size: 0.78rem;
    line-height: 1.3;
}

.invoice-preview__cif-search[hidden] {
    display: none;
}

.invoice-preview__cif-search:focus {
    outline: 2px solid rgba(69, 114, 246, 0.22);
    outline-offset: 1px;
    border-color: #4572f6;
}

.invoice-preview__line-input {
    min-height: 24px;
    padding: 4px 6px;
    font-size: 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    width: 100%;
    box-sizing: border-box;
}

.invoice-preview__line-input--description {
    text-align: left;
}

.invoice-preview__line-input--amount {
    text-align: right;
}

.invoice-preview__line-value {
    font-size: 10px;
    text-align: right;
    white-space: nowrap;
}

.invoice-preview__line-value--total {
    font-weight: 600;
}

.invoice-preview__line-actions {
    text-align: center;
}

.invoice-preview__line-remove,
.invoice-preview__add-line {
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #111827;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 600;
}

.invoice-preview__line-remove {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.invoice-preview__add-line {
    padding: 0.55rem 0.9rem;
    font-size: 0.82rem;
}

.invoice-preview__line-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.42rem;
}

.invoice-preview__empty-lines {
    padding: 0.85rem 0.45rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.72rem;
}

.invoice-layout--manual-create .invoice-preview-panel {
    max-width: min(100%, 1360px);
    margin-inline: auto;
}

.invoice-layout--document-editor .invoice-preview-panel,
.invoice-layout--document-editor .general-card,
.invoice-layout--document-editor .invoice-preview-panel + .general-card {
    max-width: 100%;
    margin-inline: 0;
}

/* === canvas height: fuente única de verdad por contexto ===
   Base:              clamp(640px, 100vh-300px, 1120px)
   manual-create:     100vh - 260px  (sidebar derecha sin header complejo)
   document-editor:   100vh - 320px  (tabs + header extra)
   edit-page:         100vh - 210px  (layout sin aside derecho) — definida en .invoice-edit-page abajo
*/
.invoice-layout--manual-create .invoice-preview-panel__canvas {
    height: clamp(720px, calc(100vh - 260px), 1280px);
    min-height: 0;
}

.invoice-layout--document-editor .invoice-preview-panel__canvas {
    height: clamp(620px, calc(100vh - 320px), 1040px);
    min-height: 0;
}

.invoice-layout--document-editor:has([data-tab-panel="destinatario"].is-active) .invoice-preview-panel,
.invoice-layout--document-editor:has([data-tab-panel="destinatario"].is-active) .general-card,
.invoice-layout--document-editor:has([data-tab-panel="destinatario"].is-active) .invoice-preview-panel + .general-card {
    width: 100%;
    margin-inline: 0;
}

.invoice-document-editor-sources {
    position: absolute !important;
    left: -99999px !important;
    top: 0 !important;
    width: 320px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.invoice-document-launcher {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--border-subtle, #e4e7ec);
    border-radius: 20px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.invoice-document-launcher__content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.invoice-document-launcher__eyebrow {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-600, #820303);
}

.invoice-document-launcher__title {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-strong, #101828);
}

.invoice-document-launcher__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.invoice-operations-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.9rem;
    align-items: stretch;
}

/* Independent layout root for the Operativa tab — no inherited constraints from invoice-layout */
.invoice-operativa-layout {
    width: 100%;
    max-width: min(100%, 1440px);
    margin-inline: auto;
}

.invoice-operations-grid--count-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.invoice-operations-grid--count-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.invoice-operations-grid--count-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.invoice-operations-grid--count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.invoice-operations-grid--count-1 {
    grid-template-columns: 1fr;
}

.invoice-operations-grid__notes,
.invoice-operations-grid__pdf,
.invoice-operations-grid__history,
.invoice-operations-grid__cancel,
.invoice-operations-grid__matriculas,
.invoice-operations-grid__fundae {
    min-width: 0;
}

.invoice-operations-grid .general-card {
    height: 100%;
    min-height: 320px;
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.invoice-operations-grid .general-card__grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.invoice-operations-grid .form-group-premium {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.invoice-operations-grid .form-group__control {
    flex: 1 1 auto;
}

.invoice-operations-grid textarea.form-control {
    height: 170px;
    min-height: 170px;
    resize: none;
}

.invoice-operations-grid .invoice-edit-history,
.invoice-operations-grid .invoice-edit-fundae__grid,
.invoice-operations-grid .invoice-matriculas-compact {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.35rem;
}

/* Cards con scroll interno: el header queda fijo, el cuerpo scrollea */
.invoice-operations-grid__history .general-card,
.invoice-operations-grid__matriculas .general-card,
.invoice-operations-grid__cancel .general-card {
    display: flex;
    flex-direction: column;
}

.invoice-operations-grid__history .general-card__grid,
.invoice-operations-grid__matriculas .general-card__grid,
.invoice-operations-grid__cancel .general-card__grid {
    flex: 1;
    height: auto; /* override height:100% del bloque base — no aplica en flex */
    overflow-y: auto;
    padding-right: 0.1rem;
}

.invoice-operations-grid .invoice-edit-cancel {
    display: flex;
    flex-direction: column;
    min-height: 100%; /* min — el contenido puede superar la altura del row del grid */
}

.invoice-operations-grid .invoice-edit-cancel__action {
    margin-top: auto;
}

.invoice-operations-grid .invoice-edit-fundae__grid,
.invoice-operations-grid .invoice-matriculas-compact__meta {
    grid-template-columns: 1fr;
}
.invoice-edit-page .layout-page__header {
    gap: 0.9rem;
    padding: 1.1rem 1.35rem 1rem;
    margin-bottom: 0;
    border-radius: 22px 22px 0 0;
    box-shadow: none;
}

.invoice-edit-page .layout-page__header-main {
    gap: 1.5rem;
    align-items: flex-start;
}

.invoice-edit-page .layout-page__header-desc {
    margin-top: 0.35rem;
    font-size: 0.95rem;
}

.invoice-edit-page .layout-page__header-stats {
    margin-top: 0.65rem;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.invoice-edit-page .layout-page__header-actions {
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.invoice-edit-page .layout-page__header-actions .btn {
    padding: 0.85rem 1.2rem;
    min-height: 48px;
    border-radius: 16px;
    box-shadow: none;
}

.invoice-edit-page .layout-page__body {
    padding: 0.35rem 1.25rem 0.6rem;
    gap: 1.25rem;
}

.invoice-edit-page .layout-page__body > .invoice-form {
    width: 100%;
    max-width: none;
    margin-inline: 0;
}

.invoice-edit-page .invoice-layout,
.invoice-edit-page .invoice-layout__main,
.invoice-edit-page .invoice-form-tabs-content,
.invoice-edit-page .grupo-panel.is-active {
    width: 100%;
    max-width: none;
    align-self: stretch;
}

.invoice-edit-page #panel-operativa.grupo-panel.is-active {
    display: block;
    width: 100%;
}

.invoice-edit-page .grupo-panel.is-active .invoice-operations-grid {
    width: 100%;
    max-width: min(100%, 1440px);
    margin-inline: auto;
}

.invoice-edit-page .layout-page__header-stat-item {
    gap: 0.45rem;
    font-size: 0.88rem;
    position: relative;
}

.invoice-edit-page .layout-page__header-stat-item:not(:last-child)::after {
    content: "•";
    margin-left: 0.1rem;
    color: var(--text-muted, #98a2b3);
}

.invoice-edit-page .layout-page__header-stat-item .stat-label {
    font-size: 0.86rem;
    color: var(--text-muted, #667085);
}

.invoice-edit-page .layout-page__header-stat-item .stat-value {
    font-size: 0.88rem;
    color: var(--text-strong, #101828);
}

.invoice-edit-page .layout-page__header-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 1.1rem;
}

.invoice-edit-page .invoice-preview-panel {
    padding: 1rem;
    border-radius: 26px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.invoice-edit-page .invoice-preview-panel__header {
    margin-bottom: 0.9rem;
    padding-inline: 0.2rem;
}

.invoice-edit-page .invoice-preview-panel__canvas {
    padding: 0.85rem;
    cursor: default;
    border-radius: 22px;
    background: #f8fafc;
    height: clamp(860px, calc(100vh - 210px), 1280px); /* 210 = navbar(56) + layout-padding(32) + panel-header(70) + canvas-padding(52) */
}

.invoice-edit-page .invoice-create-editor__viewer .invoice-preview-panel {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
}

.invoice-edit-page .invoice-create-editor__viewer .invoice-preview-panel__canvas {
    background: transparent;
    border-radius: 0;
    padding: 0;
    height: auto;
    min-height: 0;
    overflow: visible !important;
}

.invoice-edit-sidecard__empty,
.invoice-edit-sidecard__hint {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-muted, #667085);
}

.invoice-edit-history {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-left: 1rem;
}

.invoice-edit-history::before {
    content: "";
    position: absolute;
    left: 0.2rem;
    top: 0.15rem;
    bottom: 0.15rem;
    width: 1px;
    background: var(--border-subtle, #e4e7ec);
}

.invoice-edit-history__item {
    position: relative;
    display: flex;
    gap: 0.75rem;
}

.invoice-edit-history__dot {
    position: absolute;
    left: -0.95rem;
    top: 0.35rem;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: var(--primary-600, #820303);
    box-shadow: 0 0 0 4px #fff;
}

.invoice-edit-history__content {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.invoice-edit-history__meta {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.68rem;
    color: var(--text-muted, #667085);
}

.invoice-edit-history__title {
    font-size: 0.82rem;
    color: var(--text-strong, #101828);
}

.invoice-edit-history__transition {
    font-size: 0.72rem;
    color: var(--text-muted, #667085);
}

.invoice-edit-cancel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.invoice-edit-cancel__info {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.invoice-edit-cancel__info > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-subtle, #e4e7ec);
}

.invoice-edit-cancel__info > div:first-child {
    padding-top: 0;
}

.invoice-edit-cancel__info > div:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.invoice-edit-cancel__info dt {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #98a2b3);
    flex-shrink: 0;
}

.invoice-edit-cancel__info dd {
    margin: 0;
    font-size: 0.86rem;
    color: var(--text-strong, #101828);
    text-align: right;
    word-break: break-word;
}

.invoice-edit-cancel__action {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-subtle, #e4e7ec);
}

.invoice-edit-fundae__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.invoice-edit-fundae__grid span {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #98a2b3);
}

.invoice-edit-fundae__grid strong {
    display: block;
    font-size: 0.84rem;
    color: var(--text-strong, #101828);
}

.invoice-matriculas-compact {
    display: grid;
    gap: 0.75rem;
}

.invoice-matriculas-compact__item {
    display: grid;
    gap: 0.7rem;
    padding: 0.85rem;
    border: 1px solid var(--border-subtle, #e4e7ec);
    border-radius: 14px;
    background: var(--surface-muted, #f8fafc);
}

.invoice-matriculas-compact__student {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.invoice-matriculas-compact__name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--primary-600, #820303);
    text-decoration: none;
}

.invoice-matriculas-compact__name:hover {
    text-decoration: underline;
}

.invoice-matriculas-compact__email {
    font-size: 0.74rem;
    color: var(--text-muted, #667085);
}

.invoice-matriculas-compact__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem 0.8rem;
    margin: 0;
}

.invoice-matriculas-compact__meta div {
    min-width: 0;
}

.invoice-matriculas-compact__meta dt {
    margin: 0 0 0.15rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #98a2b3);
}

/* ============================================================
   Cancel invoice dialog
   ============================================================ */

[data-cancel-dialog] {
    border: none;
    border-radius: var(--radius-lg);
    padding: 0;
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    width: 100%;
}

[data-cancel-dialog]::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.invoice-cancel-dialog__body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.invoice-cancel-dialog__title {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.invoice-cancel-dialog__desc {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0;
}

.invoice-cancel-dialog__field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.invoice-cancel-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.invoice-matriculas-compact__meta dd {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-strong, #101828);
}

.invoice-matriculas-compact__meta dd span {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.72rem;
    color: var(--text-muted, #667085);
}

.invoice-matriculas-compact__meta-span {
    grid-column: 1 / -1;
}

.invoice-document-modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.invoice-document-modal[hidden] {
    display: none;
}

.invoice-document-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(4px);
}

.invoice-document-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(98vw, 1760px);
    height: min(96vh, 1180px);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.32);
}

.invoice-document-modal__header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.invoice-document-modal__header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.invoice-document-modal__header p {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted, #667085);
}

.invoice-document-modal__body {
    flex: 1;
    min-height: 0;
    padding: 1.25rem;
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    overflow: hidden; /* el canvas interno tiene su propio scroll — evita scroll chaining */
}

.invoice-preview-panel--modal {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

@media (max-width: 1360px) {
    .invoice-document-launcher {
        flex-direction: column;
        align-items: flex-start;
    }

    .invoice-document-launcher__actions {
        width: 100%;
        justify-content: flex-start;
    }

    .invoice-operations-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .invoice-matriculas-compact__meta {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1120px) {
    .invoice-operations-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .invoice-operations-grid {
        grid-template-columns: 1fr;
    }
}

.invoice-preview__client-notes {
    margin-top: 0.65rem;
    border: 1px solid #e5e7eb;
    background: #fafafa;
    padding: 0.55rem 0.65rem;
    font-size: 0.68rem;
    line-height: 1.5;
    color: #374151;
}

.invoice-preview__client-notes strong {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

.invoice-preview__client-notes p {
    margin: 0;
}

.invoice-preview__dates-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 0.9rem;
}

.invoice-preview__dates-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.9rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fafafa;
}

.invoice-preview__dates-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #667085;
}

.invoice-preview__dates-value {
    font-size: 1rem;
    font-weight: 700;
    color: #101828;
}

.invoice-pdf-modal {
    position: fixed;
    inset: 0;
    z-index: 1095;
    display: grid;
    place-items: center;
}

.invoice-pdf-modal[hidden] {
    display: none !important;
}

.invoice-pdf-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(6px);
}

.invoice-pdf-modal__dialog {
    position: relative;
    width: min(98vw, 1480px);
    height: min(96vh, 980px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.24);
    overflow: hidden;
}

.invoice-pdf-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle, #e4e7ec);
    background: #f8fafc;
}

.invoice-pdf-modal__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    align-items: center;
}

.invoice-pdf-modal__header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.invoice-pdf-modal__header p {
    margin: 0.3rem 0 0;
    color: var(--text-muted, #667085);
    font-size: 0.88rem;
}

.invoice-pdf-modal__body {
    position: relative;
    min-height: 0;
    padding: 1rem;
    background: #eef2f7;
}

.invoice-pdf-modal__status {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted, #667085);
    font-size: 0.95rem;
}

.invoice-pdf-modal__status.is-error {
    color: #b42318;
}

.invoice-pdf-modal__frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

@media (max-width: 768px) {
    .invoice-history-item__header,
    .form-section__header,
    .form-section > header,
    .invoice-summary header,
    .invoice-discount-panel header {
        flex-direction: column;
        align-items: stretch;
    }

    .invoice-pdf-blocks,
    .form-grid,
    .invoice-detail-grid {
        grid-template-columns: 1fr;
    }

    .invoice-inline-actions {
        flex-direction: column;
    }

    .invoice-document-modal__dialog {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .invoice-document-modal__header {
        flex-direction: column;
        align-items: stretch;
    }

    .invoice-pdf-modal__dialog {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }

    .invoice-pdf-modal__header {
        flex-direction: column;
        align-items: stretch;
    }

    .invoice-inline-actions .btn {
        width: 100%;
    }
}

/* Totales negativos en preview */
.invoice-preview__totals-value.is-negative {
    color: #dc2626;
    font-weight: 700;
}

/* Matrículas vinculadas colapsables */
.invoice-matriculas-collapsible {
    border: 1px solid var(--color-border, #e5e7eb);
    border-radius: 8px;
    overflow: hidden;
}

.invoice-matriculas-collapsible__summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    background: var(--color-surface, #f9fafb);
    list-style: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text, #374151);
    user-select: none;
    transition: background-color 0.15s ease;
}

.invoice-matriculas-collapsible__summary:hover {
    background: var(--color-surface-hover, #f3f4f6);
}

.invoice-matriculas-collapsible__summary::-webkit-details-marker {
    display: none;
}

.invoice-matriculas-collapsible__count {
    font-weight: 600;
}

.invoice-matriculas-collapsible__toggle {
    font-size: 0.75rem;
    color: var(--color-primary, #3b82f6);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.invoice-matriculas-collapsible[open] .invoice-matriculas-collapsible__toggle {
    content: 'Ocultar detalle';
}

.invoice-matriculas-collapsible__content {
    padding: 1rem;
    border-top: 1px solid var(--color-border, #e5e7eb);
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* public/css/components/invoice.css */
.invoice-index {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.invoice-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.invoice-kpi-card {
    border: 1px solid var(--border-subtle, #e4e7ec);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    background: var(--surface-elevated, #fff);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
}

.invoice-kpi-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted, #667085);
}

.invoice-kpi-card strong {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-strong, #101828);
}

.invoice-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--border-subtle, #e4e7ec);
    border-radius: 12px;
    background: var(--surface-muted, #f6f8fb);
}

.invoice-filters label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted, #475467);
}

.invoice-filters__actions {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.invoice-table-wrapper {
    overflow-x: auto;
}

.invoice-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.invoice-table th,
.invoice-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-subtle, #edf0f3);
    vertical-align: top;
}

.invoice-table thead th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    color: var(--text-muted, #98a2b3);
    background: var(--surface-muted, #f8fafc);
}

.invoice-table tbody tr:hover {
    background: rgba(69, 114, 246, 0.05);
}

.invoice-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted, #98a2b3);
}

.invoice-bulk {
    border-top: 1px solid var(--border-subtle, #e4e7ec);
    padding: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.invoice-bulk__actions {
    display: flex;
    gap: 0.5rem;
}

.invoice-show__summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.invoice-show__summary article {
    border: 1px solid var(--border-subtle, #e4e7ec);
    border-radius: 12px;
    padding: 1rem;
    background: var(--surface-elevated, #fff);
}

.invoice-show__summary strong {
    font-size: 1.6rem;
    display: block;
    margin: 0.5rem 0;
}

.invoice-show__timeline {
    padding: 1.5rem;
}

.invoice-show__timeline ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
    overflow-x: auto;
}

.invoice-show__timeline li {
    position: relative;
    padding-top: 1.5rem;
    min-width: 140px;
    text-align: center;
    color: var(--text-muted, #98a2b3);
}

.invoice-show__timeline .dot {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-subtle, #d0d5dd);
}

.invoice-show__timeline li.done .dot {
    background: var(--color-success, #12b76a);
}

.invoice-show__timeline li.done strong {
    color: var(--text-strong, #101828);
}

.invoice-show__discounts,
.invoice-show__actions {
    padding: 1.5rem;
}

.invoice-show__discounts ul {
    margin: 0.75rem 0 0;
    padding-left: 1rem;
    color: var(--text-muted, #475467);
}

.invoice-show__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .invoice-filters {
        grid-template-columns: 1fr;
    }

    .invoice-show__timeline ol {
        flex-direction: column;
        align-items: flex-start;
    }

    .invoice-show__timeline li {
        text-align: left;
        padding-left: 1.5rem;
    }

    .invoice-show__timeline .dot {
        left: 0;
        transform: none;
    }
}

.invoice-index-page {
    gap: 0;
}

.invoice-index-header__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.invoice-index-header__actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.invoice-index-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.invoice-index-stat {
    text-align: center;
    padding: 0.75rem;
}

.invoice-index-stat--divider {
    border-left: 2px solid #e5e7eb;
}

.invoice-index-stat__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #6b7280;
}

.invoice-index-stat__value--warning {
    color: #f59e0b;
}

.invoice-index-stat__value--success {
    color: #10b981;
}

.invoice-index-stat__label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
}

.invoice-index-filter-bar__label {
    margin-bottom: 0;
    margin-right: 0.5rem;
}

.invoice-index-filter-bar__search {
    min-width: 200px;
}

.invoice-index-filter-bar__menu {
    position: relative;
}

.invoice-index-filter-bar__submit {
    display: none;
}

.invoice-index-toolbar {
    display: flex;
    justify-content: flex-end;
    margin: 0 1.5rem 0.75rem;
}

.invoice-index-results-info {
    margin-top: 0.5rem;
}

.dynamic-filter--range {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.dynamic-filter__input--year {
    width: 100px;
}

.dynamic-filter__input--tax {
    width: 130px;
}

.dynamic-filter__input--range {
    width: 90px;
}

.dynamic-filter__input--annual-min {
    width: 110px;
}

.dynamic-filter__input--annual-year {
    width: 95px;
}

.invoice-index-table__row {
    cursor: pointer;
}

.invoice-row-menu {
    position: relative;
    display: inline-block;
}

.invoice-row-menu__panel {
    position: absolute;
    right: 0;
    top: calc(100% + 0.25rem);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 50;
    overflow: hidden;
}

.invoice-row-menu__link,
.invoice-row-menu__button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: #374151;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
}

.invoice-row-menu__link:hover,
.invoice-row-menu__button:hover {
    background-color: #f3f4f6;
}

.invoice-row-menu__button--success {
    color: #10b981;
}

.invoice-row-menu__button--danger {
    color: #dc2626;
}

.invoice-row-menu__icon--success {
    color: #10b981;
}

.invoice-row-menu__icon--danger {
    color: #ef4444;
}

.invoice-row-menu__icon--info {
    color: #3b82f6;
}

.invoice-row-menu__divider {
    border-top: 1px solid #e5e7eb;
    margin: 0.25rem 0;
}

/* public/css/components/material-cards.css */
.material-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.material-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius-lg);
    padding: 1.25rem;
    position: relative;
    transition: var(--transition-base);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.material-card:hover {
    border-color: var(--primary-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.material-card.is-selected {
    border-color: var(--primary-500);
    background-color: var(--primary-50);
}

.material-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.material-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.material-badge--digital {
    background-color: #eff6ff;
    color: #2563eb;
}

.material-badge--fisica {
    background-color: #fdf2f8;
    color: #db2777;
}

.material-badge--libro {
    background-color: #ecfdf5;
    color: #059669;
}

.material-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.25rem;
    border: 2px solid var(--gray-300);
    appearance: none;
    cursor: pointer;
    position: relative;
    background-color: white;
    transition: var(--transition-base);
}

.material-checkbox:checked {
    background-color: var(--primary-500);
    border-color: var(--primary-500);
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
}

.material-card__content h4 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.material-card__content p {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    margin: 0;
    line-height: 1.4;
}

/* public/css/components/material-selector.css */
/* Material Selector - Estilos para selector múltiple de materiales */

.material-selector {
    position: relative;
}

.material-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.material-dropdown__item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid var(--gray-100);
}

.material-dropdown__item:last-child {
    border-bottom: none;
}

.material-dropdown__item:hover {
    background-color: var(--gray-50);
}

.material-dropdown__item--active {
    background-color: var(--primary-50);
}

.material-dropdown__item--selected {
    background-color: var(--success-50);
    color: var(--success-700);
}

.material-dropdown__item--disabled {
    color: var(--gray-400);
    cursor: default;
    pointer-events: none;
    text-align: center;
}

.material-dropdown__item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.material-dropdown__item-name {
    flex: 1;
    font-weight: 500;
}

.material-dropdown__item-cost {
    font-size: 0.875rem;
    color: var(--gray-600);
    font-weight: 600;
}

.selected-materials {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    min-height: 2rem;
}

.material-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background-color: var(--primary-100);
    color: var(--primary-700);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
}

.material-tag__text {
    display: inline-flex;
    align-items: center;
}

.material-tag__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: none;
    color: var(--primary-700);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: color 0.15s ease;
}

.material-tag__remove:hover {
    color: var(--primary-900);
}

.material-tag__remove i {
    display: block;
}

/* Scrollbar personalizada para dropdown */
.material-dropdown::-webkit-scrollbar {
    width: 8px;
}

.material-dropdown::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.material-dropdown::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: var(--radius-full);
}

.material-dropdown::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* public/css/components/matriculacion.css */
        .matricula-step-panel {
            padding: 0.25rem 0;
        }

        .modal.matricula-modal {
            width: min(1180px, 96vw);
            max-width: 1180px;
            height: 92vh;
            max-height: 92vh;
        }

        .matricula-modal .modal__body {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            padding-right: 28px;
        }

        .matricula-modal .modal__footer {
            flex-wrap: nowrap;
        }

        .alumno-name-dropdown,
        .empresa-typeahead-dropdown {
            display: none;
            position: fixed;
            background: white;
            border: 1px solid #d1d5db;
            border-radius: 0.375rem;
            max-height: 220px;
            overflow-y: auto;
            z-index: var(--z-popover, 1060);
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
        }

        .matricula-step-panel {
            min-height: 420px;
        }

        .modal.matricula-masa-modal {
            width: min(960px, 94vw);
            max-width: 960px;
        }

        .step-block-head {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            padding: 0.85rem 0.95rem;
            border-radius: 0.5rem;
            margin-bottom: 1rem;
        }

        .step-block-head.compact {
            padding: 0.65rem 0.85rem;
            margin-bottom: 0.75rem;
        }

        .step-block-head-main {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.92rem;
            color: #1f2937;
        }

        .step-block-head-sub {
            margin-top: 0.2rem;
            color: #64748b;
            font-size: 0.81rem;
        }

        .inline-info-card {
            background: #eff6ff;
            padding: 1rem;
            border-radius: 0.5rem;
            border: 1px solid #bfdbfe;
        }

        .inline-warning-card {
            background: #fef3c7;
            padding: 1rem;
            border-radius: 0.5rem;
            border: 1px solid #fcd34d;
        }

        .result-card {
            padding: 1rem;
            border-radius: 0.5rem;
            border: 1px solid #d1d5db;
            background: #ffffff;
        }

        .curso-inline-row {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 0.75rem;
            align-items: end;
        }

        .facturacion-compact-container {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            max-width: 100%;
        }

        .facturacion-top-row {
            display: grid;
            grid-template-columns: minmax(200px, 1fr) auto;
            gap: 0.75rem;
            align-items: end;
            margin-bottom: 0.5rem;
        }

        #autocompletar-datos-section {
            justify-self: end;
            align-self: end;
        }

        .autofill-compact-toggle {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            min-height: 32px;
            padding: 0.35rem 0.6rem;
            border-radius: 0.375rem;
            border: 1px solid #bfdbfe;
            background: #eff6ff;
            color: #1d4ed8;
            cursor: pointer;
            font-weight: 500;
            white-space: nowrap;
            font-size: 0.75rem;
        }

        .autofill-compact-toggle input[type="checkbox"] {
            margin: 0;
            transform: translateY(1px);
        }

        .facturacion-form-grid {
            display: grid;
            gap: 0.5rem;
        }

        .facturacion-row-2col {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.6rem;
            align-items: end;
        }

        .facturacion-row-3col {
            display: grid;
            grid-template-columns: 2fr 1fr 1fr;
            gap: 0.6rem;
            align-items: end;
        }

        .fundae-compact-toggle {
            transition: all 0.2s;
        }

        .fundae-compact-toggle:hover {
            background: #fef3c7 !important;
        }

        @media (min-width: 1180px) {
            #step-facturacion[data-billing-layout="split"] .facturacion-compact-container {
                display: grid;
                grid-template-columns: minmax(320px, 0.9fr) minmax(440px, 1.1fr);
                gap: 1rem 1.25rem;
                align-items: start;
            }

            #step-facturacion[data-billing-layout="split"] .facturacion-top-row {
                grid-column: 1 / -1;
                margin-bottom: 0;
            }

            #step-facturacion[data-billing-layout="split"] #empresa-search-section,
            #step-facturacion[data-billing-layout="split"] #empresa-contacto-section,
            #step-facturacion[data-billing-layout="split"] #fundae-section {
                grid-column: 1;
                margin-bottom: 0;
            }

            #step-facturacion[data-billing-layout="split"] #facturacion-form {
                grid-column: 2;
                grid-row: 2 / span 4;
                align-self: start;
            }

            #step-facturacion #facturacion-form[data-billing-layout="full-width"] {
                grid-column: 1 / -1;
                grid-row: auto;
            }
        }

        .step-block-head.compact {
            padding: 0.5rem 0.8rem !important;
            margin-bottom: 0.5rem !important;
        }

        .step-block-head.compact strong {
            font-size: 0.85rem !important;
        }

        .step-block-head.compact i {
            font-size: 1rem !important;
        }

        #matricula-breadcrumb .breadcrumb-step {
            transition: all 0.15s ease;
        }

        #matricula-breadcrumb .breadcrumb-step:hover {
            border-color: #93c5fd;
            color: #1d4ed8;
        }

        #step-master .master-payment-panel {
            margin-top: 1.5rem;
            padding: 1rem;
            background: #f8fafc;
            border-radius: 0.5rem;
            border: 1px solid #d7dee7;
        }

        #step-master .master-payment-subtitle {
            margin: 0 0 1rem;
            color: #64748b;
            font-size: 0.875rem;
            line-height: 1.45;
        }

        #step-master .master-payment-method-options {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.75rem;
        }

        #step-master .master-payment-method-option {
            display: block;
            padding: 0.75rem 0.875rem;
            border-radius: 0.5rem;
            border: 1px solid #d1d5db;
            background: #ffffff;
            cursor: pointer;
            transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
        }

        #step-master .master-payment-method-option input[type="radio"] {
            margin-right: 0.45rem;
            transform: translateY(1px);
        }

        #step-master .master-payment-method-option-title {
            font-weight: 600;
            color: #1f2937;
        }

        #step-master .master-payment-method-option-help {
            display: block;
            margin-top: 0.35rem;
            color: #6b7280;
            font-size: 0.78rem;
            line-height: 1.35;
        }

        #step-master .master-payment-method-option.is-active {
            border-color: #3b82f6;
            background: #eff6ff;
            box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
        }

        #step-master .master-unico-info {
            margin-bottom: 0.9rem;
            padding: 0.75rem 0.875rem;
            border-radius: 0.5rem;
            border: 1px solid #dbeafe;
            background: #f8fbff;
        }

        #step-master .master-cuotas-card {
            padding: 1rem;
            background: #ffffff;
            border-radius: 0.5rem;
            border: 1px solid #c4b5fd;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
        }

        @media (max-width: 860px) {
            .modal.matricula-modal {
                width: min(100vw, 100%);
                max-height: 100vh;
                border-radius: 22px;
            }

            .matricula-modal .modal__body {
                max-height: calc(100vh - 156px);
                padding-right: 24px;
            }

            .curso-inline-row {
                grid-template-columns: 1fr;
            }

            .facturacion-top-row,
            .facturacion-row-2col,
            .facturacion-row-3col {
                grid-template-columns: 1fr;
            }

            #autocompletar-datos-section {
                justify-self: stretch;
            }

            .autofill-compact-toggle {
                width: 100%;
                justify-content: center;
            }

            #step-master .master-payment-method-options {
                grid-template-columns: 1fr;
            }

            #matricula-precio-final[readonly]:hover {
                cursor: not-allowed;
            }

            #matricula-precio-final[readonly]:hover+.lock-icon {
                display: block !important;
            }
        }

/* public/css/components/modal.css */
/**
 * ============================================================================
 *    MODAL COMPONENT
 * ============================================================================
 * Componente de ventanas modales con tokens CSS centralizados.
 * Diseñado para 1920x1080 - toda información visible sin scroll.
 * 
 * Tokens requeridos: design-tokens.css
 * ============================================================================
 */

/* -----------------------------------------------------------------------------
   Overlay (fondo oscuro)
   ----------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--modal-overlay-bg);
    z-index: var(--modal-overlay-z-index);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--modal-overlay-transition) ease-in-out;
    backdrop-filter: blur(var(--modal-overlay-blur));
}

.modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

/* -----------------------------------------------------------------------------
   Modal principal
   ----------------------------------------------------------------------------- */
.modal {
    background-color: var(--modal-bg);
    border-radius: 28px; /* Material 3 standard for large dialogs */
    width: var(--modal-width);
    max-width: var(--modal-max-width);
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.18), 0 0 1px rgba(0, 0, 0, 0.1);
    transform: scale(var(--modal-transform-scale));
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    border: none;
    overflow: hidden;
}

/* Para dialog element */
dialog.modal:not([open]) {
    display: none;
}

dialog.modal[open] {
    display: flex;
}

.modal-overlay.is-open .modal {
    transform: scale(1);
}

/* -----------------------------------------------------------------------------
   Header
   ----------------------------------------------------------------------------- */
.modal__header {
    padding: var(--modal-header-padding);
    border-bottom: var(--modal-header-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal__title {
    font-size: var(--modal-title-font-size);
    font-weight: var(--modal-title-font-weight);
    color: var(--modal-title-color);
    margin: 0;
}

/* -----------------------------------------------------------------------------
   Botón cerrar
   ----------------------------------------------------------------------------- */
.modal__close {
    background: none;
    border: none;
    color: var(--modal-close-color);
    cursor: pointer;
    padding: var(--modal-close-padding);
    border-radius: var(--modal-close-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal__close:hover {
    background-color: var(--modal-close-bg-hover);
    color: var(--modal-close-hover-color);
}

/* -----------------------------------------------------------------------------
   Body
   ----------------------------------------------------------------------------- */
.modal__body {
    padding: 24px 32px;
    color: var(--modal-body-color);
    font-size: var(--modal-body-font-size);
    line-height: var(--modal-body-line-height);
}

/* -----------------------------------------------------------------------------
   Footer
   ----------------------------------------------------------------------------- */
.modal__footer {
    padding: var(--modal-footer-padding);
    background-color: var(--modal-footer-bg);
    border-top: var(--modal-footer-border);
    border-bottom-left-radius: var(--modal-footer-radius-bottom);
    border-bottom-right-radius: var(--modal-footer-radius-bottom);
    display: flex;
    justify-content: flex-end;
    gap: var(--modal-footer-gap);
}

/* -----------------------------------------------------------------------------
   Variante Large
   ----------------------------------------------------------------------------- */
.modal__content--lg {
    max-width: var(--modal-lg-max-width);
    width: 100%;
}

/* -----------------------------------------------------------------------------
   Info Grid
   ----------------------------------------------------------------------------- */
.modal-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--modal-info-grid-min-width), 1fr));
    gap: var(--modal-info-grid-gap);
    margin-bottom: var(--modal-section-margin);
}

.modal-info-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.modal-info-label {
    font-size: var(--modal-info-label-font-size);
    font-weight: var(--modal-info-label-font-weight);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--modal-info-label-color);
}

.modal-info-value {
    font-size: var(--modal-info-value-font-size);
    color: var(--modal-info-value-color);
    font-weight: var(--modal-info-value-weight);
}

/* -----------------------------------------------------------------------------
   Modal Sections
   ----------------------------------------------------------------------------- */
.modal-section {
    margin-bottom: var(--modal-section-margin);
    padding-bottom: var(--modal-section-padding);
    border-bottom: var(--modal-section-border);
}

.modal-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.modal-section h3 {
    font-size: var(--text-base);
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-900);
    margin-bottom: var(--space-4);
}

/* -----------------------------------------------------------------------------
   Financial Grid
   ----------------------------------------------------------------------------- */
.modal-financial-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--modal-finance-grid-gap);
}

.financial-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--modal-finance-item-padding);
    background-color: var(--modal-finance-item-bg);
    border-radius: var(--radius);
}

.financial-item--highlight {
    grid-column: 1 / -1;
    background-color: var(--modal-finance-highlight-bg);
    border-left: var(--modal-finance-highlight-left-width) solid var(--modal-finance-highlight-border);
    font-weight: var(--font-weight-semibold);
}

.financial-item--sub {
    background-color: white;
    border: var(--border-width) solid var(--color-gray-200);
    font-size: var(--text-sm);
}

.financial-item--sub .financial-label {
    color: var(--color-gray-600);
}

.financial-label {
    font-size: var(--text-sm);
    color: var(--color-gray-700);
}

.financial-value {
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-900);
}

/* -----------------------------------------------------------------------------
   Rentability Section
   ----------------------------------------------------------------------------- */
.modal-rentability {
    display: flex;
    flex-direction: column;
    gap: var(--modal-rent-gap);
}

.rentability-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--modal-rent-padding);
    background: linear-gradient(135deg, var(--color-success-50) 0%, var(--color-success-100) 100%);
    border-radius: var(--modal-rent-radius);
    border-left: var(--modal-rent-border-width) solid var(--color-success-500);
}

.rentability-label {
    font-size: var(--modal-rent-label-size);
    font-weight: var(--font-weight-semibold);
    color: var(--color-success-700);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rentability-value {
    font-size: var(--modal-rent-value-size);
    font-weight: var(--font-weight-bold);
    color: var(--color-success-900);
}

.modal-rentability small {
    display: block;
    font-size: var(--text-xs);
    color: var(--color-gray-500);
    margin-top: var(--space-2);
    font-style: italic;
}

/* -----------------------------------------------------------------------------
   Grupo Modal Layout (específico de grupos)
   ----------------------------------------------------------------------------- */
.grupo-modal .modal__body {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8), rgba(255, 255, 255, 0.9));
}

.grupo-modal__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
    gap: var(--space-6);
}

.grupo-modal__column--primary {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.grupo-modal__column--side {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* -----------------------------------------------------------------------------
   Grupo Panels (específico)
   ----------------------------------------------------------------------------- */
.grupo-panel {
    background-color: white;
    border-radius: var(--radius-xl);
    padding: var(--space-5) var(--space-6);
    border: var(--border-width) solid var(--color-gray-100);
    box-shadow: var(--shadow-xl);
}

.grupo-panel--info {
    padding-bottom: var(--space-4);
}

.grupo-panel__header {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    margin-bottom: var(--space-4);
}

.grupo-panel__header--split {
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
}

.grupo-panel__header h3 {
    margin: 0;
    font-size: var(--text-base);
    color: var(--color-gray-900);
}

.grupo-panel__hint {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
}

.grupo-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-5);
}

.grupo-info__label {
    text-transform: uppercase;
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    color: var(--color-gray-500);
    margin-bottom: var(--space-1);
}

.grupo-info__value {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-900);
}

.grupo-costs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
}

.grupo-cost-card {
    border-radius: var(--radius-lg);
    border: var(--border-width) solid var(--color-gray-100);
    padding: var(--space-4);
    background-color: white;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.03);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.grupo-cost-card--primary {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(224, 231, 255, 0.7), rgba(247, 244, 255, 0.95));
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: var(--shadow-xl);
}

.grupo-cost-card__label {
    font-size: var(--text-sm);
    color: var(--color-gray-600);
}

.grupo-cost-card__value {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-bold);
    color: var(--color-gray-900);
}

.grupo-cost-card__meta {
    font-size: var(--text-xs);
    color: var(--color-gray-500);
}

.grupo-summary-card {
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    background-color: white;
    border: var(--border-width) solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--shadow-xl);
}

.grupo-summary-card--meta {
    padding: var(--space-5);
}

.grupo-summary__eyebrow {
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-gray-500);
    margin-bottom: var(--space-2);
}

.grupo-summary__value {
    font-size: clamp(2rem, 3vw, 2.75rem);
    font-weight: var(--font-weight-bold);
    color: var(--color-gray-900);
    margin: 0;
}

.grupo-summary__subtitle {
    margin: var(--space-1) 0;
    color: var(--color-gray-600);
    font-size: var(--text-sm);
}

.grupo-summary__footnote {
    display: block;
    font-size: var(--text-xs);
    color: var(--color-gray-500);
}

.grupo-summary__metrics {
    margin-top: var(--space-3);
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    font-size: var(--text-sm);
    color: var(--color-gray-600);
}

.grupo-summary__metrics strong {
    color: var(--color-gray-900);
    margin-right: var(--space-1);
}

.grupo-meta-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.grupo-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-sm);
}

.grupo-meta-label {
    color: var(--color-gray-500);
}

.grupo-meta-value {
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-900);
}

/* -----------------------------------------------------------------------------
   Table Compact for Modal
   ----------------------------------------------------------------------------- */
.table--compact {
    font-size: var(--text-sm);
}

.table--compact th,
.table--compact td {
    padding: var(--space-2) var(--space-3);
}

.table--compact thead {
    background-color: var(--color-gray-50);
}

/* -----------------------------------------------------------------------------
   Materiales List in Modal
   ----------------------------------------------------------------------------- */
#modal-materiales-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#modal-materiales-list li {
    padding: var(--space-2) var(--space-3);
    border-left: 3px solid var(--primary-500);
    background-color: var(--color-gray-50);
    margin-bottom: var(--space-2);
    border-radius: var(--radius);
}

/* -----------------------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------------------- */
@media (max-width: 960px) {
    .grupo-modal__layout {
        grid-template-columns: 1fr;
    }

    .grupo-modal__column--side {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .grupo-summary-card {
        flex: 1 1 280px;
    }
}

@media (max-width: 768px) {
    .modal__content--lg {
        max-width: 95%;
    }

    .modal-financial-grid {
        grid-template-columns: 1fr;
    }

    .financial-item--highlight {
        grid-column: 1;
    }

    .rentability-value {
        font-size: var(--text-xl);
    }
}

/* public/css/components/pagination.css */
/**
 * ============================================================================
 *    PAGINATION COMPONENT
 * ============================================================================
 * Componente de paginación modernizado con tokens CSS centralizados.
 * Diseñado para 1920x1080 - toda la información visible sin scroll.
 * 
 * Tokens requeridos: design-tokens.css
 * ============================================================================
 */

/* -----------------------------------------------------------------------------
   Contenedor principal
   ----------------------------------------------------------------------------- */
.pagination-container {
    display: flex;
    justify-content: var(--pagination-container-justify);
    align-items: var(--pagination-container-align);
    gap: var(--pagination-container-gap);
    padding-top: var(--pagination-container-padding-y);
    padding-bottom: var(--pagination-container-padding-y);
    width: 100%;
}

/* Wrapper para los números de página */
.pagination-pages {
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

/* -----------------------------------------------------------------------------
   Botones de página (números)
   ----------------------------------------------------------------------------- */
.pagination-link,
.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: var(--pagination-btn-min-width);
    height: var(--pagination-btn-height);
    padding-left: var(--pagination-btn-padding-x);
    padding-right: var(--pagination-btn-padding-x);
    background-color: var(--pagination-btn-bg);
    border: var(--border-width) solid var(--pagination-btn-border);
    border-radius: var(--pagination-btn-radius);
    color: var(--pagination-btn-color);
    font-size: var(--pagination-btn-font-size);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--pagination-btn-transition);
    user-select: none;
}

/* Hover */
.pagination-link:hover,
.pagination-btn:hover {
    background-color: var(--pagination-btn-hover-bg);
    border-color: var(--pagination-btn-hover-border);
    color: var(--pagination-btn-hover-color);
}

/* Active (página actual) */
.pagination-link.is-active,
.pagination-btn.is-active,
.pagination-link.pagination-current,
.pagination-btn.pagination-current {
    background-color: var(--pagination-btn-active-bg);
    border-color: var(--pagination-btn-active-border);
    color: var(--pagination-btn-active-color);
    box-shadow: var(--pagination-btn-active-shadow);
    cursor: default;
}

/* Disabled */
.pagination-link.is-disabled,
.pagination-btn.is-disabled,
.pagination-link.pagination-disabled,
.pagination-btn.pagination-disabled {
    opacity: var(--pagination-btn-disabled-opacity);
    pointer-events: var(--pagination-btn-disabled-pointer-events);
    cursor: not-allowed;
}

/* -----------------------------------------------------------------------------
   Botones Anterior/Siguiente
   ----------------------------------------------------------------------------- */
.pagination-prev,
.pagination-next,
a.pagination-link.pagination-nav {
    padding-left: var(--pagination-nav-padding-x);
    padding-right: var(--pagination-nav-padding-x);
    min-width: var(--pagination-nav-min-width);
    white-space: nowrap;
}

/* -----------------------------------------------------------------------------
   Ellipsis (...)
   ----------------------------------------------------------------------------- */
.pagination-ellipsis,
.pagination-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: var(--pagination-btn-min-width);
    height: var(--pagination-btn-height);
    padding-left: var(--pagination-ellipsis-padding-x);
    padding-right: var(--pagination-ellipsis-padding-x);
    color: var(--pagination-ellipsis-color);
    font-size: var(--pagination-btn-font-size);
}

/* -----------------------------------------------------------------------------
   Info de resultados (texto "Mostrando 1-10 de 22")
   ----------------------------------------------------------------------------- */
.results-info,
.pagination-info {
    color: var(--pagination-info-color);
    font-size: var(--pagination-info-font-size);
    margin: 0;
}

.pagination-info-text {
    color: var(--pagination-info-color);
    font-size: var(--pagination-info-font-size);
}

/* -----------------------------------------------------------------------------
   Selector de items por página
   ----------------------------------------------------------------------------- */
.pagination-per-page {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.pagination-per-page-label {
    color: var(--pagination-info-color);
    font-size: var(--pagination-info-font-size);
    white-space: nowrap;
}

.pagination-per-page select,
.pagination-per-page-input {
    height: var(--pagination-per-page-height);
    padding-left: var(--space-2);
    padding-right: var(--space-2);
    background-color: var(--pagination-per-page-bg);
    border: var(--border-width) solid var(--pagination-per-page-border);
    border-radius: var(--pagination-btn-radius);
    color: var(--pagination-per-page-color);
    font-size: var(--text-sm);
}

/* -----------------------------------------------------------------------------
   Variante compacta (para espacios reducidos)
   ----------------------------------------------------------------------------- */
.pagination-container--compact {
    gap: var(--space-1);
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
}

.pagination-container--compact .pagination-link,
.pagination-container--compact .pagination-btn {
    min-width: 2rem;
    height: 2rem;
    font-size: var(--text-xs);
}

/* -----------------------------------------------------------------------------
   Estados vacío
   ----------------------------------------------------------------------------- */
.pagination-empty {
    display: none;
}

/* -----------------------------------------------------------------------------
   Responsive (móviles)
   ----------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .pagination-container {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination-pages {
        order: 2;
        width: 100%;
        justify-content: center;
        margin-top: var(--space-2);
    }
    
    .pagination-prev,
    .pagination-next {
        order: 1;
    }
    
    .pagination-info {
        order: 3;
        width: 100%;
        text-align: center;
    }
}

/* public/css/components/profesor-courses.css */
/* Profesor courses assignment panel */
.profesor-courses-card .general-card__grid {
    display: block;
}

.profesor-courses {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.profesor-courses__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.profesor-courses__search {
    flex: 1 1 auto;
    max-width: 44rem;
}

.profesor-courses__search .filters__search-input {
    min-height: 2.5rem;
    border-radius: var(--radius-lg);
    background: var(--surface-card);
}

.profesor-courses__visible-count {
    flex: 0 0 auto;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.profesor-courses__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) minmax(18rem, 0.9fr);
    gap: 1rem;
    align-items: start;
}

.profesor-courses__catalog,
.profesor-courses__selected {
    min-width: 0;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--surface-card);
    box-shadow: var(--shadow-sm);
}

.profesor-courses__selected {
    position: sticky;
    top: 0.75rem;
}

.profesor-courses__panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.95rem 1rem;
    border-bottom: 1px solid var(--gray-100);
}

.profesor-courses__panel-heading h3 {
    margin: 0;
    color: var(--gray-900);
    font-size: var(--font-size-base);
    font-weight: 700;
}

.profesor-courses__panel-heading p {
    margin: 0.2rem 0 0;
    color: var(--gray-500);
    font-size: var(--font-size-xs);
}

.profesor-courses__panel-heading--compact {
    padding-bottom: 0.8rem;
}

.profesor-courses__selected-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.55rem;
    height: 1.55rem;
    margin-left: 0.35rem;
    padding: 0 0.45rem;
    border-radius: var(--radius-full);
    background: var(--primary-50);
    color: var(--primary-800);
    font-size: var(--font-size-xs);
    font-weight: 800;
    vertical-align: middle;
}

.profesor-courses__table-shell {
    max-height: min(29rem, calc(100vh - 25rem));
    min-height: 22rem;
    overflow: auto;
    border: 0;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.profesor-courses__table {
    width: 100%;
    table-layout: fixed;
}

.profesor-courses__table th,
.profesor-courses__table td {
    vertical-align: middle;
}

.profesor-courses__table th:nth-child(1),
.profesor-courses__table td:nth-child(1) { width: 3rem; }
.profesor-courses__table th:nth-child(2),
.profesor-courses__table td:nth-child(2) { width: 6.5rem; }
.profesor-courses__table th:nth-child(4),
.profesor-courses__table td:nth-child(4) { width: 8rem; }
.profesor-courses__table th:nth-child(5),
.profesor-courses__table td:nth-child(5) { width: 5rem; }

.profesor-courses__check-cell {
    text-align: center;
}

.profesor-courses__code {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.45rem;
    border-radius: var(--radius-sm);
    background: var(--primary-50);
    color: var(--primary-800);
    font-size: var(--font-size-xs);
    font-weight: 800;
    letter-spacing: 0.02em;
}

.profesor-courses__course-name {
    display: block;
    color: var(--gray-900);
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1.35;
}

.profesor-courses__theme {
    display: block;
    overflow: hidden;
    color: var(--gray-500);
    font-size: var(--font-size-xs);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profesor-courses__hours {
    color: var(--gray-800);
    font-size: var(--font-size-xs);
    font-weight: 800;
}

.profesor-courses__table .curso-row {
    cursor: pointer;
}

.profesor-courses__table .curso-row.is-selected {
    background: var(--primary-50);
    box-shadow: inset 3px 0 0 var(--primary-600);
}

.profesor-courses__table .curso-row.is-selected:hover {
    background: var(--primary-100);
}

.profesor-courses__empty,
.profesor-courses__selected-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 14rem;
    padding: 2rem;
    color: var(--gray-500);
    text-align: center;
}

.profesor-courses__empty[hidden] {
    display: none;
}

.profesor-courses__empty .material-symbols-outlined,
.profesor-courses__selected-empty .material-symbols-outlined {
    color: var(--gray-400);
    font-size: 2rem;
}

.profesor-courses__empty strong,
.profesor-courses__selected-empty strong {
    color: var(--gray-800);
    font-size: var(--font-size-sm);
}

.profesor-courses__empty span:not(.material-symbols-outlined),
.profesor-courses__selected-empty span:not(.material-symbols-outlined) {
    font-size: var(--font-size-xs);
}

.profesor-courses__selected-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-height: min(29rem, calc(100vh - 25rem));
    min-height: 22rem;
    overflow-y: auto;
    padding: 0.85rem;
}

.profesor-course-chip {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--gray-50);
    transition: border-color var(--transition-fast), background-color var(--transition-fast), box-shadow var(--transition-fast);
}

.profesor-course-chip:hover {
    border-color: var(--primary-200);
    background: var(--surface-card);
    box-shadow: var(--shadow-sm);
}

.profesor-course-chip__content {
    min-width: 0;
}

.profesor-course-chip__code {
    display: inline-flex;
    margin-bottom: 0.25rem;
    color: var(--primary-700);
    font-size: var(--font-size-xs);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.profesor-course-chip__label {
    display: block;
    color: var(--gray-800);
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1.35;
}

.profesor-course-chip__remove {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-full);
    background: var(--surface-card);
    color: var(--gray-500);
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.profesor-course-chip__remove:hover,
.profesor-course-chip__remove:focus-visible {
    border-color: var(--danger-border);
    background: var(--danger-bg);
    color: var(--danger-text);
    outline: none;
}

.profesor-course-chip__remove .material-symbols-outlined {
    font-size: 1rem;
}

@media (max-width: 1200px) {
    .profesor-courses__layout {
        grid-template-columns: 1fr;
    }

    .profesor-courses__selected {
        position: static;
    }
}

@media (max-width: 768px) {
    .profesor-courses__toolbar,
    .profesor-courses__panel-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .profesor-courses__search {
        max-width: none;
        width: 100%;
    }

}

/* public/css/components/profesor-form.css */
/* Profesor edit form refinements */
#panel-general .checkbox-wrapper--simple {
    gap: 0.65rem;
    color: var(--gray-800);
}

#panel-general .checkbox-wrapper--simple:hover {
    background: transparent;
    border: 0;
}

#panel-general .profesor-active-toggle {
    margin-top: 2.5rem;
}

#panel-general .profesor-description-field,
#panel-general .profesor-description-field .form-group__control {
    min-width: 0;
}

#panel-general .profesor-description-field .rich-editor-container {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--gray-300) !important;
    border-radius: var(--radius) !important;
    background: var(--surface-card);
}

#panel-general .profesor-description-field .ql-toolbar,
#panel-general .profesor-description-field .ql-container {
    max-width: 100%;
}

#panel-general .profesor-description-field .ql-container {
    min-height: 0;
}

#panel-general .profesor-description-field .ql-editor {
    min-height: 6.75rem !important;
}

/* public/css/components/rich-editor.css */
/* Rich Editor (Quill) Component Styles */
/* Integrate Quill with the app's design system */

.rich-editor-container {
    /* Basic styling already in JS, but can override here if needed */
}

/* Quill toolbar styling */
.ql-toolbar {
    border: none !important;
    border-bottom: 1px solid var(--gray-300) !important;
    border-radius: 0.5rem 0.5rem 0 0 !important;
    background: var(--gray-50) !important;
    padding: 0.5rem !important;
}

.ql-toolbar .ql-picker-label {
    color: var(--gray-700) !important;
}

.ql-toolbar .ql-stroke {
    stroke: var(--gray-600) !important;
}

.ql-toolbar .ql-fill {
    fill: var(--gray-600) !important;
}

.ql-toolbar button:hover {
    background: var(--gray-200) !important;
}

.ql-toolbar button.ql-active {
    background: var(--primary-100) !important;
    color: var(--primary-700) !important;
}

/* Quill editor container */
.ql-container {
    border: none !important;
    border-radius: 0 0 0.5rem 0.5rem !important;
    font-family: inherit !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
}

.ql-editor {
    padding: 1rem !important;
    min-height: 120px !important;
    color: var(--gray-900) !important;
}

.ql-editor.ql-blank::before {
    color: var(--gray-500) !important;
    font-style: normal !important;
}

/* Focus states */
.ql-toolbar:focus-within,
.ql-container:focus-within {
    border-color: var(--primary-300) !important;
    box-shadow: 0 0 0 3px var(--primary-100) !important;
}

/* Hide Quill's default border since we handle it */
.ql-editor {
    border: none !important;
}

/* Ensure proper spacing in forms */
.rich-editor-container + .form-help {
    margin-top: 0.5rem;
}

/* public/css/components/select-component.css */
/**
 * Smart Select Component Styles
 * Overrides for TomSelect to match ERP theme
 */

:root {
    --ts-pr-min: 0.75rem;
    --ts-pr-clear-button: 0em;
    --ts-pr-caret: 0em;
}

.ts-wrapper.single .ts-control, 
.ts-wrapper.multi .ts-control {
    border: 1px solid var(--gray-300);
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.5;
    box-shadow: none;
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.ts-wrapper.focus .ts-control {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.ts-dropdown {
    border: 1px solid var(--gray-200);
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-top: 0.25rem;
    z-index: 50;
}

.ts-dropdown .option {
    padding: 0.5rem 0.75rem;
}

.ts-dropdown .active {
    background-color: var(--primary-50);
    color: var(--primary-900);
}

.ts-wrapper.multi .ts-control > div {
    background-color: var(--primary-100);
    color: var(--primary-800);
    border: 1px solid var(--primary-200);
    border-radius: 0.25rem;
    padding: 0.125rem 0.5rem;
}

.ts-wrapper.plugin-remove_button .item .remove {
    border-left: 1px solid var(--primary-200);
    color: var(--primary-700);
}

.ts-wrapper.plugin-remove_button .item .remove:hover {
    background-color: var(--primary-200);
}

.no-results {
    padding: 0.75rem;
    color: var(--gray-500);
    text-align: center;
    font-style: italic;
}

/* public/css/components/sidebar-premium.css */
/**
 * ============================================================================
 *    ERP ENSENYEM - SIDEBAR PREMIUM LAYER
 * ============================================================================
 * Este archivo moderniza la barra lateral con efectos de profundidad,
 * glassmorphism y micro-animaciones.
 * ============================================================================
 */

.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border-color);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    z-index: var(--z-sticky);
    transition: width var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
}

/* Header & Brand */
.sidebar__header {
    height: 56px; /* Altura estándar Google */
    padding: 0 var(--space-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid transparent;
}

.sidebar__brand {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-700);
    letter-spacing: -0.01em;
}
.sidebar__nav {
    gap: 0 !important; /* Sin espacio entre botones */
    padding: 0.25rem 0 !important; /* Padding vertical mínimo */
}

/* Nav Links */
.sidebar__nav-link {
    margin: 1px 0.5rem; /* Margen vertical de solo 1px */
    padding: 0.35rem 0.875rem; /* Padding vertical reducido */
    border-radius: 9999px; 
    color: var(--color-gray-600);
    font-weight: 400;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    transition: all var(--transition-base) ease;
}

.sidebar__nav-link:hover {
    background: var(--color-gray-100);
    color: var(--primary-700);
    transform: none; /* Google no usa traslación lateral en hover */
}

.sidebar__nav-link.is-active {
    background: var(--primary-100); /* Un poco más de presencia para la píldora */
    color: var(--primary-800);
    font-weight: 500;
}

.sidebar__nav-icon {
    font-size: 1.125rem;
    margin-right: 0.75rem; /* Google usa menos espacio entre icono y texto */
    transition: transform var(--transition-base) ease;
    opacity: 0.75;
}

.sidebar__nav-link.is-active .sidebar__nav-icon {
    opacity: 1;
    color: var(--primary-700);
}

.sidebar__nav-link:hover .sidebar__nav-icon {
    opacity: 1;
}

/* Groups & Titles */
.sidebar__nav-group {
    margin-top: 0.5rem; /* Reducido al mínimo */
}

.sidebar__group-title {
    padding: 0 1.5rem;
    margin-bottom: 0.125rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-gray-400);
    opacity: 0.7;
}

/* Submenus */
.sidebar__submenu {
    margin: 0;
    padding-left: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    max-height: 0;
    transition: all var(--transition-slow) ease-out;
    opacity: 0;
}

.sidebar__nav-link[aria-expanded="true"] + .sidebar__submenu,
.sidebar__submenu.is-open {
    margin: 0.125rem 0.75rem 0.5rem 0.75rem;
    padding-left: 2rem;
    max-height: 800px;
    opacity: 1;
    gap: 0.125rem;
}

.sidebar__submenu-link {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    color: var(--color-gray-500);
    font-size: 0.75rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast) ease;
}

.sidebar__submenu-link i {
    font-size: 1rem;
    opacity: 0.7;
}

.sidebar__submenu-link:hover {
    color: var(--primary-600);
    background: var(--color-gray-50);
}

.sidebar__submenu-link.is-active {
    color: var(--primary-700);
    font-weight: 600;
    background: white;
    box-shadow: var(--shadow-sm);
}

/* Footer & User */
.sidebar__footer {
    margin-top: auto;
    padding: 0.5rem 0.75rem; /* Aún más compacto */
    border-top: 1px solid var(--color-gray-100);
}

.sidebar__user-section {
    background: var(--color-gray-50);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar__user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.sidebar__user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
    box-shadow: 0 2px 8px rgba(130, 3, 3, 0.15);
}

.sidebar__user-details {
    display: flex;
    flex-direction: column;
}

.sidebar__user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-gray-800);
    line-height: 1.2;
}

.sidebar__user-role {
    font-size: 0.6875rem;
    color: var(--color-gray-500);
    text-transform: capitalize;
}

.sidebar__logout-link {
    margin-top: 0.125rem;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-danger-500);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast) ease;
}

.sidebar__logout-link:hover {
    background: var(--color-danger-50);
}

/* Toggle Rotation */
.sidebar__toggle-icon {
    transition: transform var(--transition-base) ease;
}

.sidebar__nav-link[aria-expanded="true"] .sidebar__toggle-icon {
    transform: rotate(180deg);
}

/* Glassmorphism Support */
@supports (backdrop-filter: blur(12px)) {
    .sidebar {
        background: rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(12px);
    }
}

/* public/css/components/sidebar.css */
/* Sidebar Component - Complemento de style.css */

/* Separador entre bloques de navegación */
.sidebar__separator {
    height: 1px;
    background-color: var(--sidebar-border-color);
    margin: 0.5rem 0.75rem;
    opacity: 0.4;
}

.sidebar.is-collapsed .sidebar__separator {
    margin: 0.5rem 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        top: auto;
        height: auto;
    }
}

/* Scrollbar personalizado */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: var(--radius-full);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-400);
}

/* public/css/components/tables.css */
/* Table Components */

/* 1. Interactive Rows */
.table-interactive tbody tr {
    cursor: pointer;
    transition: background-color 0.15s ease;
    border-bottom: 1px solid var(--gray-100) !important;
    border: none !important;
    outline: none !important;
}

.table-interactive tbody tr:last-child {
    border-bottom: none;
}

.table-interactive tbody tr:hover {
    background-color: var(--gray-50);
}

.cost-breakdown {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
    max-width: 100%;
    white-space: nowrap;
}

.cost-breakdown__values {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gray-700);
}

.cost-breakdown__indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-500);
    flex: 0 0 auto;
}

.cost-breakdown__indicator .material-symbols-outlined {
    font-size: 0.95rem;
}

.cost-breakdown__indicator--profit {
    background: var(--success-bg);
    color: var(--success-text);
}

.cost-breakdown__indicator--loss {
    background: var(--danger-bg);
    color: var(--danger-text);
}

.cost-breakdown__indicator--insufficient {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* 2. Sticky Headers */
.table-wrapper {
    position: relative;
    overflow-x: auto;
}

/* ============================================================
   TABLE-FIT-COLS — comportamiento profesional para tablas con
   muchas columnas (.table-fit-cols + .table-wrapper--scrollable):
     · Cada celda trunca su contenido con "…" (sin desbordar al vecino).
     · Min-width por columna definido en <th style="min-width">.
     · Si la suma supera el viewport, scroll horizontal en el wrapper.
     · Headers en una sola línea, alineados verticalmente.
   ============================================================ */

.table-wrapper--scrollable {
    overflow-x: auto;
    overflow-y: hidden;
}

.table-fit-cols td[data-col],
.table-fit-cols th[data-col] {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
    vertical-align: middle;
}

/* Los headers fuerzan una sola línea (labels ya están acortados en PHP). */
.table-fit-cols thead th[data-col] {
    white-space: nowrap;
}

/* Hijos directos de las celdas: heredan el truncado para que <span>/<div> con el
   texto real también muestren "…" en lugar de desbordar al vecino. */
.table-fit-cols td[data-col] > span,
.table-fit-cols td[data-col] > a,
.table-fit-cols td[data-col] > div {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

/* Excepción: celdas con layout flex (alumnos, modalidad center, etc.) preservan
   su alineado y delegan el truncado al hijo interno. */
.table-fit-cols td[data-col] > .flex,
.table-fit-cols td[data-col] > .inline-flex {
    display: flex;
    max-width: 100%;
    overflow: hidden;
}
.table-fit-cols td[data-col] > .flex > *,
.table-fit-cols td[data-col] > .inline-flex > * {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Badges, pills y similares dentro de celdas: no se estiran fuera. */
.table-fit-cols td[data-col] .badge,
.table-fit-cols td[data-col] .pill,
.table-fit-cols td[data-col] .chip {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Columna spacer al final: sin width fijo. Cuando la suma de columnas reales es
   menor que el wrapper, esta absorbe el remanente y la tabla queda alineada al
   100% del wrapper sin estirar las columnas con contenido. Cuando la suma
   excede el wrapper, el spacer colapsa a 0 y aparece scroll horizontal. */
.table-fit-cols th[data-spacer],
.table-fit-cols td[data-spacer] {
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
}

.table-container--full-height {
    height: 100%;
    max-height: 100%;
    overflow: auto;
}

.table-sticky thead th {
    position: sticky;
    top: 0;
    background-color: var(--surface-header);
    z-index: 10;
    border-bottom: 2px solid var(--gray-100);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
}

/* 3. Contextual Actions */
.table-actions {
    opacity: 0.2;
    transition: opacity 0.2s ease;
    display: flex;
    gap: 0.05rem;
    justify-content: flex-end;
    align-items: center;
}

/* Show actions on hover */
.table-interactive tbody tr:hover .table-actions {
    opacity: 1;
}

/* Always show actions if a focusable element inside is focused (accessibility) */
.table-interactive tbody tr:focus-within .table-actions {
    opacity: 1;
}

/* Mobile fallback: always show actions on small screens */
@media (max-width: 768px) {
/* Quitar bold de nombres en tablas */
.table-interactive td {
    font-weight: 400 !important;
}

.table-actions {
        opacity: 1;
    }
}

td.clickable-row, .clickable-row td {
    cursor: pointer;
}

/* 4. Empty States */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background-color: var(--color-gray-50);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--color-gray-200);
    color: var(--color-gray-500);
    margin-top: 1rem;
}

.empty-state__icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--color-gray-400);
}

.empty-state__title {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-700);
    margin-bottom: 0.5rem;
}

.empty-state__description {
    max-width: 400px;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* 5. Grupos Listing Layout */
.grupos-table td {
    vertical-align: top;
    padding: 1.25rem;
}

.grupo-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.grupo-row__heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.grupo-row__code {
    font-weight: 600;
    font-size: var(--font-size-lg);
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

.grupo-row__course {
    margin: 0.15rem 0 0;
    color: var(--gray-500);
    font-size: var(--font-size-sm);
}

.grupo-row__heading-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.grupo-row__dates {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--gray-600);
}

.grupo-row__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grupo-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.75rem;
}

.grupo-kpi {
    background-color: var(--gray-50);
    border: 1px solid var(--gray-100);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.grupo-kpi span {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.grupo-kpi strong {
    font-size: var(--font-size-base);
    color: var(--gray-900);
}

.grupo-kpi small {
    font-size: var(--font-size-xs);
    color: var(--gray-500);
}

.grupo-kpi--span {
    grid-column: span 2;
}

@media (max-width: 900px) {
    .grupo-row__heading {
        flex-direction: column;
        align-items: flex-start;
    }

    .grupo-kpi--span {
        grid-column: span 1;
    }
}

.grupos-table .table-actions {
    flex-direction: column;
    align-items: flex-end;
}

.grupos-table .table-actions .btn {
    width: 100%;
}

/* 6. Premium Tables (Google Style) */
.table-premium-container {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: white;
}

.table-premium {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table-premium thead th {
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-premium tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.table-premium tbody tr:last-child td {
    border-bottom: none;
}

.table-premium tbody tr:hover {
    background-color: var(--primary-50);
}

.table-premium input,
.table-premium select {
    border: 1px solid transparent;
    background: transparent;
    padding: 0.35rem 0.5rem;
    width: 100%;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.table-premium input:hover,
.table-premium select:hover {
    border-color: var(--gray-300);
    background: white;
}

.table-premium input:focus,
.table-premium select:focus {
    border-color: var(--primary-500);
    background: white;
    box-shadow: 0 0 0 2px var(--primary-100);
    outline: none;
}

.table-premium--compact thead th {
    padding: 0.5rem 0.75rem;
}

.table-premium--compact tbody td {
    padding: 0.5rem 0.75rem;
}

/* Compact version for interactive tables */
.table-interactive--compact thead th {
    padding: 0.6rem 0.75rem;
    font-size: 0.65rem;
}

.table-interactive--compact tbody td {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
}

.table-interactive--compact .avatar--small {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
}

.table-interactive--compact .badge {
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
}

.table-interactive--compact td .text-muted {
    font-size: 0.7rem;
    line-height: 1;
    margin-top: 0.1rem;
}

.table-interactive--compact td .font-weight-bold {
    line-height: 1.2;
}


/* 7. Sorting Indicators */
.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
    text-align: inherit;
    white-space: nowrap;
}

.sortable-header:hover {
    background-color: var(--gray-100) !important;
}

.sortable-header::after {
    content: "unfold_more";
    display: inline-block;
    font-family: 'Material Symbols Outlined';
    font-size: 1rem;
    line-height: 1;
    margin-left: 0.5rem;
    vertical-align: middle;
    color: var(--gray-300);
    transition: color 0.2s ease;
}

.sortable-header:hover::after {
    color: var(--gray-500);
}

.sortable-header.sort-asc::after {
    content: "arrow_upward";
    color: var(--primary-600);
}

.sortable-header.sort-desc::after {
    content: "arrow_downward";
    color: var(--primary-600);
}

/* public/css/components/toast.css */
/**
 * ============================================================================
 *    TOAST NOTIFICATIONS
 * ============================================================================
 * Componente de notificaciones toast con tokens CSS centralizados.
 * Diseñado para 1920x1080 - toda información visible sin scroll.
 * 
 * Tokens requeridos: design-tokens.css
 * ============================================================================
 */

/* -----------------------------------------------------------------------------
   Contenedor principal
   ----------------------------------------------------------------------------- */
.toast-container {
    position: var(--toast-container-position);
    bottom: var(--toast-container-bottom);
    right: var(--toast-container-right);
    z-index: var(--toast-container-z-index);
    display: flex;
    flex-direction: column;
    gap: var(--toast-container-gap);
    pointer-events: none;
}

/* -----------------------------------------------------------------------------
   Toast individual
   ----------------------------------------------------------------------------- */
.toast {
    background-color: white;
    border-radius: var(--toast-radius);
    padding: var(--toast-padding-y) var(--toast-padding-x);
    box-shadow: var(--toast-shadow);
    display: flex;
    align-items: flex-start;
    gap: var(--toast-gap);
    min-width: var(--toast-min-width);
    max-width: var(--toast-max-width);
    pointer-events: auto;
    transform: translateX(120%);
    transition: transform var(--toast-transition) cubic-bezier(0.16, 1, 0.3, 1);
    border-left: var(--toast-border-left-width) solid transparent;
    border: var(--toast-border-width) solid var(--color-gray-200);
}

/* Visible state */
.toast.is-visible {
    transform: translateX(0);
}

/* -----------------------------------------------------------------------------
   Icono
   ----------------------------------------------------------------------------- */
.toast__icon {
    font-size: var(--toast-icon-size);
    flex-shrink: var(--toast-icon-flex-shrink);
    line-height: 1;
}

/* -----------------------------------------------------------------------------
   Contenido
   ----------------------------------------------------------------------------- */
.toast__content {
    flex: 1;
}

.toast__title {
    font-weight: var(--toast-title-font-weight);
    font-size: var(--toast-title-font-size);
    margin-bottom: var(--space-1);
    color: var(--toast-title-color);
}

.toast__message {
    font-size: var(--toast-message-font-size);
    color: var(--toast-message-color);
    line-height: var(--toast-message-line-height);
}

/* -----------------------------------------------------------------------------
   Botón cerrar
   ----------------------------------------------------------------------------- */
.toast__close {
    background: none;
    border: none;
    color: var(--toast-close-color);
    cursor: pointer;
    padding: var(--toast-close-padding);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
    flex-shrink: 0;
}

.toast__close:hover {
    color: var(--toast-close-hover-color);
}

/* -----------------------------------------------------------------------------
   Variantes de color
   ----------------------------------------------------------------------------- */
.toast--success {
    border-left-color: var(--toast-success-border);
    border-color: var(--toast-success-border);
}

.toast--success .toast__icon {
    color: var(--toast-success-color);
}

.toast--success .toast__title {
    color: var(--toast-success-color);
}

/* ----- */
.toast--error {
    border-left-color: var(--toast-error-border);
    border-color: var(--toast-error-border);
}

.toast--error .toast__icon {
    color: var(--toast-error-color);
}

.toast--error .toast__title {
    color: var(--toast-error-color);
}

/* ----- */
.toast--warning {
    border-left-color: var(--toast-warning-border);
    border-color: var(--toast-warning-border);
}

.toast--warning .toast__icon {
    color: var(--toast-warning-color);
}

.toast--warning .toast__title {
    color: var(--toast-warning-color);
}

/* ----- */
.toast--info {
    border-left-color: var(--toast-info-border);
    border-color: var(--toast-info-border);
}

.toast--info .toast__icon {
    color: var(--toast-info-color);
}

.toast--info .toast__title {
    color: var(--toast-info-color);
}

/* -----------------------------------------------------------------------------
   Variante compacta
   ----------------------------------------------------------------------------- */
.toast--compact {
    padding: var(--space-3) var(--space-4);
    min-width: 250px;
    max-width: 350px;
}

.toast--compact .toast__icon {
    font-size: var(--text-lg);
}

.toast--compact .toast__title {
    font-size: var(--text-sm);
}

.toast--compact .toast__message {
    font-size: var(--text-xs);
}

/* -----------------------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .toast-container {
        bottom: var(--space-4);
        right: var(--space-4);
        left: var(--space-4);
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        width: auto;
    }
}

/* public/css/components/zz-compact-design.css */
/**
 * ============================================================================
 *    COMPACT DESIGN SYSTEM - Full HD (1920x1080) Optimization
 *    Overrides cargados al final (prefijo zz-) para pisar a filters.css y otros componentes.
 * ============================================================================
 */

/* Grid utilities (sólo las columnas usadas; el contenedor .grid-system fue eliminado por dead code) */
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-5 { grid-template-columns: repeat(5, 1fr); }

/* Form group premium (usado en formularios de cursos/grupos) */
.form-group-premium {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.form-group__label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--gray-600);
    text-transform: none;
    letter-spacing: 0.01em;
}

.form-group__required {
    color: var(--danger-text);
    font-weight: 700;
}

.form-group__control .form-control {
    width: 100%;
}

.form-group__help {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 2px;
}

/* Filters: overrides visuales (padding mayor, border-radius, focus). Pisa intencionadamente filters.css */
.filters__search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-gray-400);
    font-size: 1.1rem;
    pointer-events: none;
}

.filters__search-input {
    width: 100%;
    padding-left: 2.75rem !important;
    background: var(--color-gray-50) !important;
    border: 1px solid var(--color-gray-200) !important;
    border-radius: var(--radius-lg) !important;
    height: var(--filters-height, 28px) !important;
    min-height: var(--filters-height, 28px) !important;
    transition: all var(--transition-base) !important;
}

.filters__search-input:focus {
    background: white !important;
    border-color: var(--primary-500) !important;
    box-shadow: 0 0 0 4px rgba(130, 3, 3, 0.05) !important;
}

.filters__actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Tabla interactiva: row hover y padding consistente */
.table-interactive tbody tr {
    transition: all var(--transition-fast);
}

.table-interactive tbody tr:hover {
    background: var(--primary-50) !important;
}

.table-interactive td {
    padding: 0.5rem 0.75rem !important;
    vertical-align: middle;
}

/* Animations y transitions globales para botones y badges */
.btn, .badge {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Full HD optimizations (1920x1080) */
@media (min-width: 1600px) {
    .grid-cols-3 { grid-template-columns: repeat(4, 1fr); }
    .grid-cols-4 { grid-template-columns: repeat(5, 1fr); }

    .form-control {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .invoice-layout:not(.invoice-layout--document-editor) {
        grid-template-columns: minmax(0, 1fr) 380px !important;
        gap: 2rem !important;
    }
}

/* public/css/components/zz-design-system.css */
/* ==========================================================================
   DESIGN SYSTEM — Ensenyem ERP
   Modernización global de UI/UX
   Auto-cargado por AssetLoader
   ========================================================================== */

/* ==========================================================================
   1. EXTENDED DESIGN TOKENS
   ========================================================================== */
/* ==========================================================================
   0. ICON FIX — Google Material Symbols Ligatures
   ========================================================================== */
.material-symbols-outlined {
    text-transform: none !important;
    letter-spacing: normal !important;
    word-wrap: normal !important;
    white-space: nowrap !important;
    direction: ltr !important;
}

:root {
    /* Motion System — Transiciones coherentes para todo el producto */
    --transition-fast: 120ms ease-out;
    --transition-base: 200ms ease-out;
    --transition-slow: 280ms ease-out;
    --transition-spring: 320ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Elevation System — Profundidad visual progresiva */
    --elevation-0: none;
    --elevation-1: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --elevation-2: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
    --elevation-3: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --elevation-4: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);

    /* Status Accent Colors — Barras laterales de estado */
    --status-success: #10b981;
    --status-warning: #f59e0b;
    --status-danger: #ef4444;
    --status-info: #3b82f6;
    --status-pending: #8b5cf6;
    --status-neutral: #94a3b8;

    /* Focus Ring — Accesibilidad moderna */
    --focus-ring: 0 0 0 2px white, 0 0 0 4px var(--primary-400);
    --focus-ring-inset: inset 0 0 0 2px var(--primary-400);

    /* Border Radius Extended */
    --border-radius-xl: 1rem;
    --border-radius-full: 9999px;

    /* Spacing Scale Extended */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
}


/* ==========================================================================
   2. GLOBAL INTERACTIVE TRANSITIONS
   Aplicar movimiento consistente a todos los elementos interactivos
   ========================================================================== */

/* Botones — transición unificada */
.btn {
    transition: none;
}

/* Cards — elevación suave y bordes refinados */
.card,
.stat-card,
.action-card,
.contact-card {
    transition: 
        box-shadow var(--transition-base),
        transform var(--transition-base),
        border-color var(--transition-base),
        background-color var(--transition-base);
}

.card {
    border: 1px solid var(--color-gray-200) !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--google-shadow-1) !important;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--google-shadow-2) !important;
    border-color: var(--color-gray-300) !important;
}

.card__header {
    background: var(--color-gray-50);
    border-bottom: 1px solid var(--color-gray-100) !important;
    padding: var(--space-3) var(--space-5) !important;
    margin: calc(-1 * var(--card-padding)) calc(-1 * var(--card-padding)) var(--card-padding) !important;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.card__title {
    font-family: var(--font-family);
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: var(--color-gray-500) !important;
    margin: 0 !important;
}

.card__icon {
    font-size: 1.25rem !important;
    color: var(--primary-500);
}

.card__content {
    /* Refinar el espaciado interno si es necesario */
}

/* Links */
a,
.sidebar__nav-link,
.sidebar__submenu-link {
    transition: 
        color var(--transition-fast),
        background-color var(--transition-fast),
        transform var(--transition-fast);
}

/* Badges */
.badge {
    transition: 
        transform var(--transition-fast),
        box-shadow var(--transition-fast);
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="search"],
select,
textarea {
    transition: 
        border-color var(--transition-fast),
        box-shadow var(--transition-base),
        background-color var(--transition-fast);
}


/* ==========================================================================
   3. BUTTON HIERARCHY — Solid / Outline / Ghost
   ========================================================================== */

/* (Button styles now consolidated in style.css) */

/* Tamaño dictado por padding para máxima densidad */
.btn {
    min-height: auto; 
}

.btn--large {
    padding: 0.4rem 1rem;
    font-size: 0.875rem;
}

.btn--small {
    padding: 0.15rem 0.45rem;
    font-size: 0.7rem;
}

/* Ripple container */
.btn {
    position: relative;
    overflow: hidden;
}

.btn__ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple-effect 500ms ease-out forwards;
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(2.5);
        opacity: 0;
    }
}


/* ==========================================================================
   4. TABLE ROWS — Elevación interactiva + borde de estado
   ========================================================================== */

/* Row hover mejorado */
tbody tr {
    transition: 
        background-color var(--transition-fast),
        box-shadow var(--transition-base);
    position: relative;
}

tbody tr:hover {
    background-color: var(--gray-50);
    box-shadow: inset 0 0 0 1px var(--gray-100);
}

/* Status border left en filas */
tr[data-status="sent"] td:first-child,
tr[data-status="cobrado"] td:first-child,
tr[data-status="completado"] td:first-child {
    box-shadow: inset 3px 0 0 var(--status-success);
}

tr[data-status="pending"] td:first-child,
tr[data-status="pendiente"] td:first-child,
tr[data-status="borrador"] td:first-child {
    box-shadow: none;
}

tr[data-status="error"] td:first-child,
tr[data-status="cancelado"] td:first-child,
tr[data-status="anulado"] td:first-child {
    box-shadow: inset 3px 0 0 var(--status-danger);
}

tr[data-status="emitido"] td:first-child,
tr[data-status="programado"] td:first-child {
    box-shadow: none;
}

/* Row actions — más visible en hover */
.table__actions {
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

tbody tr:hover .table__actions {
    opacity: 1;
}


/* ==========================================================================
   5. BADGES MODERNOS — Con iconos y profundidad
   ========================================================================== */

/* Badge base mejorado */
.badge {
    gap: 0.25rem;
    letter-spacing: 0.01em;
}

/* Badge con icono */
.badge__icon {
    font-size: 0.75em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

/* Badge pulse — cuando cambia estado */
.badge--pulse {
    animation: badge-pulse 1.5s ease-in-out;
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.08); }
    50% { transform: scale(1); }
    75% { transform: scale(1.04); }
}


/* ==========================================================================
   6. KPI / STAT CARDS — Profundidad + iconos circulares
   ========================================================================== */

/* KPI card con sombra en reposo */
.stat-card {
    box-shadow: var(--elevation-1);
    border: 1px solid var(--gray-100);
}

/* Icono con círculo de fondo más definido */
.stat-card__icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 1.4rem;
}

/* Número grande */
.stat-card__value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* Label más pequeño y separado */
.stat-card__label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Count up animation */
.stat-card__value[data-animate] {
    opacity: 0;
    transform: translateY(8px);
    animation: count-reveal 0.5s ease-out forwards;
    animation-delay: var(--delay, 0ms);
}

@keyframes count-reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ==========================================================================
   7. SIDEBAR — Indicador activo + hover mejorado
   ========================================================================== */

/* Estado activo limpio sin barra vertical */
.sidebar__nav-link.is-active,
.sidebar__submenu-link.is-active {
    position: relative;
    background-color: var(--primary-50);
    color: var(--primary-700);
}

/* Hover con desplazamiento sutil */
.sidebar__nav-link:hover {
    transform: translateX(2px);
}

.sidebar__nav-link:hover .sidebar__nav-icon {
    color: var(--primary-500);
}

/* Submenu links — hover más suave */
.sidebar__submenu-link {
    position: relative;
    transition:
        color var(--transition-fast),
        background-color var(--transition-fast),
        padding-left var(--transition-fast);
}

.sidebar__submenu-link:hover {
    padding-left: calc(2.25rem + 4px);
    background-color: var(--gray-50);
}

/* Iconos sidebar ligeramente más grandes */
.sidebar__nav-icon {
    font-size: 1.2rem;
    transition: color var(--transition-fast);
}

/* Group title — tracking leve */
.sidebar__group-title {
    letter-spacing: 0.08em;
    font-size: 0.7rem;
    color: var(--gray-400);
    margin-bottom: 0.25rem;
}


/* ==========================================================================
   8. INPUTS MODERNOS — Estilo "app moderna"
   ========================================================================== */

/* Input con fondo gris suave */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="search"],
select,
textarea {
    background-color: var(--gray-50);
    border: 1.5px solid transparent;
}

/* Borde solo en focus */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
    background-color: white;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(130, 3, 3, 0.08);
}

/* Hover state para inputs */
input[type="text"]:hover:not(:focus),
input[type="email"]:hover:not(:focus),
input[type="password"]:hover:not(:focus),
input[type="date"]:hover:not(:focus),
input[type="number"]:hover:not(:focus),
input[type="search"]:hover:not(:focus),
select:hover:not(:focus),
textarea:hover:not(:focus) {
    border-color: var(--gray-300);
}

/* Search input con icono integrado */
.input-search {
    position: relative;
}

.input-search__icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    font-size: 1rem;
    pointer-events: none;
    transition: color var(--transition-fast);
}

.input-search input,
.input-search .input-search__field {
    padding-left: 2.5rem;
}

.input-search:focus-within .input-search__icon {
    color: var(--primary-500);
}


/* ==========================================================================
   9. EXPANDABLE BLOCKS — Fade + Slide
   ========================================================================== */

/* Animación genérica para contenido expandible */
.expand-enter {
    animation: expand-in var(--transition-slow) ease-out forwards;
}

.expand-exit {
    animation: expand-out var(--transition-fast) ease-in forwards;
}

@keyframes expand-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 2000px;
    }
}

@keyframes expand-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

/* Fade in genérico para paneles */
.fade-in {
    animation: ds-fade-in 0.3s ease-out forwards;
}

@keyframes ds-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation para listas */
.stagger-item {
    opacity: 0;
    animation: ds-fade-in 0.3s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0ms; }
.stagger-item:nth-child(2) { animation-delay: 50ms; }
.stagger-item:nth-child(3) { animation-delay: 100ms; }
.stagger-item:nth-child(4) { animation-delay: 150ms; }
.stagger-item:nth-child(5) { animation-delay: 200ms; }
.stagger-item:nth-child(6) { animation-delay: 250ms; }
.stagger-item:nth-child(7) { animation-delay: 300ms; }
.stagger-item:nth-child(8) { animation-delay: 350ms; }


/* ==========================================================================
   10. TOAST — Posición top-right para feedback moderno
   ========================================================================== */

/* Override posición: top-right en vez de bottom-right */
.toast-container {
    top: calc(var(--header-height) + 1rem);
    right: 1.5rem;
    bottom: auto;
}

/* Toast con entrada desde arriba */
.toast {
    transform: translateX(120%) translateY(-10px);
    border-radius: var(--border-radius-lg);
}

.toast.is-visible {
    transform: translateX(0) translateY(0);
}

/* Progress bar de auto-dismiss */
.toast__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
    animation: toast-progress 3s linear forwards;
}

.toast--success .toast__progress { background-color: var(--status-success); }
.toast--error .toast__progress { background-color: var(--status-danger); }
.toast--warning .toast__progress { background-color: var(--status-warning); }
.toast--info .toast__progress { background-color: var(--status-info); }

@keyframes toast-progress {
    from { width: 100%; }
    to { width: 0; }
}


/* ==========================================================================
   11. EMPTY STATES — Para tablas y listas vacías
   ========================================================================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--gray-400);
}

.empty-state__icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state__title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.empty-state__description {
    font-size: var(--font-size-sm);
    color: var(--gray-500);
    max-width: 400px;
    margin-bottom: 1.5rem;
}


/* ==========================================================================
   12. LOADING STATES
   ========================================================================== */

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite;
    border-radius: var(--border-radius-sm);
}

.skeleton--text {
    height: 1em;
    width: 80%;
    margin-bottom: 0.5rem;
}

.skeleton--title {
    height: 1.5em;
    width: 60%;
    margin-bottom: 0.75rem;
}

.skeleton--circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton--card {
    height: 80px;
    width: 100%;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--gray-200);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.spinner--sm { width: 14px; height: 14px; border-width: 2px; }
.spinner--lg { width: 32px; height: 32px; border-width: 3px; }

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

/* Button loading state */
.btn.is-loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.is-loading .btn__icon {
    animation: spin 0.6s linear infinite;
}

/* Button disabled state */
.btn:disabled,
.btn[aria-disabled="true"] {
    background: var(--color-gray-200, #e5e7eb);
    color: var(--color-gray-500, #6b7280);
    border-color: var(--color-gray-300, #d1d5db);
    cursor: not-allowed;
    opacity: 0.65;
    box-shadow: none;
    pointer-events: none;
}


/* ==========================================================================
   13. SCROLLBAR CUSTOMIZATION
   ========================================================================== */
.sidebar::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.sidebar::-webkit-scrollbar-track,
.table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--gray-300);
    border-radius: var(--border-radius-full);
}

.sidebar::-webkit-scrollbar-thumb:hover,
.table-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: var(--gray-400);
}


/* ==========================================================================
   14. UTILITY CLASSES
   ========================================================================== */

/* Truncate text */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Flex helpers */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Width helpers */
.w-full { width: 100%; }

/* Divider */
.divider {
    height: 1px;
    background-color: var(--gray-200);
    margin: var(--space-4) 0;
    border: none;
}
/* ==========================================================================
   15. CHECKBOXES PREMIUM
   ========================================================================== */
.checkbox-group-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    min-height: var(--input-height, 38px);
}

.checkbox-premium {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--gray-700);
    user-select: none;
    transition: all 0.2s ease;
}

.checkbox-premium:hover {
    color: var(--primary-600);
}

.checkbox-premium input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    width: 14px;
    height: 14px;
    accent-color: var(--primary-600);
}

.checkbox-premium span {
    line-height: 1;
}

/* ==========================================================================
   16. SUMMARY STATS BAR — Google Senior Designer Pattern
   ========================================================================== */
.summary-stats-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 0.65rem 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
    gap: 1.5rem;
}

.summary-stats-bar {
    display: flex;
    align-items: center;
    gap: 2.5rem;
    flex: 1;
}

.summary-stats-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

/* Separador sutil entre items */
.summary-stats-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -1.25rem;
    top: 50%;
    transform: translateY(-50%);
    height: 24px;
    width: 1px;
    background: var(--gray-100);
}

.summary-stats-item__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.summary-stats-item__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.summary-stats-item__label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
}

.summary-stats-item__value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    line-height: 1.2;
}

/* Variantes Cromáticas — Google Modern Mix */
.summary-stats-item--primary .summary-stats-item__icon { background: rgba(59, 130, 246, 0.08); color: #2563eb; }
.summary-stats-item--success .summary-stats-item__icon { background: rgba(16, 185, 129, 0.08); color: #059669; }
.summary-stats-item--warning .summary-stats-item__icon { background: rgba(245, 158, 11, 0.08); color: #d97706; }
.summary-stats-item--danger .summary-stats-item__icon  { background: rgba(239, 68, 68, 0.08);  color: #dc2626; }
.summary-stats-item--neutral .summary-stats-item__icon { background: var(--gray-50); color: var(--gray-600); }

.summary-stats-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

@media (max-width: 1200px) {
    .summary-stats-container {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
    }
    .summary-stats-bar {
        justify-content: space-between;
        gap: 1rem;
    }
    .summary-stats-item:not(:last-child)::after {
        display: none;
    }
    .summary-stats-actions {
        justify-content: flex-end;
        border-top: 1px solid var(--gray-100);
        padding-top: 0.75rem;
        margin-top: 0.25rem;
    }
}

/* public/css/components/zzz-layout-system.css */
/*
 * Layout System v1.0
 * Sistema base de tres zonas (header/body/footer) + densidad compacta global.
 */

:root {
    --layout-page-gap: 0;
    --layout-card-padding: 2rem;
    --layout-card-margin-bottom: 2rem;
    --layout-form-gap: 1rem;
    --layout-input-height: 38px;
    --layout-table-font-size: 0.875rem;
    --layout-table-cell-py: 0.75rem;
    --layout-table-cell-px: 1rem;
}

.is-compact {
    --layout-card-padding: 1.2rem;
    --layout-card-margin-bottom: 1rem;
    --layout-form-gap: 0.625rem;
    --layout-input-height: 32px;
    --layout-table-font-size: 0.8125rem;
    --layout-table-cell-py: 0.375rem;
    --layout-table-cell-px: 0.75rem;
}

.content-area.is-compact {
    padding: 0.875rem 1rem;
}

/* ==========================================================================
   VIEWPORT-LOCK: cuando content-area contiene un layout-page,
   el scroll se desactiva a nivel de content-area y se delega
   exclusivamente a layout-page__body.
   ========================================================================== */
.layout-page--viewport-lock {
    height: calc(100vh - 3.5rem);
    display: flex;
    flex-direction: column;
    overflow: hidden !important;
}

.content-area:has(> .layout-page--viewport-lock) {
    overflow-y: hidden !important;
}

.layout-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: var(--layout-page-gap);
}

/* Header Estilo Google - Compacto */
.layout-page__header {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 1rem;
    background: var(--surface-header);
    border-bottom: 1px solid var(--gray-200);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    flex-shrink: 0;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.layout-page__header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.layout-page__header-identity {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.layout-page__header-icon {
    width: 32px; /* Reducido de 40px */
    height: 32px;
    background: linear-gradient(135deg, var(--primary-50), var(--surface-card));
    color: var(--primary-600);
    border: 1px solid var(--primary-100);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem; /* Reducido de 1.5rem */
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    flex: 0 0 auto;
}

.layout-page__header-text {
    min-width: 0;
}

.layout-page__header-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.01em;
}

.layout-page__header-desc {
    margin: 0.125rem 0 0;
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.35;
}

.layout-page__header-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.25rem;
}

.layout-page__header-stat-item {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
    font-size: 0.8125rem;
}

.layout-page__header-stat-item .stat-label {
    color: var(--gray-500);
    font-weight: 500;
}

.layout-page__header-stat-item .stat-value {
    color: var(--gray-900);
    font-weight: 700;
}

.layout-page__header-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.layout-page__header-nav {
    display: flex;
    justify-content: flex-start; /* Nav a la izquierda debajo del título */
    align-items: center;
    width: 100%;
}

/* Tabs integradas en header apilado */
.layout-page__header .tabs-premium.grupo-tabs {
    margin-bottom: 0;
    background: transparent; /* Más limpio si va debajo */
    border: none;
    padding: 0;
    gap: 1.5rem; /* Estilo Material Tabs: espacio en lugar de cajas */
}

.layout-page__header .tab-item {
    padding: 0.5rem 0;
    font-size: 0.875rem;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    flex: none;
}

.layout-page__header .tab-item:hover {
    background: transparent;
    color: var(--primary-600);
}

.layout-page__header .tab-item.is-active {
    background: transparent;
    box-shadow: none;
    color: var(--primary-700);
    border-bottom-color: var(--primary-700);
}

/* Sección de Filtros */
.filters-section {
    margin: 1rem 0 !important; /* Forzamos override de estilos inline si existen */
    overflow: visible;
}

/* Body y Scroll Interno */
.layout-page__body {
    min-height: 0;
    overflow-y: auto;
    background: var(--surface-header);
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    gap: 0.75rem;
}

.layout-page__body > * {
    margin: 0;
}

/* Footer Fijo */
.layout-page__footer {
    flex-shrink: 0;
    padding: 0.75rem 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Scrollbar Estilo Google */
.layout-page__body::-webkit-scrollbar {
    width: var(--scrollbar-width);
}

.layout-page__body::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

.layout-page__body::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 10px;
    border: 2px solid var(--surface-header);
}

.layout-page__body::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Animación de entrada */
.layout-page {
    animation: google-fade-in 0.2s ease-out;
}

@keyframes google-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dropdowns de Filtros (Estilo Google) */
.filters__menu {
    position: relative;
}

.filters__dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--google-shadow-2);
    border: 1px solid var(--gray-200);
    z-index: 100;
    min-width: 200px;
    padding: 0.5rem 0;
    overflow: hidden;
    animation: google-dropdown-in 0.15s ease-out;
}

@keyframes google-dropdown-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.filters__dropdown.hidden {
    display: none;
}

.filters__dropdown-panel {
    display: flex;
    flex-direction: column;
}

.filters__dropdown-header {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--gray-100);
    margin-bottom: 0.25rem;
}

.filters__dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    width: 100%;
    border: none;
    background: transparent;
    color: var(--gray-700);
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s ease;
}

.filters__dropdown-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.filters__dropdown-item i {
    font-size: 1.125rem;
    color: var(--gray-400);
}

.filters__dropdown-item--checkbox {
    cursor: pointer;
    user-select: none;
}

.filters__dropdown-item--checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.is-compact .filters__row,
.is-compact .form-grid,
.is-compact .general-card__grid,
.is-compact .grupo-general-stack,
.is-compact .grupo-form__body,
.is-compact .form-group {
    gap: var(--layout-form-gap);
}

/* Densidad compacta para formularios — EXCLUYE los controles de la barra de
   filtros, cuya altura la gobierna --filters-height (filters.css). */
.is-compact input:not(.dynamic-filter__input):not(.filters__search-input),
.is-compact select:not(.dynamic-filter__select),
.is-compact .form-control {
    min-height: var(--layout-input-height);
}

.is-compact .table,
.is-compact .table-interactive {
    font-size: var(--layout-table-font-size);
}

.is-compact .table th,
.is-compact .table td,
.is-compact .table-interactive th,
.is-compact .table-interactive td {
    padding: var(--layout-table-cell-py) var(--layout-table-cell-px);
}

/* ==========================================================================
   Tabs - Premium (Google Style)
   ========================================================================== */
.tabs-premium.grupo-tabs {
    display: flex;
    background: var(--gray-100);
    padding: 0.25rem;
    border-radius: var(--radius-lg);
    gap: 0.15rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--gray-200);
}

.tab-item {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: none;
    background: transparent;
    color: var(--gray-500);
    font-weight: 500;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-item i {
    font-size: 1.15rem;
    opacity: 0.7;
}

.tab-item:hover {
    color: var(--gray-700);
    background: rgba(255, 255, 255, 0.4);
}

.tab-item.is-active {
    background: white;
    color: var(--primary-700);
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.tab-item.is-active i {
    color: var(--primary-600);
    opacity: 1;
}

/* Panel transitions */
.grupo-panel {
    display: none;
    animation: slideUp 0.3s ease-out;
}

.grupo-panel.is-active {
    display: block;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Layout Utilities Refinement */
.is-compact .general-card {
    padding: 1rem;
}

/* ==========================================================================
   Utilities - Grid & Flex (Estilo Tailwind/Premium)
   ========================================================================== */
.grid { display: grid; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--12 { grid-template-columns: repeat(12, 1fr); }

.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.col-span-6 { grid-column: span 6 / span 6; }
.col-span-8 { grid-column: span 8 / span 8; }
.col-span-9 { grid-column: span 9 / span 9; }
.col-span-12 { grid-column: span 12 / span 12; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: 0.5rem; }
.p-3 { padding: 0.75rem; }

.w-full { width: 100%; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-2xl { font-size: 1.5rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }
.text-muted { color: var(--gray-500); }
.text-danger { color: var(--danger-600); }
.text-blue-700 { color: #1d4ed8; }
.bg-gray-50 { background-color: var(--gray-50); }
.bg-blue-50 { background-color: #eff6ff; }
.rounded-lg { border-radius: 0.5rem; }
.border { border: 1px solid var(--gray-200); }
.border-b { border-bottom: 1px solid var(--gray-200); }
.border-gray-50 { border-color: var(--gray-50); }
.border-gray-100 { border-color: var(--gray-100); }

/* ==========================================================================
   Animations
   ========================================================================== */
.animate-spin {
    animation: google-spin 1s linear infinite;
    display: inline-block;
}

@keyframes google-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Hero & Header - Compact (Google Style)
   ========================================================================== */
.grupo-form__hero {
    margin-bottom: 0.75rem !important;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.grupo-form__intro h1 {
    font-size: 1.25rem !important;
    letter-spacing: -0.01em;
}

.grupo-form__intro p.grupo-form__eyebrow {
    font-size: 0.75rem !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.15rem !important;
}

.grupo-form__actions {
    gap: 0.35rem !important;
}

.grupo-form__actions .btn {
    padding: 0.5rem 0.875rem !important;
    font-size: 0.85rem !important;
    border-radius: var(--radius-md) !important;
}

.grupo-form__actions .btn--large {
    padding: 0.5rem 1rem !important;
}

.form-hero__icon {
    width: 42px;
    height: 42px;
    background: var(--gray-50);
    color: var(--primary-600);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    border: 1px solid var(--gray-100);
}


/* Reducción de gaps en grid compacta */
.grid.is-compact {
    gap: 1rem !important;
}

.col-span-9.flex-col {
    gap: 0.75rem !important;
}

/* ==========================================================================
   Summary Stats (Premium / Google Analytics Style)
   ========================================================================== */
.summary-stats-container {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.summary-stats-bar {
    display: flex;
    flex-wrap: wrap;
    background: white;
}

.summary-stats-item {
    flex: 1;
    min-width: 200px;
    padding: 1.25rem 1.5rem;
    display: flex;
    gap: 1rem;
    border-right: 1px solid var(--gray-100);
    transition: background 0.2s ease;
}

.summary-stats-item:last-child {
    border-right: none;
}

.summary-stats-item:hover {
    background: var(--gray-50);
}

.summary-stats-item__icon {
    width: 42px;
    height: 42px;
    background: var(--primary-50);
    color: var(--primary-600);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.summary-stats-item--success .summary-stats-item__icon { background: var(--success-50); color: var(--success-600); }
.summary-stats-item--warning .summary-stats-item__icon { background: var(--warning-50); color: var(--warning-600); }
.summary-stats-item--danger .summary-stats-item__icon { background: var(--danger-50); color: var(--danger-600); }
.summary-stats-item--info .summary-stats-item__icon { background: var(--info-50); color: var(--info-600); }

.summary-stats-item__content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.summary-stats-item__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.summary-stats-item__main-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.summary-stats-item__value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    line-height: 1;
}

.summary-stats-item__trend {
    display: flex;
    align-items: center;
    gap: 0.125rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.summary-stats-item__trend span.material-symbols-outlined {
    font-size: 1rem;
}

.summary-stats-item__secondary {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--gray-400);
}

.summary-stats-actions {
    padding: 0.75rem 1.5rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-100);
    display: flex;
    justify-content: flex-end;
}

/* Tipo Factura Cards */
.tipo-factura-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.tipo-factura-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    padding: 1rem 0.75rem;
    border: 2px solid var(--gray-200);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.tipo-factura-card:hover {
    border-color: var(--primary-300);
    background: var(--primary-50);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.tipo-factura-card.is-active {
    border-color: var(--primary-500);
    background: var(--primary-50);
    box-shadow: 0 0 0 3px var(--primary-100), 0 2px 4px rgba(0,0,0,0.05);
    transform: translateY(0);
}

.tipo-factura-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tipo-factura-card__icon {
    font-size: 2rem;
    color: var(--gray-400);
    transition: color 0.2s ease;
}

.tipo-factura-card.is-active .tipo-factura-card__icon {
    color: var(--primary-600);
}

.tipo-factura-card__label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-700);
}

.tipo-factura-card.is-active .tipo-factura-card__label {
    color: var(--primary-700);
}

.tipo-factura-card__desc {
    font-size: 0.75rem;
    color: var(--gray-500);
    line-height: 1.2;
}

/* Cliente Seleccionado */
.cliente-seleccionado {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--primary-50);
    border: 1px solid var(--primary-200);
    border-radius: 0.375rem;
}

.cliente-seleccionado.is-visible {
    display: flex;
}

.cliente-seleccionado__info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.cliente-seleccionado__icon {
    color: var(--primary-600);
    font-size: 1.25rem;
}

.cliente-seleccionado__name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-800);
}

.cliente-seleccionado__change {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.2s ease;
}

.cliente-seleccionado__change:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

