:root {
    --app-red: #c8102e;
    --app-red-dark: #930b21;
    --app-navy: #17233f;
    --app-blue: #1f4f8f;
    --app-green: #168a55;
    --app-ink: #17202f;
    --app-muted: #667085;
    --app-line: #dde3ec;
    --app-soft: #f3f6fa;
    --app-panel: #ffffff;
    --app-shadow: 0 16px 40px rgba(23, 32, 47, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body.app-body {
    min-height: 100vh;
    margin: 0;
    color: var(--app-ink);
    background: #eef2f6;
    font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
}

a {
    text-decoration: none;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px 16px;
    color: #fff;
    background: #111b30;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 22px;
}

.brand-mark {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fff;
    border-radius: 8px;
}

.brand-mark img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.brand-block strong {
    display: block;
    font-size: 1.1rem;
    line-height: 1.1;
}

.brand-block small {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.78rem;
}

.app-nav {
    gap: 5px;
}

.app-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 42px;
    padding: 10px 12px;
    color: rgba(255, 255, 255, 0.72);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.92rem;
}

.app-nav .nav-link i {
    width: 20px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1rem;
}

.app-nav .nav-link:hover,
.app-nav .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.app-nav .nav-link.active {
    box-shadow: inset 3px 0 0 var(--app-red);
}

.app-nav .nav-link:hover i,
.app-nav .nav-link.active i {
    color: #fff;
}

.app-main {
    min-width: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 76px;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.94);
    border-bottom: 1px solid var(--app-line);
    backdrop-filter: blur(12px);
}

.eyebrow {
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.topbar-title {
    margin-top: 2px;
    color: var(--app-ink);
    font-size: 1rem;
    font-weight: 700;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 6px 10px;
    color: var(--app-ink);
    background: var(--app-soft);
    border: 1px solid var(--app-line);
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 600;
}

.role-pill {
    padding: 3px 7px;
    color: #fff;
    background: var(--app-navy);
    border-radius: 999px;
    font-size: 0.7rem;
}

.app-content {
    width: min(100%, 1440px);
    padding: 28px;
}

.page-heading,
.d-flex.justify-content-between.align-items-center.mb-3 {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px !important;
}

.page-heading h1,
.d-flex.justify-content-between.align-items-center.mb-3 h4,
h4.mb-4 {
    margin: 0;
    color: var(--app-ink);
    font-size: 1.55rem;
    font-weight: 750;
    letter-spacing: 0;
}

.page-heading p {
    margin: 5px 0 0;
    max-width: 640px;
    color: var(--app-muted);
    font-size: 0.95rem;
}

.card {
    border: 1px solid var(--app-line);
    border-radius: 8px;
    box-shadow: var(--app-shadow);
}

.card-body {
    padding: 18px;
}

.stat-card {
    overflow: hidden;
    border: 1px solid var(--app-line);
}

.stat-card .card-body {
    min-height: 104px;
}

.stat-icon {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    border-radius: 8px;
}

.stat-label {
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.stat-value {
    margin-top: 2px;
    color: var(--app-ink);
    font-size: 1.58rem;
    font-weight: 800;
    line-height: 1.1;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--app-ink);
    font-size: 1rem;
    font-weight: 750;
}

.section-title span {
    color: var(--app-muted);
    font-size: 0.78rem;
    font-weight: 650;
}

.chart-card canvas {
    max-height: 330px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    border-radius: 7px;
    font-weight: 650;
}

.btn-sm {
    min-height: 32px;
    padding-inline: 10px;
}

.btn-danger {
    background: var(--app-red);
    border-color: var(--app-red);
}

.btn-danger:hover,
.btn-danger:focus {
    background: var(--app-red-dark);
    border-color: var(--app-red-dark);
}

.btn-outline-danger {
    color: var(--app-red);
    border-color: rgba(200, 16, 46, 0.45);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background: var(--app-red);
    border-color: var(--app-red);
}

.form-label {
    color: var(--app-ink);
    font-size: 0.82rem;
    font-weight: 700;
}

.form-control,
.form-select {
    min-height: 40px;
    color: var(--app-ink);
    border-color: #cfd7e3;
    border-radius: 7px;
    font-size: 0.92rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--app-blue);
    box-shadow: 0 0 0 0.2rem rgba(31, 79, 143, 0.13);
}

.form-check-input:checked {
    background-color: var(--app-red);
    border-color: var(--app-red);
}

.table {
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: 0.85rem 0.8rem;
    border-color: #edf0f5;
}

.table thead th {
    color: var(--app-muted);
    background: #f7f9fc;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.table tbody td {
    color: var(--app-ink);
    font-size: 0.92rem;
}

.badge {
    border-radius: 999px;
    font-weight: 700;
    padding: 0.42em 0.7em;
}

.modal-content {
    border: 0;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(23, 32, 47, 0.22);
}

.modal-header,
.modal-footer {
    border-color: var(--app-line);
}

.alert {
    border: 0;
    border-radius: 8px;
}

.pagination {
    margin-top: 18px;
}

.page-link {
    color: var(--app-red);
}

.page-item.active .page-link {
    background: var(--app-red);
    border-color: var(--app-red);
}

.member-photo,
.member-photo-placeholder {
    width: 132px;
    height: 132px;
    border-radius: 8px;
}

.member-photo {
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 14px 36px rgba(23, 32, 47, 0.16);
}

.member-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7b8797;
    background: #eef2f6;
    border: 1px solid var(--app-line);
}

.member-photo-placeholder i {
    font-size: 3.2rem;
}

.profile-card h5 {
    color: var(--app-ink);
    font-weight: 800;
}

.profile-status-list {
    display: grid;
    gap: 10px;
}

.profile-status-list div,
.profile-details > div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #edf0f5;
}

.profile-status-list div:last-child,
.profile-details > div:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.profile-status-list span,
.profile-details span {
    color: var(--app-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.profile-status-list strong,
.profile-details strong {
    color: var(--app-ink);
    font-size: 0.9rem;
    text-align: right;
}

@media (max-width: 991.98px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: relative;
        height: auto;
        padding: 14px;
    }

    .brand-block {
        padding-bottom: 14px;
    }

    .app-nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .app-topbar {
        position: relative;
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .app-content {
        padding: 18px;
    }
}

@media (max-width: 575.98px) {
    .app-nav {
        grid-template-columns: 1fr;
    }

    .page-heading,
    .d-flex.justify-content-between.align-items-center.mb-3 {
        flex-direction: column;
        align-items: stretch !important;
    }

    .page-heading .btn,
    .d-flex.justify-content-between.align-items-center.mb-3 .btn {
        width: 100%;
    }

    .topbar-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .user-chip,
    .topbar-actions .btn {
        width: 100%;
    }

    .card-body {
        padding: 15px;
    }
}
