/* =============================================================================
   CLUB MANAGEMENT BASE STYLES

   Purpose:
   - Provide a clean baseline visual system for the application
   - Support tenant-aware branding through CSS variables
   - Keep layout readable and stable during structural refactor work
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Tenant theme variables.

   These are TENANT-NEUTRAL platform defaults only (generic Bootstrap blues /
   greys). They are NOT any single tenant's colors. Per-tenant values are
   injected at runtime by _Layout.cshtml from Ref.ClubBranding, overriding
   these defaults on :root. Shared views/CSS must reference these variables
   rather than hard-coding colors, so any tenant can be themed without code
   changes. Background and navbar use tenant-neutral defaults here; per-tenant
   values are injected from Ref.ClubBranding when configured.
   ----------------------------------------------------------------------------- */
:root {
    --tenant-primary: #0d6efd;
    --tenant-secondary: #f8f9fa;
    --tenant-accent: #0b5ed7;
    --tenant-background: #f8f9fa;
    --tenant-navbar: #f8f9fa;
    --page-max-width: 1280px;
    --user-font-scale: 1;
}

/* -----------------------------------------------------------------------------
   Responsive page shell (navbar + main content share the same width).
   ----------------------------------------------------------------------------- */
.page-shell,
.main-container {
    width: 100%;
    max-width: var(--page-max-width, 1280px);
    margin-inline: auto;
    padding-inline: clamp(1rem, 2.5vw, 2rem);
}

.page-shell-marketing {
    --page-max-width: 1320px;
}

.page-shell-admin {
    --page-max-width: 1280px;
}

.navbar > .page-shell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

html,
body {
    height: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--tenant-background);
    font-size: calc(1rem * var(--user-font-scale, 1));
}

/* User accessibility preferences (layered on tenant branding) */
html[data-font-size="large"] {
    --user-font-scale: 1.125;
}

html[data-font-size="xlarge"] {
    --user-font-scale: 1.25;
}

html[data-high-contrast="on"] a,
html[data-high-contrast="on"] .btn,
html[data-high-contrast="on"] .nav-link {
    font-weight: 600;
}

html[data-high-contrast="on"] .btn,
html[data-high-contrast="on"] .form-control,
html[data-high-contrast="on"] .card {
    border-width: 2px;
}

html[data-high-contrast="on"] :focus-visible {
    outline: 3px solid var(--tenant-accent, #0b5ed7);
    outline-offset: 2px;
}

html[data-reduced-motion="on"] *,
html[data-reduced-motion="on"] *::before,
html[data-reduced-motion="on"] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
    html:not([data-reduced-motion="on"]) *,
    html:not([data-reduced-motion="on"]) *::before,
    html:not([data-reduced-motion="on"]) *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.account-settings-page .form-select {
    min-width: 12rem;
}

/* Themeable navigation surface (default matches Bootstrap .bg-light). */
.navbar.bg-light {
    background-color: var(--tenant-navbar) !important;
}

.app-shell {
    flex: 1 0 auto;
}

a.navbar-brand {
    white-space: normal;
    text-align: center;
    word-break: break-word;
}

a {
    color: var(--tenant-accent);
}

    a:hover {
        color: var(--tenant-primary);
    }

body > header {
    position: relative;
    z-index: 1030;
}

.navbar {
    font-weight: 500;
}

.navbar .dropdown-menu {
    z-index: 1035;
}

@media (min-width: 992px) {
    .digital-clubhouse-admin__preview.sticky-lg-top {
        z-index: 1010;
    }
}

.navbar-brand {
    letter-spacing: 0.2px;
}

.tenant-navbar {
    background-color: #ffffff;
}

.tenant-logo {
    max-height: 36px;
    width: auto;
    display: inline-block;
}

.btn-primary {
    color: #fff;
    background-color: var(--tenant-primary);
    border-color: var(--tenant-primary);
}

    .btn-primary:hover,
    .btn-primary:focus {
        color: #fff;
        background-color: var(--tenant-accent);
        border-color: var(--tenant-accent);
    }

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: #fff;
    background-color: var(--tenant-primary);
    border-color: var(--tenant-primary);
}

.border-top {
    border-top: 1px solid #e5e5e5;
}

.border-bottom {
    border-bottom: 1px solid #e5e5e5;
}

.box-shadow {
    box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05);
}

button.accept-policy {
    font-size: 1rem;
    line-height: inherit;
}

.card {
    border-radius: 0.75rem;
}

.table td,
.table th {
    vertical-align: middle;
}

.footer {
    flex-shrink: 0;
    border-top: 1px solid #e5e5e5;
    background-color: #fff;
    text-align: center;
    padding: 0.9rem 0;
    font-size: 0.9rem;
}

/* -----------------------------------------------------------------------------
   Auth pages
   ----------------------------------------------------------------------------- */
.auth-page {
    min-height: calc(100vh - 180px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 1.75rem;
    border: 1px solid #e9ecef;
    background-color: #ffffff;
}

.auth-branding {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo {
    max-height: 64px;
    width: auto;
    margin-bottom: 1rem;
}

.auth-title {
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
}

.auth-subtitle {
    color: #6c757d;
    margin-bottom: 0;
}

/* -----------------------------------------------------------------------------
   Responsive navbar spacing
   ----------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .navbar .nav-link {
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
    }

    .auth-card {
        padding: 1.25rem;
    }
}

/* =============================================================================
   NAVBAR + LAYOUT POLISH
   ============================================================================= */

.tenant-navbar {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.15s ease-in-out;
}

    .navbar-nav .nav-link:hover {
        color: var(--tenant-primary);
    }

.navbar-brand span {
    font-weight: 600;
    font-size: 1.05rem;
}

/* Improve mobile collapse spacing */
@media (max-width: 991.98px) {
    .navbar-collapse {
        margin-top: 0.75rem;
    }

    .navbar-nav {
        gap: 0.25rem;
    }
}

/* =============================================================================
   PUBLIC LANDING (Home/Index)

   Purpose:
   - Modern marketing hero for the public homepage
   - Mobile-first responsive layout
   - Tenant-neutral; all identity comes from branding/content data
   ============================================================================= */

.landing-hero {
    /* Themed from tenant branding variables; inline style overrides for images. */
    background: linear-gradient(135deg, var(--tenant-primary) 0%, var(--tenant-accent) 100%);
    overflow: hidden;
}

.landing-hero-overlay {
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 55%);
}

.landing-hero-content {
    max-width: 960px;
    margin: 0 auto;
}

.landing-hero-logo {
    max-height: 96px;
    width: auto;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.landing-hero-lead {
    max-width: 42rem;
    color: rgba(255, 255, 255, 0.92);
}

/* Compact header variant used for signed-in members (dashboard-first). */
.landing-hero-compact .landing-hero-content {
    max-width: 100%;
}

/* Slim welcome strip for authenticated dashboard (replaces full hero). */
.dashboard-welcome-strip {
    background: linear-gradient(135deg, var(--tenant-primary) 0%, var(--tenant-accent) 100%);
    color: #fff;
    overflow: hidden;
}

.dashboard-welcome-strip-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.35rem 1rem;
}

.dashboard-welcome-eyebrow {
    letter-spacing: 0.08em;
    opacity: 0.85;
}

.dashboard-welcome-greeting {
    font-size: 1.05rem;
}

.digital-clubhouse-hero-excerpt {
    max-width: 42rem;
    color: rgba(255, 255, 255, 0.92);
}

.digital-clubhouse-hero-strip {
    overflow: hidden;
}

.digital-clubhouse-hero-strip__inner {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.digital-clubhouse-hero-strip__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.digital-clubhouse-hero-strip .digital-clubhouse-hero-excerpt {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    margin-right: 0;
}

.digital-clubhouse-hero-strip__cta {
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .digital-clubhouse-hero-strip__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .digital-clubhouse-hero-strip__cta {
        align-self: flex-start;
    }
}

/* Digital Clubhouse admin curation dashboard */
.digital-clubhouse-admin__header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 0.75rem;
}

.digital-clubhouse-admin__panel {
    background: #fff;
}

.digital-clubhouse-admin__eyebrow {
    letter-spacing: 0.06em;
    color: var(--tenant-accent, #0b5ed7);
    font-size: 0.7rem;
}

.digital-clubhouse-admin__current-event {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--tenant-primary, #0d6efd) 8%, #fff),
        color-mix(in srgb, var(--tenant-accent, #0b5ed7) 5%, #fff)
    );
    border: 1px solid color-mix(in srgb, var(--tenant-primary, #0d6efd) 18%, transparent);
}

.digital-clubhouse-admin__live-badge {
    background: var(--tenant-primary, #0d6efd);
    color: #fff;
    font-weight: 600;
    font-size: 0.7rem;
}

.digital-clubhouse-admin__event-row {
    background: var(--tenant-secondary, #f8f9fa);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.digital-clubhouse-admin__stat {
    background: var(--tenant-secondary, #f8f9fa);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.digital-clubhouse-admin__stat-value {
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.2;
    color: var(--tenant-accent, #0b5ed7);
}

.digital-clubhouse-admin__stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(0, 0, 0, 0.55);
    margin-top: 0.15rem;
}

.digital-clubhouse-admin__photo-preview {
    background: var(--tenant-secondary, #f8f9fa);
    border: 1px dashed rgba(0, 0, 0, 0.12);
}

.digital-clubhouse-admin__photo-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
}

.digital-clubhouse-admin__photo-preview-grid--compact {
    gap: 0.25rem;
}

.digital-clubhouse-admin__photo-preview-tile {
    aspect-ratio: 4 / 3;
    border-radius: 0.35rem;
    background: linear-gradient(
        145deg,
        color-mix(in srgb, var(--tenant-primary, #0d6efd) 12%, #e9ecef),
        color-mix(in srgb, var(--tenant-accent, #0b5ed7) 8%, #dee2e6)
    );
    opacity: 0.85;
    overflow: hidden;
}

.digital-clubhouse-admin__photo-preview-tile--filled {
    opacity: 1;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.digital-clubhouse-admin__photo-preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.digital-clubhouse-photo-carousel {
    background: color-mix(in srgb, var(--tenant-primary, #0d6efd) 3%, #fff);
    border: 1px solid color-mix(in srgb, var(--tenant-primary, #0d6efd) 10%, #e9ecef);
}

.digital-clubhouse-photo-carousel__inner {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.digital-clubhouse-photo-carousel__title {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #495057;
}

.digital-clubhouse-photo-carousel__strip {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.125rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.digital-clubhouse-photo-carousel__item {
    flex: 0 0 auto;
    width: auto;
    max-width: 10rem;
    margin: 0;
    scroll-snap-align: start;
}

.digital-clubhouse-photo-carousel__image {
    width: auto;
    height: 7.5rem;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 0.375rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: block;
    background: #f8f9fa;
}

.digital-clubhouse-photo-carousel__caption {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.6875rem;
    line-height: 1.25;
    margin-top: 0.2rem;
}

@media (max-width: 575.98px) {
    .digital-clubhouse-photo-carousel__image {
        height: 6.25rem;
    }

    .digital-clubhouse-photo-carousel__item {
        max-width: 8.75rem;
    }
}

.digital-clubhouse-admin__picker-album-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.digital-clubhouse-admin__picker-album-link {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.25rem 0.75rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
    background: #fff;
    color: inherit;
    text-decoration: none;
}

.digital-clubhouse-admin__picker-album-link:hover,
.digital-clubhouse-admin__picker-album-link:focus {
    border-color: color-mix(in srgb, var(--tenant-primary, #0d6efd) 35%, rgba(0, 0, 0, 0.08));
    color: inherit;
    text-decoration: none;
}

.digital-clubhouse-admin__picker-album-link--active {
    border-color: color-mix(in srgb, var(--tenant-primary, #0d6efd) 55%, transparent);
    background: color-mix(in srgb, var(--tenant-primary, #0d6efd) 8%, #fff);
    font-weight: 600;
}

.digital-clubhouse-admin__picker-album-label {
    min-width: 0;
}

.digital-clubhouse-admin__picker-album-date {
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
}

.digital-clubhouse-admin__picker-card {
    background: #fff;
}

.digital-clubhouse-admin__picker-card--on-home {
    outline: 2px solid color-mix(in srgb, var(--tenant-accent, #0b5ed7) 55%, transparent);
    outline-offset: -1px;
}

.digital-clubhouse-admin__picker-card .photo-gallery-image {
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.digital-clubhouse-admin__picker-card-fallback {
    background: color-mix(in srgb, var(--tenant-primary, #0d6efd) 8%, #e9ecef);
}

.digital-clubhouse-admin__preview {
    background: #fff;
}

.digital-clubhouse-admin__preview-featured {
    background: linear-gradient(
        160deg,
        color-mix(in srgb, var(--tenant-primary, #0d6efd) 14%, #1a2a3a),
        color-mix(in srgb, var(--tenant-accent, #0b5ed7) 10%, #243447)
    );
    color: #fff;
}

.digital-clubhouse-admin__preview-featured .digital-clubhouse-admin__eyebrow {
    color: rgba(255, 255, 255, 0.75);
}

.digital-clubhouse-admin__preview-featured .text-muted {
    color: rgba(255, 255, 255, 0.82) !important;
}

.digital-clubhouse-admin__preview-carousel {
    background: var(--tenant-secondary, #f8f9fa);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.digital-clubhouse-admin__preview-announcements {
    background: var(--tenant-secondary, #f8f9fa);
    border-left: 3px solid var(--tenant-accent, #0b5ed7);
}

.digital-clubhouse-admin__announcement-row {
    background: var(--tenant-secondary, #f8f9fa);
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.digital-clubhouse-admin__announcement-body {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.digital-clubhouse-admin__announcement-form {
    background: color-mix(in srgb, var(--tenant-primary, #0d6efd) 4%, #fff);
    border: 1px solid color-mix(in srgb, var(--tenant-primary, #0d6efd) 12%, #e9ecef);
}

.club-announcements {
    background: color-mix(in srgb, var(--tenant-primary, #0d6efd) 5%, #fff);
    border: 1px solid color-mix(in srgb, var(--tenant-primary, #0d6efd) 14%, #e9ecef);
}

.club-announcements__inner {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.club-announcements__heading {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    margin-top: 0;
}

.club-announcements__list {
    display: block;
    margin: 0;
    padding: 0;
}

.club-announcements__item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    font-size: 0.8125rem;
    line-height: 1.15;
    min-height: 0;
}

.club-announcements__item + .club-announcements__item {
    margin-top: 0;
}

.club-announcements__title,
.club-announcements__sep,
.club-announcements__body {
    line-height: 1.15;
}

.club-announcements__title {
    font-weight: 600;
    flex-shrink: 0;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.club-announcements__sep {
    flex-shrink: 0;
    color: rgba(0, 0, 0, 0.35);
}

.club-announcements__body {
    flex: 1;
    min-width: 0;
    color: var(--bs-secondary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
}

@media (max-width: 991.98px) {
    .digital-clubhouse-admin__preview.sticky-lg-top {
        position: static;
    }
}

@media (max-width: 575.98px) {
    .digital-clubhouse-hero .display-5 {
        font-size: calc(1.35rem + 1vw);
    }
}

.presence-widget-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.presence-widget-header-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}

.presence-widget-header-main {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    flex: 1 1 auto;
    width: 100%;
}

.presence-widget-status-actions {
    padding-left: 0.15rem;
}

.presence-widget-view-only-note {
    max-width: 36rem;
}

#member-dashboard .dashboard-widgets-row {
    --bs-gutter-y: 0.75rem;
}

#member-dashboard .presence-dashboard-widget {
    border-color: #e9ecef;
    box-shadow: none;
}

#member-dashboard .presence-dashboard-widget .card-header {
    padding: 0.625rem 0.875rem;
    background-color: #f8f9fa;
}

#member-dashboard .presence-widget-title {
    font-size: 0.875rem;
}

#member-dashboard .presence-widget-count-badge {
    font-size: 0.6875rem;
    font-weight: 500;
}

#member-dashboard .presence-widget-full-list {
    padding-inline: 0.65rem;
}

#member-dashboard .presence-widget-status-label {
    font-size: 0.8125rem;
}

#member-dashboard .presence-widget-status-actions {
    gap: 0.35rem;
}

#member-dashboard .presence-dashboard-widget .presence-widget-list {
    max-height: 11rem;
    overflow-y: auto;
}

#member-dashboard .presence-dashboard-widget .list-group-item {
    padding: 0.2rem 0.875rem;
    border-color: rgba(0, 0, 0, 0.05);
    line-height: 1.25;
}

#member-dashboard .presence-dashboard-widget .presence-widget-member-row {
    min-height: 1.5rem;
}

#member-dashboard .volunteer-hours-widget {
    border-color: #e9ecef;
    box-shadow: none;
}

#member-dashboard .volunteer-hours-widget__header {
    padding: 0.625rem 0.875rem;
    background-color: #f8f9fa;
}

#member-dashboard .volunteer-hours-widget__title {
    font-size: 0.875rem;
    font-weight: 600;
}

#member-dashboard .volunteer-hours-widget__body {
    padding: 0.625rem 0.875rem;
}

#member-dashboard .volunteer-hours-metric {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.1rem 0;
    font-size: 0.8125rem;
    line-height: 1.3;
}

#member-dashboard .volunteer-hours-metric__label {
    color: #6c757d;
    min-width: 0;
}

#member-dashboard .volunteer-hours-metric__value {
    white-space: nowrap;
    text-align: right;
    flex-shrink: 0;
}

#member-dashboard .volunteer-progress-group {
    margin-bottom: 0;
}

#member-dashboard .volunteer-progress-group .small.text-muted {
    font-size: 0.75rem;
    margin-bottom: 0.15rem !important;
}

#member-dashboard .presence-widget-meta {
    font-size: 0.75rem;
}

#member-dashboard .presence-widget-you-badge {
    font-size: 0.625rem;
    vertical-align: middle;
}

#member-dashboard .presence-widget-empty {
    padding: 0.75rem 0.875rem;
    font-size: 0.8125rem;
}

#member-dashboard .presence-dashboard-widget .presence-widget-row-self {
    background-color: color-mix(in srgb, var(--tenant-primary, #0d6efd) 6%, #fff);
}

.dashboard-widgets-row > [class*="col-"] {
    display: flex;
    flex-direction: column;
}

.dashboard-widgets-row .presence-dashboard-widget,
.dashboard-widgets-row .volunteer-hours-widget {
    flex: 1 1 auto;
}

.landing-hero-eyebrow {
    letter-spacing: 0.08em;
    opacity: 0.85;
    margin-bottom: 0.25rem;
}

/* Marketing feature cards. */
.landing-feature-card {
    border: 1px solid #e9ecef;
    transition: transform 0.12s ease-in-out, box-shadow 0.12s ease-in-out;
}

.landing-feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
}

.landing-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    color: var(--tenant-primary);
    background-color: rgba(13, 110, 253, 0.1);
}

.landing-history-card {
    border: 1px solid #e9ecef;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
}

.landing-contact-card {
    border: 1px solid #e9ecef;
}

/* Balanced single-viewport marketing landing (anonymous Home/Index). */
.page-shell-marketing.main-container {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding-top: 0.75rem;
    padding-bottom: 0;
}

.page-shell-marketing > main {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.landing-page {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.landing-page .landing-hero {
    flex-shrink: 0;
}

.landing-page .landing-hero-content {
    padding-top: 1.75rem !important;
    padding-bottom: 1.75rem !important;
}

.landing-page .landing-hero-logo {
    max-height: 72px;
}

.landing-page .landing-hero-content h1 {
    font-size: clamp(1.5rem, 2.5vw, 2.1rem);
    line-height: 1.25;
}

.landing-page .landing-hero-lead {
    font-size: 0.95rem;
    line-height: 1.5;
    max-width: 40rem;
}

.landing-page .digital-clubhouse-hero-excerpt {
    font-size: 0.875rem;
    line-height: 1.45;
    max-width: 38rem;
}

.landing-page .landing-feature-card .card-body {
    padding: 1rem 1.125rem;
}

.landing-page .landing-feature-icon {
    width: 2.75rem;
    height: 2.75rem;
}

.landing-page .landing-feature-icon svg {
    width: 22px;
    height: 22px;
}

.landing-page .landing-feature-card p {
    font-size: 0.875rem;
    line-height: 1.45;
}

.landing-page .landing-history-card p:last-child {
    font-size: 0.9rem;
    line-height: 1.5;
}

body:has(.landing-page) footer.border-top {
    margin-top: 1rem !important;
    padding: 0.75rem !important;
}

@media (min-width: 992px) {
    .landing-page {
        gap: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .landing-hero-content {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }

    .landing-hero-logo {
        max-height: 72px;
    }

    .landing-page .landing-hero-content {
        padding-top: 1.25rem !important;
        padding-bottom: 1.25rem !important;
    }

    .landing-page .landing-hero-logo {
        max-height: 56px;
    }
}

/* =============================================================================
   EVENTS CALENDAR (Events/Index)
   ============================================================================= */

.events-calendar-page {
    --calendar-accent: var(--tenant-primary, #0d6efd);
    --calendar-accent-secondary: #495057;
    --calendar-accent-soft: #f8f9fa;
    --calendar-banner-gradient: linear-gradient(
        135deg,
        color-mix(in srgb, var(--calendar-accent) 82%, #fff) 0%,
        color-mix(in srgb, var(--calendar-accent-secondary) 55%, #fff) 100%
    );
    --calendar-weekday-bg: color-mix(in srgb, var(--calendar-accent) 8%, #f8f9fa);
    --calendar-day-today-bg: color-mix(in srgb, var(--calendar-accent) 12%, #fff);
    --calendar-event-bg: color-mix(in srgb, var(--calendar-accent) 14%, #fff);
    --calendar-event-border: color-mix(in srgb, var(--calendar-accent) 24%, #e9ecef);
    --calendar-event-hover-bg: color-mix(in srgb, var(--calendar-accent) 22%, #fff);
}

.events-calendar-page__theme-tagline {
    font-size: 0.8125rem;
    color: var(--calendar-accent-secondary);
    font-weight: 500;
}

.events-calendar-page__month-label {
    min-width: 9rem;
    text-align: center;
    color: var(--calendar-accent);
}

.events-calendar-page__nav-btn {
    border-color: color-mix(in srgb, var(--calendar-accent) 30%, #dee2e6);
    color: var(--calendar-accent);
}

.events-calendar-page__today-btn {
    background-color: var(--calendar-accent);
    border-color: var(--calendar-accent);
}

.events-calendar {
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--calendar-accent) 18%, #e9ecef) !important;
}

.events-calendar__banner {
    padding: 0.75rem 1rem;
    background: var(--calendar-banner-gradient);
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

.events-calendar__banner-label {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.events-calendar__weekdays,
.events-calendar__week {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.events-calendar__weekdays {
    background: var(--calendar-weekday-bg);
    border-bottom: 1px solid color-mix(in srgb, var(--calendar-accent) 14%, #e9ecef);
}

.events-calendar__weekday {
    padding: 0.5rem 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    color: color-mix(in srgb, var(--calendar-accent) 70%, #495057);
}

.events-calendar__week + .events-calendar__week {
    border-top: 1px solid #e9ecef;
}

.events-calendar__day {
    min-height: 6.5rem;
    padding: 0.35rem;
    border-right: 1px solid #e9ecef;
    background: #fff;
}

.events-calendar__week .events-calendar__day:last-child {
    border-right: none;
}

.events-calendar__day--outside {
    background: color-mix(in srgb, var(--calendar-accent-soft) 75%, #fff);
    color: #adb5bd;
}

.events-calendar__day--past:not(.events-calendar__day--today) {
    background: #fafbfc;
}

.events-calendar__day--today {
    background: var(--calendar-day-today-bg);
}

.events-calendar__day--seasonal {
    background: color-mix(in srgb, var(--calendar-accent-secondary) 10%, #fff);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--calendar-accent-secondary) 22%, transparent);
}

.events-calendar__day-number {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.events-calendar__day--seasonal .events-calendar__day-number {
    color: var(--calendar-accent-secondary);
}

.events-calendar__day--today .events-calendar__day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    background: var(--calendar-accent);
    color: #fff;
    padding: 0 0.35rem;
}

.events-calendar__events {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.events-calendar__event-link {
    display: block;
    padding: 0.15rem 0.35rem;
    border-radius: 0.35rem;
    background: var(--calendar-event-bg);
    border: 1px solid var(--calendar-event-border);
    color: inherit;
    text-decoration: none;
    font-size: 0.6875rem;
    line-height: 1.25;
}

.events-calendar__event-link:hover,
.events-calendar__event-link:focus-visible {
    background: var(--calendar-event-hover-bg);
    color: inherit;
    text-decoration: none;
}

.events-calendar__event-time {
    display: block;
    color: #6c757d;
    font-size: 0.625rem;
}

.events-calendar__event-title {
    display: block;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.events-calendar-theme--january {
    --calendar-accent: #2563a8;
    --calendar-accent-secondary: #c0c8d4;
    --calendar-accent-soft: #eef4fb;
}

.events-calendar-theme--february {
    --calendar-accent: #b4234d;
    --calendar-accent-secondary: #7a294a;
    --calendar-accent-soft: #fdf2f6;
}

.events-calendar-theme--march {
    --calendar-accent: #2f7d4a;
    --calendar-accent-secondary: #5da86f;
    --calendar-accent-soft: #eef8f1;
}

.events-calendar-theme--april {
    --calendar-accent: #4f9f6e;
    --calendar-accent-secondary: #f0b429;
    --calendar-accent-soft: #f3fbf5;
}

.events-calendar-theme--may {
    --calendar-accent: #1e4d8c;
    --calendar-accent-secondary: #b4234d;
    --calendar-accent-soft: #eef3fa;
}

.events-calendar-theme--june {
    --calendar-accent: #e09f1f;
    --calendar-accent-secondary: #2f7d4a;
    --calendar-accent-soft: #fff8ea;
}

.events-calendar-theme--july {
    --calendar-accent: #1e4d8c;
    --calendar-accent-secondary: #b4234d;
    --calendar-accent-soft: #eef3fa;
    --calendar-banner-gradient: linear-gradient(
        135deg,
        #1e4d8c 0%,
        #ffffff 42%,
        #b4234d 100%
    );
}

.events-calendar-theme--august {
    --calendar-accent: #d97706;
    --calendar-accent-secondary: #0284c7;
    --calendar-accent-soft: #fff7eb;
}

.events-calendar-theme--september {
    --calendar-accent: #b45309;
    --calendar-accent-secondary: #7c4a1d;
    --calendar-accent-soft: #fff6ea;
}

.events-calendar-theme--october {
    --calendar-accent: #c2410c;
    --calendar-accent-secondary: #7c4a1d;
    --calendar-accent-soft: #fff4eb;
}

.events-calendar-theme--november {
    --calendar-accent: #9a3412;
    --calendar-accent-secondary: #b45309;
    --calendar-accent-soft: #fff7ed;
}

.events-calendar-theme--december {
    --calendar-accent: #166534;
    --calendar-accent-secondary: #b91c1c;
    --calendar-accent-soft: #f0fdf4;
    --calendar-banner-gradient: linear-gradient(
        135deg,
        #166534 0%,
        #15803d 35%,
        #b91c1c 100%
    );
}

@media (max-width: 767.98px) {
    .events-calendar__day {
        min-height: 5rem;
        padding: 0.25rem;
    }

    .events-calendar__weekday {
        font-size: 0.6875rem;
        padding-inline: 0.15rem;
    }

    .events-calendar__event-title {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .events-calendar__banner {
        padding: 0.6rem 0.75rem;
    }
}

/* =============================================================================
   MEMBER DASHBOARD (Home/Index)

   Purpose:
   - Provide a polished, mobile-friendly landing experience
   - Reuse tenant branding variables for accent color
   - Keep cards tappable and visually consistent on small screens
   ============================================================================= */

.dashboard-hero {
    padding: 0.25rem 0;
}

.dashboard-module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.dashboard-status-card .dashboard-status-dot {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
    background-color: #adb5bd;
}

.dashboard-status-dot.is-in {
    background-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.18);
}

.dashboard-status-dot.is-out {
    background-color: #adb5bd;
}

.presence-dashboard-widget .presence-widget-row-self {
    background-color: rgba(13, 110, 253, 0.08);
}

/* Tappable quick-access cards. */
.dashboard-card {
    color: inherit;
    border: 1px solid #e9ecef;
    transition: transform 0.12s ease-in-out, box-shadow 0.12s ease-in-out, border-color 0.12s ease-in-out;
}

.dashboard-card:hover,
.dashboard-card:focus-visible {
    color: inherit;
    transform: translateY(-2px);
    border-color: var(--tenant-primary);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.08);
}

.dashboard-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 0.75rem;
    border-radius: 0.75rem;
    color: var(--tenant-primary);
    background-color: rgba(13, 110, 253, 0.1);
}

#member-dashboard .member-home-action-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    align-items: stretch;
}

@media (min-width: 576px) {
    #member-dashboard .member-home-action-grid:has(> .member-home-action-card:nth-child(1):nth-last-child(1)) {
        grid-template-columns: minmax(0, 1fr);
    }

    #member-dashboard .member-home-action-grid:has(> .member-home-action-card:nth-child(2):nth-last-child(1)) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #member-dashboard .member-home-action-grid:has(> .member-home-action-card:nth-child(3):nth-last-child(1)) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

#member-dashboard .member-home-action-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

#member-dashboard .member-home-action-card__body {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1 1 auto;
    padding: 0.875rem 1rem;
    min-height: 100%;
}

#member-dashboard .member-home-action-card__icon {
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: 0;
    flex-shrink: 0;
    border-radius: 0.625rem;
    background-color: color-mix(in srgb, var(--tenant-primary, #0d6efd) 10%, transparent);
}

#member-dashboard .member-home-action-card__icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

#member-dashboard .member-home-action-card__content {
    flex: 1 1 auto;
    min-width: 0;
}

#member-dashboard .member-home-action-card__content .h6 {
    margin-bottom: 0.125rem;
    line-height: 1.3;
}

#member-dashboard .member-home-action-card__content p {
    margin-bottom: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#member-dashboard .member-home-action-card__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ced4da;
    transition: color 0.12s ease-in-out, transform 0.12s ease-in-out;
}

#member-dashboard .member-home-action-card__chevron svg {
    width: 1rem;
    height: 1rem;
}

#member-dashboard .member-home-action-grid > .member-home-action-card:hover,
#member-dashboard .member-home-action-grid > .member-home-action-card:focus-visible {
    color: inherit;
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--tenant-primary, #0d6efd) 35%, #dee2e6);
    box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.06);
    background-color: color-mix(in srgb, var(--tenant-primary, #0d6efd) 3%, #fff);
}

#member-dashboard .member-home-action-grid > .member-home-action-card:hover .member-home-action-card__chevron,
#member-dashboard .member-home-action-grid > .member-home-action-card:focus-visible .member-home-action-card__chevron {
    color: color-mix(in srgb, var(--tenant-primary, #0d6efd) 65%, #adb5bd);
    transform: translateX(2px);
}

@media (max-width: 575.98px) {
    #member-dashboard .member-home-action-card__body {
        padding: 0.75rem 0.875rem;
        gap: 0.625rem;
    }
}

.volunteer-progress-group .progress-bar {
    font-size: 0.7rem;
}

.volunteer-progress-potential .progress-bar {
    opacity: 0.85;
}

/* Admin Center — administrative workspace */
.admin-center-page.admin-workspace {
    width: 100%;
    margin-inline: auto;
}

.admin-workspace-header {
    margin-bottom: 0.85rem;
}

.admin-workspace-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-workspace-zone-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.4rem;
    padding-left: 0.55rem;
    border-left: 3px solid var(--tenant-primary, #0d6efd);
}

.admin-attention-list {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
}

.admin-attention-item + .admin-attention-item {
    border-top: 1px solid #f1f3f5;
}

.admin-attention-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    color: inherit;
    text-decoration: none;
    background: color-mix(in srgb, var(--tenant-accent, #0b5ed7) 5%, #fff);
}

.admin-attention-link:hover,
.admin-attention-link:focus-visible {
    color: inherit;
    background: color-mix(in srgb, var(--tenant-accent, #0b5ed7) 9%, #fff);
}

.admin-attention-count {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--tenant-accent, #0b5ed7);
    flex-shrink: 0;
}

.admin-attention-clear {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem;
    color: #6c757d;
    font-size: 0.88rem;
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--tenant-primary, #0d6efd) 4%, #fff);
    border: 1px solid color-mix(in srgb, var(--tenant-primary, #0d6efd) 12%, #e9ecef);
}

.admin-action-zero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--tenant-primary, #0d6efd);
    background: color-mix(in srgb, var(--tenant-primary, #0d6efd) 12%, #fff);
    border: 1px solid color-mix(in srgb, var(--tenant-primary, #0d6efd) 25%, #e2e8f0);
    flex-shrink: 0;
}

.admin-workspace-card-grid {
    gap: 0.75rem;
}

.admin-workspace-card-cta {
    color: var(--tenant-primary, #0d6efd);
}

.volunteer-mgmt-page .admin-workspace-zone {
    margin-top: 0;
}

.volunteer-mgmt-summary-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.volunteer-mgmt-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    color: #495057;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
}

.volunteer-mgmt-card-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.volunteer-mgmt-action-card .card-body {
    padding: 1rem;
}

.volunteer-report-page .table-sm > :not(caption) > * > * {
    padding: 0.35rem 0.5rem;
}

.volunteer-report-compact-row td {
    vertical-align: middle;
}

.admin-grid-toolbar .form-label-sm {
    font-size: 0.75rem;
    color: #6c757d;
}

.admin-grid-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    color: #6c757d;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
}

.admin-grid-sort-link:hover,
.admin-grid-sort-link:focus-visible {
    color: var(--tenant-primary, #0d6efd);
    text-decoration: none;
}

.admin-grid-sort-link.is-active {
    color: #212529;
}

.admin-grid-row-link {
    color: var(--tenant-primary, #0d6efd);
    text-decoration: none;
}

.admin-grid-row-link:hover,
.admin-grid-row-link:focus-visible {
    text-decoration: underline;
}

.volunteer-outstanding-card {
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.volunteer-outstanding-page .volunteer-outstanding-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #dee2e6;
    white-space: nowrap;
}

.volunteer-outstanding-page .volunteer-outstanding-table th.text-end .admin-grid-sort-link {
    float: right;
}

.volunteer-outstanding-page .volunteer-outstanding-table tbody td {
    white-space: nowrap;
}

.volunteer-outstanding-remaining-value {
    color: #856404;
}

.volunteer-outstanding-row:hover {
    background-color: rgba(13, 110, 253, 0.04);
}

.volunteer-household-row .card-body,
.volunteer-review-row .card-body {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.volunteer-household-metrics {
    white-space: nowrap;
}

.volunteer-review-row {
    border-color: #e9ecef;
}

.volunteer-review-row-main {
    min-height: 2.5rem;
}

.volunteer-contribution-table td {
    padding: 0.1rem 0.5rem;
}

.volunteer-back-nav {
    clear: both;
}

.admin-env-badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    background: var(--tenant-secondary, #f8f9fa);
    color: var(--tenant-primary, #0d6efd);
    border: 1px solid color-mix(in srgb, var(--tenant-primary, #0d6efd) 28%, #e2e8f0);
}

/* Member directory statistics */
.member-statistics-panel {
    border-radius: 0.5rem;
    overflow: hidden;
}

.member-statistics-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.45rem 0.75rem;
    border: 1px solid color-mix(in srgb, var(--tenant-primary, #0d6efd) 14%, #e2e8f0);
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--tenant-primary, #0d6efd) 6%, var(--tenant-background, #f8f9fa));
    color: #495057;
    font-size: 0.88rem;
    font-weight: 600;
}

.member-statistics-toggle:hover,
.member-statistics-toggle:focus-visible {
    background: color-mix(in srgb, var(--tenant-primary, #0d6efd) 9%, var(--tenant-background, #f8f9fa));
}

.member-statistics-toggle-icon::before {
    content: "▸";
    display: inline-block;
    transition: transform 0.15s ease-in-out;
}

.member-statistics-toggle:not(.collapsed) .member-statistics-toggle-icon::before {
    transform: rotate(90deg);
}

.member-statistics-body {
    margin-top: 0.45rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid color-mix(in srgb, var(--tenant-primary, #0d6efd) 12%, #e2e8f0);
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--tenant-primary, #0d6efd) 4%, #fff);
}

.member-statistics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .member-statistics-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .member-statistics-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.member-stat-chip {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.4rem;
    background: #fff;
    border: 1px solid #edf1f5;
}

.member-stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--tenant-primary, #0d6efd);
    line-height: 1.2;
}

.member-stat-label {
    font-size: 0.74rem;
    color: #6c757d;
    line-height: 1.25;
}

.admin-btn-brand {
    background: var(--tenant-primary, #0d6efd);
    border-color: var(--tenant-primary, #0d6efd);
    color: #fff;
}

.admin-btn-brand:hover,
.admin-btn-brand:focus-visible {
    background: var(--tenant-accent, #0b5ed7);
    border-color: var(--tenant-accent, #0b5ed7);
    color: #fff;
}

.branding-admin-page .branding-logo-preview {
    max-height: 72px;
    max-width: 220px;
    object-fit: contain;
}

.branding-preview-root {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    overflow: hidden;
    background: var(--tenant-background, #f8f9fa);
}

.branding-preview-navbar {
    background: var(--tenant-navbar, #f8f9fa);
    color: var(--tenant-primary, #0d6efd);
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.branding-preview-body {
    background: var(--tenant-background, #fff);
}

.branding-preview-button {
    background: var(--tenant-primary, #0d6efd);
    border-color: var(--tenant-primary, #0d6efd);
    color: #fff;
}

.branding-preview-footer {
    background: color-mix(in srgb, var(--tenant-primary, #0d6efd) 6%, #fff);
    color: #6c757d;
    border-top: 1px solid #e9ecef;
}

.branding-preview-roster {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--tenant-accent, #0b5ed7);
}

.admin-center-return-bar {
    padding-bottom: 0.25rem;
    border-bottom: 1px solid #e9ecef;
}

.admin-center-return-btn {
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .admin-center-return-btn {
        width: 100%;
    }
}

/* Full-width action buttons on phones, natural width from small breakpoint up. */
@media (min-width: 576px) {
    .w-sm-auto {
        width: auto !important;
    }
}

/* =============================================================================
   AUDIT LOG

   Purpose:
   - Keep one audit summary record on one compact row
   - Give Detail and Entity more usable horizontal space
   - Reduce visual weight of routine Action values
   - Keep expanded detail rows readable without forcing summary wrapping

   Notes:
   - These styles assume the Audit view assigns column-specific classes such as
     audit-date-cell, audit-user-cell, audit-action-cell, audit-entity-cell,
     audit-detail-cell, and audit-ip-cell.
   - Summary rows intentionally truncate with ellipsis.
   - Expanded detail rows intentionally allow wrapping.
   ============================================================================= */

   .audit-table {
    table-layout: fixed;
    width: 100%;
    min-width: 1040px;
    font-size: 0.8rem;
}
.audit-table-scroll {
    overflow-x: auto;
}
/* Keep summary rows compact and single-line. */
.audit-summary-row > td {
    padding: 0.28rem 0.45rem;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Keep table headers compact and aligned with the summary rows. */
.audit-table th {
    padding: 0.28rem 0.45rem;
    vertical-align: middle;
    white-space: nowrap;
}

/* Column sizing: fixed utility columns, flexible Detail column. */
.audit-date-cell {
    width: 122px;
}

.audit-user-cell {
    width: 104px;
}

.audit-action-cell {
    width: 96px;
}

.audit-entity-cell {
    width: 195px;
}

.audit-ip-cell {
    width: 108px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.75rem;
}

.audit-ip-column {
    width: 108px;
}

.audit-more-cell {
    width: 92px;
}

/* Override summary truncation rule so the Details button cannot be clipped. */
.audit-summary-row > td.audit-more-cell {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.audit-more-column {
    width: 92px;
}

/* Keep the Details action available while horizontally scrolling. */
.audit-table th:last-child,
.audit-more-cell {
    position: sticky;
    right: 0;
    z-index: 2;
    background-color: #ffffff;
}

.audit-table th:last-child {
    z-index: 3;
}

/* Detail gets the remaining space and truncates instead of wrapping. */
.audit-detail-cell {
    width: auto;
    font-weight: 500;
}

/* Lighter routine action text; error/exception styling can be added later. */
.audit-action {
    color: #495057;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* Inline EntityID should not create a second line in the summary row. */
.audit-entity-id-inline {
    margin-left: 0.35rem;
    font-size: 0.74rem;
}

/* Keep the details button compact. */
.audit-detail-button {
    padding: 0.12rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
    min-width: 72px;
}

/* Render a placeholder when RequestIPAddress is missing. */
.audit-ip-cell:empty::before {
    content: "\2014";
    color: #6c757d;
}

/* Expanded detail rows may wrap normally. */
.audit-detail-row td {
    padding: 0.65rem 0.75rem;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    background-color: #ffffff;
}

/* Expanded detail panel: readable but not visually heavy. */
.audit-detail-panel {
    font-size: 0.82rem;
    line-height: 1.35;
}

/* JSON/detail blocks inside expanded rows. */
.audit-json-container,
.audit-detail-panel pre {
    background-color: #f8f9fa;
    color: #212529;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.75rem;
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Admin User Edit (User Role Phase D) */
.admin-user-edit-page .admin-role-option {
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.admin-user-edit-page .admin-role-option:has(.form-check-input:checked) {
    border-color: var(--tenant-primary, #0d6efd) !important;
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.12);
}

.admin-user-edit-page .admin-role-option .form-check-input {
    margin-top: 0.2rem;
}

/* Admin User Create — readable provisioning layout */
.page-shell-admin:has(.admin-user-create-shell) {
    padding-top: 0.35rem;
}

.admin-user-create-shell .admin-center-return-bar {
    margin-bottom: 0.5rem;
    padding-bottom: 0.2rem;
}

.admin-user-create-page {
    max-width: none;
}

.admin-user-create-header {
    margin-bottom: 0.65rem;
}

.admin-user-create-header .h3 {
    font-size: 1.35rem;
    line-height: 1.25;
}

.admin-user-create-subtitle {
    line-height: 1.4;
    margin-top: 0.2rem;
}

.admin-user-create-card-body {
    padding: 1rem 1.25rem 1.1rem;
}

.admin-user-create-member-field {
    max-width: 100%;
}

.admin-user-create-member-field .form-select {
    max-width: 100%;
}

@media (min-width: 992px) {
    .admin-user-create-member-field {
        max-width: 100%;
    }

    .admin-user-create-identity-row > .col-lg-3,
    .admin-user-create-identity-row > .col-lg-4 {
        padding-top: 2.15rem;
    }
}

.admin-user-create-section-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

.admin-user-create-roles-panel {
    padding: 0;
}

.admin-user-create-settings {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    background-color: #fcfcfd;
    padding: 0.75rem 1rem;
}

.admin-user-create-options-bar,
.admin-user-create-status-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    column-gap: 1rem;
    row-gap: 0.35rem;
}

.admin-user-create-status-row {
    margin-top: 0.65rem;
    padding-top: 0.65rem;
    border-top: 1px solid #e9ecef;
}

.admin-user-create-options-label {
    flex: 0 0 9.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #212529;
}

.admin-user-create-controls-row {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    column-gap: 1.5rem;
    row-gap: 0.35rem;
    min-width: 0;
}

.admin-user-create-controls-row .form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0;
}

.admin-user-create-controls-row .form-check-input {
    flex-shrink: 0;
    margin-top: 0;
    float: none;
    margin-left: 0;
}

.admin-user-create-controls-row .form-check-label {
    font-size: 0.875rem;
}

@media (max-width: 767.98px) {
    .admin-user-create-options-bar,
    .admin-user-create-status-row {
        flex-wrap: wrap;
    }

    .admin-user-create-options-label {
        flex-basis: 100%;
    }

    .admin-user-create-identity-row > .col-lg-3,
    .admin-user-create-identity-row > .col-lg-4 {
        padding-top: 0;
    }
}

.admin-user-create-page .form-label {
    font-size: 0.875rem;
    margin-bottom: 0.35rem;
}

.admin-user-create-roles-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.625rem;
}

@media (min-width: 768px) {
    .admin-user-create-roles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .admin-user-create-roles-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.admin-user-create-page .admin-role-option {
    background-color: #fff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.admin-user-create-page .admin-user-create-role-option {
    padding: 0.75rem 0.875rem;
    min-height: 80px;
    height: 100%;
}

.admin-user-create-page .admin-role-option:has(.form-check-input:checked) {
    border-color: var(--tenant-primary, #0d6efd) !important;
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.12);
}

.admin-user-create-page .admin-role-option .form-check-input {
    margin-top: 0.25rem;
}

.admin-user-create-page .admin-role-option .form-check-label {
    line-height: 1.4;
}

.admin-user-create-role-name {
    font-size: 0.9375rem;
    line-height: 1.3;
}

.admin-user-create-role-desc {
    line-height: 1.4;
    margin-top: 0.25rem;
    white-space: normal;
    overflow-wrap: anywhere;
}

body:has(.admin-user-create-shell) footer.border-top {
    margin-top: 0.75rem !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}

@media (max-height: 820px) {
    .admin-user-create-subtitle {
        display: none;
    }

    .admin-user-create-header {
        margin-bottom: 0.45rem;
    }

    .admin-user-create-card-body {
        padding: 0.85rem 1.15rem 0.9rem;
    }

    .admin-user-create-roles.mb-3,
    .admin-user-create-settings.mb-3,
    .admin-user-create-identity-row.mb-3 {
        margin-bottom: 0.65rem !important;
    }

    body:has(.admin-user-create-shell) footer.border-top {
        margin-top: 0.5rem !important;
    }
}

.admin-user-create-reset-hint {
    line-height: 1.35;
}

.admin-effective-permissions-list .admin-effective-permission-item {
    border-bottom: 1px solid #e9ecef;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.admin-effective-permissions-list .admin-effective-permission-item:last-child {
    border-bottom: 0;
}

.admin-effective-permission-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
    align-items: baseline;
}

.admin-effective-permission-primary {
    flex: 1 1 100%;
    min-width: 0;
}

.admin-effective-permission-granted-by {
    flex: 1 1 100%;
    min-width: 0;
    line-height: 1.35;
}

.admin-effective-permission-granted-by-label {
    font-weight: 600;
    margin-right: 0.2rem;
}

.admin-permission-category-title {
    letter-spacing: 0.04em;
}

@media (min-width: 992px) {
    .admin-effective-permission-row {
        flex-wrap: nowrap;
        gap: 0.5rem 0.75rem;
    }

    .admin-effective-permission-primary {
        flex: 0 0 40%;
        max-width: 40%;
    }

    .admin-effective-permission-granted-by {
        flex: 1 1 auto;
        text-align: right;
    }
}

@media (min-width: 992px) {
    .admin-effective-permissions-card {
        position: sticky;
        top: 1.5rem;
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - 160px);
        overflow: hidden;
    }

    .admin-effective-permissions-header {
        flex-shrink: 0;
        border-bottom: 1px solid #e9ecef;
    }

    .admin-effective-permissions-scroll {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        padding-top: 0.75rem;
    }
}

@media (max-width: 991.98px) {
    .admin-effective-permissions-card {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .admin-effective-permissions-scroll {
        overflow: visible;
        max-height: none;
    }
}

/* Admin User Index (User Role Phase E) */
.admin-user-role-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    max-width: 18rem;
}

.admin-user-role-badge {
    font-weight: 500;
}

#admin-user-list-table td {
    vertical-align: middle;
}

/* =============================================================================
   MEMBERSHIP ADMINISTRATION

   Purpose:
   - Shared polish for /Admin/Members surfaces
   - Phase 1 foundation; list/detail/form pages adopt incrementally
   ============================================================================= */

.admin-member-page {
    --admin-member-section-accent: var(--tenant-primary, #0d6efd);
}

.admin-member-page-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .admin-member-page-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.admin-member-section-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.75rem;
    padding-left: 0.55rem;
    border-left: 3px solid var(--admin-member-section-accent, #0d6efd);
}

.admin-member-meta-grid {
    font-size: 0.875rem;
}

.admin-member-meta-grid .text-muted {
    color: #6c757d !important;
}

@media (max-width: 991.98px) {
    .admin-member-meta-grid > [class*="col-"] {
        margin-bottom: 0.15rem;
    }

    .admin-member-meta-grid .text-muted {
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
    }
}

.admin-member-dl dt {
    color: #6c757d;
}

.admin-member-dl dd {
    margin-bottom: 0.35rem;
}

.admin-member-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 0;
}

@media (max-width: 991.98px) {
    .admin-member-form-actions {
        position: sticky;
        bottom: 0;
        z-index: 1020;
        margin-inline: -0.25rem;
        padding: 0.75rem;
        background: color-mix(in srgb, var(--tenant-background, #f8f9fa) 88%, #fff);
        border-top: 1px solid #e9ecef;
        box-shadow: 0 -0.35rem 0.75rem rgba(0, 0, 0, 0.06);
    }
}

.admin-member-list-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .admin-member-list-toolbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.admin-member-list-search {
    min-width: 12rem;
    max-width: 28rem;
}

.admin-member-list-count {
    font-size: 0.8125rem;
    color: #6c757d;
    white-space: nowrap;
}

.admin-member-table {
    --admin-member-name-col: minmax(12rem, 1fr);
    table-layout: fixed;
    width: 100%;
}

.admin-member-table th,
.admin-member-table td {
    vertical-align: middle;
    padding-top: 0.45rem;
    padding-bottom: 0.45rem;
}

.admin-member-table .admin-member-col-member {
    min-width: 14rem;
    max-width: 0;
}

.admin-member-table .admin-member-col-status {
    width: 10.5rem;
    white-space: nowrap;
}

.admin-member-table .admin-member-col-joined {
    width: 4.25rem;
    white-space: nowrap;
    text-align: center;
}

.admin-member-table .admin-member-col-active {
    width: 5.5rem;
    white-space: nowrap;
}

.admin-member-table .admin-member-col-actions {
    width: 8.5rem;
    white-space: nowrap;
}

.admin-member-name-line {
    display: block;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-member-name-primary {
    font-weight: 600;
}

.admin-member-name-meta {
    font-weight: 400;
    font-size: 0.875rem;
    color: #6c757d;
    margin-left: 0.4rem;
}

.admin-member-status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
    border-radius: 999px;
    padding: 0.28em 0.65em;
    border: 1px solid transparent;
}

.admin-member-badge-neutral {
    background-color: #f1f3f5;
    border-color: #dee2e6;
    color: #495057;
}

.admin-member-badge-info {
    background-color: #e7f1ff;
    border-color: #b6d4fe;
    color: #0d6efd;
}

.admin-member-badge-warning {
    background-color: #fff3cd;
    border-color: #ffecb5;
    color: #997404;
}

.admin-member-badge-danger {
    background-color: #f8d7da;
    border-color: #f1aeb5;
    color: #b02a37;
}

.admin-member-badge-active {
    background-color: #d1e7dd;
    border-color: #a3cfbb;
    color: #198754;
}

.admin-member-badge-inactive {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

.admin-member-empty-search {
    display: none;
    padding: 1.25rem 0.5rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6c757d;
}

.admin-member-empty-search.is-visible {
    display: block;
}