/* Church Management System - AdminLTE 4 overrides */

:root {
    --cms-primary: #1e3a5f;
    --cms-table-head: #0d6efd;
    --cms-table-head-border: #0b5ed7;
}

/* Blue table headers — all pages */
.table > :not(caption) > * > th,
.table thead th,
.dataTables_wrapper .table > thead > tr > th {
    background-color: var(--cms-table-head) !important;
    color: #fff !important;
    border-color: var(--cms-table-head-border) !important;
    font-weight: 600;
    vertical-align: middle;
}

.table thead th a,
.table thead th .dt-column-order,
.dataTables_wrapper .table thead th.sorting,
.dataTables_wrapper .table thead th.sorting_asc,
.dataTables_wrapper .table thead th.sorting_desc {
    color: #fff !important;
}

.table thead th.sorting::before,
.table thead th.sorting::after,
.table thead th.sorting_asc::before,
.table thead th.sorting_asc::after,
.table thead th.sorting_desc::before,
.table thead th.sorting_desc::after {
    color: rgba(255, 255, 255, 0.75) !important;
}

/* Table action buttons — icon + text */
.table td .btn-sm {
    white-space: nowrap;
}

/* Church brand accent on sidebar */
.app-sidebar .brand-link .brand-image {
    background-color: var(--cms-primary) !important;
}

.small-box-icon.bi {
    font-size: 4rem;
    right: 15px;
    top: 15px;
    opacity: 0.15;
    position: absolute;
    z-index: 0;
}

.small-box .inner {
    position: relative;
    z-index: 1;
}

.small-box .inner h3 {
    font-size: 1.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.small-box .inner small {
    font-size: 0.78rem;
    margin-top: 0.15rem;
}

.cms-small-box-teal {
    background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%) !important;
    color: #fff !important;
}

.cms-small-box-teal-dark {
    background: linear-gradient(135deg, #115e59 0%, #0f766e 100%) !important;
    color: #fff !important;
}

/* SweetAlert — validation (form checks) */
.cms-swal-validation .swal2-icon.swal2-warning {
    border-color: #f59e0b;
    color: #f59e0b;
}

.cms-swal-validation .swal2-title {
    color: #1e3a5f;
    font-size: 1.35rem;
}

.cms-swal-validation .swal2-html-container,
.cms-swal-validation .swal2-content {
    color: #475569;
}

/* SweetAlert — centered success/info toasts */
.ax-swal-toast.swal2-popup {
    width: 28rem;
    max-width: calc(100vw - 2rem);
    padding: 1.75rem 1.5rem 1.5rem;
    border-radius: 0.75rem;
}

.ax-swal-toast .swal2-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
}

.ax-swal-toast .swal2-html-container {
    font-size: 0.95rem;
    color: #475569;
}

/* Legacy class aliases — module pages still use these */
.page-header {
    margin-bottom: 1rem;
}

.page-header h2 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.table-card,
.stat-card {
    /* AdminLTE cards handle styling; keep for compatibility */
}

.badge-status-visitor { background-color: #6c757d; }
.badge-status-active { background-color: #198754; }
.badge-status-inactive { background-color: #ffc107; color: #000; }
.badge-status-transferred { background-color: #0dcaf0; color: #000; }
.badge-status-deceased { background-color: #212529; }

.qr-display {
    font-family: monospace;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

/* DataTables in dashboard cards — controls align with padded card body */
.card .dataTables_wrapper .row:first-child,
.card .dataTables_wrapper .row:last-child,
.staff-card .dataTables_wrapper .row:first-child,
.staff-card .dataTables_wrapper .row:last-child,
.premium-shell .dataTables_wrapper .row:first-child,
.premium-shell .dataTables_wrapper .row:last-child,
.reports-panel-body .dataTables_wrapper .row:first-child,
.reports-panel-body .dataTables_wrapper .row:last-child,
.cms-panel .dataTables_wrapper .row:first-child,
.cms-panel .dataTables_wrapper .row:last-child {
    padding-left: 0;
    padding-right: 0;
}

.user-avatar {
    font-size: 0.875rem;
}

.login-logo a {
    color: var(--cms-primary);
    text-decoration: none;
}

.login-logo a:hover {
    color: #0d6efd;
}

/* Page preloader — full-page load only (see app.js) */
.page-preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f4f6f9;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.page-preloader--skip,
.page-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-preloader-inner {
    text-align: center;
}

.page-preloader-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border: 4px solid rgba(30, 58, 95, 0.15);
    border-top-color: var(--cms-primary);
    border-radius: 50%;
    animation: page-preloader-spin 0.8s linear infinite;
}

.page-preloader-text {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cms-primary);
    letter-spacing: 0.02em;
}

@keyframes page-preloader-spin {
    to { transform: rotate(360deg); }
}

[data-bs-theme="dark"] .page-preloader {
    background: #212529;
}

[data-bs-theme="dark"] .page-preloader-text {
    color: #adb5bd;
}

[data-bs-theme="dark"] .page-preloader-spinner {
    border-color: rgba(255, 255, 255, 0.12);
    border-top-color: #6ea8fe;
}

/* ============================================================
   AUTH PAGES — Glassmorphism login (Duapa-style)
   ============================================================ */
.auth-layout {
    margin: 0;
    min-height: 100vh;
}

.auth-layout .page-preloader-text {
    color: rgba(255, 255, 255, 0.95);
}

.auth-layout .page-preloader-spinner {
    border-color: rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
}

.auth-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}

.auth-glass-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 720px;
    min-width: min(100%, 340px);
    padding: 2.75rem 3rem 2.5rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

.auth-card-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-church-logo {
    display: block;
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 0 auto 0.75rem;
    border-radius: 10px;
    object-fit: contain;
}

.auth-card-heading {
    margin: 0 0 0.4rem;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #1a2634;
    line-height: 1.35;
}

.auth-card-subtitle {
    margin: 0;
    font-size: 1rem;
    font-weight: 400;
    color: #3d4f63;
    line-height: 1.4;
}

.auth-card-subtitle--login {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.02em;
    text-transform: none;
}

/* Legacy aliases */
.auth-card-label {
    margin: 0 0 0.4rem;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #1a2634;
}

.auth-card-title {
    margin: 0 0 2rem;
    font-size: 1rem;
    font-weight: 400;
    color: #3d4f63;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.auth-field {
    margin: 0;
}

.password-toggle-wrap {
    position: relative;
}

.password-toggle-wrap .auth-input,
.password-toggle-wrap .form-control {
    padding-right: 3rem;
}

.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    border: none;
    background: transparent;
    color: #5a6f86;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.password-toggle-btn:hover {
    color: #1a2634;
}

.password-toggle-btn:focus {
    outline: none;
    color: #1a2634;
}

.auth-input {
    width: 100%;
    padding: 1rem 1.15rem;
    border: none;
    border-radius: 10px;
    background: rgba(230, 240, 255, 0.92);
    color: #1a2a3a;
    font-size: 1rem;
    outline: none;
    transition: box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input::placeholder {
    color: rgba(26, 42, 58, 0.55);
}

.auth-input:focus {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(91, 155, 213, 0.45);
}

.auth-submit {
    width: 100%;
    margin-top: 0.5rem;
    padding: 1rem 1.15rem;
    border: none;
    border-radius: 10px;
    background: #4a90c9;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.auth-submit:hover {
    background: #3a7fb8;
}

.auth-submit:active {
    transform: scale(0.99);
}

.auth-link {
    display: block;
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.9rem;
    color: #fff;
    text-decoration: none;
}

.auth-link:hover {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: underline;
}

.auth-link-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.auth-server-panel {
    padding-top: 0.25rem;
}

.auth-company-selected {
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #1a2634;
}

.auth-layout--company-bg:not(.auth-layout--pro)::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(238, 242, 247, 0.65);
    z-index: 0;
    pointer-events: none;
}

.auth-company-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-company-logo {
    display: block;
    width: 100%;
    max-width: 140px;
    height: auto;
    margin: 0 auto 0.85rem;
    object-fit: contain;
    border-radius: 12px;
}

.auth-company-name {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e3a5f;
    line-height: 1.3;
}

.auth-layout--company-bg .auth-page,
.auth-layout--company-bg .page-preloader {
    position: relative;
    z-index: 1;
}

/* Clean login with logo watermark background */
.auth-layout--logo-bg {
    background-repeat: no-repeat;
    background-position: center center;
    background-size: min(680px, 70vw);
    background-attachment: fixed;
}

.auth-layout--logo-bg::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(238, 242, 247, 0.65);
    z-index: 0;
    pointer-events: none;
}

.auth-layout--logo-bg .auth-page,
.auth-layout--logo-bg .page-preloader {
    position: relative;
    z-index: 1;
}

.auth-layout--logo-bg .page-preloader-text {
    color: #1e3a5f;
}

.auth-layout--logo-bg .page-preloader-spinner {
    border-color: rgba(30, 58, 95, 0.15);
    border-top-color: #1e3a5f;
}

.auth-glass-card--clean {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.auth-layout--logo-bg .auth-card-subtitle--login {
    color: #1e3a5f;
}

.auth-layout--logo-bg .auth-link {
    color: #1d4ed8;
}

.auth-layout--logo-bg .auth-link:hover {
    color: #1e40af;
}

.auth-layout--logo-bg .auth-company-selected {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #0f172a;
}

.auth-card-note {
    margin: 0 0 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: #4a6078;
    line-height: 1.45;
}

.auth-glass-card--light-text .auth-card-heading,
.auth-glass-card--light-text .auth-card-subtitle,
.auth-glass-card--light-text .auth-card-note {
    color: #fff;
}

/* ============================================================
   DASHBOARD & APP SHELL — Duapa-style admin
   ============================================================ */
.cms-app-body {
    background: #eceff3 !important;
}

.cms-app-body .app-main {
    background: #eceff3;
}

/*
 * SMS-style app shell (AdminLTE 3 pattern on AdminLTE 4):
 * Fixed full-height sidebar with internal scroll; content column is a flex stack
 * so the footer stays pinned to the bottom of the viewport on short pages.
 */
body.fixed-header.cms-app-body .app-wrapper {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
    height: auto !important;
}

body.fixed-header.cms-app-body .app-main {
    flex: 1 1 auto !important;
}

body.fixed-header.cms-app-body .app-footer {
    flex-shrink: 0;
    margin-top: auto;
}

@media (min-width: 992px) {

    body.fixed-header.cms-app-body .app-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin-left: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        z-index: 1038;
    }

    body.fixed-header.cms-app-body .cms-sidebar-user {
        flex-shrink: 0;
    }

    body.fixed-header.cms-app-body .app-sidebar .sidebar-wrapper {
        flex: 1 1 auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }

    body.fixed-header.cms-app-body .app-header,
    body.fixed-header.cms-app-body .app-main,
    body.fixed-header.cms-app-body .app-footer {
        margin-left: var(--lte-sidebar-width);
        width: calc(100% - var(--lte-sidebar-width));
        max-width: none;
    }

    body.fixed-header.cms-app-body .app-header {
        position: sticky;
        top: 0;
        z-index: 1034;
        flex-shrink: 0;
    }
}

.cms-app-body .app-footer {
    background: var(--bs-body-bg);
}

.member-detail-backdrop,
.member-detail-drawer {
    display: none !important;
}

.member-detail-backdrop.is-open {
    display: block !important;
}

.member-detail-drawer.is-open {
    display: flex !important;
}

.cms-dashboard-page .app-content {
    padding-top: 1.25rem;
}

/* Navbar */
.cms-navbar {
    background: #fff !important;
    border-bottom: 1px solid #dee2e6;
    min-height: 3.5rem;
    max-height: 3.5rem;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.cms-navbar .container-fluid {
    min-height: 3.5rem;
    align-items: center;
}

.cms-navbar .nav-link {
    color: #333 !important;
    padding: 0.5rem 0.75rem;
}

.cms-navbar-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #222;
    white-space: nowrap;
}

.cms-nav-bell,
.cms-nav-birthday {
    position: relative;
}

.cms-nav-birthday {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: inherit;
    padding: 0.5rem 0.75rem;
    line-height: 1.2;
    font-size: 0.9rem;
    font-weight: 600;
}

.cms-nav-birthday:hover,
.cms-nav-birthday:focus {
    color: #1e3a5f;
}

.cms-nav-birthday-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-size: 1.15rem;
}

.cms-nav-birthday-icon-wrap .cms-nav-badge {
    top: -6px;
    right: -8px;
}

.cms-nav-birthday-label {
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .cms-nav-birthday-label {
        display: none;
    }
}

.cms-nav-badge {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ffc107;
    color: #212529;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.cms-nav-badge--birthday {
    background: #e91e8c;
    color: #fff;
}

.birthday-member-photo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.birthday-member-photo--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #6c757d;
    font-size: 1.1rem;
}

/* Sidebar */
.cms-sidebar {
    background: #3a3f44 !important;
}

.cms-sidebar .sidebar-brand {
    display: none;
}

.cms-sidebar-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cms-sidebar-avatar-wrap {
    --cms-sidebar-avatar-size: 120px;
    --cms-sidebar-avatar-radius: 30px;
    width: var(--cms-sidebar-avatar-size);
    height: var(--cms-sidebar-avatar-size);
    margin-bottom: 0.75rem;
    padding: 3px;
    border-radius: var(--cms-sidebar-avatar-radius);
    background: linear-gradient(
        120deg,
        #5b9bd5,
        #3a6ea5,
        #f0a500,
        #5b9bd5
    );
    background-size: 300% 300%;
    animation: cms-sidebar-avatar-border 4s ease infinite;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

@keyframes cms-sidebar-avatar-border {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.cms-sidebar-avatar {
    width: 100%;
    height: 100%;
    border-radius: calc(var(--cms-sidebar-avatar-radius) - 3px);
    background: linear-gradient(145deg, #5b9bd5, #3a6ea5);
    color: #fff;
    font-size: 2.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    box-shadow: none;
}

.cms-sidebar-avatar--photo {
    display: block;
    object-fit: cover;
    border: none;
    background: #3a3f44;
}

.cms-sidebar-avatar-wrap--uploadable {
    position: relative;
    cursor: pointer;
}

.cms-sidebar-avatar-upload {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: calc(var(--cms-sidebar-avatar-radius) - 3px);
    background: rgba(15, 23, 42, 0.55);
    color: #fff;
    font-size: 1.35rem;
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: pointer;
}

.cms-navbar-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(30, 58, 95, 0.12);
    flex-shrink: 0;
}

.cms-navbar-avatar--initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #5b9bd5, #3a6ea5);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
}

.cms-sidebar-avatar-wrap--uploadable:hover .cms-sidebar-avatar-upload,
.cms-sidebar-avatar-wrap--uploadable:focus-within .cms-sidebar-avatar-upload {
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .cms-sidebar-avatar-wrap {
        animation: none;
        background: linear-gradient(120deg, #5b9bd5, #3a6ea5);
    }
}

.cms-sidebar-user-info {
    width: 100%;
    max-width: 220px;
}

.cms-sidebar-user-info strong {
    display: block;
    color: #fff;
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.cms-sidebar-role {
    display: block;
    color: #fd7e14;
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: lowercase;
    margin-bottom: 0.15rem;
}

.cms-sidebar-branch-toggle,
.cms-sidebar-branch-label {
    width: 100%;
    max-width: 100%;
    padding: 0.3rem 0.55rem;
    font-size: 0.78rem;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.85);
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: pointer;
}

.cms-sidebar-branch-toggle {
    display: block;
    margin-top: 0;
    text-align: left;
    appearance: none;
}

.cms-sidebar-branch-toggle::after {
    display: none;
}

.cms-sidebar-branch-toggle:focus,
.cms-sidebar-branch-toggle.show {
    outline: none;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    background-color: rgba(255, 255, 255, 0.08);
}

.cms-sidebar-branch-label {
    display: block;
    margin-top: 0.35rem;
    cursor: default;
    opacity: 0.8;
}

.cms-sidebar-branch-dropdown {
    width: 100%;
    margin-top: 0.35rem;
}

.cms-sidebar-branch-menu {
    width: 100%;
    min-width: 100%;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #fff;
    padding: 0.25rem 0;
    margin-top: 0.25rem !important;
}

.cms-sidebar-branch-item {
    font-size: 0.78rem;
    color: #212529;
    padding: 0.45rem 0.75rem;
    white-space: normal;
}

.cms-sidebar-branch-item:hover,
.cms-sidebar-branch-item:focus {
    color: #0d6efd;
    background-color: #e7f1ff;
}

.cms-sidebar-branch-item.active,
.cms-sidebar-branch-item.active:hover,
.cms-sidebar-branch-item.active:focus {
    color: #fff;
    background-color: #0d6efd;
}

.cms-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    border-radius: 0;
    padding: 0.65rem 1rem;
}

.cms-sidebar .nav-link:hover,
.cms-sidebar .nav-link.active {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

.cms-sidebar .nav-icon {
    font-size: 1rem;
}

.cms-sidebar-logout {
    margin-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.5rem;
}

/* Dashboard stat cards */
.cms-stat-card {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    padding: 1.1rem 1rem;
    min-height: 105px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.cms-stat-body {
    position: relative;
    z-index: 1;
}

.cms-stat-body h3 {
    margin: 0 0 0.25rem;
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
}

.cms-stat-body p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.95;
}

.cms-stat-body small {
    display: block;
    font-size: 0.75rem;
    opacity: 0.85;
    margin-top: 0.25rem;
}

.cms-stat-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3.5rem;
    opacity: 0.25;
    z-index: 0;
}

.cms-stat-cyan    { background: #17a2b8; }
.cms-stat-green   { background: #28a745; }
.cms-stat-yellow  { background: #ffc107; color: #212529; }
.cms-stat-yellow .cms-stat-icon { opacity: 0.3; }
.cms-stat-red     { background: #dc3545; }
.cms-stat-blue    { background: #007bff; }
.cms-stat-teal    { background: #20c997; }
.cms-stat-gray    { background: #6c757d; }
.cms-stat-teal-dark { background: linear-gradient(135deg, #115e59 0%, #0f766e 100%); }
.cms-stat-olive   { background: #3d5c3a; }
.cms-stat-orange  { background: #fd7e14; }

.cms-dashboard-photo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.cms-dashboard-photo-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 1.25rem;
}

.sidebar-menu button.nav-link {
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.sidebar-menu button.nav-link p {
    margin: 0;
    display: inline;
}

/* Leave balance widgets (light cards on inner pages) */
.leave-balance-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 100%;
    padding: 1.25rem 1.35rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-left-width: 4px;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.leave-balance-card__icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.35rem;
}

.leave-balance-card__label {
    margin: 0 0 0.35rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.leave-balance-card__value {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.leave-balance-card__value span {
    font-size: 0.875rem;
    font-weight: 500;
    color: #94a3b8;
}

.leave-balance-card--blue { border-left-color: #2563eb; }
.leave-balance-card--blue .leave-balance-card__icon { background: #eff6ff; color: #2563eb; }

.leave-balance-card--rose { border-left-color: #e11d48; }
.leave-balance-card--rose .leave-balance-card__icon { background: #fff1f2; color: #e11d48; }

.leave-balance-card--amber { border-left-color: #d97706; }
.leave-balance-card--amber .leave-balance-card__icon { background: #fffbeb; color: #d97706; }

.leave-balance-card--violet { border-left-color: #7c3aed; }
.leave-balance-card--violet .leave-balance-card__icon { background: #f5f3ff; color: #7c3aed; }

.leave-balance-card--pink { border-left-color: #db2777; }
.leave-balance-card--pink .leave-balance-card__icon { background: #fdf2f8; color: #db2777; }

.leave-balance-card--teal { border-left-color: #0d9488; }
.leave-balance-card--teal .leave-balance-card__icon { background: #f0fdfa; color: #0d9488; }

.leave-balance-card--slate { border-left-color: #64748b; }
.leave-balance-card--slate .leave-balance-card__icon { background: #f8fafc; color: #64748b; }


/* Dashboard panels / tables */
.cms-panel {
    border: none;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.cms-panel-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.cms-panel-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #333;
}

.cms-panel-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: 4px;
    background: #28a745;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
}

.cms-panel-table thead th {
    background: #f8f9fa !important;
    color: #333 !important;
    border-color: #dee2e6 !important;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.75rem 1rem;
}

.cms-panel-table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
    color: #444;
    border-color: #eee;
}

.cms-panel-table tbody tr:hover {
    background: #f8f9fa;
}

.cms-panel-footer {
    padding: 0.65rem 1.25rem;
    background: #fff;
    border-top: 1px solid #eee;
    text-align: right;
    font-size: 0.8rem;
    color: #888;
}

.cms-panel > .table-responsive,
.cms-panel.card > .table-responsive {
    padding: 1rem 1.25rem 1.25rem;
}

/* Programs / events tables (dashboard + Programs/Events page) */
.cms-programs-table {
    margin-bottom: 0;
}

.cms-programs-table thead th {
    background: #f8f9fa !important;
    color: #333 !important;
    border: 1px solid #dee2e6 !important;
    font-size: 0.875rem;
    font-weight: 600;
    vertical-align: middle;
    white-space: nowrap;
}

.cms-programs-table tbody td {
    border: 1px solid #dee2e6 !important;
    vertical-align: middle;
    font-size: 0.875rem;
    color: #333;
}

.cms-programs-table tbody tr:nth-child(even) {
    background: #fafbfc;
}

.cms-programs-table tbody tr:hover {
    background: #f1f5f9;
}

.cms-program-desc-cell {
    max-width: 360px;
    white-space: normal;
    line-height: 1.45;
}

.cms-program-flyer-cell {
    text-align: center;
}

.cms-program-flyer-thumb {
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    display: inline-block;
}

.cms-program-flyer-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px dashed #ced4da;
    color: #adb5bd;
    background: #f8f9fa;
}

.cms-programs-table tbody td {
    vertical-align: top;
}

.cms-programs-table .cms-program-flyer-cell {
    width: 140px;
    min-width: 140px;
    padding: 0.85rem 0.75rem;
}

.cms-program-flyer-link {
    display: block;
    width: 120px;
    margin: 0 auto;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    line-height: 0;
}

.cms-program-flyer-thumb--featured {
    width: 120px;
    height: 130px;
    object-fit: cover;
    display: block;
    border: none;
    border-radius: 0;
}

.cms-program-flyer-placeholder--featured {
    width: 120px;
    height: 130px;
    margin: 0 auto;
    font-size: 1.75rem;
}

.cms-programs-table--dashboard .cms-program-flyer-cell {
    width: 156px;
    min-width: 156px;
}

.cms-programs-table--dashboard .cms-program-flyer-link {
    width: 141px;
}

.cms-programs-table--dashboard .cms-program-flyer-thumb--featured,
.cms-programs-table--dashboard .cms-program-flyer-placeholder--featured {
    width: 141px;
    height: calc(72px * 1.28);
}

.cms-programs-table--dashboard .cms-program-flyer-placeholder--featured {
    font-size: 1.35rem;
}

.cms-programs-table.cms-programs-table--dashboard {
    border: 1px solid #000;
    border-collapse: collapse;
}

.cms-programs-table.cms-programs-table--dashboard thead th,
.cms-programs-table.cms-programs-table--dashboard tbody td {
    border: 1px solid #000 !important;
}

.cms-programs-table--dashboard .cms-program-name-col,
.cms-programs-table--dashboard .cms-program-name-cell {
    width: 200px;
    max-width: 220px;
    white-space: normal;
}

.cms-programs-table--dashboard .cms-program-name-cell {
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.cms-programs-table--dashboard .cms-program-desc-cell {
    max-width: none;
}

.cms-program-actions-cell .btn {
    font-size: 0.78rem;
    padding: 0.25rem 0.55rem;
}

.cms-programs-page-card {
    border: 1px solid #e3e6ea;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.cms-programs-page-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e3e6ea;
    padding: 0.85rem 1.25rem;
}

.cms-programs-page-title {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
}

/* ============================================================
   ROLES & PERMISSIONS PAGE
   ============================================================ */
.roles-page .cms-stat-card {
    min-height: 96px;
}

.roles-sidebar-header {
    flex-wrap: wrap;
    gap: 0.75rem;
}

.roles-sidebar-search {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #eee;
    background: #fafbfc;
}

.roles-list {
    max-height: 620px;
    overflow-y: auto;
    padding: 0.75rem;
}

.roles-card {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.roles-card:hover {
    border-color: #b6d4fe;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.08);
}

.roles-card.is-active {
    border-color: #0d6efd;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.06), rgba(13, 110, 253, 0.02));
    box-shadow: 0 4px 14px rgba(13, 110, 253, 0.12);
}

.roles-card-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 0.75rem 0.85rem 0.95rem;
    border: none;
    background: transparent;
    text-align: left;
    width: 100%;
    cursor: pointer;
}

.roles-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #eef4ff;
    color: #0d6efd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.roles-card.is-active .roles-card-icon {
    background: #0d6efd;
    color: #fff;
}

.roles-card-info {
    flex: 1;
    min-width: 0;
}

.roles-card-info strong {
    display: block;
    font-size: 0.95rem;
    color: #1e2a36;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.roles-card-info small {
    display: block;
    color: #6c757d;
    font-size: 0.78rem;
}

.roles-card-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex-shrink: 0;
}

.roles-card-delete {
    align-self: center;
    margin-right: 0.45rem;
    padding: 0.25rem 0.45rem;
}

.roles-editor .roles-form {
    padding: 0 1.25rem 1.25rem;
}

.roles-form-section {
    padding: 1.25rem 0;
    border-bottom: 1px solid #eee;
}

.roles-form-section:last-of-type {
    border-bottom: none;
}

.roles-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 1rem;
}

.roles-permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.roles-module-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    background: #fafbfc;
    transition: box-shadow 0.2s ease;
}

.roles-module-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.roles-module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.roles-module-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.roles-module-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #eef4ff;
    color: #0d6efd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.roles-module-body {
    padding: 0.75rem 1rem 1rem 1.35rem;
    max-height: 220px;
    overflow-y: auto;
}

.roles-perm-item {
    padding: 0.45rem 0 0.45rem 0.15rem;
    border-bottom: 1px dashed #e9ecef;
}

.roles-perm-item .form-check-input {
    width: 1.1em;
    height: 1.1em;
    margin-top: 0.15em;
    flex-shrink: 0;
    border-color: #adb5bd;
    cursor: pointer;
}

.roles-perm-item .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.roles-perm-item .form-check-label {
    cursor: pointer;
    padding-left: 0.35rem;
}

.roles-perm-item:last-child {
    border-bottom: none;
}

.roles-perm-name {
    font-weight: 500;
    color: #334155;
}

.roles-form-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    margin: 0 -1.25rem -1.25rem;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    border-radius: 0 0 4px 4px;
}

@media (max-width: 991.98px) {
    .roles-list {
        max-height: 360px;
    }

    .roles-permissions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .cms-navbar-title {
        font-size: 0.85rem;
        max-width: 50vw;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .cms-stat-body h3 {
        font-size: 1.35rem;
    }

    .auth-glass-card {
        max-width: 100%;
        padding: 2rem 1.75rem 1.75rem;
    }
}

/* ============================================================
   FORMS MODULE
   ============================================================ */
.forms-form-shell {
    max-width: 920px;
    margin: 0 auto;
}

.forms-form-shell--narrow {
    max-width: 680px;
}

.forms-form-shell--sms {
    max-width: 820px;
}

.forms-page-card {
    border: 1px solid #e3e6ea;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.forms-page-card .card-body {
    padding: 1.75rem 1.75rem 1.5rem;
}

.forms-card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #e3e6ea;
    color: #212529;
    font-size: 1rem;
    padding: 0.85rem 1.25rem;
}

.forms-field-label {
    color: #495057;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.forms-input-group .input-group-text {
    background: #fff;
    border-color: #ced4da;
    color: #6c757d;
    min-width: 2.75rem;
    justify-content: center;
}

.forms-input-group .form-control,
.forms-input-group .form-select {
    border-color: #ced4da;
}

.forms-input-group .form-control:focus,
.forms-input-group .form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.forms-input-group .form-control.bg-light {
    background-color: #f1f3f5 !important;
    color: #495057;
}

.forms-input-group--textarea .input-group-text {
    align-self: stretch;
}

.forms-input-group--textarea textarea.form-control {
    min-height: 8rem;
    resize: vertical;
}

.forms-btn-action {
    border-radius: 0.375rem;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.75rem 1.25rem;
}

.forms-btn-action.btn-primary {
    background: #0d6efd;
    border-color: #0d6efd;
}

.forms-btn-action.btn-success {
    background: #198754;
    border-color: #198754;
}

.forms-btn-pair {
    margin-top: 0.5rem;
}

.forms-help-text {
    color: #6c757d;
    font-size: 0.8125rem;
    margin-top: 0.35rem;
}

.forms-desc-cell {
    max-width: 220px;
    white-space: normal;
    font-size: 0.875rem;
}

.forms-flyer-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.forms-public-card {
    max-width: 520px;
    margin: 2rem auto;
    padding: 2rem;
}

.forms-public-flyer {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
}

/* Public registration forms (WerkspaceLab-style card) */
.auth-layout.public-form-layout,
.auth-layout.public-form-layout .page-preloader {
    background-color: #e9ecef !important;
    background-image: none !important;
}

.public-form-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem 3rem;
}

.public-form-container {
    width: 100%;
    max-width: 640px;
}

.public-form-banner-img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 8px;
}

.public-form-event-title {
    font-weight: 700;
    color: #212529;
}

.public-form-event-sub {
    font-size: 0.95rem;
    color: #6c757d;
}

.public-form-intro {
    font-size: 0.92rem;
    line-height: 1.55;
    color: #495057;
}

.public-form-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.public-form-card-header {
    background: #f1f3f5;
    border-bottom: 1px solid #dee2e6;
    padding: 0.85rem 1.25rem;
    font-weight: 700;
    font-size: 1rem;
    color: #212529;
}

.public-form-card-body {
    padding: 1.25rem;
}

.public-form-fields {
    display: flex;
    flex-direction: column;
}

.public-form-field {
    margin-bottom: 1rem;
}

.public-form-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #212529;
}

.public-form-required {
    color: #dc3545;
}

.public-form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #212529;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 6px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.public-form-control:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.public-form-select {
    appearance: auto;
}

.public-form-textarea {
    min-height: 100px;
    resize: vertical;
}

.public-form-submit {
    align-self: flex-start;
    margin-top: 0.25rem;
    padding: 0.5rem 1.35rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #fff;
    background: #0d6efd;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.public-form-submit:hover {
    background: #0b5ed7;
}

.registration-qr-poster {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.registration-qr-sheet {
    text-align: center;
    padding: 2.5rem 2rem;
}

.registration-qr-church {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #111827;
}

.registration-qr-branch {
    margin: 0 0 1.75rem;
    font-size: 0.95rem;
    color: #6b7280;
}

.registration-qr-scan-me {
    margin: 0 0 1rem;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: #111827;
}

.registration-qr-image {
    display: block;
    width: 240px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 1.25rem;
}

.registration-qr-caption {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

/* Registration QR — single-page print poster */
@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }

    .members-registration-qr-page .app-header,
    .members-registration-qr-page .app-sidebar,
    .members-registration-qr-page .app-content-header,
    .members-registration-qr-page .app-footer,
    .members-registration-qr-page .page-preloader,
    .members-registration-qr-page .no-print {
        display: none !important;
    }

    .members-registration-qr-page,
    .members-registration-qr-page .app-wrapper,
    .members-registration-qr-page .app-main,
    .members-registration-qr-page .app-content,
    .members-registration-qr-page .container-fluid {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        height: auto !important;
        overflow: visible !important;
    }

    .members-registration-qr-page.fixed-header.fixed-footer {
        padding: 0 !important;
    }

    .members-registration-qr-page .registration-qr-poster {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100vw;
        height: 100vh;
        min-height: 100vh;
        margin: 0;
        padding: 0;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        page-break-before: avoid;
        page-break-after: avoid;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .members-registration-qr-page .registration-qr-sheet {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 1.5rem;
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .members-registration-qr-page .registration-qr-church {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .members-registration-qr-page .registration-qr-branch {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .members-registration-qr-page .registration-qr-scan-me {
        font-size: 2.75rem;
        font-weight: 800;
        letter-spacing: 0.22em;
        margin-bottom: 1.25rem;
    }

    .members-registration-qr-page .registration-qr-image {
        width: 72vmin !important;
        max-width: 520px !important;
        height: auto !important;
        margin-bottom: 1.5rem !important;
    }

    .members-registration-qr-page .registration-qr-caption {
        font-size: 1.15rem;
    }
}

/* Premium visitor self-registration */
.auth-layout.visitor-register-layout,
.auth-layout.visitor-register-layout .page-preloader {
    background: linear-gradient(160deg, #f4f6f9 0%, #e9edf3 45%, #dfe5ee 100%) !important;
    background-image: none !important;
    background-attachment: scroll !important;
    overflow-x: hidden;
}

.auth-page.visitor-register-page {
    align-items: flex-start;
    justify-content: flex-start;
    padding:
        max(1.25rem, env(safe-area-inset-top, 0px))
        max(1rem, env(safe-area-inset-right, 0px))
        max(1.5rem, env(safe-area-inset-bottom, 0px))
        max(1rem, env(safe-area-inset-left, 0px));
}

.visitor-register-page {
    box-sizing: border-box;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    -webkit-text-size-adjust: 100%;
}

@media (min-width: 576px) {
    .auth-page.visitor-register-page {
        align-items: center;
        justify-content: center;
    }
}

.visitor-register-shell {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.visitor-register-card {
    background: #fff;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 12px 40px rgba(15, 23, 42, 0.1);
    padding: 2rem 2rem 1.75rem;
    box-sizing: border-box;
}

.visitor-register-card-head {
    text-align: center;
    margin-bottom: 1.75rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eef1f5;
    position: relative;
}

.visitor-register-card-head::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -1px;
    transform: translateX(-50%);
    width: 48px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, #1e3a5f, transparent);
}

.visitor-register-eyebrow {
    margin: 0 0 0.5rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #6b7280;
    overflow-wrap: anywhere;
}

.visitor-register-heading {
    margin: 0 0 0.35rem;
    font-size: clamp(1.45rem, 4vw, 1.75rem);
    font-weight: 600;
    letter-spacing: -0.025em;
    color: #111827;
    line-height: 1.2;
}

.visitor-register-location {
    margin: 0 0 0.65rem;
    font-size: 0.92rem;
    font-weight: 500;
    color: #4b5563;
}

.visitor-register-lead {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: #9ca3af;
    max-width: 32ch;
    margin-left: auto;
    margin-right: auto;
}

.visitor-register-form {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.visitor-register-name-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1rem;
}

.visitor-register-field {
    margin-bottom: 1.1rem;
    min-width: 0;
}

.visitor-register-field label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #374151;
}

.visitor-register-req {
    color: #b91c1c;
    font-weight: 700;
}

.visitor-register-input {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    line-height: 1.4;
    color: #111827;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.visitor-register-input::placeholder {
    color: #9ca3af;
}

.visitor-register-input:hover {
    border-color: #d1d5db;
    background: #fff;
}

.visitor-register-input:focus {
    outline: 0;
    border-color: #1e3a5f;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(30, 58, 95, 0.1);
}

.visitor-register-select {
    appearance: auto;
    cursor: pointer;
}

.visitor-register-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    width: 100%;
    min-height: 48px;
    margin-top: 0.5rem;
    padding: 0.95rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fff;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(30, 58, 95, 0.28);
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.visitor-register-submit .bi {
    font-size: 1.35rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.visitor-register-submit:hover {
    background: linear-gradient(135deg, #172f4d 0%, #243f5c 100%);
    box-shadow: 0 6px 20px rgba(30, 58, 95, 0.34);
    transform: translateY(-1px);
}

.visitor-register-submit:hover .bi {
    transform: translateX(3px);
}

.visitor-register-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(30, 58, 95, 0.22);
}

@media (max-width: 575.98px) {
    .auth-page.visitor-register-page {
        padding-top: max(0.85rem, env(safe-area-inset-top, 0px));
        padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
    }

    .visitor-register-shell {
        max-width: none;
    }

    .visitor-register-card {
        padding: 1.35rem 1rem 1.25rem;
        border-radius: 14px;
        box-shadow:
            0 1px 2px rgba(15, 23, 42, 0.04),
            0 8px 24px rgba(15, 23, 42, 0.08);
    }

    .visitor-register-card-head {
        margin-bottom: 1.15rem;
        padding-bottom: 1rem;
    }

    .visitor-register-heading {
        font-size: 1.35rem;
    }

    .visitor-register-lead {
        font-size: 0.84rem;
        max-width: none;
    }

    .visitor-register-name-fields {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .visitor-register-field {
        margin-bottom: 0.95rem;
    }

    .visitor-register-input {
        padding: 0.85rem 0.9rem;
        border-radius: 10px;
    }

    .visitor-register-submit {
        position: sticky;
        bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
        z-index: 2;
        margin-top: 0.25rem;
    }
}

@media (max-width: 380px) {
    .visitor-register-card {
        padding: 1.15rem 0.85rem 1rem;
    }

    .visitor-register-eyebrow {
        font-size: 0.62rem;
        letter-spacing: 0.1em;
    }
}

/* Member attendance QR (public phone view) */
.member-qr-page .member-qr-image {
    width: min(280px, 78vw);
    height: auto;
    margin: 0 auto 1rem;
    display: block;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.member-qr-hint {
    margin: 0 0 1.25rem;
    font-size: 0.88rem;
    color: #6b7280;
}

.member-qr-save-btn {
    text-decoration: none;
}

/* Communication page */
.communication-template-search {
    max-width: 260px;
    min-width: 180px;
}

.communication-template-preview-cell {
    max-width: 420px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.communication-simple-tabs .nav-link {
    font-weight: 600;
}

/* Members bulk import page */
.members-import-page .content-wrapper {
    background: #f0f2f5;
}

.members-import-page-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.members-import-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.members-import-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s ease;
}

.members-import-back:hover {
    color: #1e3a5f;
}

.members-import-title {
    margin: 0 0 0.35rem;
    font-size: clamp(1.5rem, 3vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #111827;
}

.members-import-lead {
    margin: 0;
    max-width: 52ch;
    font-size: 0.92rem;
    line-height: 1.55;
    color: #6b7280;
}

.members-import-template-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e3a5f;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}

.members-import-template-btn:hover {
    color: #172f4d;
    border-color: #9ca3af;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.members-import-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), 0 8px 24px rgba(15, 23, 42, 0.04);
    margin-bottom: 1.25rem;
}

.members-import-card-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.members-import-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.members-import-card-icon--success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #047857;
}

.members-import-card-title {
    margin: 0 0 0.2rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #111827;
}

.members-import-card-sub {
    margin: 0;
    font-size: 0.84rem;
    color: #9ca3af;
}

.members-import-dropzone {
    display: block;
    margin-bottom: 1.15rem;
    cursor: pointer;
}

.members-import-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.members-import-dropzone-inner {
    padding: 2rem 1.5rem;
    text-align: center;
    border: 2px dashed #d1d5db;
    border-radius: 14px;
    background: #fafbfc;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.members-import-dropzone:hover .members-import-dropzone-inner,
.members-import-dropzone.is-dragover .members-import-dropzone-inner {
    border-color: #1e3a5f;
    background: #f0f4f8;
    box-shadow: inset 0 0 0 1px rgba(30, 58, 95, 0.08);
}

.members-import-dropzone.has-file .members-import-dropzone-inner {
    border-color: #10b981;
    background: #f0fdf4;
    border-style: solid;
}

.members-import-dropzone-icon {
    font-size: 2rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.members-import-dropzone.has-file .members-import-dropzone-icon {
    color: #059669;
}

.members-import-dropzone-title {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
}

.members-import-dropzone-hint {
    margin: 0;
    font-size: 0.82rem;
    color: #9ca3af;
}

.members-import-dropzone-file {
    margin: 0.65rem 0 0;
    font-size: 0.88rem;
    font-weight: 600;
    color: #047857;
}

.members-import-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    margin-bottom: 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.members-import-option:hover {
    border-color: #d1d5db;
    background: #fff;
}

.members-import-checkbox {
    margin-top: 0.2rem;
    width: 1rem;
    height: 1rem;
    accent-color: #1e3a5f;
    flex-shrink: 0;
}

.members-import-option-box {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.members-import-option-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #374151;
}

.members-import-option-desc {
    font-size: 0.8rem;
    color: #9ca3af;
    line-height: 1.4;
}

.members-import-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.members-import-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.members-import-btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d4a6f 100%);
    box-shadow: 0 3px 10px rgba(30, 58, 95, 0.25);
}

.members-import-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(30, 58, 95, 0.3);
}

.members-import-btn-success {
    color: #fff;
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    box-shadow: 0 3px 10px rgba(5, 150, 105, 0.25);
}

.members-import-btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 16px rgba(5, 150, 105, 0.3);
}

.members-import-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
}

.members-import-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.members-import-stat {
    padding: 0.85rem 0.75rem;
    text-align: center;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #fafbfc;
}

.members-import-stat-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.2;
    color: #111827;
}

.members-import-stat-label {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9ca3af;
}

.members-import-stat--ready {
    border-color: #a7f3d0;
    background: #ecfdf5;
}

.members-import-stat--ready .members-import-stat-value {
    color: #047857;
}

.members-import-stat--invalid {
    border-color: #fecaca;
    background: #fef2f2;
}

.members-import-stat--invalid .members-import-stat-value {
    color: #b91c1c;
}

.members-import-stat--duplicate {
    border-color: #fde68a;
    background: #fffbeb;
}

.members-import-stat--duplicate .members-import-stat-value {
    color: #b45309;
}

.members-import-alerts .alert {
    border-radius: 10px;
    font-size: 0.86rem;
}

.members-import-table-wrap {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.25rem;
}

.members-import-table {
    margin-bottom: 0;
    font-size: 0.86rem;
}

.members-import-table thead th {
    background: #f8fafc !important;
    color: #6b7280 !important;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e5e7eb !important;
    padding: 0.7rem 1rem !important;
}

.members-import-table tbody td {
    padding: 0.65rem 1rem !important;
    vertical-align: middle;
    border-color: #f1f5f9 !important;
    color: #374151;
}

.members-import-table tbody tr:hover {
    background: #f8fafc;
}

.members-import-guide {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 1.35rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    position: sticky;
    top: 1rem;
}

.members-import-guide-title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.members-import-guide-intro {
    margin: 0 0 1.15rem;
    font-size: 0.82rem;
    color: #9ca3af;
}

.members-import-guide-group {
    margin-bottom: 1rem;
}

.members-import-guide-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
}

.members-import-guide-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.members-import-guide-list--wrap {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.members-import-guide-list li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.members-import-guide-list li small {
    color: #9ca3af;
}

.members-import-tag {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #374151;
    background: #f3f4f6;
    border-radius: 6px;
}

.members-import-tag-req {
    color: #991b1b;
    background: #fef2f2;
}

.members-import-tag-muted {
    color: #6b7280;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.members-import-tip {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-top: 0.5rem;
    padding: 0.75rem 0.85rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: #6b7280;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
}

.members-import-tip .bi {
    color: #d97706;
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

@media (max-width: 767.98px) {
    .members-import-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .members-import-hero {
        flex-direction: column;
    }

    .members-import-template-btn {
        width: 100%;
        justify-content: center;
    }

    .members-import-guide {
        position: static;
    }
}

.receipt-card-header {
    background: linear-gradient(135deg, #1e3a5f, #2d5a8e) !important;
    border-bottom: none !important;
    color: #fff !important;
    font-size: 1rem;
    padding: 0.9rem 1.25rem;
}

.receipt-card-header .bi {
    font-size: 1.1rem;
    opacity: 0.95;
}

.impact-report-table th {
    font-size: 0.78rem;
    vertical-align: middle;
    white-space: nowrap;
}

.impact-report-table td {
    font-size: 0.85rem;
    text-align: center;
}

.impact-report-table td:first-child,
.impact-report-table td:nth-child(2) {
    text-align: left;
}

.staff-name-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.staff-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #eef4ff;
    color: #0d6efd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.staff-avatar--lg {
    width: 72px;
    height: 72px;
    font-size: 1.25rem;
}

.staff-avatar--photo,
.staff-avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #dee2e6;
}

.staff-profile-avatar-wrap {
    position: relative;
    display: inline-block;
    margin-bottom: 0.25rem;
}

.staff-profile-avatar-placeholder,
.staff-profile-avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #dee2e6;
}

.staff-profile-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e7f0fb;
    color: #6ea8db;
    font-size: 3.5rem;
    line-height: 1;
}

.staff-profile-avatar-placeholder.staff-profile-avatar-placeholder--text {
    font-size: 2rem;
    font-weight: 700;
    color: #0d6efd;
    background: #eef4ff;
}

.staff-profile-camera-btn {
    position: absolute;
    bottom: 0;
    right: -4px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #212529;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.staff-profile-camera-btn:hover {
    background: #000;
    color: #fff;
}

.staff-profile-camera-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.35);
}

.member-search-results {
    position: relative;
    z-index: 1050;
}

.member-search-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: #fff;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.member-search-item:hover {
    background: #f0f4ff;
}

#eventsCalendar {
    min-height: 650px;
}

.settings-tabs .nav-link {
    color: #495057;
    font-weight: 500;
}

.settings-tabs .nav-link.active {
    color: #1e3a5f;
    font-weight: 600;
}

/* ============================================================
   SETTINGS PAGE
   ============================================================ */
.settings-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%);
    color: #fff;
    box-shadow: 0 0.5rem 1.25rem rgba(30, 58, 95, 0.25);
}

.settings-hero-body {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.settings-hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.settings-hero-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.settings-hero-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9375rem;
}

.settings-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.settings-stat-chip {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    min-width: 120px;
}

.settings-stat-chip .settings-stat-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.8;
    margin-bottom: 0.15rem;
}

.settings-stat-chip strong {
    font-size: 0.9375rem;
}

.settings-nav-card {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.04);
    overflow: hidden;
    position: sticky;
    top: 1rem;
}

.settings-nav-card-title {
    padding: 0.85rem 1.15rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    background: #f8f9fa;
    border-bottom: 1px solid #e3e6ea;
}

.settings-side-nav {
    padding: 0.5rem;
}

.settings-side-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 0.5rem;
    color: #495057;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.settings-side-link:hover {
    background: #f0f4f8;
    color: #1e3a5f;
}

.settings-side-link.active {
    background: linear-gradient(135deg, rgba(30, 58, 95, 0.1), rgba(45, 90, 142, 0.08));
    color: #1e3a5f;
    border: 1px solid rgba(30, 58, 95, 0.12);
}

.settings-side-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.settings-side-link.active .settings-side-icon {
    background: #1e3a5f;
    color: #fff;
}

.settings-side-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.settings-side-text strong {
    font-size: 0.9375rem;
}

.settings-side-text small {
    color: #6c757d;
    font-size: 0.75rem;
    margin-top: 0.15rem;
}

.settings-side-link.active .settings-side-text small {
    color: #5a6c7d;
}

.settings-panel-header {
    background: linear-gradient(135deg, #1e3a5f, #2d5a8e) !important;
    border-bottom: none !important;
    color: #fff !important;
    padding: 0.9rem 1.25rem;
}

.settings-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    margin-bottom: 0.75rem;
}

.settings-preview-card .card-body {
    padding: 1.5rem;
}

.settings-login-preview {
    background: linear-gradient(rgba(15, 25, 40, 0.35), rgba(15, 25, 40, 0.45)), #1a2634;
    border-radius: 12px;
    padding: 1.5rem 1rem;
}

.settings-preview-logo {
    max-width: 200px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.settings-preview-logo-placeholder {
    width: 80px;
    height: 80px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.7);
}

.settings-preview-name {
    color: #fff;
    font-weight: 600;
    font-size: 0.9375rem;
}

.settings-preview-badge {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.settings-option-card {
    height: 100%;
    padding: 1.25rem;
    border: 1px solid #e3e6ea;
    border-radius: 0.75rem;
    background: #fafbfc;
}

.settings-option-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 0.85rem;
}

.settings-branch-card {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 0.75rem;
    padding: 1.15rem;
    height: 100%;
    box-shadow: 0 0.125rem 0.35rem rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.settings-branch-card:hover {
    box-shadow: 0 0.35rem 0.85rem rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.settings-branch-card.is-inactive {
    opacity: 0.72;
}

.settings-branch-card-top {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.settings-branch-avatar {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.settings-branch-badges {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-end;
}

.settings-branch-meta {
    font-size: 0.8125rem;
    color: #6c757d;
}

.settings-branch-meta li {
    margin-bottom: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-branch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.settings-modal-header {
    background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
    color: #fff;
}

.settings-modal-header .btn-close {
    filter: invert(1);
}

.settings-modal-checks {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
}

.settings-hub {
    animation: premiumFadeIn 0.35s ease;
}

.settings-panel {
    display: none;
}

.settings-panel.is-active {
    display: block;
}

.settings-side-link {
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.settings-save-bar {
    display: flex;
    justify-content: flex-end;
    padding: 0.25rem 0 0.5rem;
}

.settings-form .form-label.fw-semibold {
    color: #334155;
    font-size: 0.875rem;
}

.settings-form .form-control,
.settings-form .form-select {
    border-color: #cbd5e1;
    border-radius: 0.5rem;
}

.settings-form .form-control:focus,
.settings-form .form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.subscription-blocked-wrap {
    max-width: 36rem;
    margin: 2rem auto;
    animation: premiumFadeIn 0.35s ease;
}

.subscription-blocked-card {
    border-radius: 1rem;
}

.subscription-blocked-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fef3c7;
    color: #b45309;
    font-size: 1.75rem;
}

body.subscription-blocked-page .app-sidebar,
body.subscription-blocked-page .app-sidebar-overlay {
    display: none !important;
}

body.subscription-blocked-page .app-main {
    margin-left: 0 !important;
}

@media (max-width: 991.98px) {
    .settings-nav-card {
        position: static;
    }

    .settings-side-nav {
        flex-direction: row !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 0.25rem;
    }

    .settings-side-link {
        flex: 0 0 auto;
        min-width: 160px;
    }

    .settings-side-text small {
        display: none;
    }
}

.ax-billing-toggle {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ax-plan-card {
    display: block;
    cursor: pointer;
    margin: 0;
    height: 100%;
}

.ax-plan-card__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ax-plan-card__inner {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    height: 100%;
    padding: 1.15rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.ax-plan-card:hover .ax-plan-card__inner {
    border-color: #93c5fd;
}

.ax-plan-card--selected .ax-plan-card__inner,
.ax-plan-card__input:checked + .ax-plan-card__inner {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.ax-plan-card--current .ax-plan-card__inner {
    background: linear-gradient(180deg, #f8fbff 0%, #fff 100%);
}

.ax-plan-card--disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.ax-plan-card--disabled .ax-plan-card__inner {
    border-style: dashed;
}

.ax-plan-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.ax-plan-card__name {
    font-size: 1.05rem;
    color: #0f172a;
}

.ax-plan-card__price {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1d4ed8;
}

.ax-plan-card__desc {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.45;
}

.ax-plan-card__meta {
    color: #475569;
    font-size: 0.85rem;
    margin-top: auto;
}

/* ============================================================
   ATTENDANCE — Hybrid multi-mode
   ============================================================ */
.attendance-mark-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.25rem;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%);
    color: #fff;
    box-shadow: 0 0.5rem 1.25rem rgba(30, 58, 95, 0.22);
}

.attendance-mark-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.8125rem;
    text-decoration: none;
    margin-bottom: 0.65rem;
}

.attendance-mark-back:hover {
    color: #fff;
}

.attendance-mark-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.attendance-mark-meta {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.9375rem;
}

.attendance-mark-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.attendance-stat-card {
    min-width: 110px;
    padding: 0.75rem 1.1rem;
    border-radius: 0.65rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center;
}

.attendance-stat-card strong {
    display: block;
    font-size: 1.65rem;
    line-height: 1.1;
    margin-top: 0.15rem;
}

.attendance-stat-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
}

.attendance-mark-shell {
    overflow: hidden;
}

.attendance-mode-nav {
    padding: 1rem 1.25rem 0;
    background: #f8f9fa;
    border-bottom: 1px solid #e3e6ea;
}

.attendance-mode-pills {
    gap: 0.5rem;
}

.attendance-mode-pills .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #495057;
    font-weight: 600;
    font-size: 0.875rem;
    padding: 0.55rem 1.1rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dee2e6;
}

.attendance-mode-pills .nav-link.active {
    background: #1e3a5f;
    border-color: #1e3a5f;
    color: #fff;
}

.attendance-mark-body {
    padding: 1.35rem 1.25rem 1.5rem;
}

.attendance-toolbar {
    padding: 1.15rem 1.25rem;
    margin-bottom: 1.25rem;
    border-radius: 0.65rem;
    background: #f8f9fb;
    border: 1px solid #e3e6ea;
}

.attendance-toolbar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.attendance-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1.25rem;
    font-size: 0.8125rem;
    color: #6c757d;
}

.attendance-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    color: #495057;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot--present { background: #198754; }
.legend-dot--absent { background: #dc3545; }
.legend-dot--unmarked { background: #adb5bd; }

.attendance-legend-hint {
    margin-left: auto;
    color: #6c757d;
    font-size: 0.78rem;
}

.attendance-panel {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 0.65rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.35rem rgba(0, 0, 0, 0.04);
}

.attendance-panel-header {
    padding: 0.85rem 1.15rem;
    background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
    color: #fff;
    font-weight: 600;
    font-size: 0.9375rem;
}

.attendance-panel-body {
    padding: 1.15rem;
}

.attendance-empty-state {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: #6c757d;
}

.attendance-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: #eef2f7;
    color: #1e3a5f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.attendance-empty-state h4 {
    font-size: 1.1rem;
    color: #343a40;
    margin-bottom: 0.35rem;
}

.attendance-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 1rem;
}

.attendance-photo-card {
    position: relative;
    background: #fff;
    border: 2px solid #e3e6ea;
    border-radius: 0.85rem;
    padding: 1rem 0.65rem 0.85rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.attendance-photo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.35rem 1rem rgba(0, 0, 0, 0.1);
}

.attendance-photo-card.is-present {
    border-color: #198754;
    background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
}

.attendance-photo-card.is-absent {
    border-color: #dc3545;
    background: linear-gradient(180deg, #fff5f5 0%, #fff 100%);
}

.attendance-photo-status {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #e9ecef;
    color: #6c757d;
}

.attendance-photo-card.is-present .attendance-photo-status {
    background: #198754;
    color: #fff;
}

.attendance-photo-card.is-absent .attendance-photo-status {
    background: #dc3545;
    color: #fff;
}

.attendance-photo-thumb {
    width: 76px;
    height: 76px;
    margin: 0 auto 0.65rem;
    border-radius: 50%;
    overflow: hidden;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 0.15rem 0.5rem rgba(0, 0, 0, 0.08);
}

.attendance-photo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attendance-photo-initials {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e3a5f;
}

.attendance-photo-name {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.25;
    color: #212529;
    margin-bottom: 0.15rem;
}

.attendance-photo-meta {
    font-size: 0.72rem;
    color: #6c757d;
}

.attendance-recent-list {
    max-height: 280px;
    overflow-y: auto;
}

.attendance-qr-card {
    overflow: hidden;
}

.attendance-qr-reader {
    min-height: 340px;
    background: #111;
}

.attendance-qr-success {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 10000;
    background: rgba(25, 135, 84, 0.95);
    color: #fff;
    padding: 1.5rem 2rem;
    border-radius: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.attendance-qr-success.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.attendance-qr-success .bi {
    font-size: 2rem;
}

@media (max-width: 991.98px) {
    .attendance-legend-hint {
        margin-left: 0;
        width: 100%;
    }

    .attendance-mark-stats {
        width: 100%;
    }

    .attendance-stat-card {
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 575.98px) {
    .attendance-mark-hero {
        padding: 1.15rem;
    }

    .attendance-mark-title {
        font-size: 1.25rem;
    }

    .attendance-mode-pills .nav-link span {
        display: none;
    }
}

/* Members table & inline detail panel */
.member-photo-col {
    width: 56px;
    padding-right: 0.25rem !important;
}

.member-table-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e9ecef;
    display: block;
}

.member-table-avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f, #2d5a87);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
}

#membersTable tbody tr.member-row-expanded {
    background-color: rgba(30, 58, 95, 0.06);
}

#membersTable tbody tr.member-row-expanded > td {
    border-bottom: none;
}

.member-detail-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.member-detail-backdrop.is-open {
    display: block;
    opacity: 1;
    visibility: visible;
}

@media (min-width: 992px) {
    .member-detail-backdrop {
        left: var(--lte-sidebar-width, 250px);
    }
}

.member-detail-drawer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    max-height: min(85vh, 900px);
    background: #f4f6f9;
    border-radius: 1rem 1rem 0 0;
    box-shadow: 0 -12px 40px rgba(30, 58, 95, 0.18);
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.35s ease;
    visibility: hidden;
    pointer-events: none;
    flex-direction: column;
}

@media (min-width: 992px) {
    .member-detail-drawer {
        left: var(--lte-sidebar-width, 250px);
    }
}

.member-detail-drawer.is-open {
    display: flex;
    height: min(85vh, 900px);
    max-height: min(85vh, 900px);
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
}

.member-detail-drawer-handle {
    flex-shrink: 0;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: #cbd5e1;
    margin: 0.65rem auto 0;
}

.member-detail-drawer-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

body.member-detail-drawer-open {
    overflow: hidden;
}

.member-detail-panel {
    animation: memberDetailSlideUp 0.35s ease-out;
    margin: 0;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    border: none;
}

@keyframes memberDetailSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.member-detail-hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 2;
}

.member-detail-hero-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.member-detail-photo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}

.member-detail-photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    font-size: 1.25rem;
    font-weight: 700;
}

.member-detail-name {
    margin: 0 0 0.35rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
}

.member-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.member-detail-meta {
    font-size: 0.875rem;
    opacity: 0.9;
}

.member-detail-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.member-detail-body {
    padding: 1.25rem 1.5rem 1.5rem;
    background: #fff;
}

.member-detail-card {
    background: #f8fafc;
    border: 1px solid #e9ecef;
    border-radius: 0.65rem;
    padding: 1rem 1.15rem;
    height: 100%;
}

.member-detail-card--qr {
    text-align: center;
}

.member-detail-card-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1e3a5f;
    margin-bottom: 0.85rem;
}

.member-detail-dl {
    margin: 0;
}

.member-detail-dl > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.875rem;
}

.member-detail-dl > div:last-child {
    border-bottom: none;
}

.member-detail-dl dt {
    color: #6c757d;
    font-weight: 500;
    margin: 0;
}

.member-detail-dl dd {
    margin: 0;
    text-align: right;
    font-weight: 600;
    color: #212529;
}

.member-detail-events {
    list-style: none;
    margin: 0;
    padding: 0;
}

.member-detail-event {
    display: flex;
    justify-content: space-between;
    padding: 0.45rem 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.875rem;
}

.member-detail-event:last-child {
    border-bottom: none;
}

.member-detail-qr-wrap {
    background: #fff;
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: inline-block;
    border: 1px solid #dee2e6;
}

.member-detail-qr-img {
    width: 140px;
    height: 140px;
    object-fit: contain;
}

.member-detail-qr-empty {
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.member-detail-qr-token {
    margin-top: 0.75rem;
    text-align: left;
    word-break: break-all;
}

.member-detail-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
}

.member-detail-stat {
    background: linear-gradient(135deg, #1e3a5f, #2d5a87);
    color: #fff;
    border-radius: 0.65rem;
    padding: 0.85rem 1rem;
    text-align: center;
}

.member-detail-stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.85;
}

.member-detail-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 0.15rem;
}

.member-detail-cert {
    margin-bottom: 0.65rem;
}

.member-detail-household li + li {
    margin-top: 0.25rem;
}

@media (max-width: 767.98px) {
    .member-detail-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .member-detail-hero-actions {
        width: 100%;
    }
}

/* ── CMS branded modals ───────────────────────────────────────── */
.cms-modal .modal-dialog {
    margin-top: auto;
    margin-bottom: auto;
}

@media (min-width: 992px) {
    .cms-modal .cms-modal-dialog--wide {
        max-width: 920px;
    }
}

.cms-modal-content {
    border: none;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1.5rem 3.5rem rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(30, 58, 95, 0.06);
}

.cms-modal-header {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 55%, #0ea5e9 100%);
    color: #fff;
    border-bottom: none;
    padding: 1.15rem 1.35rem;
    align-items: flex-start;
}

.cms-modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.85;
    margin-top: 0.15rem;
}

.cms-modal-heading {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.cms-modal-icon {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.cms-modal-titles .modal-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
}

.cms-modal-subtitle {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.35;
}

.cms-modal-body {
    padding: 1.35rem 1.35rem 0.5rem;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 120px);
}

.cms-modal-footer {
    border-top: 1px solid #e8edf3;
    background: #f8fafc;
    padding: 0.9rem 1.35rem 1.15rem;
    gap: 0.5rem;
}

.cms-modal-btn-cancel {
    border-color: #d5dde8;
    color: #475569;
    font-weight: 500;
}

.cms-modal-btn-submit {
    font-weight: 600;
    padding-left: 1.1rem;
    padding-right: 1.1rem;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.cms-modal-section {
    background: #fff;
    border: 1px solid #e6ecf3;
    border-radius: 0.85rem;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.cms-modal-section-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    background: linear-gradient(90deg, rgba(30, 58, 95, 0.07), rgba(37, 99, 235, 0.04));
    border-bottom: 1px solid #e8edf3;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1e3a5f;
}

.cms-modal-section-head i {
    font-size: 1rem;
    color: #2563eb;
}

.cms-modal-section-body {
    padding: 1rem 1rem 0.25rem;
}

.cms-modal-section-body .form-label {
    font-weight: 600;
    font-size: 0.84rem;
    color: #334155;
}

.cms-modal-section-body .form-control,
.cms-modal-section-body .form-select {
    border-color: #d8e0ea;
    border-radius: 0.55rem;
}

.cms-modal-section-body .form-control:focus,
.cms-modal-section-body .form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.15);
}

.cms-type-pills {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.65rem;
}

.cms-type-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.85rem 0.75rem;
    margin: 0;
    border: 2px solid #dbe3ee;
    border-radius: 0.75rem;
    background: #fff;
    color: #475569;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
    font-weight: 600;
    font-size: 0.88rem;
    min-height: 88px;
}

.cms-type-pill i {
    font-size: 1.35rem;
    color: #64748b;
}

.cms-type-pill small {
    display: block;
    font-weight: 500;
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.25;
}

.btn-check:checked + .cms-type-pill {
    border-color: #2563eb;
    background: linear-gradient(180deg, #eff6ff, #fff);
    color: #1e3a5f;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.14);
    transform: translateY(-1px);
}

.btn-check:checked + .cms-type-pill i {
    color: #2563eb;
}

.btn-check:focus-visible + .cms-type-pill {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.cms-modal--success .cms-modal-header {
    background: linear-gradient(135deg, #065f46 0%, #059669 50%, #10b981 100%);
}

.cms-modal--danger .cms-modal-header {
    background: linear-gradient(135deg, #7f1d1d 0%, #dc2626 50%, #f97316 100%);
}

.cms-modal--info .cms-modal-header {
    background: linear-gradient(135deg, #0c4a6e 0%, #0284c7 50%, #38bdf8 100%);
}

.cms-modal--warning .cms-modal-header {
    background: linear-gradient(135deg, #78350f 0%, #d97706 50%, #fbbf24 100%);
}

.cms-modal-highlight {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(14, 165, 233, 0.06));
    border: 1px dashed rgba(37, 99, 235, 0.35);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
    color: #334155;
    margin-bottom: 1rem;
}

@media (max-width: 575.98px) {
    .cms-modal-body,
    .cms-modal-footer,
    .cms-modal-header {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .cms-type-pills {
        grid-template-columns: 1fr;
    }
}

/* Public member profile (QR scan) */
.member-public-page .member-public-card {
    max-width: 420px;
}

.member-public-profile {
    text-align: center;
    padding: 0.5rem 0 0.25rem;
}

.member-public-photo-wrap {
    margin-bottom: 1rem;
}

.member-public-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e2e8f0;
    margin: 0 auto;
}

.member-public-photo--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
}

.member-public-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 1.25rem;
}

.member-public-details {
    margin: 0;
    text-align: left;
}

.member-public-detail {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.member-public-detail:last-child {
    border-bottom: none;
}

.member-public-detail dt {
    margin: 0;
    font-size: 0.88rem;
    color: #64748b;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.member-public-detail dd {
    margin: 0;
    font-size: 0.92rem;
    color: #0f172a;
    text-align: right;
    word-break: break-word;
}

/* Kiosk check-in */
.kiosk-mode-page {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(145deg, #0f2744 0%, #1e3a5f 45%, #2d5a8e 100%);
    color: #0f172a;
}

.kiosk-shell {
    min-height: 100vh;
    padding: 1.25rem;
    max-width: 1180px;
    margin: 0 auto;
}

.kiosk-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    color: #fff;
}

.kiosk-header-church {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.82;
    margin-bottom: 0.35rem;
}

.kiosk-header-title {
    margin: 0 0 0.25rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
}

.kiosk-header-meta {
    margin: 0;
    opacity: 0.88;
    font-size: 0.95rem;
}

.kiosk-header-stats {
    display: flex;
    gap: 0.75rem;
}

.kiosk-stat {
    min-width: 88px;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center;
}

.kiosk-stat strong {
    display: block;
    font-size: 1.5rem;
    line-height: 1.1;
    color: #fff;
}

.kiosk-stat span {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.85;
}

.kiosk-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
    gap: 1rem;
    align-items: start;
}

.kiosk-scan-panel,
.kiosk-profile-panel {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
    padding: 1.25rem;
}

.kiosk-mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.35rem;
    background: #f1f5f9;
    border-radius: 12px;
}

.kiosk-mode-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border: none;
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
    background: transparent;
    color: #475569;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.kiosk-mode-btn.active {
    background: #1e3a5f;
    color: #fff;
    box-shadow: 0 4px 14px rgba(30, 58, 95, 0.28);
}

.kiosk-camera-wrap {
    border-radius: 14px;
    overflow: hidden;
    background: #0f172a;
    min-height: 300px;
}

#kioskQrReader {
    width: 100%;
    min-height: 300px;
}

#kioskQrReader video {
    object-fit: cover;
}

.kiosk-camera-actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.kiosk-hint {
    margin: 0.85rem 0 0;
    text-align: center;
    font-size: 0.86rem;
    color: #64748b;
}

.kiosk-manual-input {
    text-align: center;
    font-size: 1.15rem;
    letter-spacing: 0.03em;
}

.kiosk-error-banner {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    font-size: 0.92rem;
}

.kiosk-profile-empty {
    text-align: center;
    padding: 2rem 1rem 1.5rem;
    color: #64748b;
}

.kiosk-profile-empty-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 1rem;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 2rem;
}

.kiosk-profile-empty h2 {
    font-size: 1.15rem;
    color: #1e293b;
    margin-bottom: 0.35rem;
}

.kiosk-profile-card {
    text-align: center;
    padding: 0.5rem 0.25rem 1rem;
    animation: kioskProfileIn 0.35s ease;
}

.kiosk-profile-card.is-success .kiosk-profile-status {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.kiosk-profile-card.is-error .kiosk-profile-status {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
}

.kiosk-profile-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.kiosk-profile-photo-wrap {
    margin-bottom: 0.85rem;
}

.kiosk-profile-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #e2e8f0;
    margin: 0 auto;
}

.kiosk-profile-photo--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
}

.kiosk-profile-name {
    margin: 0 0 0.2rem;
    font-size: 1.45rem;
    color: #0f172a;
}

.kiosk-profile-number {
    margin: 0 0 0.85rem;
    color: #64748b;
    font-weight: 600;
}

.kiosk-profile-meta {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    align-items: center;
}

.kiosk-profile-badge {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #e2e8f0;
    color: #334155;
}

.kiosk-profile-badge[data-status="active"] {
    background: #dcfce7;
    color: #166534;
}

.kiosk-profile-badge[data-status="visitor"] {
    background: #e0f2fe;
    color: #075985;
}

.kiosk-profile-detail {
    font-size: 0.9rem;
    color: #475569;
}

.kiosk-recent {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.kiosk-recent-title {
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
}

.kiosk-recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kiosk-recent-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.kiosk-recent-item:last-child {
    border-bottom: none;
}

.kiosk-recent-photo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.kiosk-recent-photo--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 700;
}

.kiosk-recent-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.kiosk-recent-body strong {
    font-size: 0.92rem;
    color: #0f172a;
}

.kiosk-recent-body span {
    font-size: 0.78rem;
    color: #64748b;
}

@keyframes kioskProfileIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    .kiosk-profile-panel {
        order: 2;
    }
}

@media (max-width: 575.98px) {
    .kiosk-shell {
        padding: 0.85rem;
    }

    .kiosk-scan-panel,
    .kiosk-profile-panel {
        padding: 1rem;
    }

    .kiosk-header-stats {
        width: 100%;
    }

    .kiosk-stat {
        flex: 1;
    }
}

/* Reports */
.reports-page .content-wrapper {
    background: #f1f5f9;
}

.reports-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.reports-sidebar {
    position: sticky;
    top: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.reports-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.5rem 0.85rem;
    margin-bottom: 0.35rem;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 700;
    color: #1e3a5f;
}

.reports-sidebar-brand i {
    font-size: 1.15rem;
}

.reports-sidebar-note {
    margin: 1rem 0 0;
    padding-top: 0.85rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.78rem;
    color: #64748b;
    line-height: 1.45;
}

.reports-side-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.reports-side-nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}

.reports-side-nav-link i {
    width: 1.1rem;
    text-align: center;
    opacity: 0.85;
}

.reports-side-nav-link:hover {
    background: #f8fafc;
    color: #1e3a5f;
}

.reports-side-nav-link.active {
    background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
    color: #fff;
    box-shadow: 0 4px 14px rgba(30, 58, 95, 0.22);
}

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

.reports-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.35rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #1e3a5f 0%, #2d5a8e 100%);
    border-radius: 16px;
    color: #fff;
    box-shadow: 0 12px 32px rgba(30, 58, 95, 0.18);
}

.reports-hero-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    font-size: 1.45rem;
}

.reports-hero-text {
    flex: 1;
    min-width: 200px;
}

.reports-hero-text h2 {
    margin: 0 0 0.2rem;
    font-size: 1.45rem;
    color: #fff;
}

.reports-hero-text p {
    margin: 0;
    opacity: 0.88;
    font-size: 0.92rem;
}

.reports-hero-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.82rem;
    opacity: 0.92;
}

.reports-hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.reports-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    margin-bottom: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.reports-toolbar-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.reports-filter-field label {
    display: block;
    margin-bottom: 0.28rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
}

.reports-toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reports-kpi-grid {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.reports-kpi-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reports-kpi-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reports-kpi-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.reports-kpi {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    height: 100%;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
}

.reports-kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.reports-kpi--navy .reports-kpi-icon { background: #e8eef5; color: #1e3a5f; }
.reports-kpi--green .reports-kpi-icon { background: #dcfce7; color: #166534; }
.reports-kpi--teal .reports-kpi-icon { background: #e0f2fe; color: #075985; }
.reports-kpi--amber .reports-kpi-icon { background: #fef3c7; color: #b45309; }
.reports-kpi--purple .reports-kpi-icon { background: #ede9fe; color: #6d28d9; }
.reports-kpi--slate .reports-kpi-icon { background: #f1f5f9; color: #475569; }
.reports-kpi--danger .reports-kpi-icon { background: #fee2e2; color: #b91c1c; }

.reports-kpi-label {
    display: block;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.reports-kpi-value {
    font-size: 1.3rem;
    color: #0f172a;
    line-height: 1.2;
}

.reports-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.reports-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.reports-panel-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.reports-panel-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8eef5;
    color: #1e3a5f;
}

.reports-panel-title {
    margin: 0;
    font-size: 1rem;
    color: #0f172a;
}

.reports-panel-subtitle {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    color: #64748b;
}

.reports-panel-badge {
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.reports-panel-body {
    padding: 1rem 1.25rem 1.25rem;
}

.reports-panel-body .table-responsive {
    border-radius: 8px;
    overflow: hidden;
}

.reports-empty {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: #64748b;
}

.reports-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.85rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 1.5rem;
}

.reports-table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.reports-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    padding: 0.75rem 1rem;
}

.reports-table tbody td {
    padding: 0.8rem 1rem;
    vertical-align: middle;
    border-color: #f1f5f9;
}

.reports-table tbody tr.reports-row-light,
.reports-table tbody tr:nth-child(odd) {
    background: #fff;
}

.reports-table tbody tr.reports-row-alt,
.reports-table tbody tr:nth-child(even) {
    background: #f1f5f9;
}

.reports-table tbody tr:hover {
    background: #e8eef5 !important;
}

.reports-ref {
    font-size: 0.8rem;
    color: #1e3a5f;
    background: #f1f5f9;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
}

.reports-pill {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.reports-pill--success { background: #dcfce7; color: #166534; }
.reports-pill--info { background: #e0f2fe; color: #075985; }
.reports-pill--neutral { background: #e2e8f0; color: #475569; }

.reports-count-badge {
    display: inline-flex;
    min-width: 1.75rem;
    justify-content: center;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #e8eef5;
    color: #1e3a5f;
    font-weight: 700;
    font-size: 0.82rem;
}

.reports-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.reports-overview-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.reports-overview-card-head {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.9rem 1rem;
    color: #fff;
}

.reports-overview-card--navy .reports-overview-card-head { background: linear-gradient(135deg, #1e3a5f, #2d5a8e); }
.reports-overview-card--green .reports-overview-card-head { background: linear-gradient(135deg, #166534, #22c55e); }
.reports-overview-card--teal .reports-overview-card-head { background: linear-gradient(135deg, #075985, #0ea5e9); }
.reports-overview-card--purple .reports-overview-card-head { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
.reports-overview-card--amber .reports-overview-card-head { background: linear-gradient(135deg, #b45309, #f59e0b); }

.reports-overview-card-head h3 {
    margin: 0;
    font-size: 0.95rem;
}

.reports-overview-metrics {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
}

.reports-overview-metrics li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.88rem;
}

.reports-overview-metrics li:last-child {
    border-bottom: none;
}

.reports-overview-metrics span {
    color: #64748b;
}

.reports-overview-metrics strong {
    color: #0f172a;
}

.reports-table-area {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
}

.reports-amount-debit { color: #b45309; }
.reports-amount-credit { color: #166534; }

.reports-ledger-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
}

.reports-ledger-banner--open {
    background: #f8fafc;
    color: #475569;
}

.reports-ledger-banner--close {
    background: #e8eef5;
    color: #1e3a5f;
    border-bottom: none;
    border-top: 1px solid #dbe3ef;
}

.reports-dt-toolbar,
.reports-dt-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.reports-dt-footer {
    border-bottom: none;
    border-top: 1px solid #e2e8f0;
}

.reports-panel-body .dataTables_wrapper .reports-dt-toolbar:first-child {
    border-radius: 0;
}

.reports-dt-length label,
.reports-dt-filter label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 0.84rem;
    color: #64748b;
    font-weight: 600;
}

.reports-dt-length select,
.reports-dt-filter input {
    font-size: 0.84rem;
}

.reports-dt-info {
    font-size: 0.82rem;
    color: #64748b;
}

.reports-dt-paging .pagination {
    margin: 0;
    gap: 0.2rem;
}

.reports-dt-paging .page-link {
    border-radius: 8px !important;
    min-width: 2rem;
    text-align: center;
    color: #334155;
    background: #fff;
    border-color: #e2e8f0;
    box-shadow: none;
}

.reports-dt-paging .page-link:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.reports-dt-paging .page-item.active .page-link,
.reports-dt-paging .page-item.active .page-link:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #1e293b !important;
    font-weight: 700;
}

.reports-dt-paging .page-link:focus {
    box-shadow: none;
}

.reports-dt-paging .page-item.active .page-link:focus {
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.35);
}

.reports-panel-body .table-responsive + .reports-dt-footer,
.reports-panel-body .dataTables_wrapper {
    border-radius: 8px;
    overflow: hidden;
}

.reports-screen-only {
    /* On-screen dashboard widgets only; excluded from export documents */
}

.ledger-pro {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ledger-pro-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.ledger-pro-summary-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
}

.ledger-pro-summary-card small {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.76rem;
    color: #64748b;
}

.ledger-pro-summary-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 700;
}

.ledger-pro-summary-value {
    display: block;
    margin-top: 0.25rem;
    font-size: 1.35rem;
    color: #0f172a;
    line-height: 1.2;
}

.ledger-pro-summary-card--debit { border-top: 3px solid #f59e0b; }
.ledger-pro-summary-card--credit { border-top: 3px solid #16a34a; }
.ledger-pro-summary-card--close { border-top: 3px solid #1e3a5f; }

.ledger-pro-register {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.04);
}

.ledger-pro-register-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
}

.ledger-pro-register-head h3 {
    margin: 0;
    font-size: 1rem;
    color: #0f172a;
}

.ledger-pro-register-head p {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: #64748b;
}

.ledger-pro-table-wrap {
    padding: 0;
}

.ledger-pro-table thead th {
    background: #0f172a;
    color: #fff;
    border-color: #0f172a;
    font-size: 0.72rem;
}

.ledger-pro-date {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.ledger-pro-desc {
    min-width: 180px;
    max-width: 280px;
}

.ledger-pro-account {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    background: #f1f5f9;
    font-size: 0.8rem;
    color: #334155;
}

.ledger-pro-debit {
    color: #b45309;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.ledger-pro-credit {
    color: #166534;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.ledger-pro-balance {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    color: #0f172a;
}

.ledger-pro-foot-row td {
    background: #f8fafc;
    font-weight: 700;
    border-top: 2px solid #cbd5e1;
}

.reports-filter-field--search {
    min-width: 200px;
}

.reports-print-meta {
    margin-bottom: 1rem;
}

.reports-print-meta h1 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

@media (max-width: 991.98px) {
    .ledger-pro-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .reports-shell {
        grid-template-columns: 1fr;
    }

    .reports-sidebar {
        position: static;
    }

    .reports-side-nav-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .reports-side-nav-link {
        padding: 0.5rem 0.7rem;
        font-size: 0.82rem;
    }

    .reports-kpi-grid--4,
    .reports-kpi-grid--3,
    .reports-kpi-grid--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .ledger-pro-summary {
        grid-template-columns: 1fr;
    }

    .reports-kpi-grid--4,
    .reports-kpi-grid--3,
    .reports-kpi-grid--2 {
        grid-template-columns: 1fr;
    }

    .reports-hero {
        padding: 1rem;
    }

    .reports-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

@media print {
    .reports-no-print,
    .reports-dt-toolbar,
    .reports-dt-footer,
    .app-sidebar,
    .app-header,
    .main-footer,
    .reports-sidebar {
        display: none !important;
    }

    .reports-shell {
        display: block;
    }

    .reports-content,
    .reports-print-meta {
        display: block !important;
    }

    .reports-panel {
        break-inside: avoid;
        box-shadow: none !important;
    }
}
