/* =====================================================
   NSU Module Shell
===================================================== */

.nsu-module-page {
    max-width: 1180px;
    margin: 1.75rem auto 2.25rem;
}

.nsu-module-header {
    margin-bottom: 1.5rem;
}

.nsu-module-back {
    display: inline-block;
    margin-bottom: .65rem;
    color: var(--nsu-blue, #003b8f);
    font-weight: 600;
    text-decoration: none;
}

.nsu-module-back:hover {
    text-decoration: underline;
}

.nsu-module-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 750;
    line-height: 1.2;
}

.nsu-module-description {
    margin: .45rem 0 0;
    color: #5f6b7a;
    max-width: 760px;
}


/* =====================================================
   Module Layout
===================================================== */

.nsu-module-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 1.5rem;
    align-items: start;
}


/* =====================================================
   Module Cards
===================================================== */

.nsu-module-card {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
    padding: 1.6rem;
}

.nsu-module-summary {
    position: sticky;
    top: 1rem;
}

.nsu-module-summary h2 {
    margin-top: 0;
    font-size: 1.25rem;
}

.nsu-module-summary-value {
    display: block;
    margin: .75rem 0;
    font-size: 2rem;
    font-weight: 800;
    color: var(--nsu-warning, #9a6700);
}


/* =====================================================
   Module Actions
===================================================== */

.nsu-module-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eceff3;
}

.nsu-module-actions .btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}


/* =====================================================
   Module Tables
===================================================== */



.nsu-module-table {
    width: 100%;
    margin-bottom: 0;
}

.nsu-module-table th,
.nsu-module-table td {
    padding: 1rem .85rem;
    vertical-align: middle;
}

.nsu-module-table th {
    font-size: .9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #495057;
}

.nsu-module-table tbody tr:hover {
    background: #f3f8ff;
}

.nsu-module-table th:last-child,
.nsu-module-table td:last-child {
    text-align: center;
}

/* Tables with checkbox/select columns */
.nsu-module-table--select th:first-child,
.nsu-module-table--select td:first-child {
    width: 52px;
}

/* Events need a wider title column */
.nsu-module-table--events th:first-child,
.nsu-module-table--events td:first-child {
    width: 32%;
}

.nsu-module-table--events th:nth-child(4),
.nsu-module-table--events td:nth-child(4) {
    min-width: 300px;
}


/* =====================================================
   Status Badges
===================================================== */

.nsu-status-badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .55rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    background: #dc3545;
    color: #fff;
}

.nsu-status-badge--success {
    background: #198754;
}

.nsu-status-badge--info {
    background: #005baa;
}

.nsu-status-badge--warning {
    background: #ffc107;
    color: #111827;
}

.nsu-status-badge--neutral {
    background: #6c757d;
}


/* =====================================================
   Empty States
===================================================== */

.nsu-module-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #5f6b7a;
}

.nsu-module-empty h2 {
    margin: 0 0 .5rem;
    color: #111827;
    font-size: 1.35rem;
}

.nsu-module-empty p {
    margin: 0 auto 1rem;
    max-width: 520px;
}


/* =====================================================
   Responsive
===================================================== */

@media (max-width: 900px) {
    .nsu-module-layout {
        grid-template-columns: 1fr;
    }

    .nsu-module-summary {
        position: static;
    }
}


.nsu-module-tabs {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #d9dee5;
}

.nsu-module-tab {
    display: inline-block;
    padding: .75rem 1rem;
    color: var(--nsu-blue, #003b8f);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.nsu-module-tab:hover {
    text-decoration: none;
    border-bottom-color: #b8c7dc;
}

.nsu-module-tab.is-active {
    color: #111827;
    border-bottom-color: var(--nsu-blue, #003b8f);
}

.nsu-module-card,
.nsu-module-card * {
    max-height: none !important;
}

.nsu-module-card {
    overflow: visible !important;
}

.nsu-detail-modal-body {
    padding: 1.5rem;
}

.nsu-detail-modal-image-wrap {
    margin-bottom: 1.25rem;
    text-align: center;
}

.nsu-detail-modal-image {
    display: block;
    max-width: 100%;
    max-height: 420px;
    margin: 0 auto;
    border-radius: 10px;
    object-fit: contain;
}

.nsu-detail-modal-description {
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.nsu-detail-modal-description p {
    margin-bottom: 1rem;
}

.nsu-detail-modal-metadata {
    margin-top: 1rem;
}

.nsu-detail-modal-metadata dt {
    font-weight: 700;
}

.nsu-detail-modal-metadata dd {
    margin-bottom: .75rem;
}

.nsu-skeleton {
    display: block;
    min-height: 1rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #eef1f5 25%, #f7f9fb 37%, #eef1f5 63%);
    background-size: 400% 100%;
    animation: nsuSkeleton 1.4s ease infinite;
}

.nsu-skeleton--short { width: 90px; }
.nsu-skeleton--medium { width: 180px; }
.nsu-skeleton--long { width: 280px; }
.nsu-skeleton--button { width: 84px; height: 32px; border-radius: 6px; }


@keyframes nsuSkeleton {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* Desktop */
.nsu-table-responsive {
    overflow: visible;
}
.nsu-action-result {
    text-align: center;
    padding: 1rem 1rem 1.5rem;
}

.nsu-action-result__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    margin-bottom: 1rem;
    border-radius: 999px;
    font-size: 2rem;
    font-weight: 800;
}

.nsu-action-result--success .nsu-action-result__icon {
    background: #e8f5ee;
    color: #198754;
}

.nsu-action-result--error .nsu-action-result__icon {
    background: #fdecec;
    color: #dc3545;
}

.nsu-action-result h1 {
    margin: 0 0 .5rem;
    font-size: 2rem;
    font-weight: 750;
}

.nsu-action-result p {
    margin: 0 auto;
    max-width: 640px;
    color: #5f6b7a;
}
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: block;
}

/* Tablets and phones */
@media (max-width: 992px) {

    .nsu-table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nsu-module-table {
        min-width: 900px;
    }
}