/* ── Catálogo: header chrome (NESGo barra oro + WinUI) ───────── */
.impulsa-catalog-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.impulsa-catalog-title-block {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    min-width: 0;
}

.impulsa-catalog-accent-bar {
    width: 4px;
    min-height: 2.5rem;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--st-gold-light), var(--st-gold-intense));
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.impulsa-catalog-category {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--st-gold-intense);
    margin-bottom: 0.1rem;
}

.impulsa-catalog-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--st-text-primary);
    margin: 0;
    line-height: 1.2;
}

.impulsa-catalog-subtitle {
    font-size: 0.85rem;
    color: var(--st-text-secondary);
    margin: 0.15rem 0 0;
}

.impulsa-catalog-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.impulsa-catalog-toolbar .btn {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
}

/* ── Filtros catálogo ────────────────────────────────────────── */
.impulsa-catalog-filters {
    background: var(--st-surface-elevated);
    border: 1px solid var(--st-surface-border);
    border-radius: var(--impulsa-radius-md);
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.impulsa-catalog-filters .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--st-text-secondary);
    margin-bottom: 0.25rem;
}

/* ── Barra de estado (WinUI StatusText) ──────────────────────── */
.impulsa-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    color: var(--st-text-secondary);
    background: var(--st-surface-elevated);
    border: 1px solid var(--st-surface-border);
    border-radius: var(--impulsa-radius-sm);
}

/* ── CrudGrid ────────────────────────────────────────────────── */
.crud-grid-wrapper {
    border: 1px solid var(--st-surface-border);
    border-radius: var(--impulsa-radius-md);
    overflow: hidden;
    background: var(--st-surface);
}

.crud-grid {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.crud-grid thead th {
    background: var(--st-table-header-bg);
    color: var(--st-text-header);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    padding: var(--density-table-head-y) var(--density-table-cell-x);
    border-bottom: none;
    vertical-align: middle;
}

.crud-grid tbody td {
    padding: var(--density-table-cell-y) var(--density-table-cell-x);
    vertical-align: middle;
    border-color: var(--st-surface-border);
}

.crud-grid tbody tr:nth-child(even) {
    background: var(--st-table-zebra);
}

.crud-grid tbody tr:hover {
    background: var(--st-table-hover);
}

.crud-grid tbody tr.selected {
    background: var(--st-table-selected);
}

.crud-grid-actions-col {
    width: 1%;
    white-space: nowrap;
}

.crud-grid .btn-action-icon {
    padding: 0.2rem 0.45rem;
    font-size: 0.8rem;
    line-height: 1.2;
}

.crud-grid-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--st-text-secondary);
}

.crud-grid-empty-icon {
    font-size: 2rem;
    opacity: 0.35;
    margin-bottom: 0.5rem;
}

.crud-grid-footer {
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--st-surface-border);
    background: var(--st-surface-elevated);
}

.crud-grid-footer .pagination .page-link {
    color: var(--st-deep-blue);
    font-size: 0.85rem;
}

.crud-grid-footer .pagination .page-item.active .page-link {
    background: var(--st-deep-blue);
    border-color: var(--st-deep-blue);
}

.crud-grid-sort-link {
    color: var(--st-text-header);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.crud-grid-sort-link:hover {
    color: #fff;
    text-decoration: underline;
}

.crud-grid-sort-indicator {
    font-size: 0.7rem;
    opacity: 0.85;
}

.crud-grid-filter-row th {
    background: var(--st-surface-elevated);
    padding: 0.35rem var(--density-table-cell-x);
    border-bottom: 1px solid var(--st-surface-border);
}

.crud-grid-filter-input {
    min-width: 4.5rem;
    border-color: var(--st-surface-border);
    background: var(--st-surface);
}

.crud-grid-filter-actions {
    background: var(--st-surface-elevated);
}

.crud-grid-page-size {
    width: auto;
    min-width: 4.25rem;
}

/* ── MenuMaestro árbol ───────────────────────────────────────── */
.menu-tree-layout {
    display: grid;
    grid-template-columns: minmax(280px, 34%) 1fr;
    gap: 1rem;
    min-height: 420px;
}

@media (max-width: 991.98px) {
    .menu-tree-layout {
        grid-template-columns: 1fr;
    }
}

.menu-tree-panel {
    border: 1px solid var(--st-surface-border);
    border-radius: var(--impulsa-radius-md);
    background: var(--st-surface);
    overflow: hidden;
}

.menu-tree-panel-header {
    background: var(--st-table-header-bg);
    color: var(--st-text-header);
    padding: 0.55rem 0.85rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.menu-tree-scroll {
    max-height: 520px;
    overflow: auto;
}

.menu-tree-area {
    border-bottom: 1px solid var(--st-surface-border);
}

.menu-tree-area-toggle {
    width: 100%;
    border: none;
    background: var(--st-surface-elevated);
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    color: var(--st-deep-blue);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-tree-folder {
    padding: 0.35rem 0.75rem 0.35rem 1.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--st-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.menu-tree-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem 0.45rem 1.75rem;
    border-left: 3px solid transparent;
    text-decoration: none;
    color: var(--st-text-primary);
}

.menu-tree-item:hover {
    background: var(--st-menu-active-bg);
    color: var(--st-deep-blue);
}

.menu-tree-item.active {
    background: var(--st-menu-active-bg);
    border-left-color: var(--st-deep-blue);
    font-weight: 600;
}

.menu-detail-panel {
    border: 1px solid var(--st-surface-border);
    border-radius: var(--impulsa-radius-md);
    background: var(--st-surface);
    padding: 1rem;
}

.menu-detail-empty {
    color: var(--st-text-secondary);
    padding: 2rem 1rem;
    text-align: center;
}

.dual-list-count {
    font-size: 0.78rem;
    color: var(--st-text-secondary);
    margin-bottom: 0.35rem;
}

/* ── Formularios ─────────────────────────────────────────────── */
.impulsa-form .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--st-text-secondary);
    margin-bottom: 0.25rem;
}

.impulsa-form .form-control,
.impulsa-form .form-select {
    min-height: 2.25rem;
    border-color: var(--st-surface-border);
    border-radius: var(--impulsa-radius-sm);
}

.impulsa-form .form-control.text-uppercase {
    text-transform: uppercase;
}

.impulsa-form-field {
    margin-bottom: 0.85rem;
}

.impulsa-form-field .validation-message {
    font-size: 0.78rem;
    color: var(--st-coral-validation);
    margin-top: 0.2rem;
}

.form-label.is-required::after,
.impulsa-form-field .form-label.is-required::after {
    content: " *";
    color: var(--st-coral-validation);
    font-weight: 600;
}

.impulsa-form-field.is-invalid .form-control,
.impulsa-form-field.is-invalid .form-select {
    border-color: var(--st-coral-validation);
    box-shadow: 0 0 0 1px rgba(239, 122, 110, 0.35);
}

.impulsa-form-section {
    border: 1px solid var(--st-surface-border);
    border-radius: var(--impulsa-radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
}

.impulsa-form-section-header {
    background: var(--st-surface-elevated);
    padding: 0.55rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--st-deep-blue);
    border-bottom: 1px solid var(--st-surface-border);
}

.impulsa-form-section-body {
    padding: 1rem;
}

.impulsa-edit-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

/* Label izquierda en pantallas medianas+ */
@media (min-width: 768px) {
    .impulsa-form-field.horizontal {
        display: grid;
        grid-template-columns: minmax(120px, 28%) 1fr;
        gap: 0.75rem 1rem;
        align-items: start;
    }

    .impulsa-form-field.horizontal .form-label {
        text-align: right;
        padding-top: 0.45rem;
        margin-bottom: 0;
    }

    .impulsa-form-field.horizontal .field-control {
        min-width: 0;
    }
}

/* ── Badges estado ───────────────────────────────────────────── */
.badge-activo {
    background: var(--st-status-active-bg);
    color: var(--st-status-active-text);
    border: 1px solid var(--st-status-active-border);
}

.badge-inactivo {
    background: var(--st-status-inactive-bg);
    color: var(--st-status-inactive-text);
    border: 1px solid var(--st-status-inactive-border);
}

/* ── Pantallas especiales (dual-list, permisos) ───────────────── */
.impulsa-special-panel {
    border: 1px solid var(--st-surface-border);
    border-radius: var(--impulsa-radius-md);
    background: var(--st-surface);
    padding: 1rem;
}

.impulsa-special-panel h2,
.impulsa-special-panel .h6 {
    color: var(--st-deep-blue);
    font-weight: 600;
}

.impulsa-dual-list-table {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--st-surface-border);
    border-radius: var(--impulsa-radius-sm);
}

.impulsa-dual-list-table table {
    margin-bottom: 0;
    font-size: 0.85rem;
}

/* ── Confirm modal ───────────────────────────────────────────── */
.impulsa-confirm-modal .modal-header {
    background: var(--st-surface-elevated);
    border-bottom-color: var(--st-surface-border);
}

.impulsa-confirm-modal .modal-title {
    color: var(--st-deep-blue);
    font-weight: 600;
}

.impulsa-account-modal .modal-header {
    background: var(--st-surface-elevated);
    border-bottom-color: var(--st-surface-border);
}

.impulsa-account-modal .modal-title {
    color: var(--st-deep-blue);
    font-weight: 600;
}

/* ── Fase 6: reportes / impresión ───────────────────────────── */
.impulsa-print-page-break {
    page-break-after: always;
}

.impulsa-pivot-table .habilidad-total-badge {
    display: inline-block;
    min-width: 2.5rem;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-weight: 600;
    color: #1a1a1a;
}

.gafete-print-card {
    width: 320px;
    margin: 0 auto;
    border: 2px solid var(--st-deep-blue);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

.gafete-print-header {
    background: var(--st-deep-blue);
    color: #fff;
    text-align: center;
    padding: 0.75rem 1rem;
}

.gafete-print-empresa {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    opacity: 0.9;
}

.gafete-print-logo {
    font-weight: 700;
    letter-spacing: 0.12em;
}

.gafete-print-body {
    padding: 1.25rem 1rem 1.5rem;
    text-align: center;
}

.gafete-print-photo {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 0.75rem;
}

.gafete-print-name {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.25;
}

.gafete-print-role {
    color: var(--st-deep-blue);
    font-weight: 600;
    margin-top: 0.25rem;
}

.gafete-print-meta {
    font-size: 0.85rem;
    color: var(--st-text-muted);
}

.gafete-print-code {
    margin-top: 0.75rem;
    font-family: ui-monospace, monospace;
    letter-spacing: 0.08em;
}

.gafete-print-barcode {
    width: 100%;
    max-width: 240px;
    margin-top: 0.5rem;
}

/* ── UiKit demo ──────────────────────────────────────────────── */
.uikit-swatch {
    width: 3rem;
    height: 3rem;
    border-radius: var(--impulsa-radius-sm);
    border: 1px solid var(--st-surface-border);
}

/* ── Home dashboard (PrincipalWindow) ─────────────────────────── */
.home-dashboard {
    max-width: 1100px;
    margin: 0 auto;
}

.home-hero {
    overflow: hidden;
    border: none;
    background: linear-gradient(125deg, var(--st-surface) 0%, var(--st-surface-elevated) 45%, rgba(207, 239, 252, 0.55) 100%);
    box-shadow: var(--impulsa-shadow-md);
}

.home-hero-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.5rem 1.75rem;
}

.home-hero-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--st-gold-intense);
    margin: 0 0 0.35rem;
}

.home-hero-title {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    color: var(--st-text-primary);
    margin: 0;
    line-height: 1.15;
}

.home-hero-subtitle {
    margin: 0.5rem 0 0;
    color: var(--st-text-secondary);
    font-size: 0.92rem;
    max-width: 36rem;
}

.home-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.home-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--st-deep-blue-dark-1);
    background: rgba(0, 144, 208, 0.1);
}

.home-meta-chip-muted {
    color: var(--st-text-secondary);
    background: var(--st-pearl);
    font-weight: 500;
}

.home-hero-brand {
    flex-shrink: 0;
    width: 96px;
    height: 96px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(207, 239, 252, 0.65));
    box-shadow: inset 0 0 0 1px rgba(0, 144, 208, 0.12);
}

.home-hero-logo {
    object-fit: contain;
}

.home-stat-card {
    height: 100%;
    padding: 1.15rem 1.25rem;
    border-radius: var(--impulsa-radius-lg);
    border: none;
    background: var(--st-surface);
    box-shadow: 0 1px 2px rgba(30, 42, 54, 0.06), 0 4px 16px rgba(30, 42, 54, 0.04);
    transition: transform 0.15s, box-shadow 0.15s;
}

.home-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--impulsa-shadow-md);
}

.home-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--st-deep-blue);
    background: rgba(0, 144, 208, 0.1);
    margin-bottom: 0.75rem;
}

.home-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    color: var(--st-text-primary);
}

.home-stat-label {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: var(--st-text-secondary);
}

.home-panel-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--st-text-primary);
    margin: 0 0 0.85rem;
}

.home-panel-hint {
    font-size: 0.82rem;
    color: var(--st-text-secondary);
    margin: -0.35rem 0 0.85rem;
}

.home-session-list {
    display: grid;
    gap: 0.65rem;
}

.home-session-row {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.75rem;
    align-items: baseline;
    padding-bottom: 0.55rem;
    border-bottom: 1px dashed var(--st-surface-border);
}

.home-session-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.home-session-row dt {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--st-text-secondary);
    margin: 0;
}

.home-session-row dd {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--st-text-primary);
}

.home-quick-links {
    display: grid;
    gap: 0;
}

.home-quick-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.1rem;
    border: none;
    border-bottom: 1px solid var(--st-surface-border);
    border-radius: 0;
    background: transparent;
    text-decoration: none;
    transition: color 0.12s;
}

.home-quick-link:last-child {
    border-bottom: none;
}

.home-quick-link-body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.home-quick-link:hover {
    color: var(--st-deep-blue);
    background: transparent;
    transform: none;
}

.home-quick-link:hover .home-link-chevron {
    transform: translateX(3px);
    color: var(--st-deep-blue);
}

.home-quick-link-area {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--st-gold-intense);
}

.home-quick-link-item {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--st-deep-blue-dark-1);
}

.home-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--st-text-primary);
}

.home-area-card {
    border: none;
    box-shadow: 0 1px 2px rgba(30, 42, 54, 0.06), 0 4px 16px rgba(30, 42, 54, 0.04);
    transition: transform 0.15s, box-shadow 0.15s;
}

.home-area-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(30, 42, 54, 0.08);
}

.home-area-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--st-surface-border);
}

.home-area-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--st-text-primary);
    margin: 0;
}

.home-area-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    color: var(--st-deep-blue-dark-1);
    background: var(--st-pearl);
}

.home-area-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.home-area-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.1rem;
    border-radius: 0;
    font-size: 0.84rem;
    color: var(--st-text-primary);
    text-decoration: none;
    transition: color 0.12s;
}

.home-area-link span:first-child {
    min-width: 0;
}

.home-area-link:hover {
    background: transparent;
    color: var(--st-deep-blue);
}

.home-area-link:hover .home-link-chevron {
    transform: translateX(3px);
    color: var(--st-deep-blue);
}

.home-link-chevron {
    flex-shrink: 0;
    color: var(--st-silver-lunar);
    transition: transform 0.12s ease, color 0.12s ease;
}

.home-area-more {
    margin-top: 0.65rem;
    font-size: 0.75rem;
    color: var(--st-text-secondary);
}

@media (max-width: 767.98px) {
    .home-hero-body {
        flex-direction: column;
        align-items: flex-start;
        padding: 1.25rem;
    }

    .home-hero-brand {
        display: none;
    }

    .home-session-row {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }
}
