:root {
    --navy: #10243e;
    --navy-deep: #0b1b30;
    --blue: #2463a8;
    --blue-soft: #edf4fb;
    --accent: #2e75b6;
    --background: var(--mos-surface-soft);
    --surface: #ffffff;
    --border: var(--mos-border);
    --text: #17212b;
    --muted: #667482;
    --success: #2e8b57;
    --shadow: 0 2px 8px rgba(20, 40, 60, .07);
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: var(--background);
    color: var(--text);
}

a {
    color: inherit;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}


/* SIDEBAR */

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.brand {
    height: 72px;
    padding: 15px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--navy);
    color: white;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: .5px;
}

.brand-name {
    font-size: 15px;
    font-weight: 750;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.organization-card {
    margin: 14px 14px 8px;
    padding: 11px;
    border-radius: 10px;
    background: var(--blue-soft);
    display: flex;
    gap: 10px;
    align-items: center;
}

.organization-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--navy);
    border: 1px solid #d2deeb;
    display: grid;
    place-items: center;
    font-weight: 800;
}

.organization-card strong {
    display: block;
    font-size: 12px;
}

.organization-card span {
    display: block;
    font-size: 10px;
    color: var(--muted);
    margin-top: 2px;
}

.navigation {
    overflow-y: auto;
    padding: 5px 10px 15px;
}

.nav-section {
    padding: 18px 12px 7px;
    font-size: 9px;
    letter-spacing: 1.2px;
    font-weight: 800;
    color: #8b97a4;
    text-transform: uppercase;
}

.nav-item {
    height: 38px;
    padding: 0 11px;
    margin: 2px 0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 550;
}

.nav-item:hover {
    background: var(--mos-surface-muted);
}

.nav-item.disabled {
    cursor: default;
}

.nav-icon {
    width: 20px;
    text-align: center;
    color: var(--blue);
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 8px 10px 12px;
}

.product-version {
    padding: 9px 11px 0;
    font-size: 10px;
    color: var(--muted);
}

.product-version span {
    display: block;
    margin-top: 2px;
    color: #9aa4ad;
}


/* MAIN */

.main {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
}

.topbar {
    height: 72px;
    background: var(--navy);
    color: white;
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-context {
    font-size: 15px;
    font-weight: 650;
}

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

.search {
    width: 220px;
    height: 38px;
    padding: 0 13px;
    border: 1px solid rgba(255,255,255,.15);
    background: rgba(255,255,255,.10);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255,255,255,.8);
}

.admin-badge {
    height: 38px;
    padding: 0 13px;
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 8px;
    display: flex;
    align-items: center;
    font-size: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--mos-surface);
    color: var(--navy);
    font-size: 11px;
    font-weight: 800;
}

.content {
    padding: 30px;
    max-width: 1500px;
    margin: 0 auto;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 24px;
}

.eyebrow {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.4px;
    color: var(--blue);
}

.page-heading h1 {
    margin: 5px 0 5px;
    font-size: 29px;
    letter-spacing: -.6px;
}

.page-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.button {
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
}

.button.primary {
    background: var(--navy);
    color: white;
}


/* METRICS */

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metric-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    min-height: 145px;
    box-shadow: var(--shadow);
    text-decoration: none;
}

.metric-card:hover {
    border-color: var(--mos-info-border);
}

.metric-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--blue-soft);
    color: var(--blue);
    display: grid;
    place-items: center;
}

.metric-value {
    font-size: 30px;
    line-height: 1;
    font-weight: 780;
    color: var(--navy);
    margin-top: 12px;
}

.metric-label {
    font-size: 13px;
    font-weight: 700;
    margin-top: 8px;
}

.metric-detail {
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
}


/* DASHBOARD */

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, .75fr);
    gap: 20px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-header {
    padding: 19px 21px;
    border-bottom: 1px solid var(--border);
}

.panel-header h2 {
    margin: 0;
    font-size: 16px;
}

.panel-header p {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--muted);
}

.module-grid {
    padding: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.module-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    gap: 13px;
    align-items: flex-start;
}

.module-card:hover {
    background: var(--mos-surface-soft);
}

.module-icon {
    width: 37px;
    height: 37px;
    flex: 0 0 37px;
    border-radius: 9px;
    background: var(--blue-soft);
    color: var(--blue);
    display: grid;
    place-items: center;
    font-weight: 700;
}

.module-card strong {
    display: block;
    font-size: 12px;
}

.module-card span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.45;
}

.status-row {
    display: flex;
    gap: 11px;
    padding: 15px 20px;
    border-bottom: 1px solid #edf0f3;
}

.status-row:last-child {
    border-bottom: 0;
}

.status-check,
.status-next {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex: 0 0 24px;
    display: grid;
    place-items: center;
    font-size: 11px;
}

.status-check {
    background: var(--mos-success-surface);
    color: var(--success);
}

.status-next {
    background: var(--blue-soft);
    color: var(--blue);
}

.status-row strong {
    display: block;
    font-size: 11px;
}

.status-row span:not(.status-check):not(.status-next) {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    color: var(--muted);
}


/* RESPONSIVE */

@media (max-width: 1050px) {
    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .sidebar {
        width: 72px;
    }

    .brand > div:not(.brand-mark),
    .organization-card > div:not(.organization-avatar),
    .nav-item span:last-child,
    .nav-section,
    .product-version {
        display: none;
    }

    .organization-card {
        padding: 8px;
        justify-content: center;
    }

    .nav-item {
        justify-content: center;
    }

    .main {
        margin-left: 72px;
        width: calc(100% - 72px);
    }

    .search {
        display: none;
    }

    .content {
        padding: 20px;
    }

    .metric-grid,
    .module-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   PEOPLE DIRECTORY
   ========================================================= */

.page-actions {
    display: flex;
    gap: 9px;
    align-items: center;
}

.button.secondary {
    background: var(--mos-surface);
    color: var(--navy);
    border: 1px solid var(--border);
}

button.button {
    font-family: inherit;
    cursor: pointer;
}

.directory-toolbar {
    background: var(--mos-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    box-shadow: var(--shadow);
}

.directory-search {
    height: 40px;
    min-width: 360px;
    border: 1px solid var(--border);
    background: var(--mos-surface-soft);
    border-radius: 8px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: 12px;
}

.filter-group {
    display: flex;
    gap: 6px;
}

.filter-button {
    border: 1px solid var(--border);
    background: var(--mos-surface);
    color: var(--muted);
    border-radius: 7px;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 650;
}

.filter-button.active {
    background: var(--blue-soft);
    color: var(--blue);
    border-color: var(--mos-info-border);
}

.directory-panel {
    background: var(--mos-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.directory-header,
.person-row {
    display: grid;
    grid-template-columns: minmax(260px, 1.6fr) 180px 1fr 1fr 30px;
    align-items: center;
    column-gap: 16px;
}

.directory-header {
    min-height: 44px;
    padding: 0 18px;
    background: var(--mos-surface-soft);
    border-bottom: 1px solid var(--border);
    color: #7b8792;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.person-row {
    min-height: 72px;
    padding: 10px 18px;
    border-bottom: 1px solid #edf0f3;
    text-decoration: none;
    transition: background .12s ease;
}

.person-row:last-child {
    border-bottom: 0;
}

.person-row:hover {
    background: var(--mos-surface-soft);
}

.person-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.person-avatar {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 50%;
    background: var(--blue-soft);
    color: var(--blue);
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 800;
}

.person-identity strong {
    display: block;
    font-size: 12px;
}

.person-identity span {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

.directory-muted {
    font-size: 11px;
    color: var(--muted);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 20px;
    padding: 4px 9px;
    background: var(--mos-surface-muted);
    color: #53616e;
    font-size: 9px;
    font-weight: 750;
}

.status-disciple {
    background: var(--mos-info-surface);
    color: var(--mos-info-text);
}

.status-visitor {
    background: var(--mos-warning-surface);
    color: #986314;
}

.status-regular_attendee {
    background: var(--mos-success-surface);
    color: var(--mos-success-text);
}

.row-arrow {
    color: #9ba6af;
    font-size: 21px;
    text-align: right;
}

.empty-state {
    padding: 45px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
}


/* =========================================================
   PERSON PROFILE
   ========================================================= */

.profile-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 20px;
}

.profile-identity {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--navy);
    color: white;
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 800;
}

.profile-heading h1 {
    margin: 3px 0 7px;
    font-size: 27px;
}

.profile-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.active-record {
    color: var(--success);
    font-size: 10px;
    font-weight: 700;
}

.profile-tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    background: var(--mos-surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 5px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.profile-tab {
    white-space: nowrap;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 7px;
    padding: 9px 14px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 650;
}

.profile-tab.active {
    background: var(--blue-soft);
    color: var(--blue);
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, .72fr);
    gap: 18px;
}

.profile-main,
.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.profile-section {
    overflow: hidden;
}

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

.detail-field {
    min-height: 76px;
    padding: 17px 20px;
    border-right: 1px solid #edf0f3;
    border-bottom: 1px solid #edf0f3;
}

.detail-field:nth-child(even) {
    border-right: 0;
}

.detail-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 750;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.detail-field strong {
    font-size: 12px;
    font-weight: 650;
}

.household-card {
    display: flex;
    gap: 13px;
    padding: 18px 20px;
}

.household-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 9px;
    background: var(--blue-soft);
    color: var(--blue);
    display: grid;
    place-items: center;
}

.household-card strong {
    display: block;
    font-size: 12px;
}

.household-card span {
    display: block;
    color: var(--blue);
    margin-top: 3px;
    font-size: 10px;
}

.household-card p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.empty-state.compact {
    padding: 22px;
}

.profile-stat {
    min-height: 51px;
    padding: 0 18px;
    border-bottom: 1px solid #edf0f3;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-stat span {
    color: var(--muted);
    font-size: 11px;
}

.profile-stat strong {
    color: var(--navy);
    font-size: 12px;
}

.coming-soon {
    padding: 14px 18px;
    background: var(--mos-surface-soft);
    color: var(--muted);
    font-size: 9.5px;
    line-height: 1.5;
}

.quick-actions {
    padding: 12px;
}

.quick-actions button {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #edf0f3;
    background: transparent;
    padding: 11px 8px;
    text-align: left;
    color: var(--blue);
    font-family: inherit;
    font-size: 11px;
    font-weight: 650;
}

.quick-actions button:last-child {
    border-bottom: 0;
}

@media (max-width: 1050px) {
    .directory-header,
    .person-row {
        grid-template-columns: minmax(230px, 1.5fr) 150px 1fr 30px;
    }

    .directory-header > :nth-child(4),
    .person-row > :nth-child(4) {
        display: none;
    }

    .profile-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .directory-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .directory-search {
        min-width: 0;
    }

    .directory-header {
        display: none;
    }

    .person-row {
        grid-template-columns: 1fr 30px;
    }

    .person-row > :nth-child(2),
    .person-row > :nth-child(3),
    .person-row > :nth-child(4) {
        display: none;
    }

    .profile-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-field {
        border-right: 0;
    }
}


/* =========================================================
   PHASE 1I — PERSON PROFILE
   ========================================================= */

.person-profile {
    width: 100%;
}

.profile-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: var(--text-muted, #6b7280);
    font-size: 14px;
}

.profile-breadcrumb a {
    color: var(--primary, #4b0d57);
    font-weight: 600;
    text-decoration: none;
}

.profile-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    background: var(--mos-surface);
    border: 1px solid #e7e8ec;
    border-radius: 18px;
    padding: 28px 30px;
    box-shadow: 0 8px 28px rgba(17, 24, 39, 0.05);
}

.profile-identity {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-avatar {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 82px;
    background: linear-gradient(145deg, #4b0d57, #71247d);
    color: white;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: 1px;
}

.profile-name-block h1 {
    margin: 4px 0 3px;
    font-size: 30px;
    line-height: 1.15;
}

.profile-legal-name {
    color: var(--mos-muted);
    margin-bottom: 10px;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-badge.relationship {
    background: var(--mos-accent-surface);
    color: var(--mos-accent-text);
}

.status-badge.active {
    background: var(--mos-success-surface);
    color: var(--mos-success-text);
}

.status-badge.muted {
    background: var(--mos-surface-muted);
    color: #626873;
}

.status-badge.directory {
    background: var(--mos-info-surface);
    color: var(--mos-info-text);
}

.profile-actions {
    display: flex;
    gap: 10px;
}

.profile-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    margin: 22px 0;
    padding: 5px;
    background: var(--mos-surface);
    border: 1px solid #e7e8ec;
    border-radius: 13px;
}

.profile-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 9px;
    white-space: nowrap;
    text-decoration: none;
    color: var(--mos-text);
    font-size: 14px;
    font-weight: 650;
}

.profile-tab.active {
    background: #4b0d57;
    color: white;
}

.profile-tab.future {
    color: var(--mos-muted);
    cursor: default;
}

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

.profile-main {
    display: grid;
    gap: 20px;
}

.profile-sidebar {
    display: grid;
    gap: 20px;
}

.content-card {
    background: var(--mos-surface);
    border: 1px solid #e7e8ec;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 5px 18px rgba(17, 24, 39, 0.035);
}

.compact-card {
    padding: 20px;
}

.card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.card-heading h2,
.compact-card h3 {
    margin: 4px 0 0;
}

.eyebrow {
    display: block;
    color: var(--mos-accent-text);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.11em;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 30px;
}

.detail-item {
    min-width: 0;
}

.detail-item a {
    color: var(--mos-accent-text);
    text-decoration: none;
    font-weight: 600;
}

.detail-label {
    display: block;
    margin-bottom: 5px;
    color: var(--mos-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .035em;
}

.empty-value {
    color: var(--mos-muted);
}

.household-address {
    padding: 15px 17px;
    margin-bottom: 16px;
    background: var(--mos-accent-surface);
    border-radius: 11px;
    color: var(--mos-text);
    line-height: 1.55;
}

.household-members {
    display: grid;
}

.household-member {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 13px 4px;
    border-bottom: 1px solid #ececef;
    color: inherit;
    text-decoration: none;
}

.household-member:last-child {
    border-bottom: 0;
}

.household-member:hover strong {
    color: var(--mos-accent-text);
}

.household-member-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    background: var(--mos-accent-surface);
    color: var(--mos-accent-text);
    font-weight: 800;
}

.household-member-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.household-member-info span {
    margin-top: 2px;
    color: var(--mos-muted);
    font-size: 13px;
}

.household-member-arrow {
    color: var(--mos-muted);
    font-size: 24px;
}

.notes-content {
    color: var(--mos-text);
    line-height: 1.65;
}

.privacy-note {
    margin-top: 18px;
    padding: 12px 14px;
    border-left: 3px solid #7c3b86;
    background: var(--mos-accent-surface);
    color: #6b6270;
    font-size: 12px;
    line-height: 1.5;
}

.empty-panel {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 20px;
    border: 1px dashed #d5d7dc;
    border-radius: 11px;
    color: var(--mos-muted);
}

.empty-panel.compact {
    padding: 14px;
}

.sidebar-detail {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #ececef;
    font-size: 13px;
}

.sidebar-detail:last-child {
    border-bottom: 0;
}

.sidebar-detail span {
    color: var(--mos-muted);
}

.sidebar-detail strong {
    text-align: right;
}

.future-module {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 0;
    border-bottom: 1px solid #ececef;
}

.future-module:last-child {
    border-bottom: 0;
}

.future-module span {
    color: var(--mos-text);
    font-size: 13px;
    font-weight: 700;
}

.future-module small {
    color: #8b9099;
    font-size: 11px;
}

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

    .profile-sidebar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .profile-actions {
        width: 100%;
    }

    .profile-actions .button {
        flex: 1;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .profile-sidebar {
        grid-template-columns: 1fr;
    }

    .profile-avatar {
        width: 66px;
        height: 66px;
        flex-basis: 66px;
        font-size: 22px;
    }

    .profile-name-block h1 {
        font-size: 25px;
    }
}


/* =========================================================
   Phase 2 | Groups, Ministries & Parishes
   ========================================================= */

.organization-metrics {
    margin-bottom: 24px;
}

.directory-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.directory-tab {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 9px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.directory-tab:hover {
    background: var(--blue-soft);
    color: var(--blue);
}

.directory-tab.active {
    background: var(--navy);
    color: #fff;
}

.organization-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.organization-card-large {
    display: flex;
    flex-direction: column;
    min-height: 255px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 5px 18px rgba(16, 36, 62, 0.04);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.organization-card-large:hover {
    transform: translateY(-2px);
    border-color: var(--mos-info-border);
    box-shadow: 0 10px 26px rgba(16, 36, 62, 0.08);
}

.organization-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
}

.organization-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 800;
    font-size: 17px;
}

.organization-icon.parish {
    background: var(--mos-success-surface);
    color: var(--success);
}

.organization-type {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.organization-card-large h2 {
    margin: 0 0 10px;
    font-size: 21px;
    color: var(--navy);
}

.organization-card-large p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
    font-size: 14px;
}

.organization-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: auto;
    padding-top: 22px;
    color: var(--muted);
    font-size: 13px;
}

.organization-card-footer strong {
    color: var(--navy);
}

.view-link {
    color: var(--blue);
    font-weight: 700;
}

.breadcrumb-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 20px;
    color: var(--muted);
    font-size: 13px;
}

.breadcrumb-row a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 700;
}

.group-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 30px;
    padding: 28px;
    margin-bottom: 22px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
}

.group-hero-main {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    min-width: 0;
}

.hero-icon {
    width: 62px;
    height: 62px;
    min-width: 62px;
    border-radius: 16px;
    font-size: 21px;
}

.group-hero h1 {
    margin: 4px 0 8px;
    color: var(--navy);
}

.group-hero p {
    max-width: 700px;
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.group-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.summary-card {
    padding: 19px 20px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
}

.summary-label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.summary-card strong {
    color: var(--navy);
    font-size: 17px;
}

.content-card {
    margin-bottom: 22px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.section-heading h2 {
    margin: 4px 0 0;
    color: var(--navy);
    font-size: 19px;
}

.section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    border-radius: 16px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 13px;
    font-weight: 800;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.detail-grid > div {
    padding: 17px;
    border-radius: 11px;
    background: var(--background);
}

.detail-label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.detail-grid strong {
    color: var(--navy);
    font-size: 14px;
    line-height: 1.5;
}

.leader-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.leader-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
}

.leader-card:hover {
    border-color: var(--mos-info-border);
    background: var(--background);
}

.leader-card strong,
.leader-card span {
    display: block;
}

.leader-card strong {
    margin-bottom: 3px;
    color: var(--navy);
}

.leader-card span {
    color: var(--muted);
    font-size: 12px;
}

.member-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 12px;
    font-weight: 800;
}

.member-list {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.member-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 180px 20px;
    align-items: center;
    gap: 14px;
    min-height: 70px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
}

.member-row:last-child {
    border-bottom: 0;
}

.member-row:hover {
    background: var(--background);
}

.member-row-name strong,
.member-row-name span {
    display: block;
}

.member-row-name strong {
    margin-bottom: 3px;
    color: var(--navy);
}

.member-row-name span {
    color: var(--muted);
    font-size: 12px;
}

.member-row-role {
    color: var(--muted);
    font-size: 13px;
}

.member-row-arrow {
    color: var(--blue);
    font-weight: 800;
}

.empty-inline {
    padding: 18px;
    border-radius: 10px;
    background: var(--background);
    color: var(--muted);
    font-size: 14px;
}

.empty-state {
    grid-column: 1 / -1;
    padding: 40px;
    border: 1px dashed var(--border);
    border-radius: 16px;
    text-align: center;
    background: var(--surface);
}

.empty-state h3 {
    margin: 0 0 8px;
    color: var(--navy);
}

.empty-state p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 1000px) {
    .organization-grid {
        grid-template-columns: 1fr;
    }

    .group-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .group-hero {
        flex-direction: column;
    }

    .group-summary-grid,
    .detail-grid,
    .leader-grid {
        grid-template-columns: 1fr;
    }

    .member-row {
        grid-template-columns: 40px minmax(0, 1fr) 20px;
    }

    .member-row-role {
        display: none;
    }
}

/* =========================================================
   Phase 2C - Person Church Life
   ========================================================= */

.church-life-section {
    margin-top: 24px;
}

.church-life-section .section-heading {
    margin-bottom: 18px;
}

.church-life-section .section-heading h2 {
    margin: 4px 0 4px;
}

.church-life-section .section-heading p {
    margin: 0;
    color: var(--muted);
}

.church-life-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.church-life-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}

.church-life-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.church-life-card-heading h3 {
    margin: 4px 0 0;
    font-size: 18px;
    color: var(--navy);
}

.church-life-label {
    display: block;
    color: var(--mos-accent-text);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
}

.church-life-count {
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.church-life-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.church-life-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease, background .15s ease;
}

.church-life-item:hover {
    border-color: var(--mos-info-border);
    background: var(--mos-surface-soft);
}

.church-life-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 800;
}

.church-life-icon.parish-icon {
    background: var(--mos-success-surface);
    color: var(--mos-success-text);
}

.church-life-content {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.church-life-content strong {
    color: var(--navy);
    font-size: 14px;
}

.church-life-content span {
    color: var(--muted);
    font-size: 13px;
}

.church-life-arrow {
    color: var(--blue);
    font-size: 20px;
    font-weight: 700;
}

.church-life-other {
    margin-top: 16px;
}

.empty-state.compact {
    padding: 18px;
    border-radius: 10px;
    background: var(--mos-surface-soft);
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 900px) {
    .church-life-grid {
        grid-template-columns: 1fr;
    }
}

/* Phase 2E.1 | Parish Leadership */

.leadership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.leadership-person {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
}

.leadership-person:hover {
    border-color: var(--accent);
}

.leadership-person-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.leadership-person-copy strong {
    color: var(--navy);
}

.leadership-person-copy span {
    color: var(--muted);
    font-size: 0.88rem;
}

.empty-state {
    margin-top: 16px;
    padding: 18px;
    border-radius: 10px;
    background: var(--background);
    color: var(--muted);
}


/* =========================================================
   Parish Care
   ========================================================= */

.parish-care-roster {
    margin-top: 24px;
}

.section-count {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.parish-member-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.parish-member-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    transition:
        border-color 0.15s ease,
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.parish-member-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(16, 36, 62, 0.08);
}

.parish-member-avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--blue-soft);
    color: var(--navy);
    font-weight: 700;
}

.parish-member-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.parish-member-info strong {
    color: var(--text);
}

.parish-member-info span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.86rem;
}

.empty-state.compact {
    margin-top: 18px;
    padding: 20px;
}

.empty-state.compact p {
    margin-bottom: 0;
}

@media (max-width: 700px) {
    .parish-member-grid {
        grid-template-columns: 1fr;
    }
}


/* SkyCloud Church People Import */

.import-panel,
.import-results {
    margin-top: 24px;
}

.import-form {
    max-width: 720px;
    display: grid;
    gap: 22px;
}

.import-field {
    display: grid;
    gap: 8px;
}

.import-field label {
    font-weight: 700;
    color: var(--navy);
}

.import-field select,
.import-field input[type="file"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d6dde6;
    border-radius: 8px;
    background: var(--mos-surface);
    font: inherit;
}

.import-notice,
.import-message {
    padding: 14px 16px;
    border-radius: 8px;
}

.import-notice {
    background: var(--blue-soft);
    color: var(--navy);
}

.import-error {
    margin-bottom: 20px;
    background: var(--mos-danger-surface);
    color: var(--mos-danger-text);
}

.import-success {
    margin-top: 20px;
    background: var(--mos-success-surface);
    color: var(--mos-success-text);
}

.import-summary-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.summary-card {
    padding: 18px;
    border: 1px solid #e1e6ec;
    border-radius: 10px;
    background: var(--mos-surface);
}

.summary-card strong {
    display: block;
    font-size: 1.7rem;
    color: var(--navy);
}

.summary-card span {
    display: block;
    margin-top: 4px;
    color: #647184;
    font-size: .9rem;
}

.import-preview-table {
    overflow-x: auto;
}

.import-preview-table table {
    width: 100%;
    border-collapse: collapse;
}

.import-preview-table th,
.import-preview-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #e5e9ee;
}

.import-preview-table th {
    color: var(--navy);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

@media (max-width: 700px) {
    .import-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}


/* Phase 2I.3 confirmed import */

.import-confirmation {
    margin-top: 24px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border: 1px solid #d9e3ed;
    border-radius: 10px;
    background: var(--mos-surface-soft);
}

.import-confirmation strong {
    color: var(--navy);
    font-size: 1.05rem;
}

.import-confirmation p {
    margin: 5px 0 0;
    color: var(--muted);
}

@media (max-width: 700px) {
    .import-confirmation {
        align-items: stretch;
        flex-direction: column;
    }

    .import-confirmation form,
    .import-confirmation .button {
        width: 100%;
    }
}


/* =========================================================
   SETTINGS
   ========================================================= */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(280px, 420px)
    );
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.settings-card {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--mos-surface);
    border: 1px solid #dfe5ec;
    border-radius: 14px;
}

.settings-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--mos-surface-muted);
    font-size: 1.4rem;
    font-weight: 700;
}

.settings-card-body {
    min-width: 0;
}

.settings-card-body h2 {
    margin: 0.2rem 0 0.65rem;
}

.settings-card-body p {
    margin-top: 0;
}

.settings-card-body .button {
    margin-top: 0.5rem;
}

.profile-menu {
    position: relative;
}

.profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 48px;
    background: var(--mos-surface);
    border-radius: 12px;
    padding: 12px;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0,0,0,.15);
    z-index: 9999;
}

.profile-dropdown.open {
    display: block;
}

.profile-dropdown a {
    display: block;
    padding: 10px 12px;
    text-decoration: none;
}

.profile-dropdown-header {
    font-weight: 700;
    padding: 10px 12px;
}


.profile-dropdown,
.profile-dropdown * {
    color: #222 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.profile-dropdown {
    background: var(--mos-surface) !important;
}

.profile-dropdown a {
    color: #222 !important;
}



/* =========================================================
   MinistryOS Event Editor
   ========================================================= */

.event-editor {
    max-width: 1050px;
}

.event-editor-tabs {
    display: flex;
    border-bottom: 1px solid #dbe2ea;
    margin-bottom: 22px;
}

.event-tab {
    appearance: none;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    padding: 14px 28px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    color: #59697b;
}

.event-tab.active {
    color: var(--mos-text-strong);
    border-bottom-color: var(--mos-text-strong);
}

.event-card {
    background: var(--mos-surface);
    border: 1px solid #dfe6ed;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 18px;
    box-shadow: 0 2px 8px rgba(20, 42, 67, .05);
}

.event-card-heading {
    margin-bottom: 20px;
}

.event-card-heading h2 {
    margin: 4px 0 0;
}

.event-field {
    margin-bottom: 18px;
}

.event-field label {
    display: block;
    font-weight: 700;
    margin-bottom: 7px;
    color: var(--mos-text-strong);
}

.event-control {
    box-sizing: border-box;
    width: 100%;
    min-height: 46px;
    border: 1px solid #cbd6e2;
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--mos-surface);
    color: var(--mos-text-strong);
    font: inherit;
}

textarea.event-control {
    min-height: 115px;
    resize: vertical;
}

.event-control:focus {
    outline: 2px solid rgba(23, 71, 115, .15);
    border-color: var(--mos-info-border);
}

.event-time-grid {
    display: grid;
    grid-template-columns: 1.7fr 1fr 1fr 1.7fr;
    gap: 16px;
}

.event-two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.event-switch-list {
    display: grid;
    gap: 4px;
}

.event-switch-row,
.event-feature-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    cursor: pointer;
}

.event-switch-row input,
.event-feature-toggle input {
    appearance: none;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: var(--mos-surface-muted);
    position: relative;
    cursor: pointer;
    transition: all .2s ease;
    flex-shrink: 0;
}

.event-switch-row input::before,
.event-feature-toggle input::before {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 3px;
    left: 3px;
    border-radius: 50%;
    background: var(--mos-surface);
    transition: transform .2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
}

.event-switch-row input:checked,
.event-feature-toggle input:checked {
    background: #174773;
}

.event-switch-row input:checked::before,
.event-feature-toggle input:checked::before {
    transform: translateX(20px);
}

.event-feature-toggle {
    align-items: flex-start;
}

.event-feature-toggle span {
    display: grid;
    gap: 3px;
}

.event-feature-toggle small,
.event-field small {
    color: var(--mos-muted);
}

.event-visibility-field {
    max-width: 460px;
}

.event-fee-field {
    max-width: 320px;
    margin-top: 18px;
}

.event-editor-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin: 24px 0 8px;
}

.required {
    color: var(--mos-danger-text);
}

@media (max-width: 800px) {
    .event-time-grid,
    .event-two-column {
        grid-template-columns: 1fr;
    }

    .event-editor-tabs {
        position: sticky;
        top: 0;
        background: var(--mos-surface);
        z-index: 5;
    }
}


/* =========================================================
   MinistryOS Dashboard Events
   ========================================================= */

.dashboard-events-section {
    margin: 24px 0;
}

.dashboard-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 14px;
}

.dashboard-section-heading h2 {
    margin: 0 0 3px;
}

.dashboard-section-heading span {
    color: var(--mos-muted);
}

.dashboard-event-list {
    display: grid;
    gap: 12px;
}

.dashboard-event-card {
    display: grid;
    grid-template-columns: 86px 1fr;
    background: var(--mos-surface);
    border: 1px solid #dfe6ed;
    border-left: 5px solid #238759;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(20, 42, 67, .06);
}

.dashboard-event-date {
    display: grid;
    align-content: center;
    justify-items: center;
    background: #f4f7fa;
    border-right: 1px solid #e1e7ed;
    padding: 14px 8px;
}

.dashboard-event-date span,
.dashboard-event-date small {
    font-size: .76rem;
    font-weight: 700;
    text-transform: uppercase;
}

.dashboard-event-date strong {
    font-size: 1.8rem;
    line-height: 1.05;
    color: var(--mos-text-strong);
}

.dashboard-event-body {
    padding: 15px 18px;
}

.dashboard-event-meta {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .05em;
    color: var(--mos-muted);
    margin-bottom: 4px;
}

.dashboard-event-title {
    display: block;
    color: var(--mos-text-strong);
    font-size: 1.05rem;
    font-weight: 800;
    text-decoration: none;
}

.dashboard-event-title:hover {
    text-decoration: underline;
}

.dashboard-event-location,
.dashboard-event-time {
    color: #536475;
    margin-top: 3px;
}

.dashboard-event-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid #edf1f4;
    margin-top: 12px;
    padding-top: 11px;
}

.dashboard-checkin-button {
    min-width: 90px;
    text-align: center;
}

.dashboard-events-empty {
    background: var(--mos-surface);
    border: 1px solid #dfe6ed;
    border-radius: 12px;
    padding: 22px;
}


/* =========================================================
   Event Check-In
   ========================================================= */

.checkin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr);
    gap: 20px;
}

.event-checkin-search {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.event-checkin-search input {
    flex: 1;
    min-height: 44px;
    border: 1px solid #cbd6e2;
    border-radius: 8px;
    padding: 10px 12px;
    font: inherit;
}

.checkin-person-list,
.checkin-attendance-list {
    display: grid;
    gap: 8px;
}

.checkin-person-row {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 12px;
    align-items: center;
    border: 1px solid #e2e8ee;
    border-radius: 10px;
    padding: 10px 12px;
}

.checkin-person-avatar {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #142d4d;
    color: #fff;
    font-weight: 800;
}

.checkin-person-info {
    display: grid;
}

.checkin-person-info span {
    color: var(--mos-muted);
    font-size: .9rem;
}

.checkin-status {
    color: var(--mos-success-text);
    font-weight: 800;
}

.checkin-attendance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #edf1f4;
    padding: 10px 0;
}

.checkin-attendance-row div {
    display: grid;
}

.checkin-attendance-row span {
    color: var(--mos-muted);
}

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

    .dashboard-event-card {
        grid-template-columns: 70px 1fr;
    }
}


/* =========================================================
   Person Event History
   ========================================================= */

.person-event-filters {
    display: grid;
    grid-template-columns: 220px 220px auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 20px;
}

.person-event-filter-actions {
    display: flex;
    gap: 8px;
    padding-bottom: 18px;
}

.person-event-history {
    display: grid;
    margin-top: 18px;
}

.person-event-history-row {
    display: grid;
    grid-template-columns: 180px 1fr 150px;
    gap: 18px;
    align-items: center;
    padding: 15px 8px;
    border-bottom: 1px solid #e3e9ef;
    color: inherit;
    text-decoration: none;
}

.person-event-history-row:hover {
    background: var(--mos-surface-soft);
}

.person-event-history-date,
.person-event-history-main,
.person-event-history-checkin {
    display: grid;
    gap: 3px;
}

.person-event-history-main span,
.person-event-history-date span,
.person-event-history-checkin span {
    color: var(--mos-muted);
}

.person-event-history-checkin {
    text-align: right;
}

.person-registration-grid {
    display: grid;
    gap: 12px;
}

.person-registration-card {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    border: 1px solid #dfe6ed;
    border-radius: 12px;
    padding: 18px;
}

.person-registration-card h2 {
    margin: 4px 0;
}

@media (max-width: 800px) {
    .person-event-filters {
        grid-template-columns: 1fr;
    }

    .person-event-filter-actions {
        padding-bottom: 0;
    }

    .person-event-history-row {
        grid-template-columns: 1fr;
    }

    .person-event-history-checkin {
        text-align: left;
    }

    .person-registration-card {
        align-items: flex-start;
        flex-direction: column;
    }
}


/* =========================================================
   MinistryOS Calendar
   ========================================================= */

.ministry-calendar {
    background: var(--mos-surface);
    border: 1px solid #dfe6ed;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(20, 42, 67, .06);
}

.ministry-calendar-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid #e3e9ef;
}

.ministry-calendar-header > div {
    text-align: center;
}

.ministry-calendar-header h2 {
    margin: 0;
}

.ministry-calendar-header span {
    color: var(--mos-muted);
    font-size: .9rem;
}

.ministry-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--mos-surface-soft);
    border-bottom: 1px solid #dfe6ed;
}

.ministry-calendar-weekdays div {
    padding: 10px;
    text-align: center;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #617184;
}

.ministry-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.ministry-calendar-day {
    min-height: 150px;
    padding: 9px;
    border-right: 1px solid #e6ebf0;
    border-bottom: 1px solid #e6ebf0;
    background: var(--mos-surface);
    min-width: 0;
}

.ministry-calendar-day:nth-child(7n) {
    border-right: 0;
}

.ministry-calendar-day.empty {
    background: var(--mos-surface-soft);
}

.ministry-calendar-day.today {
    background: var(--mos-info-surface);
}

.ministry-calendar-day-number {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-weight: 800;
    color: var(--mos-text-strong);
    margin-bottom: 7px;
}

.ministry-calendar-day.today
.ministry-calendar-day-number {
    background: #142d4d;
    color: #fff;
}

.ministry-calendar-events {
    display: grid;
    gap: 5px;
}

.ministry-calendar-event {
    display: grid;
    min-width: 0;
    padding: 7px 8px;
    border-left: 3px solid #25875b;
    border-radius: 6px;
    background: var(--mos-success-surface);
    color: var(--mos-success-text);
    text-decoration: none;
}

.ministry-calendar-event:hover {
    background: var(--mos-success-surface);
}

.ministry-calendar-event strong,
.ministry-calendar-event span,
.ministry-calendar-event small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ministry-calendar-event strong {
    font-size: .82rem;
}

.ministry-calendar-event span,
.ministry-calendar-event small {
    font-size: .74rem;
}

@media (max-width: 900px) {
    .ministry-calendar {
        overflow-x: auto;
    }

    .ministry-calendar-weekdays,
    .ministry-calendar-grid {
        min-width: 850px;
    }
}


/* =========================================================
   MinistryOS Calendar
   ========================================================= */

.ministry-calendar {
    background: var(--mos-surface);
    border: 1px solid #dfe6ed;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 3px 12px rgba(20, 42, 67, .06);
}

.ministry-calendar-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid #e3e9ef;
}

.ministry-calendar-header > div {
    text-align: center;
}

.ministry-calendar-header h2 {
    margin: 0;
}

.ministry-calendar-header span {
    color: var(--mos-muted);
    font-size: .9rem;
}

.ministry-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--mos-surface-soft);
    border-bottom: 1px solid #dfe6ed;
}

.ministry-calendar-weekdays div {
    padding: 10px;
    text-align: center;
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #617184;
}

.ministry-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.ministry-calendar-day {
    min-height: 150px;
    padding: 9px;
    border-right: 1px solid #e6ebf0;
    border-bottom: 1px solid #e6ebf0;
    background: var(--mos-surface);
    min-width: 0;
}

.ministry-calendar-day:nth-child(7n) {
    border-right: 0;
}

.ministry-calendar-day.empty {
    background: var(--mos-surface-soft);
}

.ministry-calendar-day.today {
    background: var(--mos-info-surface);
}

.ministry-calendar-day-number {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    font-weight: 800;
    color: var(--mos-text-strong);
    margin-bottom: 7px;
}

.ministry-calendar-day.today
.ministry-calendar-day-number {
    background: #142d4d;
    color: #fff;
}

.ministry-calendar-events {
    display: grid;
    gap: 5px;
}

.ministry-calendar-event {
    display: grid;
    min-width: 0;
    padding: 7px 8px;
    border-left: 3px solid #25875b;
    border-radius: 6px;
    background: var(--mos-success-surface);
    color: var(--mos-success-text);
    text-decoration: none;
}

.ministry-calendar-event:hover {
    background: var(--mos-success-surface);
}

.ministry-calendar-event strong,
.ministry-calendar-event span,
.ministry-calendar-event small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ministry-calendar-event strong {
    font-size: .82rem;
}

.ministry-calendar-event span,
.ministry-calendar-event small {
    font-size: .74rem;
}

@media (max-width: 900px) {
    .ministry-calendar {
        overflow-x: auto;
    }

    .ministry-calendar-weekdays,
    .ministry-calendar-grid {
        min-width: 850px;
    }
}

.dashboard-activity-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    align-items: start;
}

.dashboard-attendance-section {
    margin: 24px 0;
}

.dashboard-attendance-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(230px, 1fr)
    );
    gap: 12px;
}

.dashboard-attendance-card {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
    align-items: start;
    background: var(--mos-surface);
    border: 1px solid #dfe6ed;
    border-left: 4px solid #25875b;
    border-radius: 12px;
    padding: 15px;
    color: inherit;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(20, 42, 67, .05);
}

.dashboard-attendance-card:hover {
    background: var(--mos-surface-soft);
}

.dashboard-attendance-count {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--mos-success-surface);
    color: var(--mos-success-text);
    font-weight: 900;
}

.dashboard-attendance-content {
    display: grid;
    gap: 3px;
}

.dashboard-attendance-content strong {
    color: var(--mos-text-strong);
}

.dashboard-attendance-content span {
    color: var(--mos-text);
}

.dashboard-attendance-content small {
    color: #718092;
}


/* =========================================================
   MinistryOS Event Operations Hub
   ========================================================= */

.event-operations-metrics {
    display: grid;
    grid-template-columns: repeat(
        4,
        minmax(0, 1fr)
    );
    gap: 14px;
    margin-bottom: 20px;
}

.event-operations-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.25fr)
        minmax(300px, .75fr);
    gap: 20px;
}

.event-detail-description {
    margin-top: 24px;
}

.event-detail-description p {
    line-height: 1.6;
}

.event-operations-list {
    display: grid;
}

.event-operations-person {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 4px;
    border-bottom: 1px solid #e5ebf0;
    text-decoration: none;
    color: inherit;
}

.event-operations-person:hover {
    background: var(--mos-surface-soft);
}

.event-operations-person > div {
    display: grid;
    gap: 3px;
}

.event-operations-person span {
    color: var(--mos-muted);
}

@media (max-width: 900px) {
    .event-operations-metrics {
        grid-template-columns: repeat(
            2,
            minmax(0, 1fr)
        );
    }

    .event-operations-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .event-operations-metrics {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   Event QR Check-In Panel
   ========================================================= */

.event-qr-panel {
    margin-bottom: 20px;
}

.event-qr-content {
    background: var(--mos-surface-soft);
    border: 1px solid #dfe6ed;
    border-radius: 10px;
    padding: 16px;
    overflow-wrap: anywhere;
}

.event-qr-content code {
    font-size: .9rem;
}


/* =========================================================
   QR Check-In User Experience
   ========================================================= */

.event-checkin-confirmation {
    text-align: center;
    padding: 30px;
}

.event-checkin-confirmation h2 {
    margin: 12px 0 24px;
}


/* =========================================================
   MinistryOS Member Home
   ========================================================= */

.member-home-heading {
    margin-bottom: 24px;
}

.member-home-heading h1 {
    margin: 4px 0 6px;
}

.member-home-grid {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
    gap: 20px;
}

.member-home-card {
    background: var(--mos-surface);
    border: 1px solid #dfe6ed;
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 3px 12px rgba(20, 42, 67, .05);
}

.member-home-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.member-home-card-heading h2 {
    margin: 3px 0 0;
}

.member-profile-summary {
    display: grid;
    gap: 12px;
}

.member-profile-summary > div {
    display: grid;
    gap: 2px;
}

.member-profile-summary span,
.member-list-row span,
.member-event-card span,
.member-event-card small {
    color: var(--mos-muted);
}

.member-home-card-actions {
    margin-top: 18px;
}

.member-list {
    display: grid;
}

.member-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 4px;
    border-bottom: 1px solid #e5ebf0;
    text-decoration: none;
    color: inherit;
}

.member-list-row > div {
    display: grid;
    gap: 3px;
}

.member-event-grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(260px, 1fr)
    );
    gap: 12px;
}

.member-event-card {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 12px;
    align-items: center;
    border: 1px solid #dfe6ed;
    border-radius: 10px;
    padding: 12px;
    color: inherit;
    text-decoration: none;
}

.member-event-card > div:last-child {
    display: grid;
    gap: 3px;
}

.member-event-date {
    display: grid;
    justify-items: center;
    border-right: 1px solid #e5ebf0;
    padding-right: 10px;
}

.member-event-date strong {
    font-size: 1.35rem;
    line-height: 1;
}

.member-event-date span {
    font-size: .74rem;
    font-weight: 800;
    text-transform: uppercase;
}

@media (max-width: 850px) {
    .member-home-grid {
        grid-template-columns: 1fr;
    }

    .member-home-card-heading {
        flex-direction: column;
    }
}


/* =========================================================
   MinistryOS Member Shell
   ========================================================= */

.app-shell:has(.member-primary-nav) {
    grid-template-columns: 1fr;
}

.member-primary-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: var(--mos-surface);
    border-bottom: 1px solid #e3e9ef;
    overflow-x: auto;
}

.member-primary-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--mos-text);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.member-primary-nav a:hover {
    background: var(--mos-surface-soft);
    color: var(--mos-text-strong);
}

@media (max-width: 700px) {
    .member-primary-nav {
        padding: 10px 14px;
    }
}


/* =========================================================
   Member Events Workspace
   ========================================================= */

.member-event-status {
    color: var(--mos-success-text) !important;
    font-weight: 800;
}

.member-attendance-status {
    display: grid;
    gap: 3px;
    text-align: right;
}

.member-attendance-status strong {
    color: var(--mos-success-text);
}

.member-empty-state {
    padding: 18px;
    border: 1px dashed #cad5df;
    border-radius: 10px;
    color: var(--mos-muted);
    background: var(--mos-surface-soft);
}

@media (max-width: 700px) {
    .member-attendance-status {
        text-align: left;
    }
}


/* =========================================================
   Member Profile Workspace
   ========================================================= */

.member-profile-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 1.2fr)
        minmax(300px, .8fr);
    gap: 20px;
}

.member-profile-details {
    display: grid;
    grid-template-columns: repeat(
        2,
        minmax(0, 1fr)
    );
    gap: 18px;
}

.member-profile-details > div {
    display: grid;
    gap: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5ebf0;
}

.member-profile-details span,
.member-profile-group span {
    color: var(--mos-muted);
    font-size: .88rem;
}

.member-profile-groups {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(220px, 1fr)
    );
    gap: 12px;
}

.member-profile-group {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid #dfe6ed;
    border-radius: 10px;
    background: var(--mos-surface-soft);
}

@media (max-width: 850px) {
    .member-profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .member-profile-details {
        grid-template-columns: 1fr;
    }
}


/* Member Event Actions */

.member-event-actions {
    margin-top: 8px;
}

.event-status {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 800;
}

.event-status.attended {
    background: var(--mos-success-surface);
    color: var(--mos-success-text);
}

.event-status.registered {
    background: var(--mos-info-surface);
    color: var(--mos-info-text);
}

.event-status.available {
    background: var(--mos-warning-surface);
    color: #8a5a00;
}


/* Paid Event ticketing — compact operational layout */

.event-ticket-delete {
    display: none !important;
}

.event-ticket-types-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 10px 0 12px;
}

.event-ticket-types-heading small {
    display: block;
    margin-top: 3px;
    color: var(--mos-muted);
}

.event-ticket-add-link {
    border: 0;
    background: transparent;
    padding: 4px 0;
    color: var(--mos-info-text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.event-ticket-add-link:hover {
    text-decoration: underline;
}

.event-ticket-type-row {
    display: grid;
    grid-template-columns:
        minmax(130px, 180px)
        minmax(220px, 1fr)
        minmax(130px, 180px)
        34px;
    gap: 16px;
    align-items: end;
    padding: 14px 16px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: var(--mos-surface-soft);
}

.event-ticket-type-row .event-field {
    margin-bottom: 0;
}

.event-ticket-type-row .event-control {
    min-height: 38px;
    padding: 7px 9px;
    border-width: 0 0 1px;
    border-radius: 0;
    background: transparent;
}

.event-ticket-type-row .event-field label {
    margin-bottom: 3px;
    font-size: 13px;
}

.event-ticket-remove {
    width: 32px;
    height: 38px;
    border: 0;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--mos-danger-text);
}

#per-event-ticket-options .event-two-column {
    grid-template-columns: minmax(180px, 260px) minmax(180px, 260px);
    max-width: 620px;
    gap: 22px;
}

#per-event-ticket-options .event-field {
    margin-bottom: 8px;
}

#per-event-ticket-options .event-control {
    min-height: 40px;
}

.event-inline-switch {
    margin-top: 7px;
    min-height: 34px;
}

.event-ticket-mode {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.event-ticket-mode-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
}

.event-ticket-mode-option input {
    width: 18px;
    height: 18px;
}

@media (max-width: 850px) {
    .event-ticket-type-row {
        grid-template-columns: 1fr 1fr;
    }

    #per-event-ticket-options .event-two-column {
        grid-template-columns: 1fr;
    }
}

/* Event deletion actions */

.page-actions {
    flex-wrap: wrap;
}

.event-delete-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.event-delete-actions form {
    margin: 0;
}

.button.danger {
    background: #b42318;
    border-color: #b42318;
    color: #ffffff;
}

.button.danger:hover {
    background: #912018;
    border-color: #912018;
}

.button.danger-outline {
    background: var(--mos-surface);
    border: 1px solid #b42318;
    color: var(--mos-danger-text);
}

.button.danger-outline:hover {
    background: var(--mos-danger-surface);
}

@media (max-width: 900px) {
    .event-delete-actions {
        width: 100%;
    }
}


/* =========================================================
   MinistryOS Global Action Acknowledgements
   ========================================================= */

.ministryos-toast-stack {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 5000;
    display: grid;
    gap: 12px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.ministryos-toast {
    display: grid;
    grid-template-columns: 34px 1fr 32px;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 14px 14px 14px 16px;
    border: 1px solid #d7e0e8;
    border-left-width: 5px;
    border-radius: 14px;
    background: var(--mos-surface);
    box-shadow:
        0 12px 30px rgba(17, 34, 51, .14),
        0 2px 8px rgba(17, 34, 51, .08);
    pointer-events: auto;
    animation: ministryos-toast-in .22s ease-out;
}

.ministryos-toast.success {
    border-left-color: #18794e;
}

.ministryos-toast.error {
    border-left-color: #b42318;
}

.ministryos-toast.warning {
    border-left-color: #b7791f;
}

.ministryos-toast.info {
    border-left-color: var(--mos-info-border);
}

.ministryos-toast-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 15px;
}

.ministryos-toast.success .ministryos-toast-icon {
    background: var(--mos-success-surface);
    color: var(--mos-success-text);
}

.ministryos-toast.error .ministryos-toast-icon {
    background: var(--mos-danger-surface);
    color: var(--mos-danger-text);
}

.ministryos-toast.warning .ministryos-toast-icon {
    background: var(--mos-warning-surface);
    color: #9a6700;
}

.ministryos-toast.info .ministryos-toast-icon {
    background: var(--mos-surface-muted);
    color: var(--mos-info-text);
}

.ministryos-toast-message {
    color: var(--mos-text-strong);
    font-weight: 650;
    line-height: 1.4;
}

.ministryos-toast-close {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #68798a;
    font-size: 20px;
    cursor: pointer;
}

.ministryos-toast-close:hover {
    background: var(--mos-surface-muted);
    color: var(--mos-text-strong);
}

.ministryos-toast.is-leaving {
    opacity: 0;
    transform: translateX(20px);
    transition:
        opacity .18s ease,
        transform .18s ease;
}

@keyframes ministryos-toast-in {
    from {
        opacity: 0;
        transform: translateY(-8px) translateX(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0) translateX(0);
    }
}

@media (max-width: 640px) {
    .ministryos-toast-stack {
        top: 12px;
        right: 16px;
        left: 16px;
        width: auto;
    }
}



/* People directory live search */

.people-typeahead {
    position: relative;
}

.people-search-suggestions {
    position: absolute;
    z-index: 2000;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    overflow: hidden;
    border: 1px solid #d7e0e8;
    border-radius: 12px;
    background: var(--mos-surface);
    box-shadow:
        0 14px 32px rgba(17, 34, 51, .14),
        0 3px 8px rgba(17, 34, 51, .08);
}

.people-search-suggestion {
    display: grid;
    gap: 3px;
    padding: 11px 13px;
    border-bottom: 1px solid #edf1f4;
    color: var(--mos-text-strong);
    text-decoration: none;
    cursor: pointer;
}

.people-search-suggestion:last-child {
    border-bottom: 0;
}

.people-search-suggestion strong {
    font-size: 14px;
    line-height: 1.25;
}

.people-search-suggestion span {
    overflow: hidden;
    color: var(--mos-muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.people-search-suggestion:hover,
.people-search-suggestion.active {
    background: var(--mos-surface-muted);
}



/* =========================================================
   MinistryOS PWA — Phase G2 Install Experience
   ========================================================= */

.profile-dropdown .profile-dropdown-action {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 10px 12px;
    text-align: left;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    color: #222 !important;
}

.profile-dropdown .profile-dropdown-action:hover,
.profile-dropdown a:hover {
    background: var(--mos-surface-soft);
    border-radius: 7px;
}

.profile-dropdown .profile-dropdown-action[hidden] {
    display: none !important;
}


/* ==========================================================
   MinistryOS mobile / installed-PWA navigation drawer
   ========================================================== */

.mobile-sidebar-toggle,
.mobile-sidebar-scrim {
    display: none;
}

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


@media (max-width: 1050px) {

    .mobile-sidebar-toggle {
        appearance: none;
        border: 1px solid var(--border);
        background: var(--surface);
        color: var(--navy);
        width: 38px;
        height: 38px;
        border-radius: 9px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 38px;
        padding: 0;
        cursor: pointer;
        font-size: 21px;
        font-weight: 700;
        line-height: 1;
    }

    .mobile-sidebar-toggle:focus-visible {
        outline: 3px solid rgba(23, 71, 115, .22);
        outline-offset: 2px;
    }

    .sidebar {
        transition:
            width .18s ease,
            box-shadow .18s ease;
        z-index: 50;
    }

    body.ministryos-sidebar-open {
        overflow: hidden;
    }

    body.ministryos-sidebar-open .sidebar {
        width: 260px;
        box-shadow: 12px 0 30px rgba(15, 23, 42, .18);
    }

    body.ministryos-sidebar-open
    .brand > div:not(.brand-mark),

    body.ministryos-sidebar-open
    .organization-card > div:not(.organization-avatar),

    body.ministryos-sidebar-open
    .nav-item span:last-child,

    body.ministryos-sidebar-open
    .nav-section,

    body.ministryos-sidebar-open
    .product-version {
        display: block;
    }

    body.ministryos-sidebar-open
    .organization-card {
        justify-content: flex-start;
    }

    body.ministryos-sidebar-open
    .nav-item {
        justify-content: flex-start;
    }

    .mobile-sidebar-scrim {
        position: fixed;
        inset: 0;
        border: 0;
        padding: 0;
        background: rgba(15, 23, 42, .32);
        z-index: 40;
        cursor: default;
    }

    body.ministryos-sidebar-open
    .mobile-sidebar-scrim {
        display: block;
    }
}


/* ==========================================================
   MinistryOS global Person search + Owner Person actions
   ========================================================== */

.topbar-person-search {
    position: relative;
}

.topbar-person-search .search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-person-search .search input {
    width: 180px;
    border: 0;
    outline: 0;
    background: transparent;
    color: inherit;
    font: inherit;
}

.topbar-person-search .search input::placeholder {
    color: inherit;
    opacity: .7;
}

.topbar-person-results {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 360px;
    overflow-y: auto;
    background: var(--mos-surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .18);
    z-index: 120;
}

.topbar-person-results.open {
    display: block;
}

.topbar-person-result {
    display: block;
    padding: 11px 13px;
    border-bottom: 1px solid #eef2f6;
    color: var(--mos-text-strong);
    text-decoration: none;
}

.topbar-person-result:last-child {
    border-bottom: 0;
}

.topbar-person-result:hover {
    background: var(--mos-surface-soft);
}

.topbar-person-result strong,
.topbar-person-result span {
    display: block;
}

.topbar-person-result span {
    margin-top: 2px;
    color: var(--mos-muted);
    font-size: .78rem;
}

.topbar-person-empty {
    padding: 12px 13px;
    color: var(--mos-muted);
    font-size: .85rem;
}

.person-more-menu {
    position: relative;
}

.person-more-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    width: 210px;
    padding: 6px;
    background: var(--mos-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .16);
    z-index: 100;
}

.person-more-dropdown.open {
    display: block;
}

.person-more-dropdown form {
    margin: 0;
}

.person-more-action {
    width: 100%;
    border: 0;
    background: transparent;
    border-radius: 7px;
    padding: 10px 11px;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: var(--mos-text-strong);
}

.person-more-action:hover {
    background: var(--mos-surface-muted);
}

.person-more-action.danger {
    color: var(--mos-danger-text);
}

.person-more-action.danger:hover {
    background: var(--mos-danger-surface);
}

.person-more-divider {
    height: 1px;
    margin: 5px 3px;
    background: var(--mos-surface-muted);
}

.person-more-disabled {
    padding: 9px 10px;
    color: var(--mos-muted);
    font-size: .82rem;
}


@media (max-width: 760px) {

    .topbar-person-search .search input {
        width: 115px;
    }

    .topbar-person-results {
        position: fixed;
        top: 66px;
        right: 12px;
        left: 84px;
        width: auto;
    }

}


/* ==========================================================
   LEADERSHIP NAVIGATION GROUPS
   ========================================================== */

.leadership-navigation .nav-group {
    margin: 4px 0;
}

.leadership-navigation .nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    box-sizing: border-box;
    border-radius: 9px;
    color: var(--muted);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition:
        background .15s ease,
        color .15s ease;
}

.leadership-navigation .nav-group-toggle::-webkit-details-marker {
    display: none;
}

.leadership-navigation .nav-group-toggle::marker {
    display: none;
    content: "";
}

.leadership-navigation .nav-group-toggle:hover {
    background: rgba(19, 43, 76, .06);
    color: var(--navy);
}

.leadership-navigation .nav-group[open] > .nav-group-toggle {
    color: var(--navy);
    font-weight: 750;
}

.leadership-navigation .nav-group-label {
    flex: 1;
    min-width: 0;
}

.leadership-navigation .nav-group-chevron {
    flex: 0 0 auto;
    font-size: .8rem;
    opacity: .65;
    transform: rotate(0deg);
    transition: transform .15s ease;
}

.leadership-navigation
.nav-group[open]
> .nav-group-toggle
.nav-group-chevron {
    transform: rotate(180deg);
}

.leadership-navigation .nav-group-items {
    display: grid;
    gap: 2px;
    margin: 3px 0 6px 17px;
    padding-left: 9px;
    border-left: 1px solid rgba(19, 43, 76, .11);
}

.leadership-navigation .nav-subitem {
    min-height: 37px;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: .86rem;
}

.leadership-navigation .nav-subitem .nav-icon {
    font-size: .86rem;
    opacity: .72;
}

.nav-notification-count {
    margin-left: auto;
    min-width: 21px;
    height: 21px;
    padding: 0 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #132b4c;
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1;
}


/* Preserve useful grouped navigation in the compact sidebar. */
@media (max-width: 760px) {

    .leadership-navigation .nav-group-label,
    .leadership-navigation .nav-group-chevron {
        display: none;
    }

    .leadership-navigation .nav-group-toggle {
        justify-content: center;
    }

    .leadership-navigation .nav-group-items {
        display: none;
    }

    body.ministryos-sidebar-open
    .leadership-navigation
    .nav-group-label,

    body.ministryos-sidebar-open
    .leadership-navigation
    .nav-group-chevron {
        display: inline;
    }

    body.ministryos-sidebar-open
    .leadership-navigation
    .nav-group-toggle {
        justify-content: flex-start;
    }

    body.ministryos-sidebar-open
    .leadership-navigation
    .nav-group[open]
    .nav-group-items {
        display: grid;
    }
}



/* ==========================================================
   MinistryOS Leadership shell — tablet correction
   Keep existing phone behavior intact while preventing the
   260px desktop sidebar from consuming iPad/tablet layouts.
   ========================================================== */

@media (min-width: 761px) and (max-width: 1050px) {

    .sidebar {
        width: 72px;
    }

    .brand > div:not(.brand-mark),
    .organization-card > div:not(.organization-avatar),
    .nav-item span:last-child,
    .nav-section,
    .product-version {
        display: none;
    }

    .organization-card {
        padding: 8px;
        justify-content: center;
    }

    .nav-item {
        justify-content: center;
    }

    .main {
        margin-left: 72px;
        width: calc(100% - 72px);
    }

    .content {
        padding: 24px;
    }

    .leadership-navigation .nav-group-label,
    .leadership-navigation .nav-group-chevron {
        display: none;
    }

    .leadership-navigation .nav-group-toggle {
        justify-content: center;
    }

    .leadership-navigation .nav-group-items {
        display: none;
    }

    body.ministryos-sidebar-open
    .leadership-navigation
    .nav-group-label,

    body.ministryos-sidebar-open
    .leadership-navigation
    .nav-group-chevron {
        display: inline;
    }

    body.ministryos-sidebar-open
    .leadership-navigation
    .nav-group-toggle {
        justify-content: flex-start;
    }

    body.ministryos-sidebar-open
    .leadership-navigation
    .nav-group[open]
    .nav-group-items {
        display: grid;
    }
}


/* =========================================================
   MINISTRYOS-APPEARANCE-SYSTEM
   ========================================================= */

html {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;

    --navy: #d8e7f7;
    --navy-deep: #09111d;
    --blue: #79b7f2;
    --blue-soft: #172536;
    --accent: #67a9e6;
    --background: #0d1520;
    --surface: #151f2c;
    --border: #2c3948;
    --text: #edf3f8;
    --muted: #a8b5c2;
    --success: #63c58d;
    --shadow: 0 2px 8px rgba(0, 0, 0, .28);
}

.profile-appearance {
    position: relative;
}

.profile-dropdown-action,
.profile-dropdown form button,
.profile-appearance-toggle,
.appearance-option {
    appearance: none;
    border: 0;
    background: transparent;
    width: 100%;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.profile-dropdown-action,
.profile-dropdown form button,
.profile-appearance-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
}

.profile-submenu-arrow {
    margin-left: 1rem;
    font-size: 1.2rem;
    line-height: 1;
}

.profile-appearance-submenu {
    display: none;
    position: absolute;
    right: calc(100% + 8px);
    top: -8px;
    min-width: 190px;
    padding: 8px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    z-index: 10000;
}

.profile-appearance-submenu.open {
    display: block;
}

.appearance-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
}

.appearance-option:hover,
.appearance-option:focus-visible,
.profile-appearance-toggle:hover,
.profile-appearance-toggle:focus-visible {
    background: var(--blue-soft);
}

.appearance-check {
    width: 1rem;
    text-align: center;
    font-weight: 800;
}

.appearance-option.is-selected .appearance-check::before {
    content: "✓";
}

html[data-theme="dark"] .profile-dropdown,
html[data-theme="dark"] .profile-appearance-submenu {
    background: var(--surface) !important;
    border-color: var(--border);
}

html[data-theme="dark"] .profile-dropdown,
html[data-theme="dark"] .profile-dropdown *,
html[data-theme="dark"] .profile-appearance-submenu,
html[data-theme="dark"] .profile-appearance-submenu * {
    color: var(--text) !important;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .main,
html[data-theme="dark"] .content,
html[data-theme="dark"] .sidebar {
    background-color: var(--background);
    color: var(--text);
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .header,
html[data-theme="dark"] .card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .settings-card,
html[data-theme="dark"] .profile-card,
html[data-theme="dark"] .organization-card {
    border-color: var(--border);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background: #101a27;
    color: var(--text);
    border-color: var(--border);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: var(--muted);
}

html[data-theme="dark"] table,
html[data-theme="dark"] th,
html[data-theme="dark"] td {
    border-color: var(--border);
}

html[data-theme="dark"] hr {
    border-color: var(--border);
}

@media (max-width: 700px) {
    .profile-appearance-submenu {
        position: static;
        min-width: 0;
        margin: 2px 0 4px 12px;
        box-shadow: none;
        border-radius: 8px;
    }
}


/* =========================================================
   MINISTRYOS-DISCIPLE-HOME-DARK-COMPLETE
   Dark treatment for existing Disciple Portal components.
   No layout or structural changes.
   ========================================================= */

html[data-theme="dark"] body.disciple-portal-mode {
    background: var(--background) !important;
    color: var(--text) !important;
}


/* ---------------------------------------------------------
   Main portal canvas / sections
   --------------------------------------------------------- */

html[data-theme="dark"] body.disciple-portal-mode .member-hub,
html[data-theme="dark"] body.disciple-portal-mode .member-section {
    background: transparent !important;
    color: var(--text) !important;
}


/* ---------------------------------------------------------
   Shared cards
   --------------------------------------------------------- */

html[data-theme="dark"] body.disciple-portal-mode .member-card,
html[data-theme="dark"] body.disciple-portal-mode .member-card.member-section,
html[data-theme="dark"] body.disciple-portal-mode .member-section > .member-card:first-child,
html[data-theme="dark"] body.disciple-portal-mode .member-announcement,
html[data-theme="dark"] body.disciple-portal-mode .member-resource-card,
html[data-theme="dark"] body.disciple-portal-mode .giving-placeholder {
    background: var(--surface) !important;
    color: var(--text) !important;
    border-color: var(--border) !important;
    box-shadow:
        0 8px 24px rgba(0, 0, 0, .24) !important;
}


/* ---------------------------------------------------------
   Card typography
   --------------------------------------------------------- */

html[data-theme="dark"] body.disciple-portal-mode .member-card h1,
html[data-theme="dark"] body.disciple-portal-mode .member-card h2,
html[data-theme="dark"] body.disciple-portal-mode .member-card h3,
html[data-theme="dark"] body.disciple-portal-mode .member-announcement h1,
html[data-theme="dark"] body.disciple-portal-mode .member-announcement h2,
html[data-theme="dark"] body.disciple-portal-mode .member-announcement h3,
html[data-theme="dark"] body.disciple-portal-mode .member-resource-card h1,
html[data-theme="dark"] body.disciple-portal-mode .member-resource-card h2,
html[data-theme="dark"] body.disciple-portal-mode .member-resource-card h3,
html[data-theme="dark"] body.disciple-portal-mode .member-resource-body h3 {
    color: var(--text) !important;
}

html[data-theme="dark"] body.disciple-portal-mode .member-card p,
html[data-theme="dark"] body.disciple-portal-mode .member-announcement p,
html[data-theme="dark"] body.disciple-portal-mode .member-resource-card p,
html[data-theme="dark"] body.disciple-portal-mode .member-card-body p,
html[data-theme="dark"] body.disciple-portal-mode .member-announcement-body p,
html[data-theme="dark"] body.disciple-portal-mode .member-resource-body p {
    color: var(--muted) !important;
}


/* ---------------------------------------------------------
   Accent labels / eyebrows
   --------------------------------------------------------- */

html[data-theme="dark"] body.disciple-portal-mode .eyebrow,
html[data-theme="dark"] body.disciple-portal-mode .member-card.member-section .eyebrow,
html[data-theme="dark"] body.disciple-portal-mode .member-worship-card .eyebrow,
html[data-theme="dark"] body.disciple-portal-mode .giving-placeholder .eyebrow {
    color: #d59adc !important;
}


/* ---------------------------------------------------------
   Home section headings
   --------------------------------------------------------- */

html[data-theme="dark"] body.disciple-portal-mode .home-zone-heading,
html[data-theme="dark"] body.disciple-portal-mode .home-zone-heading-row {
    color: var(--text) !important;
}

html[data-theme="dark"] body.disciple-portal-mode .home-zone-heading h2 {
    color: var(--text) !important;
}

html[data-theme="dark"] body.disciple-portal-mode .home-zone-heading p {
    color: var(--muted) !important;
}


/* ---------------------------------------------------------
   Artwork / image frames
   Keep published artwork unchanged; darken only its frame.
   --------------------------------------------------------- */

html[data-theme="dark"] body.disciple-portal-mode .member-home-carousel,
html[data-theme="dark"] body.disciple-portal-mode .member-home-carousel img,
html[data-theme="dark"] body.disciple-portal-mode .member-resource-image-link,
html[data-theme="dark"] body.disciple-portal-mode .member-announcement > img,
html[data-theme="dark"] body.disciple-portal-mode .member-announcement > a:first-child,
html[data-theme="dark"] body.disciple-portal-mode .member-feature-pair > .member-card > .member-image,
html[data-theme="dark"] body.disciple-portal-mode .member-worship-card > .member-image {
    background: #111b28 !important;
}


/* ---------------------------------------------------------
   Weekly announcements shell
   --------------------------------------------------------- */

html[data-theme="dark"] body.disciple-portal-mode .weekly-announcements-shell {
    background:
        linear-gradient(
            145deg,
            #151f2c 0%,
            #182331 48%,
            #101925 100%
        ) !important;

    border-color: #334151 !important;

    box-shadow:
        0 14px 38px rgba(0, 0, 0, .30) !important;
}

html[data-theme="dark"] body.disciple-portal-mode .weekly-announcements-heading h2 {
    color: var(--text) !important;
}

html[data-theme="dark"] body.disciple-portal-mode .weekly-announcements-heading span {
    color: #d59adc !important;
}

html[data-theme="dark"] body.disciple-portal-mode .weekly-announcement-row {
    background:
        linear-gradient(
            145deg,
            #182331,
            #141e2b
        ) !important;

    border-color: #354354 !important;

    box-shadow:
        0 5px 16px rgba(0, 0, 0, .20) !important;
}

html[data-theme="dark"] body.disciple-portal-mode .weekly-announcement-row
+ .weekly-announcement-row {
    border-color: #354354 !important;
}

html[data-theme="dark"] body.disciple-portal-mode .weekly-announcement-row h3 {
    color: var(--text) !important;
}

html[data-theme="dark"] body.disciple-portal-mode .weekly-announcement-row p {
    color: var(--muted) !important;
}

html[data-theme="dark"] body.disciple-portal-mode .weekly-announcements-empty {
    color: var(--muted) !important;
    background: #182331 !important;
    border-color: #3b4958 !important;
}


/* ---------------------------------------------------------
   Actions / links inside home cards
   --------------------------------------------------------- */

html[data-theme="dark"] body.disciple-portal-mode .member-card a:not(.button),
html[data-theme="dark"] body.disciple-portal-mode .member-announcement a:not(.button),
html[data-theme="dark"] body.disciple-portal-mode .member-resource-card a:not(.button) {
    color: inherit;
}

html[data-theme="dark"] body.disciple-portal-mode .weekly-announcements-manage {
    color: #e6b8eb !important;
    background: #1a2634 !important;
    border-color: #76507b !important;
}

html[data-theme="dark"] body.disciple-portal-mode .weekly-announcements-manage:hover {
    background: #223142 !important;
}


/* ---------------------------------------------------------
   Generic light surfaces occurring inside member home
   --------------------------------------------------------- */

html[data-theme="dark"] body.disciple-portal-mode .member-card-body,
html[data-theme="dark"] body.disciple-portal-mode .member-announcement-body,
html[data-theme="dark"] body.disciple-portal-mode .member-resource-body {
    color: var(--text) !important;
}



/* =========================================================
   MINISTRYOS-DARK-POLISH-PASTORAL-LIVE
   Final dark treatment for Pastoral Welcome + Live Worship.
   ========================================================= */


/* ---------------------------------------------------------
   PASTORAL WELCOME
   --------------------------------------------------------- */

html[data-theme="dark"]
body.disciple-portal-mode
.member-pastoral-welcome {
    background: #132131 !important;
    border: 1px solid #2c4054 !important;
    box-shadow:
        0 10px 28px rgba(0,0,0,.24) !important;
    color: #edf3f8 !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-pastoral-welcome-media {
    background: #101a27 !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-pastoral-welcome-copy {
    background: #132131 !important;
    color: #edf3f8 !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-pastoral-welcome-copy .eyebrow {
    color: #d89ade !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-pastoral-welcome-copy h2 {
    color: #f4f7fa !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-pastoral-welcome-message {
    color: #b7c4d1 !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-pastoral-welcome-signature {
    color: #edf3f8 !important;
}


/* ---------------------------------------------------------
   LIVE WORSHIP
   --------------------------------------------------------- */

html[data-theme="dark"]
body.disciple-portal-mode
.member-live-worship-card {
    background: #132131 !important;
    border: 1px solid #2c4054 !important;
    box-shadow:
        0 10px 28px rgba(0,0,0,.24) !important;
    color: #edf3f8 !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-live-worship-media {
    background: #101a27 !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-live-worship-copy {
    background: #132131 !important;
    color: #edf3f8 !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-live-worship-copy .eyebrow {
    color: #d89ade !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-live-worship-copy h3 {
    color: #f4f7fa !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-live-worship-copy p {
    color: #b7c4d1 !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-live-worship-copy strong {
    color: #dbe5ee !important;
}


/* ---------------------------------------------------------
   BUTTONS IN THESE TWO CARDS
   --------------------------------------------------------- */

html[data-theme="dark"]
body.disciple-portal-mode
.member-live-worship-card .button,
html[data-theme="dark"]
body.disciple-portal-mode
.member-pastoral-welcome .button {
    background: #20364b !important;
    color: #f4f7fa !important;
    border: 1px solid #3d5872 !important;
    box-shadow: none !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-live-worship-card .button:hover,
html[data-theme="dark"]
body.disciple-portal-mode
.member-pastoral-welcome .button:hover {
    background: #29455f !important;
    border-color: #527493 !important;
}


/* ---------------------------------------------------------
   PRESERVE PUBLISHED ARTWORK
   --------------------------------------------------------- */

html[data-theme="dark"]
body.disciple-portal-mode
.member-pastoral-welcome-media img,
html[data-theme="dark"]
body.disciple-portal-mode
.member-live-worship-media img {
    background: transparent !important;
}



/* =========================================================
   MINISTRYOS-DARK-FINAL-POLISH
   Hero text, member action buttons, top-right account controls.
   ========================================================= */


/* ---------------------------------------------------------
   HERO / WELCOME AREA
   --------------------------------------------------------- */

html[data-theme="dark"]
body.disciple-portal-mode
.member-home-heading {
    color: #f4f7fa !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-home-heading h1 {
    color: #f4f7fa !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-home-heading p {
    color: #aebdcb !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-home-heading .eyebrow {
    color: #d89ade !important;
}


/* ---------------------------------------------------------
   MEMBER HOME BUTTONS
   --------------------------------------------------------- */

html[data-theme="dark"]
body.disciple-portal-mode
.member-hub .button,
html[data-theme="dark"]
body.disciple-portal-mode
.member-hub .button.primary,
html[data-theme="dark"]
body.disciple-portal-mode
.member-hub .button.secondary,
html[data-theme="dark"]
body.disciple-portal-mode
.member-actions .button {
    background: #20364b !important;
    color: #f4f7fa !important;
    border: 1px solid #3c5871 !important;
    box-shadow: none !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-hub .button:hover,
html[data-theme="dark"]
body.disciple-portal-mode
.member-actions .button:hover {
    background: #294861 !important;
    border-color: #527695 !important;
    color: #ffffff !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-hub .button:focus-visible,
html[data-theme="dark"]
body.disciple-portal-mode
.member-actions .button:focus-visible {
    outline: 2px solid #79b7f2 !important;
    outline-offset: 2px;
}


/* ---------------------------------------------------------
   TOP-RIGHT MEMBER PORTAL / AVATAR
   --------------------------------------------------------- */

html[data-theme="dark"]
body.disciple-portal-mode
.admin-badge {
    background: #1a2c40 !important;
    color: #f4f7fa !important;
    border-color: #48627b !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.admin-badge:hover {
    background: #233b53 !important;
    color: #ffffff !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.user-avatar {
    background: #1a2c40 !important;
    color: #f4f7fa !important;
    border: 1px solid #48627b !important;
    box-shadow: none !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.user-avatar:hover {
    background: #233b53 !important;
    border-color: #6685a2 !important;
}



/* =========================================================
   MINISTRYOS-DARK-HERO-FIX
   Disciple Portal welcome hero only.
   ========================================================= */

html[data-theme="dark"]
body.disciple-portal-mode
.member-hub-welcome {
    color: #f4f7fa !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-hub-welcome .eyebrow {
    color: #d89ade !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-hub-welcome h1 {
    color: #f5f8fb !important;
    text-shadow: none !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.member-hub-welcome p {
    color: #aebdcb !important;
}



/* =========================================================
   MINISTRYOS-DARK-LEADERSHIP
   Leadership View dark-mode surfaces.
   Layout and functionality remain unchanged.
   ========================================================= */

html[data-theme="dark"]
body:not(.disciple-portal-mode) {
    background: #0d1520 !important;
    color: #edf3f8 !important;
}


/* ---------------------------------------------------------
   MAIN CONTENT / HEADINGS
   --------------------------------------------------------- */

html[data-theme="dark"]
body:not(.disciple-portal-mode) .content,
html[data-theme="dark"]
body:not(.disciple-portal-mode) .main {
    background: #0d1520 !important;
    color: #edf3f8 !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) h1,
html[data-theme="dark"]
body:not(.disciple-portal-mode) h2,
html[data-theme="dark"]
body:not(.disciple-portal-mode) h3,
html[data-theme="dark"]
body:not(.disciple-portal-mode) h4,
html[data-theme="dark"]
body:not(.disciple-portal-mode) strong {
    color: #f4f7fa;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) p,
html[data-theme="dark"]
body:not(.disciple-portal-mode) small {
    color: #aebdcb;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) .eyebrow {
    color: #d89ade !important;
}


/* ---------------------------------------------------------
   METRIC CARDS
   --------------------------------------------------------- */

html[data-theme="dark"]
body:not(.disciple-portal-mode) .metric-card {
    background: #152231 !important;
    color: #edf3f8 !important;
    border-color: #2d4052 !important;
    box-shadow:
        0 8px 24px rgba(0,0,0,.22) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) .metric-card:hover {
    background: #19293a !important;
    border-color: #3b536a !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) .metric-card a,
html[data-theme="dark"]
body:not(.disciple-portal-mode) .metric-card strong {
    color: #f4f7fa !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) .metric-card span,
html[data-theme="dark"]
body:not(.disciple-portal-mode) .metric-card small {
    color: #aebdcb !important;
}


/* ---------------------------------------------------------
   PANELS
   --------------------------------------------------------- */

html[data-theme="dark"]
body:not(.disciple-portal-mode) .panel {
    background: #152231 !important;
    color: #edf3f8 !important;
    border-color: #2d4052 !important;
    box-shadow:
        0 8px 24px rgba(0,0,0,.20) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) .panel-header {
    border-color: #2d4052 !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) .panel-header h2 {
    color: #f4f7fa !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) .panel-header p {
    color: #aebdcb !important;
}


/* ---------------------------------------------------------
   PATHWAYS / NEW DISCIPLE ATTENTION CARDS
   --------------------------------------------------------- */

html[data-theme="dark"]
body:not(.disciple-portal-mode) .nd-dashboard-section {
    background: #152231 !important;
    color: #edf3f8 !important;
    border-color: #2d4052 !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) .nd-card {
    background: #182737 !important;
    color: #edf3f8 !important;
    border-color: #354b60 !important;
    box-shadow:
        0 6px 20px rgba(0,0,0,.18) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) .nd-card:hover {
    background: #1d2e40 !important;
    border-color: #45617c !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) .nd-card-name,
html[data-theme="dark"]
body:not(.disciple-portal-mode) .nd-card h3,
html[data-theme="dark"]
body:not(.disciple-portal-mode) .nd-card h4 {
    color: #f4f7fa !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) .nd-card p,
html[data-theme="dark"]
body:not(.disciple-portal-mode) .nd-card small,
html[data-theme="dark"]
body:not(.disciple-portal-mode) .nd-card span {
    color: #b2c0ce !important;
}


/* ---------------------------------------------------------
   UPCOMING EVENTS / RECENT ATTENDANCE
   --------------------------------------------------------- */

html[data-theme="dark"]
body:not(.disciple-portal-mode) .activity-event-row,
html[data-theme="dark"]
body:not(.disciple-portal-mode) .activity-attendance-row {
    background: #152231 !important;
    color: #edf3f8 !important;
    border-color: #35485a !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) .activity-event-row:hover,
html[data-theme="dark"]
body:not(.disciple-portal-mode) .activity-attendance-row:hover {
    background: #1b2b3c !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) .activity-event-row a,
html[data-theme="dark"]
body:not(.disciple-portal-mode) .activity-attendance-row a {
    color: #f4f7fa !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) .activity-event-row small,
html[data-theme="dark"]
body:not(.disciple-portal-mode) .activity-attendance-row small,
html[data-theme="dark"]
body:not(.disciple-portal-mode) .activity-event-row span,
html[data-theme="dark"]
body:not(.disciple-portal-mode) .activity-attendance-row span {
    color: #aebdcb;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) .activity-attendance-badge {
    background: #18382d !important;
    color: #8be0ac !important;
    border-color: #2c644c !important;
}


/* ---------------------------------------------------------
   FORMS / INPUTS WITHIN LEADERSHIP VIEW
   --------------------------------------------------------- */

html[data-theme="dark"]
body:not(.disciple-portal-mode) input,
html[data-theme="dark"]
body:not(.disciple-portal-mode) select,
html[data-theme="dark"]
body:not(.disciple-portal-mode) textarea {
    background: #111d2a !important;
    color: #edf3f8 !important;
    border-color: #35495d !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) input::placeholder,
html[data-theme="dark"]
body:not(.disciple-portal-mode) textarea::placeholder {
    color: #74869a !important;
}


/* ---------------------------------------------------------
   LEADERSHIP BUTTONS
   --------------------------------------------------------- */

html[data-theme="dark"]
body:not(.disciple-portal-mode) .button,
html[data-theme="dark"]
body:not(.disciple-portal-mode) .dashboard-checkin-button {
    background: #20364b !important;
    color: #f4f7fa !important;
    border-color: #3c5871 !important;
    box-shadow: none !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) .button:hover,
html[data-theme="dark"]
body:not(.disciple-portal-mode) .dashboard-checkin-button:hover {
    background: #294861 !important;
    color: #ffffff !important;
    border-color: #527695 !important;
}


/* ---------------------------------------------------------
   GENERIC TABLE SURFACES
   --------------------------------------------------------- */

html[data-theme="dark"]
body:not(.disciple-portal-mode) table {
    background: #152231;
    color: #edf3f8;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) th {
    background: #182737;
    color: #f4f7fa;
    border-color: #35485a;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode) td {
    color: #d6e0e9;
    border-color: #35485a;
}



/* =========================================================
   MINISTRYOS-DARK-LEADERSHIP-REFINEMENT
   Remaining Leadership View light-theme holdouts.
   ========================================================= */


/* ---------------------------------------------------------
   LEADERSHIP TOP BAR
   --------------------------------------------------------- */

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.topbar {
    background: #132b4c !important;
    color: #f4f7fa !important;
    border-color: #29445f !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.topbar * {
    border-color: #35516c;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.topbar-person-search .search {
    background: #193550 !important;
    border-color: #35516c !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.topbar-person-search .search input {
    background: #10283f !important;
    color: #f4f7fa !important;
    border-color: #35516c !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.topbar-person-search .search input::placeholder {
    color: #91a6ba !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.topbar .admin-badge,
html[data-theme="dark"]
body:not(.disciple-portal-mode)
.topbar .user-avatar {
    background: #1a3854 !important;
    color: #f4f7fa !important;
    border-color: #4a6680 !important;
}


/* ---------------------------------------------------------
   PATHWAYS — NEEDS ATTENTION
   --------------------------------------------------------- */

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.pathway-attention-panel {
    background: #152231 !important;
    border-color: #2f6f8f !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.pathway-attention-panel .panel-header span {
    color: #93a7b9 !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.pathway-attention-count {
    background: #1b2c3d !important;
    border-color: #3b536a !important;
    color: #f4f7fa !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.pathway-attention-count > div:first-child {
    color: #f4f7fa !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.pathway-attention-count > div:last-child {
    color: #aebdcb !important;
}


/* Summary counters */

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.pathway-summary-card {
    background: #182737 !important;
    border-color: #3a5065 !important;
    color: #f4f7fa !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.pathway-summary-card > div:first-child {
    color: #93a7b9 !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.pathway-summary-card > div:last-child {
    color: #f4f7fa !important;
}


/* Person/pathway cards */

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.pathway-attention-card {
    background: #182737 !important;
    color: #edf3f8 !important;
    border-color: #3a5065 !important;
    box-shadow:
        0 5px 16px rgba(0,0,0,.16) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.pathway-attention-card:hover {
    background: #1d3043 !important;
    border-color: #4b6984 !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.pathway-attention-card > div {
    color: #edf3f8 !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.pathway-attention-card > div:nth-child(2),
html[data-theme="dark"]
body:not(.disciple-portal-mode)
.pathway-attention-card > div:nth-child(5) {
    color: #aebdcb !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.pathway-attention-card > div:nth-child(3) {
    color: #8fa4b7 !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.pathway-attention-empty {
    background: #182737 !important;
    color: #aebdcb !important;
    border-color: #3a5065 !important;
}


/* ---------------------------------------------------------
   UPCOMING EVENT DATE TILES
   --------------------------------------------------------- */

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.activity-date-tile {
    background: #1a334a !important;
    color: #89c5f5 !important;
    border: 1px solid #35536d !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.activity-date-tile span {
    color: #8fc8f3 !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.activity-date-tile strong {
    color: #f4f7fa !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.activity-date-tile small {
    color: #aebdcb !important;
}


/* ---------------------------------------------------------
   EVENT / ATTENDANCE TYPOGRAPHY
   --------------------------------------------------------- */

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.activity-row-meta {
    color: #91a5b8 !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.activity-row-title {
    color: #f4f7fa !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.activity-row-detail {
    color: #aebdcb !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.activity-count {
    color: #dce6ef !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.activity-panel-link {
    color: #79b7f2 !important;
}


/* ---------------------------------------------------------
   CHECK-IN BUTTONS
   --------------------------------------------------------- */

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.activity-checkin {
    background: #203c55 !important;
    color: #f4f7fa !important;
    border-color: #45637d !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.activity-checkin:hover {
    background: #294b68 !important;
    border-color: #5a7d9b !important;
}


/* ---------------------------------------------------------
   ATTENDANCE BADGES
   --------------------------------------------------------- */

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.activity-attendance-badge {
    background: #123d2d !important;
    color: #8fe1b0 !important;
    border: 1px solid #286148 !important;
}

/* MINISTRYOS-SITEWIDE-THEME-TOKENS
   Canonical neutral palette for Light / Dark / Device Default.
*/
html {
    --mos-surface: #ffffff;
    --mos-surface-soft: #f8fafc;
    --mos-surface-muted: #f1f5f9;

    --mos-border: #e2e8f0;
    --mos-border-faint: #eef2f6;
    --mos-border-strong: #cbd5e1;

    --mos-text-strong: #172033;
    --mos-text: #334155;
    --mos-muted: #64748b;
}

html[data-theme="dark"] {
    --mos-surface: #151f2c;
    --mos-surface-soft: #182433;
    --mos-surface-muted: #1d2b3b;

    --mos-border: #314154;
    --mos-border-faint: #283747;
    --mos-border-strong: #42566d;

    --mos-text-strong: #f3f7fb;
    --mos-text: #dce6ef;
    --mos-muted: #a8b6c5;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] option {
    color-scheme: dark;
}

html[data-theme="dark"] a:not(.button):not(.nav-item):not(.sidebar-link) {
    text-decoration-color: currentColor;
}

/* MINISTRYOS-SEMANTIC-THEME-TOKENS
   Status and accent colors that remain meaningful in every appearance mode.
*/
html {
    --mos-success-surface: #ecfdf5;
    --mos-success-surface-strong: #dcfce7;
    --mos-success-text: #166534;
    --mos-success-border: #86c9a3;

    --mos-warning-surface: #fff7ed;
    --mos-warning-surface-strong: #fef3c7;
    --mos-warning-text: #92400e;
    --mos-warning-border: #e8b66b;

    --mos-danger-surface: #fff1f0;
    --mos-danger-surface-strong: #fee2e2;
    --mos-danger-text: #b42318;
    --mos-danger-border: #dc7e76;

    --mos-info-surface: #eff6ff;
    --mos-info-surface-strong: #dbeafe;
    --mos-info-text: #17577e;
    --mos-info-border: #8eb7d6;

    --mos-accent-surface: #faf7fb;
    --mos-accent-text: #6a246f;
    --mos-accent-border: #cfa7d3;
}

html[data-theme="dark"] {
    --mos-success-surface: #142a21;
    --mos-success-surface-strong: #193529;
    --mos-success-text: #83d6a8;
    --mos-success-border: #315f49;

    --mos-warning-surface: #322719;
    --mos-warning-surface-strong: #40321d;
    --mos-warning-text: #f1c47b;
    --mos-warning-border: #70532d;

    --mos-danger-surface: #331d21;
    --mos-danger-surface-strong: #422228;
    --mos-danger-text: #f2a2a2;
    --mos-danger-border: #71404a;

    --mos-info-surface: #15283a;
    --mos-info-surface-strong: #19344d;
    --mos-info-text: #8fc8f2;
    --mos-info-border: #355b78;

    --mos-accent-surface: #291d2c;
    --mos-accent-text: #d9a4de;
    --mos-accent-border: #65446a;
}

/* MINISTRYOS-DARK-BATCH1-COMPONENTS
   First deep-page correction batch:
   Groups, Sunday School, Serving, Rooms, Giving,
   Publishing/Announcements and My Serving.
*/

html[data-theme="dark"] .directory-tabs {
    background: var(--mos-surface);
    border-color: var(--mos-border);
}

html[data-theme="dark"] .directory-tab {
    color: var(--mos-muted);
}

html[data-theme="dark"] .directory-tab.active {
    background: #20364b !important;
    color: #f4f7fa !important;
    border-color: #3c5871 !important;
}

html[data-theme="dark"] .organization-card-large,
html[data-theme="dark"] .organization-card-top,
html[data-theme="dark"] .organization-card-footer {
    background: var(--mos-surface) !important;
    color: var(--mos-text) !important;
    border-color: var(--mos-border) !important;
}

/* MINISTRYOS-DARK-BATCH2-PUBLISHING-SHELL
   Publishing workspaces, Builder hero and Disciple Portal shell.
*/

/* ==========================================================
   CHURCH RESOURCES — LEADERSHIP WORKSPACE
   ========================================================== */

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.resource-builder-section {
    background: var(--mos-surface) !important;
    border-color: var(--mos-border) !important;
    box-shadow: none !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.resource-builder-section-header {
    background:
        linear-gradient(
            145deg,
            var(--mos-surface-soft) 0%,
            var(--mos-accent-surface) 100%
        ) !important;

    border-color: var(--mos-border) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.resource-builder-section-header h2 {
    color: var(--mos-text-strong) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.resource-builder-description {
    color: var(--mos-muted) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.content-workspace-card {
    background: var(--mos-surface) !important;
    border-color: var(--mos-border) !important;
    box-shadow: none !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.content-workspace-row {
    border-color: var(--mos-border) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.content-workspace-name strong {
    color: var(--mos-text-strong) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.content-workspace-name span,
html[data-theme="dark"]
body:not(.disciple-portal-mode)
.content-workspace-note {
    color: var(--mos-muted) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.content-workspace-status {
    background: var(--mos-surface-muted) !important;
    color: var(--mos-muted) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.content-workspace-status.published {
    background: var(--mos-success-surface) !important;
    color: var(--mos-success-text) !important;
}


/* ==========================================================
   WORSHIP GUIDES — CURRENT GUIDE
   ========================================================== */

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.worship-builder-current {
    background:
        linear-gradient(
            145deg,
            #182737 0%,
            #1d2b3b 100%
        ) !important;

    border-color: #42566d !important;
    box-shadow: none !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.worship-builder-current-header {
    border-color: #42566d !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.worship-builder-current-header h2,
html[data-theme="dark"]
body:not(.disciple-portal-mode)
.worship-builder-current-copy strong,
html[data-theme="dark"]
body:not(.disciple-portal-mode)
.worship-builder-history-heading h2 {
    color: var(--mos-text-strong) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.worship-builder-current-copy span,
html[data-theme="dark"]
body:not(.disciple-portal-mode)
.worship-builder-history-heading p {
    color: var(--mos-muted) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.worship-builder-current-badge {
    background: var(--mos-success-surface) !important;
    color: var(--mos-success-text) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.worship-builder-current-action {
    color: var(--mos-accent-text) !important;
}


/* ==========================================================
   BUILDER — DISCIPLE PORTAL STRUCTURE HERO
   ========================================================== */

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.builder-primary-card {
    background:
        linear-gradient(
            145deg,
            #182433 0%,
            #211d2a 62%,
            #291d2c 100%
        ) !important;

    border-color: var(--mos-accent-border) !important;

    box-shadow:
        0 14px 34px rgba(0,0,0,.22) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.builder-primary-card:hover {
    border-color: #8c5c92 !important;

    box-shadow:
        0 18px 40px rgba(0,0,0,.28) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.builder-primary-card::after {
    background: rgba(217,164,222,.07) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.builder-primary-copy h2 {
    color: var(--mos-text-strong) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.builder-primary-copy p {
    color: var(--mos-muted) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.builder-primary-open {
    color: var(--mos-accent-text) !important;
}

html[data-theme="dark"]
body:not(.disciple-portal-mode)
.builder-primary-badge {
    background: #6a246f !important;
    color: #ffffff !important;
}


/* ==========================================================
   DISCIPLE PORTAL — TOP SHELL / NAVIGATION
   ========================================================== */

html[data-theme="dark"]
body.disciple-portal-mode
.topbar {
    background: #132b4c !important;
    color: #f4f7fa !important;
    border-color: #29445f !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.topbar * {
    border-color: #35516c;
}

html[data-theme="dark"]
body.disciple-portal-mode
.user-avatar,
html[data-theme="dark"]
body.disciple-portal-mode
.admin-badge {
    background: #1a3854 !important;
    color: #f4f7fa !important;
    border-color: #4a6680 !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.disciple-nav-shell {
    background: #101a27 !important;
    color: #dce6ef !important;
    border-color: #2c3948 !important;
    box-shadow: none !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.disciple-nav-shell .nav-item,
html[data-theme="dark"]
body.disciple-portal-mode
.disciple-nav-shell summary {
    color: #aebdcb !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.disciple-nav-shell .nav-item:hover,
html[data-theme="dark"]
body.disciple-portal-mode
.disciple-nav-shell summary:hover {
    background: #172536 !important;
    color: #f4f7fa !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.disciple-nav-shell .nav-item.active,
html[data-theme="dark"]
body.disciple-portal-mode
.disciple-nav-shell .nav-item[aria-current="page"] {
    background: #1a334a !important;
    color: #f4f7fa !important;
    border-color: #6a246f !important;
}


/* ==========================================================
   DISCIPLE-FACING CHURCH RESOURCES
   ========================================================== */

html[data-theme="dark"]
body.disciple-portal-mode
.resources-card {
    background: var(--mos-surface) !important;
    border-color: var(--mos-border) !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.resources-card h2,
html[data-theme="dark"]
body.disciple-portal-mode
.resources-row strong {
    color: var(--mos-text-strong) !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.resources-row {
    color: var(--mos-text) !important;
    border-color: var(--mos-border-faint) !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.resources-row span,
html[data-theme="dark"]
body.disciple-portal-mode
.resources-empty {
    color: var(--mos-muted) !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.resources-header-image {
    background: var(--mos-surface) !important;
    border-color: var(--mos-border) !important;
}

/* MINISTRYOS-DARK-DISCIPLE-NAV-ACTIVE-FIX */
html[data-theme="dark"]
body.disciple-portal-mode
.disciple-nav-shell .nav-item.active,

html[data-theme="dark"]
body.disciple-portal-mode
.disciple-nav-shell .nav-item[aria-current="page"],

html[data-theme="dark"]
body.disciple-portal-mode
.disciple-nav-shell a.active {
    background: #1a334a !important;
    color: #f4f7fa !important;
    border-color: #6a246f !important;
    box-shadow: none !important;
}

html[data-theme="dark"]
body.disciple-portal-mode
.disciple-nav-shell .nav-item.active *,

html[data-theme="dark"]
body.disciple-portal-mode
.disciple-nav-shell .nav-item[aria-current="page"] *,

html[data-theme="dark"]
body.disciple-portal-mode
.disciple-nav-shell a.active * {
    color: #f4f7fa !important;
}


/* MINISTRYOS_DARK_SHARED_CONTRAST_20261025
   Improve shared form and action contrast without modifying light mode.
   Preserve existing sidebar, navigation and semantic status styling.
*/

/* Shared action buttons */
html[data-theme="dark"] body:not(.disciple-portal-mode)
.button.primary,
html[data-theme="dark"] body:not(.disciple-portal-mode)
button.button.primary {
    background: #2563a6 !important;
    color: #ffffff !important;
    border: 1px solid #4b8cca !important;
    opacity: 1;
}

html[data-theme="dark"] body:not(.disciple-portal-mode)
.button.secondary,
html[data-theme="dark"] body:not(.disciple-portal-mode)
button.button.secondary {
    background: #263b50 !important;
    color: #f3f7fb !important;
    border: 1px solid #64819d !important;
    opacity: 1;
}

/* Preserve destructive-action meaning */
html[data-theme="dark"] body:not(.disciple-portal-mode)
.button.danger {
    background: #a92e2e !important;
    color: #ffffff !important;
    border-color: #dc7474 !important;
}

html[data-theme="dark"] body:not(.disciple-portal-mode)
.button.danger-outline {
    background: var(--mos-danger-surface) !important;
    color: var(--mos-danger-text) !important;
    border-color: var(--mos-danger-border) !important;
}

/* Input and selection foregrounds */
html[data-theme="dark"] body:not(.disciple-portal-mode)
input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] body:not(.disciple-portal-mode)
select,
html[data-theme="dark"] body:not(.disciple-portal-mode)
textarea {
    color: #f3f7fb !important;
    border-color: #526981 !important;
}

html[data-theme="dark"] body:not(.disciple-portal-mode)
input::placeholder,
html[data-theme="dark"] body:not(.disciple-portal-mode)
textarea::placeholder {
    color: #bac8d6 !important;
    opacity: 1;
}

/* Clear keyboard focus */
html[data-theme="dark"] body:not(.disciple-portal-mode)
.button:focus-visible,
html[data-theme="dark"] body:not(.disciple-portal-mode)
input:focus-visible,
html[data-theme="dark"] body:not(.disciple-portal-mode)
select:focus-visible,
html[data-theme="dark"] body:not(.disciple-portal-mode)
textarea:focus-visible {
    outline: 2px solid #93c5fd !important;
    outline-offset: 2px;
}

/* Disabled controls remain identifiable and readable */
html[data-theme="dark"] body:not(.disciple-portal-mode)
.button:disabled,
html[data-theme="dark"] body:not(.disciple-portal-mode)
button.button[disabled] {
    opacity: .65 !important;
    cursor: not-allowed;
}


/* MINISTRYOS_BRAND_MARK_CONTRAST_20261025
   Improve SC lettering contrast without changing branding layout.
*/
.brand-mark {
    color: #183654 !important;
    -webkit-text-fill-color: #183654 !important;
}

/* MINISTRYOS-SKYCLOUD-FAMILY-BRAND-CSS-V1
   Compact product identity; existing sidebar preserved.
*/
.brand .ministryos-family-icon {
    width: 38px;
    min-width: 38px;
    height: 38px;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    padding: 7px;
    border: 1px solid #c6dcf4;
    border-radius: 10px;
    background: #e8f2fc;
    color: #2363a4 !important;
    -webkit-text-fill-color: #2363a4 !important;
    box-shadow: none;
}
.ministryos-family-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}
.brand .ministryos-family-name {
    line-height: 1.12;
}
.ministryos-family-parent {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .045em;
    color: var(--muted);
}
.ministryos-family-title {
    display: block;
    margin-top: 3px;
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -.025em;
    color: var(--mos-text-strong, #183654);
}
.ministryos-family-orange {
    color: #f28c28;
    -webkit-text-fill-color: #f28c28;
}
.brand .ministryos-family-tagline {
    font-size: 10px;
    line-height: 1.35;
    color: var(--muted);
    margin-top: 4px;
}

/* MINISTRYOS-MEMBER-TOPBAR-FAMILY-CSS-V1 */
.ministryos-member-family-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex-shrink: 0;
}
.ministryos-member-family-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    border: 1px solid #c6dcf4;
    border-radius: 10px;
    background: #e8f2fc;
    color: #2363a4;
}
.ministryos-member-family-icon svg {
    width: 22px;
    height: 22px;
}
.ministryos-member-family-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.12;
}
.ministryos-member-family-parent {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .045em;
    color: var(--mos-text-muted, #718096);
}
.ministryos-member-family-title {
    margin-top: 3px;
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -.025em;
    color: var(--mos-text-strong, #183654);
}
.ministryos-member-family-orange {
    color: #f28c28;
    -webkit-text-fill-color: #f28c28;
}
.ministryos-member-family-tagline {
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.3;
    color: var(--mos-text-muted, #718096);
}
@media (max-width: 600px) {
    .ministryos-member-family-brand {
        gap: 7px;
    }
    .ministryos-member-family-icon {
        width: 32px;
        min-width: 32px;
        height: 32px;
        padding: 5px;
    }
    .ministryos-member-family-icon svg {
        width: 19px;
        height: 19px;
    }
    .ministryos-member-family-title {
        font-size: 16px;
    }
    .ministryos-member-family-parent {
        font-size: 9px;
    }
    .ministryos-member-family-tagline {
        font-size: 9px;
    }
}

/* MINISTRYOS-DISCIPLE-VISIBLE-FAMILY-CSS-V1 */
body.disciple-portal-mode .ministryos-disciple-family-brand {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    min-width: 0;
    margin-right: 14px;
}
body.disciple-portal-mode .ministryos-disciple-family-brand
.ministryos-member-family-title {
    font-size: 17px;
}
body.disciple-portal-mode .ministryos-disciple-family-brand
.ministryos-member-family-tagline {
    font-size: 9px;
}
@media (max-width: 1050px) {
    body.disciple-portal-mode .ministryos-disciple-family-brand {
        margin-right: auto;
    }
}

/* MINISTRYOS-MEMBER-APP-IDENTITY-FINAL-V1 */
body.disciple-portal-mode .topbar {
    display: flex !important;
    align-items: center;
    min-height: 64px;
}
body.disciple-portal-mode .topbar-context-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
body.disciple-portal-mode .ministryos-member-family-brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
@media (max-width: 600px) {
    body.disciple-portal-mode .topbar {
        padding: 8px 12px;
    }
}

/* MINISTRYOS-DISCIPLE-APP-BRAND-REUSE-CSS-V2 */
body.disciple-portal-mode .topbar
.ministryos-disciple-topbar-identity {
    display: flex !important;
    align-items: center;
    gap: 10px;
    flex: 0 1 auto;
    min-width: 0;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}
body.disciple-portal-mode
.ministryos-disciple-topbar-identity
.ministryos-family-parent,
body.disciple-portal-mode
.ministryos-disciple-topbar-identity
.ministryos-family-tagline {
    color: #d2ddec;
}
body.disciple-portal-mode
.ministryos-disciple-topbar-identity
.ministryos-family-title {
    color: #fff;
    -webkit-text-fill-color: #fff;
}
body.disciple-portal-mode
.ministryos-disciple-topbar-identity
.ministryos-family-orange {
    color: #f28c28;
    -webkit-text-fill-color: #f28c28;
}
@media (max-width: 600px) {
    body.disciple-portal-mode
    .ministryos-disciple-topbar-identity
    .ministryos-family-title {
        font-size: 16px;
    }
    body.disciple-portal-mode
    .ministryos-disciple-topbar-identity
    .ministryos-family-tagline {
        font-size: 9px;
    }
}
