:root {
    --mcm-gold: #fcc126;
    --mcm-blue: #133ebd;
    --mcm-blue-soft: #2e66ec;
    --mcm-navy: #0c1d3d;
    --mcm-navy-2: #14284d;
    --mcm-ink: #151f33;
    --mcm-muted: #667a98;
    --mcm-surface: #eef2f8;
    --mcm-white: #ffffff;
    --shadow-soft: 0 12px 30px rgba(12, 30, 62, 0.09);
    --shadow-strong: 0 20px 44px rgba(12, 30, 62, 0.15);

    --topbar-h: 62px;
    --sidebar-w: 292px;
}

* {
    box-sizing: border-box;
}

/* Scrollbars globales mas delgados para reducir ruido visual. */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(103, 119, 144, 0.45) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(103, 119, 144, 0.45);
    border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(103, 119, 144, 0.65);
}

html,
body {
    max-width: 100%;
    overflow-x: clip;
}

@supports not (overflow: clip) {
    html,
    body {
        overflow-x: hidden;
    }
}

body {
    margin: 0;
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    color: var(--mcm-ink);
    background: radial-gradient(1200px 650px at 95% -10%, rgba(252, 193, 38, 0.18), transparent 62%),
                radial-gradient(950px 530px at -15% 10%, rgba(19, 62, 189, 0.1), transparent 62%),
                linear-gradient(180deg, #f5f8fd 0%, #edf2f8 100%);
    line-height: 1.35;
}

h1,
h2,
h3,
h4,
h5 {
    color: #182945;
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    font-weight: 700;
    letter-spacing: 0.1px;
}

a {
    color: var(--mcm-blue);
}

.top-nav {
    height: var(--topbar-h);
    background: linear-gradient(100deg, #0e2245 0%, #122d5f 48%, #163b83 100%);
    border-bottom: 2px solid var(--mcm-gold);
    box-shadow: 0 12px 34px rgba(10, 24, 52, 0.36);
    backdrop-filter: blur(6px);
}

.top-nav .container-fluid {
    padding-inline: 1rem 1.25rem;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.34rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: rgba(245, 249, 255, 0.93);
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.08);
}

.user-chip i {
    font-size: 0.92rem;
}

.user-chip-btn {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(245, 249, 255, 0.93);
}

.user-chip-btn:hover,
.user-chip-btn:focus,
.user-chip-btn:active,
.show > .user-chip-btn {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.16);
}

.user-chip-btn::after {
    margin-left: 0.15rem;
    vertical-align: 0.12em;
}

.user-dropdown-menu {
    border-radius: 0.8rem;
    border: 1px solid #d7e2f3;
    box-shadow: 0 14px 28px rgba(12, 33, 71, 0.18);
    min-width: 210px;
}

.user-dropdown-menu .dropdown-item {
    font-weight: 600;
    color: #253d62;
}

.user-dropdown-menu .dropdown-item:hover {
    background: #f2f7ff;
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.8rem 0.55rem;
}

.user-dropdown-meta {
    display: grid;
    min-width: 0;
}

.user-dropdown-meta strong {
    color: #223b63;
    font-size: 0.92rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-meta span {
    color: #5f7393;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: capitalize;
}

.user-avatar-lg-mini,
.user-avatar-fallback {
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.user-avatar-lg-mini {
    object-fit: cover;
    border: 1px solid #d1ddf2;
}

.user-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #6a7e9d;
    background: #eff4fc;
    border: 1px solid #d8e3f4;
}

.user-avatar-mini {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 1px 6px rgba(10, 20, 45, 0.35);
}

.profile-avatar-wrap {
    width: 180px;
    height: 180px;
    border-radius: 1rem;
    border: 1px solid #d9e5f6;
    background: #f4f8ff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar-lg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-empty {
    color: #6e809d;
    font-weight: 700;
}

.profile-crop-box {
    width: 320px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border: 1px solid #d8e4f6;
    border-radius: 0.9rem;
    overflow: hidden;
    background: #f0f4fb;
}

.profile-crop-box canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.person-with-avatar {
    display: inline-flex;
    align-items: center;
    gap: 0.62rem;
}

.list-avatar,
.list-avatar-fallback {
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 999px;
    flex-shrink: 0;
}

.list-avatar {
    object-fit: cover;
    border: 1px solid #d3e0f2;
}

.list-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eaf1fe;
    color: #4c6ea3;
    border: 1px solid #d4e1f5;
}

.entity-list-table td {
    vertical-align: middle;
}

.person-with-avatar-entity {
    display: flex;
    align-items: center;
    gap: 0.72rem;
    min-width: 0;
}

.entity-list-avatar,
.entity-list-avatar-fallback {
    width: 2.9rem;
    height: 2.9rem;
    flex: 0 0 2.9rem;
}

.person-with-avatar-entity > span:last-child {
    font-weight: 600;
    color: #223a5f;
    line-height: 1.2;
}

.lider-show-identity {
    display: flex;
    align-items: center;
    gap: 0.95rem;
}

.lider-show-avatar,
.lider-show-avatar-fallback {
    width: 84px;
    height: 84px;
    border-radius: 999px;
    flex: 0 0 84px;
    border: 1px solid #c8d7ee;
}

.lider-show-avatar {
    object-fit: cover;
}

.lider-show-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4c6ea3;
    background: #eaf1fe;
}

.lider-show-avatar-fallback i {
    font-size: 1.65rem;
}

.lider-show-info {
    min-width: 0;
}

.pastor-show-identity {
    display: flex;
    align-items: center;
    gap: 0.95rem;
}

.pastor-show-avatar,
.pastor-show-avatar-fallback {
    width: 84px;
    height: 84px;
    border-radius: 999px;
    flex: 0 0 84px;
    border: 1px solid #c8d7ee;
}

.pastor-show-avatar {
    object-fit: cover;
}

.pastor-show-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #4c6ea3;
    background: #eaf1fe;
}

.pastor-show-avatar-fallback i {
    font-size: 1.65rem;
}

.pastor-show-info {
    min-width: 0;
}

@media (max-width: 991.98px) {
    .entity-list-avatar,
    .entity-list-avatar-fallback {
        width: 2.45rem;
        height: 2.45rem;
        flex-basis: 2.45rem;
    }

    .lider-show-avatar,
    .lider-show-avatar-fallback {
        width: 68px;
        height: 68px;
        flex-basis: 68px;
    }

    .pastor-show-avatar,
    .pastor-show-avatar-fallback {
        width: 68px;
        height: 68px;
        flex-basis: 68px;
    }
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: #fff;
    font-family: "Source Sans 3", "Segoe UI", sans-serif;
    font-size: 1.58rem;
    font-weight: 700;
}

.navbar-brand:hover {
    color: #fff;
}

.system-pill {
    margin-left: 0.25rem;
    align-items: center;
    padding: 0.24rem 0.56rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.1);
    color: #f6f9ff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.brand-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--mcm-gold);
    box-shadow: 0 0 0 6px rgba(252, 193, 38, 0.18);
}

.brand-logo {
    width: 99px;
    height: 99px;
    margin:0;
    padding:0;
    margin-right:-8px;
    object-fit: contain;
    background: transparent;
}

.app-shell {
    display: flex;
    min-height: 100vh;
    padding-top: var(--topbar-h);
}

.app-sidebar {
    width: var(--sidebar-w);
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    z-index: 1030;
    overflow-y: auto;
    padding: 1rem 0.88rem 1.1rem;
    background: linear-gradient(185deg, #132b58 0%, #102449 50%, #0d1e3f 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

.sidebar-heading {
    margin: 0.18rem 0.6rem 0.9rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(195, 214, 255, 0.7);
    font-weight: 700;
}

.sidebar-nav {
    display: grid;
    gap: 0.33rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.74rem;
    padding: 0.74rem 0.84rem;
    border-radius: 0.76rem;
    color: #d8e5ff;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: 0.2s ease;
    position: relative;
}

.sidebar-link i {
    color: #9ec0ff;
    font-size: 1rem;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
    transform: translateX(2px);
}

.sidebar-link.active {
    color: #fff;
    background: linear-gradient(120deg, var(--mcm-blue) 0%, #2f67f1 100%);
    box-shadow: 0 10px 22px rgba(12, 49, 142, 0.44);
}

.sidebar-link.active::after {
    content: "";
    position: absolute;
    left: -0.24rem;
    top: 18%;
    bottom: 18%;
    width: 3px;
    border-radius: 999px;
    background: #ffd86c;
}

.sidebar-link.active i {
    color: #ffffff;
}

.app-content {
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    padding: 1.75rem 1.35rem 0;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.app-content::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.42) 0%, rgba(255, 255, 255, 0.16) 100%);
    pointer-events: none;
}

.content-wrap {
    max-width: 1480px;
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
}

.app-footer {
    position: relative;
    z-index: 1;
    margin: 0;
    margin-top: auto;
    margin-left: -1.35rem;
    margin-right: -1.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 0;
    padding: 0.18rem 0.6rem;
    min-height: 24px;
    background: linear-gradient(185deg, #132b58 0%, #102449 50%, #0d1e3f 100%);
    box-shadow: 0 -2px 8px rgba(8, 22, 48, 0.38);
}

.app-footer-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.app-footer-left,
.app-footer-right {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
}

.app-footer-right {
    margin-left: auto;
}

.app-footer-copy,
.app-footer-note,
.app-footer-sep {
    color: #d8e5ff;
    font-size: 0.79rem;
    line-height: 1;
}

.app-footer-note-mobile {
    display: none;
    color: #d8e5ff;
    font-size: 0.79rem;
    line-height: 1;
}

.app-footer-link {
    font-weight: 600;
    color: #9ec0ff;
    text-decoration: none;
    font-size: 0.79rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    line-height: 1;
}

.app-footer-link:hover {
    color: #ffffff;
}

.content-wrap > .d-flex:first-child {
    margin-bottom: 1rem !important;
}

.section-title {
    display: inline-flex;
    align-items: center;
    gap: 0.52rem;
}

.section-title i {
    font-size: 1.02rem;
    color: #3b5f99;
    background: #e9f1ff;
    border: 1px solid #d6e4fb;
    width: 1.72rem;
    height: 1.72rem;
    border-radius: 0.46rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.card {
    border: 1px solid #dee6f3;
    border-radius: 1.05rem;
    background: #fff;
    box-shadow: var(--shadow-soft);
    transition: box-shadow 0.24s ease, transform 0.24s ease;
}

.card:hover {
    box-shadow: var(--shadow-strong);
    transform: translateY(-1px);
}

.card-header {
    border-bottom: 1px solid #e8eef8;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    color: #22395d;
    font-weight: 700;
    font-size: 0.96rem;
    letter-spacing: 0.2px;
}

form.card.card-body.mb-3 {
    border: 1px solid #dce6f5;
    border-radius: 0.95rem;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 8px 24px rgba(17, 36, 72, 0.08);
}

h1.h3 {
    font-weight: 800;
    letter-spacing: 0.2px;
}

h1.h3.mb-4,
h1.h3.mb-3 {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

h1.h3.mb-4:not(.section-title)::before,
h1.h3.mb-3:not(.section-title)::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: linear-gradient(120deg, var(--mcm-blue), var(--mcm-gold));
    box-shadow: 0 0 0 4px rgba(19, 62, 189, 0.12);
}

.table {
    margin: 0;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table thead th {
    border-bottom-width: 1px;
    border-color: #e3e8f2;
    text-transform: uppercase;
    font-size: 0.77rem;
    letter-spacing: 0.8px;
    color: #526583;
    font-weight: 800;
    background: #f7fafe;
    padding-top: 0.82rem;
    padding-bottom: 0.82rem;
    position: relative;
}

.table tbody td {
    vertical-align: middle;
    border-color: #edf2f8;
    color: #223455;
    font-weight: 500;
}

.table thead th:first-child,
.table tbody td:first-child {
    width: 62px;
    text-align: center;
}

.table tbody td:first-child {
    color: #6f7f98;
    font-weight: 700;
}

.table tbody td:last-child,
.table thead th:last-child {
    white-space: nowrap;
}

.table tbody td.text-end {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.45rem;
}

.btn-icon-only {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-only i {
    font-size: 0.86rem;
    line-height: 1;
}

.table-hover tbody tr:hover,
.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: #f8fbff;
}

.table-hover tbody tr:hover {
    transform: none;
}

.table-footer-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin: 0.85rem 1rem 1rem;
    padding: 0.76rem 0.92rem;
    border: 1px solid #e4ebf7;
    border-radius: 0.72rem;
    background: #f8fbff;
}

.records-totalizer {
    display: inline-flex;
    align-items: center;
    gap: 0.36rem;
    color: #4e6383;
    font-size: 0.91rem;
    font-weight: 600;
}

.records-totalizer i {
    color: #6a7fa0;
}

.records-totalizer strong {
    color: #1b3e75;
    font-weight: 700;
}

.table-pagination .page-link {
    border-radius: 0.56rem;
    border: 1px solid #d6e0ef;
    color: #244272;
    background: #fff;
    margin: 0 1px;
    min-width: 34px;
    text-align: center;
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.25rem 0.52rem;
}

.table-pagination .page-link:hover {
    background: #eef4ff;
    color: #17396f;
}

.table-pagination .page-item.active .page-link {
    border-color: #1f4fc6;
    background: linear-gradient(120deg, var(--mcm-blue) 0%, #346dff 100%);
    color: #fff;
    box-shadow: 0 6px 12px rgba(19, 62, 189, 0.22);
}

.table-pagination .page-item.disabled .page-link {
    color: #91a0b7;
    background: #f7f9fd;
}

.form-control,
.form-select,
textarea {
    border-radius: 0.72rem;
    border-color: #cfd8e8;
    min-height: 44px;
    font-size: 0.94rem;
    background-color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.form-control::placeholder {
    color: #7b8ba3;
}

.form-control:focus,
.form-select:focus,
textarea:focus {
    border-color: #6f91f1;
    box-shadow: 0 0 0 0.24rem rgba(19, 62, 189, 0.17);
}

.form-label {
    font-size: 0.86rem;
    color: #2f4566;
    font-weight: 700;
}

.form-dynamic {
    border-color: #dbe6f6;
    background: linear-gradient(180deg, #ffffff 0%, #f9fcff 100%);
}

.form-section-title {
    display: flex;
    align-items: center;
    gap: 0.42rem;
    margin-top: 1rem;
    margin-bottom: 0.4rem;
    padding: 0.2rem 0 0.55rem;
    border-bottom: 1px dashed #d9e4f3;
    color: #28446c;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.65px;
}

.form-dynamic .form-section-title:first-child {
    margin-top: 0.1rem;
}

.form-section-title i {
    color: #426aa5;
    font-size: 0.86rem;
}

.academy-level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.55rem;
    margin-top: 0.35rem;
}

.academy-level-option {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    min-width: 0;
    padding: 0.62rem 0.72rem;
    margin: 0;
    border: 1px solid #d9e2f0;
    border-radius: 0.65rem;
    background: #ffffff;
    cursor: pointer;
}

.academy-level-option .form-check-input {
    float: none;
    margin: 0;
    margin-left: 0;
    flex-shrink: 0;
    width: 1.05rem;
    height: 1.05rem;
    border-color: #9ab0d3;
}

.academy-level-option .form-check-input:checked {
    background-color: var(--mcm-blue);
    border-color: var(--mcm-blue);
}

.academy-level-option .form-check-label {
    color: #273f62;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.academy-level-option:has(.form-check-input:checked) {
    border-color: #6f91f1;
    background: #f3f7ff;
    box-shadow: inset 0 0 0 1px rgba(19, 62, 189, 0.12);
}

.btn {
    border-radius: 0.7rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-brand {
    border: 0;
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.2px;
    background: linear-gradient(115deg, var(--mcm-blue) 0%, var(--mcm-blue-soft) 100%);
    border-radius: 0.74rem;
    box-shadow: 0 10px 20px rgba(19, 62, 189, 0.26);
}

.btn-brand:hover {
    color: #fff;
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.btn-outline-primary,
.btn-outline-danger,
.btn-outline-secondary {
    font-weight: 700;
    border-width: 1.4px;
}

.btn-outline-primary:hover,
.btn-outline-danger:hover,
.btn-outline-secondary:hover {
    transform: translateY(-1px);
}

.alert {
    border: 0;
    border-radius: 0.86rem;
    box-shadow: 0 8px 20px rgba(30, 43, 70, 0.08);
}

.text-muted {
    color: #6b7f9e !important;
}

.table .badge,
.status-pill {
    padding: 0.32rem 0.6rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}

.status-pill.active {
    background: #e6f8ed;
    color: #1f7b44;
    border: 1px solid #c2ebd1;
}

.status-pill.inactive {
    background: #fff2e8;
    color: #a85822;
    border: 1px solid #ffd9bd;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.7rem;
}

.report-summary-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    border: 1px solid #dce7f6;
    border-radius: 0.82rem;
    padding: 0.68rem 0.76rem;
}

.report-summary-card .label {
    color: #6c7e98;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.65px;
    font-weight: 700;
}

.report-summary-card .value {
    color: #1b365f;
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 0.14rem;
}

.report-info-grid {
    display: grid;
    gap: 0.52rem;
}

.report-info-grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-info-grid.one-col {
    grid-template-columns: 1fr;
}

.report-info-item {
    border: 1px solid #dee8f6;
    background: #fbfdff;
    border-radius: 0.68rem;
    padding: 0.52rem 0.6rem;
    min-width: 0;
}

.report-info-item .k,
.report-note-box .k,
.report-metric-item .k {
    color: #607590;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.65px;
    font-weight: 700;
    display: block;
}

.report-info-item .v,
.report-note-box .v,
.report-metric-item .v {
    color: #1f375d;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 0.08rem;
    display: block;
    word-break: break-word;
}

.report-metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.52rem;
}

.report-metric-item {
    border: 1px solid #dce6f5;
    border-radius: 0.68rem;
    background: #f7faff;
    padding: 0.54rem 0.58rem;
}

.report-note-box {
    border: 1px solid #dce6f5;
    border-radius: 0.7rem;
    background: #fbfdff;
    padding: 0.62rem 0.68rem;
}

.report-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.62rem;
}

.report-photo-item {
    display: block;
    border-radius: 0.72rem;
    overflow: hidden;
    border: 1px solid #dbe6f6;
    background: #f6f9ff;
    box-shadow: 0 6px 14px rgba(15, 34, 70, 0.08);
}

.report-photo-item img {
    width: 100%;
    height: 130px;
    object-fit: cover;
    display: block;
    transition: transform 0.24s ease;
}

.report-photo-item:hover img {
    transform: scale(1.03);
}

.profile-photo-clickable {
    cursor: zoom-in;
}

.profile-photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 5100;
    display: none;
}

.profile-photo-lightbox.active {
    display: block;
}

.profile-photo-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
}

.profile-photo-lightbox-dialog {
    position: relative;
    z-index: 1;
    width: 100vw;
    height: 100vh;
    display: grid;
    place-items: center;
}

.profile-photo-lightbox-image {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    image-rendering: auto;
    border-radius: 0;
    box-shadow: 0 12px 44px rgba(0, 0, 0, 0.42);
}

.profile-photo-lightbox-close {
    position: absolute;
    top: 8px;
    right: 8px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background:
        radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 54%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0 6px, rgba(255, 255, 255, 0.04) 6px 12px),
        linear-gradient(160deg, rgba(255, 255, 255, 0.78), rgba(227, 234, 247, 0.88));
    backdrop-filter: blur(4px);
    color: #0f2346;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    padding: 0;
    font-weight: 700;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        0 8px 18px rgba(0, 0, 0, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.profile-photo-lightbox-close:hover {
    transform: translateY(-1px) scale(1.03);
    filter: brightness(1.03);
}

@media (max-width: 768px) {
    .profile-photo-lightbox-close {
        top: 6px;
        right: 6px;
        height: 38px;
        width: 38px;
    }
}

.resumen-filtro-card {
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    border: 1px solid #dce7f6;
}

.resumen-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 0.55rem;
}

.resumen-kpi-item {
    border: 1px solid #d8e4f5;
    border-radius: 0.72rem;
    background: #fbfdff;
    padding: 0.55rem 0.62rem;
}

.resumen-kpi-item span {
    display: block;
    color: #607590;
    text-transform: uppercase;
    letter-spacing: 0.55px;
    font-size: 0.68rem;
    font-weight: 700;
}

.resumen-kpi-item strong {
    display: block;
    margin-top: 0.15rem;
    color: #173768;
    font-size: 1.03rem;
}

.resumen-pastor-list {
    display: grid;
    gap: 0.75rem;
}

.resumen-pastor-card {
    border: 1px solid #dbe6f5;
    border-radius: 0.86rem;
    overflow: hidden;
    background: #fff;
}

.resumen-pastor-card.iglesia-central {
    border-left: 4px solid #0f4ac6;
}

.resumen-pastor-card.iglesia-hija {
    border-left: 4px solid #d08b00;
}

.resumen-pastor-header {
    padding: 0.72rem 0.82rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: #d7dde7;
    border-bottom: 1px solid #dbe7f6;
}

.resumen-pastor-header h3 {
    margin: 0;
    font-size: 1rem;
    color: #223a5f;
}

.iglesia-subtitle {
    margin-top: 0.2rem;
    display: flex;
    gap: 0.42rem;
    flex-wrap: wrap;
    align-items: center;
}

.iglesia-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.16rem 0.5rem;
    border-radius: 999px;
    font-size: 0.71rem;
    font-weight: 700;
    letter-spacing: 0.25px;
}

.iglesia-pill-central {
    color: #0f3f9e;
    background: #e8f0ff;
    border: 1px solid #c7d9ff;
}

.iglesia-pill-hija {
    color: #7a5100;
    background: #fff2d9;
    border: 1px solid #f2d8a8;
}

.iglesia-parent-text {
    color: #5f7290;
    font-size: 0.78rem;
    font-weight: 600;
}

.resumen-pastor-meta {
    display: inline-flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    color: #4f6487;
    font-size: 0.82rem;
    font-weight: 600;
}

.resumen-pastor-meta strong {
    color: #213e67;
}

.resumen-pastor-card table th {
    white-space: nowrap;
    font-size: 0.75rem;
    color: #587196;
    text-transform: uppercase;
    letter-spacing: 0.55px;
    background: #f6f9ff;
}

.resumen-pastor-card table td {
    font-size: 0.86rem;
    color: #203b64;
    vertical-align: middle;
}

.iglesia-block-web {
    border: 1px solid #d7e3f4;
    border-radius: 0.9rem;
    overflow: hidden;
    background: #fff;
}

.iglesia-head-web {
    padding: 0.75rem 0.9rem;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
}

.iglesia-head-web.central {
    background: #bcc8d9;
    color: #1f3b61;
}

.iglesia-head-web.hija {
    background: #cfd6e2;
    color: #1f3b61;
}

.iglesia-meta-web {
    padding: 0.5rem 0.9rem;
    background: #f5f8ff;
    border-bottom: 1px solid #dbe6f5;
    color: #4f6487;
    font-size: 0.82rem;
    font-weight: 600;
}

.pastor-list-web {
    padding: 0.7rem;
    display: grid;
    gap: 0.7rem;
}

.pastor-card-web {
    border: 1px solid #dbe6f5;
    border-radius: 0.72rem;
    overflow: hidden;
    background: #fff;
}

.pastor-head-web {
    padding: 0.42rem 0.82rem;
    background: #d7dde7;
    color: #223a5f;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    border-bottom: 1px solid #c5cfde;
}

.pastor-head-web .name {
    font-size: 1.02rem;
}

.pastor-identity-web {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.pastor-avatar-web,
.pastor-avatar-fallback-web {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #b6c3d8;
    flex: 0 0 44px;
}

.pastor-avatar-web {
    object-fit: cover;
    display: inline-block;
}

.pastor-avatar-fallback-web {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #edf2f9;
    color: #3f5578;
}

.pastor-meta-web {
    font-size: 0.84rem;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    color: #4f6487;
}

.pastor-meta-row-web {
    display: inline-flex;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.pastor-detail-table {
    table-layout: fixed;
    width: 100%;
}

.pastor-detail-table col.col-celula {
    width: 22%;
}

.pastor-detail-table col.col-lider-principal,
.pastor-detail-table col.col-lider-asistente {
    width: 16%;
}

.pastor-detail-table col.col-fecha {
    width: 12%;
}

.pastor-detail-table col.col-asistencia,
.pastor-detail-table col.col-visitantes,
.pastor-detail-table col.col-conversiones {
    width: 7%;
}

.pastor-detail-table col.col-ofrenda {
    width: 13%;
}

.pastor-detail-table td:nth-child(1),
.pastor-detail-table th:nth-child(1) {
    white-space: normal;
}

.pastor-detail-table td:nth-child(4),
.pastor-detail-table td:nth-child(5),
.pastor-detail-table td:nth-child(6),
.pastor-detail-table td:nth-child(7),
.pastor-detail-table td:nth-child(8) {
    white-space: nowrap;
}

.ofrenda-cell-web {
    line-height: 1.05;
}

.ofrenda-amount-web {
    font-weight: 700;
    color: #223a5f;
}

.ofrenda-type-web {
    display: block;
    margin-top: 0.16rem;
    font-size: 0.72rem;
    color: #667b9d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (min-width: 992px) {
    .pastor-card-web .table-responsive {
        overflow-x: visible;
    }

    .pastor-detail-table th {
        white-space: nowrap;
        letter-spacing: 0.4px;
        font-size: 0.78rem;
    }

    .pastor-detail-table th:nth-child(5),
    .pastor-detail-table th:nth-child(6),
    .pastor-detail-table th:nth-child(7),
    .pastor-detail-table th:nth-child(8),
    .pastor-detail-table td:nth-child(5),
    .pastor-detail-table td:nth-child(6),
    .pastor-detail-table td:nth-child(7),
    .pastor-detail-table td:nth-child(8) {
        padding-left: 0.35rem;
        padding-right: 0.35rem;
    }
}

@media (max-width: 991.98px) {
    .pastor-detail-table {
        table-layout: auto;
    }

    .pastor-detail-table col {
        width: auto;
    }
}

.kpi-card {
    position: relative;
    overflow: hidden;
    border: 0;
    background: linear-gradient(145deg, #fff 0%, #f7faff 100%);
}

.kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--mcm-gold), var(--mcm-blue));
}

.kpi-label {
    color: #5b6880;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    font-weight: 800;
}

.kpi-value {
    font-size: 2rem;
    font-weight: 800;
    color: #0f2955;
}

.system-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.9rem;
}

.system-card {
    display: block;
    text-decoration: none;
    background: #fff;
    border: 1px solid #dce6f5;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 12px 24px rgba(15, 37, 70, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.system-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(15, 37, 70, 0.14);
}

.system-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 0.65rem;
    font-size: 1.05rem;
    margin-bottom: 0.48rem;
}

.system-card-title {
    display: block;
    color: #1a345c;
    font-size: 1.03rem;
    font-weight: 800;
}

.system-card-text {
    display: block;
    margin-top: 0.24rem;
    color: #5c7090;
    font-size: 0.9rem;
    min-height: 2.45rem;
}

.system-card-badge {
    margin-top: 0.58rem;
    display: inline-flex;
    align-items: center;
    font-size: 0.74rem;
    font-weight: 700;
    border-radius: 999px;
    padding: 0.22rem 0.56rem;
}

.system-card.system-celulas {
    border-color: #d3e5ff;
}

.system-card.system-celulas .system-card-icon {
    color: #1f58c8;
    background: #eaf2ff;
}

.system-card.system-celulas .system-card-badge {
    color: #1448ab;
    background: #e4efff;
    border: 1px solid #c7dcff;
}

.system-card.system-academia {
    border-color: #d8e7d8;
}

.system-card.system-academia .system-card-icon {
    color: #256f3f;
    background: #ebf8ef;
}

.system-card.system-academia .system-card-badge {
    color: #1f6538;
    background: #e4f4e9;
    border: 1px solid #c8e8d1;
}

.system-card.system-fundacion {
    border-color: #f0dfd1;
}

.system-card.system-fundacion .system-card-icon {
    color: #8f3f20;
    background: #fff2ea;
}

.system-card.system-fundacion .system-card-badge {
    color: #874124;
    background: #ffede3;
    border: 1px solid #f6d2be;
}

.card.p-3 {
    border-radius: 1rem;
    border-color: #dde7f6;
}

.card.p-3 hr {
    margin: 1.1rem 0;
    border-color: #dde6f4;
}

.select2-container {
    width: 100% !important;
}

.select2-container .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    min-height: 44px;
    border: 1px solid #c8d6ee;
    border-radius: 0.75rem;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    padding: 0.26rem 0.38rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.select2-container .select2-selection--single {
    display: flex;
    align-items: center;
}

.select2-container .select2-selection--single .select2-selection__rendered {
    color: #1d2c4b;
    font-size: 0.95rem;
    line-height: 1.35;
    padding-left: 0.2rem;
    padding-right: 1.9rem;
}

.select2-container .select2-selection--single .select2-selection__placeholder {
    color: #7a8eaf;
}

.select2-container .select2-selection--single .select2-selection__arrow {
    height: 100%;
    right: 0.55rem;
}

.select2-container .select2-selection--single .select2-selection__arrow b {
    border-color: #4767a7 transparent transparent transparent;
}

.select2-container--default .select2-selection--multiple {
    padding-right: 1.9rem;
}

.select2-container--default .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 0.34rem;
}

.select2-container--default .select2-selection--multiple .select2-search--inline .select2-search__field {
    margin-top: 0.3rem;
    margin-left: 0.2rem;
    color: #1d2c4b;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #2f5ec6;
    box-shadow: 0 0 0 0.2rem rgba(47, 94, 198, 0.15);
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #2f5ec6;
    box-shadow: 0 0 0 0.2rem rgba(47, 94, 198, 0.15);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    border: 1px solid #c4d4f1;
    background: linear-gradient(180deg, #edf4ff 0%, #e5efff 100%);
    color: #173a7a;
    border-radius: 999px;
    padding: 0.2rem 0.56rem;
    font-size: 0.84rem;
    font-weight: 600;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #1a3d80;
    margin-right: 0.34rem;
    border-right: 0;
}

.select2-dropdown {
    border: 1px solid #c8d6ee;
    border-radius: 0.75rem;
    box-shadow: 0 14px 32px rgba(24, 47, 91, 0.14);
    overflow: hidden;
}

.select2-container--open .select2-dropdown--below {
    margin-top: 0.28rem;
}

.select2-container--open .select2-dropdown {
    max-width: calc(100vw - 1rem);
}

.select2-search--dropdown {
    padding: 0.45rem;
    background: #f6f9ff;
    border-bottom: 1px solid #e2ebfa;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #c8d6ee;
    border-radius: 0.55rem;
    min-height: 36px;
    padding: 0.35rem 0.55rem;
    color: #1d2c4b;
}

.select2-container--default .select2-results__option {
    padding: 0.52rem 0.72rem;
    color: #233556;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: #2f5ec6;
    color: #ffffff;
}

.select2-container--default .select2-results__option--selected {
    background: #edf3ff;
    color: #173a7a;
}

.map-picker-wrap {
    border: 1px dashed #c8d6ee;
    border-radius: 0.75rem;
    padding: 0.65rem;
    background: #f8fbff;
}

.map-picker {
    width: 100%;
    height: 320px;
    border: 1px solid #c8d6ee;
    border-radius: 0.75rem;
    overflow: hidden;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.4rem;
    background: radial-gradient(880px 460px at 10% 8%, rgba(208, 160, 35, 0.19), transparent 58%),
                radial-gradient(920px 560px at 92% 92%, rgba(38, 88, 214, 0.2), transparent 58%),
                linear-gradient(145deg, #f3f6fc 0%, #dde5f2 100%);
}

.login-shell {
    width: min(1120px, 100%);
    border-radius: 1.35rem;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.2fr 0.95fr;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid #dbe5f5;
    box-shadow: 0 28px 62px rgba(12, 31, 72, 0.18);
    backdrop-filter: blur(2px);
    box-sizing: border-box;
}

.login-shell.login-shell-compact {
    width: min(980px, 100%);
}

.login-brand {
    position: relative;
    padding: 3.25rem;
    background: linear-gradient(140deg, #0c255d 0%, #13377c 56%, #1f4fb3 100%);
    color: #fff;
}

.login-brand::after {
    content: "";
    position: absolute;
    width: 270px;
    height: 270px;
    border-radius: 50%;
    right: -95px;
    bottom: -95px;
    background: radial-gradient(circle, rgba(245, 192, 50, 0.92) 0%, rgba(245, 192, 50, 0.14) 62%, transparent 78%);
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f8df8d;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    padding: 0.38rem 0.7rem;
    position: relative;
    z-index: 1;
}

.login-brand-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.24);
    padding: 0.38rem;
    box-shadow: 0 10px 24px rgba(7, 21, 48, 0.25);
    position: relative;
    z-index: 1;
}

.login-brand h1 {
    color: #fff;
    font-size: clamp(2.1rem, 2.8vw, 2.95rem);
    margin: 0.85rem 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    max-width: 12ch;
    position: relative;
    z-index: 1;
}

.login-brand p {
    color: rgba(255, 255, 255, 0.9);
    max-width: 36ch;
    position: relative;
    z-index: 1;
    line-height: 1.5;
}

.login-brand-list {
    position: relative;
    z-index: 1;
    margin: 1.35rem 0 1.75rem;
    padding-left: 1.1rem;
    color: rgba(255, 255, 255, 0.92);
}

.login-brand-list li {
    margin-bottom: 0.46rem;
}

.login-brand-org {
    color: #f4f7ff;
    line-height: 1.45;
}

.login-card {
    padding: 2.45rem 2.45rem 2.2rem;
    background: linear-gradient(170deg, #ffffff 0%, #f7f9fc 100%);
}

.login-eyebrow {
    display: inline-block;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2f5ec6;
    margin-bottom: 0.25rem;
}

.login-card h2 {
    color: var(--mcm-navy);
    margin-bottom: 0.5rem;
    font-size: clamp(1.85rem, 2.2vw, 2.25rem);
    line-height: 1.15;
}

.login-subtitle {
    color: #5f6f8d;
    margin-bottom: 1.15rem;
}

.login-card .form-label {
    color: #213a70;
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.login-card .form-control {
    min-height: 50px;
    border-radius: 0.85rem;
    border-color: #c9d7ec;
    background: #f9fbff;
    box-shadow: inset 0 1px 2px rgba(12, 31, 75, 0.04);
}

.login-card .form-control:focus {
    border-color: #2f5ec6;
    box-shadow: 0 0 0 0.2rem rgba(47, 94, 198, 0.17);
    background: #fff;
}

.login-card .btn-brand {
    min-height: 50px;
    border-radius: 0.85rem;
    font-size: 1.05rem;
    font-weight: 700;
    box-shadow: 0 12px 26px rgba(36, 78, 188, 0.24);
}

.login-footnote {
    margin-top: 0.9rem;
    font-size: 0.82rem;
    color: #6b7994;
}

.auth-link-row {
    margin-top: 1.35rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.auth-link-row a {
    color: #234ca9;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.92rem;
}

.auth-link-row a:hover {
    color: #16346f;
    text-decoration: underline;
}

@media (max-width: 991px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        box-shadow: 0 18px 32px rgba(8, 22, 48, 0.32);
    }

    .app-sidebar.open {
        transform: translateX(0);
    }

    .app-content {
        margin-left: 0;
        width: 100%;
        padding: 1rem 1rem 0;
    }

    .app-footer {
        margin-left: -1rem;
        margin-right: -1rem;
    }

    .app-content::before {
        display: none;
    }

    .table-footer-block {
        flex-direction: column;
        align-items: stretch;
        margin-inline: 0.7rem;
    }

    .table-pagination {
        justify-content: center;
    }

    .top-nav .container-fluid {
        padding-inline: 0.75rem;
    }

    .navbar-brand {
        font-size: 1.3rem;
    }

    .content-wrap > .d-flex.justify-content-between {
        flex-wrap: wrap;
        gap: 0.6rem;
    }

    .content-wrap > .d-flex.justify-content-between .btn {
        min-height: 38px;
    }

    .card.p-3 .d-flex.gap-2,
    form.card .d-flex.gap-2,
    .content-wrap .d-flex.gap-2 {
        flex-wrap: wrap;
    }

    .card.p-3 .d-flex.gap-2 .btn,
    form.card .d-flex.gap-2 .btn {
        flex: 1 1 auto;
    }

    .table tbody td.text-end {
        gap: 0.3rem;
    }

    .btn-icon-only {
        width: 1.9rem;
        height: 1.9rem;
    }
}

@media (max-width: 900px) {
    .login-page {
        padding: 0.95rem;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-brand {
        padding: 2.2rem;
    }

    .login-brand-logo {
        width: 52px;
        height: 52px;
    }

    .login-brand h1 {
        max-width: none;
    }

    .login-card {
        padding: 2rem;
    }

    .auth-link-row {
        justify-content: flex-start;
    }
}

@media (max-width: 767px) {
    .login-page {
        padding: 0.62rem;
    }

    .login-shell,
    .login-shell.login-shell-compact {
        width: 100%;
        border-radius: 0.98rem;
    }

    .login-brand {
        padding: 1.2rem;
    }

    .login-brand::after {
        width: 150px;
        height: 150px;
        right: -48px;
        bottom: -48px;
    }

    .login-brand-logo {
        width: 46px;
        height: 46px;
    }

    .login-badge {
        font-size: 0.68rem;
        padding: 0.3rem 0.55rem;
    }

    .login-brand h1 {
        font-size: clamp(1.35rem, 8vw, 1.85rem);
        letter-spacing: 0.4px;
        margin-top: 0.7rem;
        margin-bottom: 0.55rem;
    }

    .login-brand p,
    .login-brand-org,
    .login-brand-list {
        max-width: none;
        font-size: 0.94rem;
    }

    .login-brand-list {
        margin: 1rem 0 1.2rem;
        padding-left: 1rem;
    }

    .login-card {
        padding: 1.15rem;
    }

    .login-card h2 {
        font-size: clamp(1.45rem, 7vw, 1.78rem);
        margin-bottom: 0.45rem;
    }

    .login-subtitle {
        margin-bottom: 0.9rem;
        font-size: 0.94rem;
    }

    .login-card .form-control {
        min-height: 46px;
    }

    .login-card .btn-brand {
        min-height: 46px;
        font-size: 1rem;
    }

    .auth-link-row {
        margin-top: 1rem;
        gap: 0.55rem;
    }

    .app-content {
        padding: 0.82rem 0.82rem 0;
    }

    .app-footer {
        margin-left: -0.82rem;
        margin-right: -0.82rem;
    }

    .section-title {
        gap: 0.4rem;
    }

    .section-title i {
        width: 1.55rem;
        height: 1.55rem;
        font-size: 0.9rem;
    }

    h1.h3 {
        font-size: 1.28rem;
    }

    .card,
    .card.p-3,
    form.card.card-body.mb-3 {
        border-radius: 0.85rem;
    }

    .table thead th,
    .table tbody td {
        font-size: 0.82rem;
        padding-top: 0.66rem;
        padding-bottom: 0.66rem;
    }

    .table thead th:first-child,
    .table tbody td:first-child {
        width: 52px;
    }

    .records-totalizer {
        font-size: 0.84rem;
    }

    .table-pagination .page-link {
        min-width: 30px;
        font-size: 0.78rem;
        padding: 0.2rem 0.44rem;
    }

    .form-control,
    .form-select,
    textarea {
        min-height: 41px;
    }

    select[multiple] {
        min-height: 140px;
    }

    .academy-level-grid {
        grid-template-columns: 1fr;
    }

    .report-info-grid.two-col {
        grid-template-columns: 1fr;
    }

    .report-metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .system-grid {
        grid-template-columns: 1fr;
    }

    .app-footer {
        padding: 0.16rem 0.4rem;
        min-height: 22px;
    }

    .app-footer-main {
        justify-content: space-between;
        gap: 0.24rem;
    }

    .app-footer-left,
    .app-footer-right {
        gap: 0.24rem;
    }

    .app-footer-copy,
    .app-footer-note,
    .app-footer-sep,
    .app-footer-link,
    .app-footer-note-mobile {
        font-size: 0.74rem;
    }

    .app-footer-link {
        padding: 0;
    }

    .app-footer-sep,
    .app-footer-note {
        display: none;
    }

    .app-footer-note-mobile {
        display: inline;
    }
}

@media (max-width: 575px) {
    .report-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-metric-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 575px) {
    .navbar-brand {
        font-size: 1.16rem;
        gap: 0.48rem;
    }

    .brand-dot {
        width: 10px;
        height: 10px;
    }

    .brand-logo {
        width: 38px;
        height: 38px;
    }

    .top-nav .btn.btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.76rem;
    }

    .user-chip-btn {
        padding: 0.28rem 0.52rem;
        font-size: 0.76rem;
    }

    .user-avatar-mini {
        width: 1.9rem;
        height: 1.9rem;
    }

    .list-avatar,
    .list-avatar-fallback {
        width: 2.05rem;
        height: 2.05rem;
    }

    .table-footer-block {
        margin-inline: 0.5rem;
        padding: 0.62rem 0.68rem;
    }

    .table-pagination .page-link {
        min-width: 28px;
        padding-inline: 0.36rem;
    }

    .card.p-3 .d-flex.gap-2 .btn,
    form.card .d-flex.gap-2 .btn {
        width: 100%;
    }

    .btn-icon-only {
        width: 1.8rem;
        height: 1.8rem;
    }
}
