/* Shared presentation layer for non-home modules. Module-specific CSS can still
   own complex components while common surfaces stay compact and consistent. */
.module-page:not(.module-page--home) {
    --module-radius: 6px;
    --module-gap: 12px;
    --module-border: var(--border-color, rgba(255, 255, 255, 0.08));
    --module-muted: var(--text-secondary, rgba(255, 255, 255, 0.58));
}

.module-page:not(.module-page--home) .module-content {
    display: flow-root;
    min-width: 0;
    padding-top: 14px;
    padding-bottom: 22px;
}

.module-page:not(.module-page--home) .module-content > .row {
    row-gap: var(--module-gap);
}

.module-page:not(.module-page--home) .module-content .card {
    border: 1px solid var(--module-border);
    border-radius: var(--module-radius);
    box-shadow: none;
}

.module-page:not(.module-page--home) .module-content :is(.card-header, .card__header) {
    min-height: 46px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--module-border);
}

.module-page:not(.module-page--home) .module-content :is(.card-body, .card__body, .card-container) {
    padding: 14px;
}

.module-page:not(.module-page--home) .module-content :is(.card-title, .card__title, .page-title) {
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
    letter-spacing: 0;
}

.module-page:not(.module-page--home) .module-content fieldset {
    min-width: 0;
    margin-bottom: var(--module-gap);
    padding: 14px;
    border: 1px solid var(--module-border);
    border-radius: var(--module-radius);
}

.module-page:not(.module-page--home) .module-content legend {
    width: auto;
    max-width: 100%;
    margin: 0 0 8px;
    padding: 0 6px;
    color: var(--text-default);
    font-size: 14px;
    line-height: 1.35;
    letter-spacing: 0;
}

.module-page:not(.module-page--home) .module-content :is(input, textarea, select, .choices__inner):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]) {
    max-width: 100%;
    border-color: var(--module-border);
    border-radius: 5px;
}

.module-page:not(.module-page--home) .module-content textarea {
    min-height: 96px;
    resize: vertical;
}

.module-page:not(.module-page--home) .module-content :is(input, textarea, select, button, a, [tabindex]):focus-visible {
    outline: 2px solid var(--span);
    outline-offset: 2px;
}

.module-page:not(.module-page--home) .module-content :is(.tabs__buttons, .tabs-nav, .nav-tabs, .filter-buttons, .chips) {
    display: flex;
    max-width: 100%;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.module-page:not(.module-page--home) .module-content :is(.tabs__button, .tabs-nav__item, .nav-link, .chips_btn, .filter) {
    min-height: 36px;
    border-radius: 5px;
    white-space: nowrap;
}

.module-page:not(.module-page--home) .module-content :is(.button, .secondary_btn, .primary_btn) {
    min-height: 38px;
    border-radius: 5px;
}

.module-page:not(.module-page--home) .module-content .table-responsive {
    overflow: auto;
    border: 1px solid var(--module-border);
    border-radius: var(--module-radius);
    scrollbar-width: thin;
}

.module-page:not(.module-page--home) .module-content .table-responsive table {
    min-width: 100%;
    margin-bottom: 0;
}

.module-page:not(.module-page--home) .module-content table :is(th, td) {
    height: auto;
    padding: 11px 12px;
    vertical-align: middle;
    line-height: 1.4;
}

.module-page:not(.module-page--home) .module-content table th {
    color: var(--module-muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: uppercase;
}

.module-page:not(.module-page--home) .module-content table tbody tr:not(:last-child) > * {
    border-bottom-color: var(--module-border);
}

.module-page:not(.module-page--home) .module-content :is(.pagination, .button_pagination, .pagination__list) {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
}

.module-page:not(.module-page--home) .module-content :is(.pagination a, .pagination button, .button_pagination button, .pagination__item) {
    display: inline-flex;
    min-width: 36px;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
}

.module-page:not(.module-page--home) .module-content :is(.popup__content, .modal-content, .modal__content) {
    width: min(720px, calc(100vw - 24px));
    max-height: calc(100dvh - 24px);
    overflow: auto;
    border: 1px solid var(--module-border);
    border-radius: 8px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
}

.module-page:not(.module-page--home) .module-content :is(.no-data, .empty-state, .table-empty) {
    min-height: 150px;
    padding: 24px 16px;
    color: var(--module-muted);
    text-align: center;
}

.module-page:not(.module-page--home) .module-content img {
    max-width: 100%;
}

@media (max-width: 767.98px) {
    .module-page:not(.module-page--home) .module-content {
        padding-top: 10px;
        padding-bottom: 18px;
    }

    .module-page:not(.module-page--home) .module-content :is(.card-header, .card__header) {
        padding: 10px 12px;
    }

    .module-page:not(.module-page--home) .module-content :is(.card-body, .card__body, .card-container) {
        padding: 12px;
    }

    .module-page:not(.module-page--home) .module-content table :is(th, td) {
        padding: 9px 10px;
    }

    .module-page:not(.module-page--home) .module-content :is(.popup__content, .modal-content, .modal__content) {
        width: calc(100vw - 20px);
        max-height: calc(100dvh - 20px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .module-page:not(.module-page--home) .module-content *,
    .module-page:not(.module-page--home) .module-content *::before,
    .module-page:not(.module-page--home) .module-content *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
