/* ==========================================================================
   Humans — Da Vinci Renaissance Brand Design System
   Aesthetic: Renaissance humanist / parchment & ink / Da Vinci workshop
   ========================================================================== */

/* --- Fonts ---
   Cormorant Garamond: Renaissance-inspired serif for display/headings
   Source Sans 3: Clean humanist sans-serif for body/data
   Loaded via <link> in _Layout.cshtml
   ------------- */

/* Prevent layout shift when scrollbar appears/disappears */
html { scrollbar-gutter: stable; }

/* --- Bootstrap variable bridge ---
   Retints unthemed Bootstrap utilities (text-*, border-*, bg-*-subtle/-text-emphasis/-border-subtle,
   focus rings, alert-secondary/alert-light, link colors) to design tokens. .bg-primary/.bg-info stay
   explicitly blue-muted below (existing info-style badge/panel use); --bs-primary maps to gold-dark to
   match .btn-primary/.btn-outline-primary branding for the utilities that aren't already overridden. */
:root {
    --bs-body-color: var(--h-text);
    --bs-body-bg: var(--h-bg);
    --bs-border-color: var(--h-border);
    --bs-secondary-color: var(--h-umber);
    --bs-tertiary-bg: var(--h-vellum);
    --bs-link-color: var(--h-gold-dark);
    --bs-link-color-rgb: 168, 138, 78;
    --bs-link-hover-color: var(--h-aged-ink);
    --bs-link-hover-color-rgb: 61, 43, 31;
    --bs-focus-ring-color: rgba(201, 169, 110, 0.2);

    --bs-primary: var(--h-gold-dark);
    --bs-primary-rgb: 168, 138, 78;
    --bs-secondary: var(--h-sepia);
    --bs-secondary-rgb: 139, 115, 85;
    --bs-success: var(--h-sage-dark);
    --bs-success-rgb: 79, 112, 84;
    --bs-info: var(--h-blue-muted);
    --bs-info-rgb: 91, 125, 143;
    --bs-warning: var(--h-amber);
    --bs-warning-rgb: 196, 138, 42;
    --bs-danger: var(--h-rust);
    --bs-danger-rgb: 160, 64, 48;
    --bs-light: var(--h-vellum);
    --bs-light-rgb: 240, 226, 200;
    --bs-dark: var(--h-aged-ink);
    --bs-dark-rgb: 61, 43, 31;

    --bs-primary-bg-subtle: var(--h-alert-info-bg);
    --bs-primary-text-emphasis: var(--h-alert-info-text);
    --bs-primary-border-subtle: var(--h-blue-muted);
    --bs-success-bg-subtle: var(--h-alert-success-bg);
    --bs-success-text-emphasis: var(--h-alert-success-text);
    --bs-success-border-subtle: var(--h-sage);
    --bs-warning-bg-subtle: var(--h-alert-warning-bg);
    --bs-warning-text-emphasis: var(--h-alert-warning-text);
    --bs-warning-border-subtle: var(--h-amber);
    --bs-danger-bg-subtle: var(--h-alert-danger-bg);
    --bs-danger-text-emphasis: var(--h-alert-danger-text);
    --bs-danger-border-subtle: var(--h-rust);
    --bs-info-bg-subtle: var(--h-alert-info-bg);
    --bs-info-text-emphasis: var(--h-alert-info-text);
    --bs-info-border-subtle: var(--h-blue-muted);
    --bs-secondary-bg-subtle: var(--h-vellum);
    --bs-secondary-text-emphasis: var(--h-aged-ink-light);
    --bs-secondary-border-subtle: var(--h-border);
    --bs-light-bg-subtle: var(--h-parchment-light);
    --bs-light-text-emphasis: var(--h-sepia);
    --bs-light-border-subtle: var(--h-border-light);
    --bs-dark-bg-subtle: var(--h-aged-ink-light);
    --bs-dark-text-emphasis: var(--h-parchment);
    --bs-dark-border-subtle: var(--h-aged-ink);
}

/* --- Environment Banner (non-production) --- */
.env-banner {
    background: var(--h-rust);
    color: var(--h-text-on-dark);
    text-align: center;
    font-family: var(--h-font-body);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 3px 0;
    overflow: hidden;
    white-space: nowrap;
}

/* --- Base --- */
html, body {
    overflow-x: hidden;
}

body {
    overflow-y: auto;
    font-family: var(--h-font-body);
    color: var(--h-text);
    background-color: var(--h-bg);
    background-image: var(--h-grain);
    background-repeat: repeat;
    background-size: 256px 256px;
    font-size: 0.95rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- Typography --- */
h1, h2, h3, .display-4, .card-title,
.h1, .h2, .h3, .h4, .h5 {
    font-family: var(--h-font-display);
    color: var(--h-aged-ink);
    font-weight: 600;
    letter-spacing: 0.01em;
}

h1, .h1 { font-size: 2.1rem; font-weight: 700; }
h2, .h2 { font-size: 1.7rem; }
h3, .h3 { font-size: 1.4rem; }
h4, .h4 { font-size: 1.2rem; }
h5, .h5 { font-size: 1.1rem; }

.display-4 {
    font-family: var(--h-font-display);
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.lead {
    font-family: var(--h-font-display);
    font-size: 1.2rem;
    font-weight: 400;
    font-style: italic;
    color: var(--h-sepia);
}

/* --- Responsive heading steps --- */
@media (max-width: 899px) {
    h1, .h1 { font-size: 1.9rem; }
    h2, .h2 { font-size: 1.55rem; }
    h3, .h3 { font-size: 1.3rem; }
}

@media (max-width: 599px) {
    h1, .h1 { font-size: 1.7rem; }
    h2, .h2 { font-size: 1.4rem; }
    h3, .h3 { font-size: 1.2rem; }
}

/* --- Navbar --- */
.navbar {
    background-color: var(--h-aged-ink) !important;
    height: 64px;
    padding: 0 28px;
    gap: 28px;
}

.navbar-brand {
    font-family: var(--h-font-display) !important;
    font-style: italic;
    font-weight: 700 !important;
    font-size: 1.45rem !important;
    color: var(--h-gold) !important;
    letter-spacing: 0.01em;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.navbar-brand:hover {
    color: var(--h-gold-light) !important;
}

/* Logo icon in navbar */
.navbar-brand svg,
.navbar-brand img {
    height: 38px;
    width: auto;
    margin-right: 0.6rem;
    vertical-align: middle;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.navbar-brand:hover svg,
.navbar-brand:hover img {
    opacity: 1;
}

/* Links strip: the flexible middle column between the brand and the right
   cluster. At every width it scrolls horizontally when the links don't fit
   (site.js adds .is-overflowing for the edge fade, scrolls the active link
   into view, and fixed-positions an open dropdown's menu). <900px it also
   drops to its own full-width row. */
.navbar-links {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.navbar-links::-webkit-scrollbar {
    display: none;
}

.navbar-links.is-overflowing {
    -webkit-mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent);
    mask-image: linear-gradient(to right, transparent, black 24px, black calc(100% - 24px), transparent);
}

/* site.js sets this while a strip dropdown is open: the mask would hide the menu. */
.navbar-links.dropdown-open {
    -webkit-mask-image: none;
    mask-image: none;
}

.navbar .navbar-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
}

.navbar .nav-link {
    color: var(--h-parchment) !important;
    font-family: var(--h-font-body);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 14px !important;
    border-radius: 4px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 0.2s ease, background-color 0.2s ease;
}

/* Queue count bubbles inside nav links */
.nav-badge {
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    padding: 2px 7px;
    margin-left: 0.3em;
    letter-spacing: 0.04em;
    vertical-align: middle;
    background-color: var(--h-amber);
    color: var(--h-warm-white);
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: var(--h-gold) !important;
    background-color: rgba(255, 245, 221, 0.08);
}

.navbar .nav-link.active {
    color: var(--h-gold) !important;
    border-bottom-color: var(--h-gold);
    border-radius: 0;
}

/* Login/logout links in nav */
.navbar .btn-link {
    color: var(--h-parchment) !important;
    font-family: var(--h-font-body);
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    transition: color 0.2s ease;
}

.navbar .btn-link:hover {
    color: var(--h-gold) !important;
}

/* Language chooser in dark nav */
.navbar .btn-outline-secondary {
    color: var(--h-parchment) !important;
    border-color: rgba(245, 230, 200, 0.3) !important;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.navbar .btn-outline-secondary:hover {
    background-color: rgba(201, 169, 110, 0.15) !important;
    color: var(--h-gold) !important;
}

/* <900px: no hamburger, ever — the scrolling links strip drops to its own row. */
@media (max-width: 899.98px) {
    /* The strip gets its own full-width row under the brand/right-cluster bar. */
    .navbar {
        height: auto;
        flex-wrap: wrap;
        row-gap: 0;
    }

    .navbar-brand {
        display: inline-flex;
        align-items: center;
        min-height: 56px;
    }

    .navbar > .navbar-links {
        order: 3;
        flex: 0 0 100%;
    }
}

@media (max-width: 599.98px) {
    .navbar {
        padding: 0 16px;
        gap: 16px;
    }

    .navbar-brand {
        font-size: 1.15rem !important;
    }

    .navbar .nav-link {
        font-size: 0.75rem;
        padding: 6px 10px !important;
    }
}

/* --- Profile Dropdown --- */
.profile-dropdown-name {
    color: var(--h-parchment);
    font-family: var(--h-font-body);
    font-weight: 600;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.profile-dropdown-menu {
    min-width: 220px;
    background-color: var(--h-bg-elevated);
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
    box-shadow: var(--h-shadow-lg);
    font-family: var(--h-font-body);
    /* Stay above the human-search typeahead's open dropdown (z-index 2000). */
    z-index: 3000;
}

.profile-dropdown-menu .dropdown-item {
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
    color: var(--h-text);
}

.profile-dropdown-menu .dropdown-item:hover,
.profile-dropdown-menu .dropdown-item:focus {
    background-color: var(--h-parchment-light);
    color: var(--h-aged-ink);
}

.profile-dropdown-menu .dropdown-item i {
    color: var(--h-sepia-light);
    font-size: 0.8rem;
}

.profile-dropdown-menu .dropdown-divider {
    border-color: var(--h-border-light);
}

/* Dropdown toggle in navbar — style and remove Bootstrap's default caret */
.navbar .dropdown > .btn-link.dropdown-toggle::after {
    display: none;
}

.navbar .dropdown > .btn-link {
    color: var(--h-parchment) !important;
}

.navbar .dropdown > .btn-link:hover {
    color: var(--h-gold) !important;
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    padding-top: 2.25rem;
    padding-bottom: 3rem;
}

@media (max-width: 899.98px) {
    .main-content {
        padding-top: 2rem;
        padding-bottom: 2.5rem;
    }
}

@media (max-width: 599.98px) {
    .main-content {
        padding-top: 1.375rem;
        padding-bottom: 1.5rem;
    }
}

/* --- Cards --- */
.card {
    background-color: var(--h-bg-card);
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius-lg);
    box-shadow: var(--h-shadow-sm);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
    box-shadow: var(--h-shadow);
}

.card-header {
    background-color: var(--h-vellum);
    border-bottom: 1px solid var(--h-border);
    font-family: var(--h-font-display);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.02em;
    color: var(--h-aged-ink);
    padding: 0.75rem 1.25rem;
    border-radius: var(--h-radius-lg) var(--h-radius-lg) 0 0 !important;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background-color: var(--h-vellum) !important;
    border-top: 1px solid var(--h-border);
    border-radius: 0 0 var(--h-radius-lg) var(--h-radius-lg) !important;
    padding: 0.75rem 1.25rem;
}

.card-title {
    font-weight: 700;
}

.card-title a {
    color: var(--h-aged-ink);
    transition: color 0.2s ease;
}

.card-title a:hover {
    color: var(--h-gold-dark);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--h-font-body);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 9px 20px;
    border-radius: var(--h-radius);
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 1rem;
}

.btn:disabled,
.btn.disabled {
    opacity: 0.45;
}

@media (max-width: 599px) {
    .btn {
        min-height: 40px;
    }
}

.btn-primary {
    background-color: var(--h-gold);
    border-color: var(--h-gold);
    color: var(--h-aged-ink);
    --bs-btn-disabled-bg: var(--h-gold);
    --bs-btn-disabled-border-color: var(--h-gold);
    --bs-btn-disabled-color: var(--h-aged-ink);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--h-gold-dark);
    border-color: var(--h-gold-dark);
    color: var(--h-warm-white);
    box-shadow: 0 2px 8px rgba(201, 169, 110, 0.3);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--h-gold-dark);
    border-color: var(--h-gold);
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: var(--h-gold);
    --bs-btn-disabled-color: var(--h-gold-dark);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--h-gold);
    border-color: var(--h-gold);
    color: var(--h-aged-ink);
    transform: translateY(-1px);
}

.btn-outline-secondary {
    background-color: transparent;
    border-color: var(--h-border);
    color: var(--h-sepia);
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: var(--h-border);
    --bs-btn-disabled-color: var(--h-sepia);
}

/* Filled: filter toggles pair it with .btn-outline-secondary to mark the selected value. */
.btn-secondary {
    background-color: var(--h-parchment-dark);
    border-color: var(--h-sepia);
    color: var(--h-aged-ink);
    --bs-btn-disabled-bg: var(--h-parchment-dark);
    --bs-btn-disabled-border-color: var(--h-sepia);
    --bs-btn-disabled-color: var(--h-aged-ink);
}

.btn-outline-secondary:hover,
.btn-secondary:hover {
    background-color: var(--h-vellum);
    border-color: var(--h-sepia-light);
    color: var(--h-aged-ink);
}

/* WCAG AA: aged-ink on amber-light is ~6.2:1; every other amber fill fails with any text token
   (ink on amber 4.49, warm-white on amber-dark 4.0), so hover darkens the border, not the fill. */
.btn-warning {
    background-color: var(--h-amber-light);
    border-color: var(--h-amber-light);
    color: var(--h-aged-ink);
    --bs-btn-disabled-bg: var(--h-amber-light);
    --bs-btn-disabled-border-color: var(--h-amber-light);
    --bs-btn-disabled-color: var(--h-aged-ink);
}

.btn-warning:hover {
    background-color: var(--h-amber-light);
    border-color: var(--h-amber-dark);
    color: var(--h-aged-ink);
    box-shadow: 0 2px 8px rgba(196, 138, 42, 0.3);
    transform: translateY(-1px);
}

.btn-outline-warning {
    border-color: var(--h-amber);
    color: var(--h-alert-warning-text);
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: var(--h-amber);
    --bs-btn-disabled-color: var(--h-alert-warning-text);
}

.btn-outline-warning:hover {
    background-color: var(--h-amber-light);
    border-color: var(--h-amber-light);
    color: var(--h-aged-ink);
}

.btn-outline-warning:focus,
.btn-outline-warning.active,
.btn-outline-warning:active {
    background-color: var(--h-amber-light);
    border-color: var(--h-amber-light);
    color: var(--h-aged-ink);
}

.btn-danger {
    background-color: var(--h-rust);
    border-color: var(--h-rust);
    color: #fff;
    --bs-btn-disabled-bg: var(--h-rust);
    --bs-btn-disabled-border-color: var(--h-rust);
    --bs-btn-disabled-color: #fff;
}

.btn-danger:hover {
    background-color: #86372a;
    border-color: #86372a;
    color: #fff;
}

.btn-outline-danger {
    color: var(--h-rust);
    border-color: var(--h-rust);
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: var(--h-rust);
    --bs-btn-disabled-color: var(--h-rust);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger.active,
.btn-outline-danger:active {
    background-color: var(--h-rust);
    border-color: var(--h-rust);
    color: #fff;
}

.btn-success {
    background-color: var(--h-sage-dark);
    border-color: var(--h-sage-dark);
    color: #fff;
    --bs-btn-disabled-bg: var(--h-sage-dark);
    --bs-btn-disabled-border-color: var(--h-sage-dark);
    --bs-btn-disabled-color: #fff;
}

.btn-success:hover {
    background-color: #3e5a42;
    border-color: #3e5a42;
    color: #fff;
}

.btn-outline-success {
    color: var(--h-sage-dark);
    border-color: var(--h-sage-dark);
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: var(--h-sage-dark);
    --bs-btn-disabled-color: var(--h-sage-dark);
}

.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success.active,
.btn-outline-success:active {
    background-color: var(--h-sage-dark);
    border-color: var(--h-sage-dark);
    color: #fff;
}

.btn-link {
    color: var(--h-gold-dark);
    font-weight: 700;
}

.btn-link:hover {
    color: var(--h-aged-ink);
}

.btn-dark {
    background-color: var(--h-aged-ink);
    border-color: var(--h-aged-ink);
    color: var(--h-parchment);
    --bs-btn-disabled-bg: var(--h-aged-ink);
    --bs-btn-disabled-border-color: var(--h-aged-ink);
    --bs-btn-disabled-color: var(--h-parchment);
}

.btn-dark:hover {
    background-color: var(--h-aged-ink-light);
    border-color: var(--h-aged-ink-light);
    color: var(--h-parchment);
}

.btn-light {
    background-color: var(--h-vellum);
    border-color: var(--h-border);
    color: var(--h-aged-ink);
    --bs-btn-disabled-bg: var(--h-vellum);
    --bs-btn-disabled-border-color: var(--h-border);
    --bs-btn-disabled-color: var(--h-aged-ink);
}

.btn-light:hover {
    background-color: var(--h-parchment-dark);
    border-color: var(--h-sepia-light);
}

.btn-group {
    border-radius: var(--h-radius);
}

.btn-check:checked + .btn,
.btn-check:active + .btn,
.btn-group > .btn.active {
    background-color: var(--h-aged-ink);
    border-color: var(--h-aged-ink);
    color: var(--h-parchment);
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.2);
}

.btn-info {
    background-color: var(--h-blue-muted);
    border-color: var(--h-blue-muted);
    color: var(--h-text-on-dark);
    border-radius: var(--h-radius);
    font-weight: 700;
    --bs-btn-disabled-bg: var(--h-blue-muted);
    --bs-btn-disabled-border-color: var(--h-blue-muted);
    --bs-btn-disabled-color: var(--h-text-on-dark);
}

.btn-info:hover {
    background-color: #4a6977;
    border-color: #4a6977;
    color: var(--h-text-on-dark);
}

.btn-outline-info {
    border-color: var(--h-blue-muted);
    color: var(--h-blue-muted);
    border-radius: var(--h-radius);
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-outline-info:hover {
    background-color: var(--h-blue-muted);
    border-color: var(--h-blue-muted);
    color: var(--h-text-on-dark);
}

.btn-outline-info:focus,
.btn-outline-info.active,
.btn-outline-info:active {
    background-color: var(--h-blue-muted);
    border-color: var(--h-blue-muted);
    color: var(--h-text-on-dark);
}

.btn-outline-dark {
    border-color: var(--h-aged-ink);
    color: var(--h-aged-ink);
    border-radius: var(--h-radius);
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-outline-dark:hover {
    background-color: var(--h-aged-ink);
    color: var(--h-parchment);
}

/* --- Authorization Visual Indicators --- */
.auth-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    font-family: var(--h-font-body);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--h-sepia);
    background-color: var(--h-parchment-dark);
    border: 1px solid var(--h-border);
    border-radius: 999px;
    padding: 0.25em 0.75em;
}

.auth-lock-icon {
    color: var(--h-sepia-light);
    font-size: 0.7em;
    margin-left: 0.3em;
    opacity: 0.7;
}

.navbar .nav-link.nav-restricted {
    color: var(--h-amber) !important;
}

/* --- Badges ---
   Status badges (EnumBadgeMap/StatusBadgeExtensions, PageHeaderTagHelper) become tinted pills, matching
   the tables/alerts spec's status-pill principle. Plain (non-badge) .bg-* panel/utility uses below are
   left as solid fills. Count badges (.rounded-pill, e.g. notification counts) keep their solid look. */
.badge {
    font-family: var(--h-font-body);
    font-weight: 700;
    letter-spacing: 0.04em;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.78rem;
}

.badge.bg-primary,
.badge.bg-info {
    background-color: var(--h-alert-info-bg) !important;
    color: var(--h-alert-info-text) !important;
}

.badge.bg-success {
    background-color: var(--h-alert-success-bg) !important;
    color: var(--h-alert-success-text) !important;
}

.badge.bg-warning {
    background-color: var(--h-alert-warning-bg) !important;
    color: var(--h-alert-warning-text) !important;
}

.badge.bg-danger {
    background-color: var(--h-alert-danger-bg) !important;
    color: var(--h-alert-danger-text) !important;
}

.badge.bg-secondary {
    background-color: var(--h-parchment-dark) !important;
    color: var(--h-aged-ink-light) !important;
}

.badge.bg-dark {
    background-color: var(--h-aged-ink) !important;
    color: var(--h-parchment) !important;
}

.badge.bg-light {
    background-color: var(--h-vellum) !important;
    color: var(--h-umber) !important;
}

.badge.rounded-pill.bg-primary,
.badge.rounded-pill.bg-info {
    background-color: #4a6977 !important;
    color: #fff !important;
}

.badge.rounded-pill.bg-success {
    background-color: var(--h-sage-dark) !important;
    color: #fff !important;
}

.badge.rounded-pill.bg-warning {
    background-color: var(--h-amber-light) !important;
    color: var(--h-aged-ink) !important;
}

.badge.rounded-pill.bg-danger {
    background-color: var(--h-rust) !important;
    color: #fff !important;
}

.badge.rounded-pill.bg-secondary {
    background-color: var(--h-umber) !important;
    color: #fff !important;
}

.badge.rounded-pill.bg-dark {
    background-color: var(--h-aged-ink) !important;
    color: var(--h-parchment) !important;
}

.bg-primary {
    background-color: var(--h-blue-muted) !important;
}

.bg-success {
    background-color: var(--h-sage) !important;
}

.bg-warning {
    background-color: var(--h-amber) !important;
    color: var(--h-text-on-dark) !important;
}

.bg-secondary {
    background-color: var(--h-sepia) !important;
}

.bg-info {
    background-color: var(--h-blue-muted) !important;
}

.bg-danger {
    background-color: var(--h-rust) !important;
}

/* --- Alerts --- */
.alert {
    border-radius: var(--h-radius);
    border: none;
    padding: 14px 18px;
    font-size: 0.92rem;
}

.alert-heading {
    font-family: var(--h-font-display);
    font-weight: 700;
    font-size: 1.02rem;
    margin-bottom: 2px;
}

.alert-link {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

.alert .btn-close {
    opacity: 0.6;
}

.alert .btn-close:hover {
    opacity: 1;
}

.alert-secondary,
.alert-light {
    background-color: var(--h-vellum);
    color: var(--h-aged-ink);
    border-left: 4px solid var(--h-sepia-light);
}

.alert-warning {
    background-color: var(--h-alert-warning-bg);
    color: var(--h-alert-warning-text);
    border-left: 4px solid var(--h-amber);
}

.alert-info {
    background-color: var(--h-alert-info-bg);
    color: var(--h-alert-info-text);
    border-left: 4px solid var(--h-blue-muted);
}

.alert-success {
    background-color: var(--h-alert-success-bg);
    color: var(--h-alert-success-text);
    border-left: 4px solid var(--h-sage);
}

.alert-danger {
    background-color: var(--h-alert-danger-bg);
    color: var(--h-alert-danger-text);
    border-left: 4px solid var(--h-rust);
}

/* --- List Groups (in cards) --- */
.list-group-item {
    border-color: var(--h-border-light);
    color: var(--h-text);
    transition: all 0.15s ease;
}

.list-group-item-action:hover {
    background-color: var(--h-vellum);
    color: var(--h-gold-dark);
}

.list-group-item.active,
.list-group-item-action:active {
    background-color: var(--h-gold);
    border-color: var(--h-gold);
    color: var(--h-aged-ink);
}

.list-group-item-success {
    background-color: var(--h-alert-success-bg);
    color: var(--h-alert-success-text);
}

.list-group-item-warning {
    background-color: var(--h-alert-warning-bg);
    color: var(--h-alert-warning-text);
}

.list-group-item-danger {
    background-color: var(--h-alert-danger-bg);
    color: var(--h-alert-danger-text);
}

.list-group-item-info {
    background-color: var(--h-alert-info-bg);
    color: var(--h-alert-info-text);
}

/* --- Forms --- */
.form-control,
.form-select {
    border-color: var(--h-border);
    border-radius: var(--h-radius);
    font-family: var(--h-font-body);
    background-color: var(--h-warm-white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--h-gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.2);
    background-color: var(--h-bg-elevated);
}

.form-control::placeholder {
    color: var(--h-umber);
    font-style: italic;
}

.form-control:disabled,
.form-control[readonly],
.form-select:disabled {
    background-color: var(--h-parchment);
    color: var(--h-umber);
    opacity: 1;
}

.form-text {
    font-family: var(--h-font-display);
    font-style: italic;
    font-size: 0.78rem;
    color: var(--h-umber);
}

.input-group-text {
    background-color: var(--h-vellum);
    border-color: var(--h-border);
    color: var(--h-umber);
}

/* WCAG: appearance:none checkboxes/switches can't use accent-color, so the checked state is styled
   directly (spec-buttons-forms-cards.md forms section). */
.form-check-input:checked {
    background-color: var(--h-gold-dark);
    border-color: var(--h-gold-dark);
}

.form-check-input:focus {
    border-color: var(--h-gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.2);
}

.is-invalid,
.form-control.is-invalid,
.form-select.is-invalid,
.input-validation-error,
.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: var(--h-rust) !important;
}

.is-invalid:focus,
.form-control.is-invalid:focus,
.form-select.is-invalid:focus,
.input-validation-error:focus {
    box-shadow: 0 0 0 3px rgba(160, 64, 48, 0.15);
}

.invalid-feedback,
.validation-summary-errors {
    font-size: 0.82rem;
    color: var(--h-rust);
}

.form-label {
    font-family: var(--h-font-display);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--h-aged-ink);
    letter-spacing: 0.01em;
    margin-bottom: 4px;
}

/* --- Tables --- */
.table {
    --bs-table-hover-bg: var(--h-vellum);
}

.table th {
    font-family: var(--h-font-body);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 12px 16px;
    border-bottom-width: 2px;
    border-color: var(--h-border);
}

.table td {
    padding: 14px 16px;
    border-color: var(--h-border-light);
    vertical-align: middle;
}

.table-sm > :not(caption) > * > * {
    padding: 8px 12px;
}

/* Header tint via the table variables at zero specificity, so a contextual thead (.table-dark,
   .table-danger) and body-row th cells keep Bootstrap's own colors. */
:where(.table > thead) {
    --bs-table-bg: var(--h-vellum);
    --bs-table-color: var(--h-umber);
}

.table-light,
.table > thead.table-light > tr > * {
    --bs-table-bg: var(--h-vellum);
    --bs-table-color: var(--h-umber);
}

.table-success {
    --bs-table-bg: var(--h-alert-success-bg);
    --bs-table-color: var(--h-alert-success-text);
}

.table-warning {
    --bs-table-bg: var(--h-alert-warning-bg);
    --bs-table-color: var(--h-alert-warning-text);
}

.table-danger {
    --bs-table-bg: var(--h-alert-danger-bg);
    --bs-table-color: var(--h-alert-danger-text);
}

.table-info {
    --bs-table-bg: var(--h-alert-info-bg);
    --bs-table-color: var(--h-alert-info-text);
}

.table-active {
    --bs-table-bg: var(--h-vellum);
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: var(--h-vellum);
}

.sortable-table-header {
    cursor: pointer;
    user-select: none;
}

.sortable-table-header:focus-visible {
    outline: 2px solid var(--h-gold);
    outline-offset: 2px;
}

.sortable-table-header.sort-asc,
.sortable-table-header.sort-desc {
    color: var(--h-aged-ink);
}

/* --- Footer --- */
footer {
    background-color: var(--h-vellum) !important;
    border-top: 1px solid var(--h-border) !important;
    color: var(--h-sepia);
    font-size: 0.85rem;
}

/* --- Pagination --- */
.page-link {
    color: var(--h-gold-dark);
    border-color: var(--h-border);
    border-radius: var(--h-radius-sm);
    font-size: 0.82rem;
}

.page-link:hover {
    color: var(--h-aged-ink);
    background-color: var(--h-vellum);
}

.page-item.active .page-link {
    background-color: var(--h-aged-ink);
    border-color: var(--h-aged-ink);
    color: var(--h-parchment);
}

/* --- Nav tabs / pills --- */
.nav-tabs {
    border-bottom: 1px solid var(--h-border);
}

.nav-tabs .nav-link {
    font-family: var(--h-font-display);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--h-umber);
    background-color: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
}

.nav-tabs .nav-link:hover {
    color: var(--h-aged-ink);
    border-color: transparent;
}

.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    color: var(--h-aged-ink);
    background-color: transparent;
    border-color: transparent transparent var(--h-gold);
}

.nav-pills .nav-link {
    font-family: var(--h-font-body);
    font-size: 0.82rem;
    color: var(--h-umber);
    background-color: var(--h-warm-white);
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
}

.nav-pills .nav-link.active {
    background-color: var(--h-aged-ink);
    color: var(--h-parchment);
    border-color: var(--h-aged-ink);
}

/* --- Breadcrumb --- */
.breadcrumb {
    font-family: var(--h-font-body);
    font-size: 0.85rem;
}

.breadcrumb-item,
.breadcrumb-item a {
    color: var(--h-umber);
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--h-aged-ink);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--h-aged-ink);
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--h-sepia-light);
}

/* --- Modal --- */
.modal-content {
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius-lg);
    box-shadow: var(--h-shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--h-border-light);
}

.modal-header .modal-title {
    font-family: var(--h-font-display);
    font-weight: 700;
    color: var(--h-aged-ink);
}

.modal-footer {
    background-color: var(--h-vellum);
    border-top: 1px solid var(--h-border-light);
}

/* --- Accordion --- */
.accordion-item {
    border-color: var(--h-border);
}

.accordion-button {
    font-family: var(--h-font-body);
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--h-aged-ink);
    background-color: var(--h-bg-elevated);
}

.accordion-button:not(.collapsed) {
    background-color: var(--h-vellum);
    color: var(--h-aged-ink);
    box-shadow: inset 0 -1px 0 var(--h-border);
}

.accordion-button:focus {
    border-color: var(--h-gold);
    box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.2);
}

/* --- Progress / spinner --- */
.progress {
    background-color: var(--h-parchment-dark);
    border-radius: var(--h-radius);
}

.progress-bar {
    background-color: var(--h-gold);
}

.spinner-border,
.spinner-grow {
    color: var(--h-aged-ink);
}

/* --- Tooltip / popover --- */
.tooltip {
    --bs-tooltip-bg: var(--h-aged-ink);
    --bs-tooltip-color: var(--h-parchment);
}

.popover {
    --bs-popover-border-color: var(--h-border);
    --bs-popover-header-bg: var(--h-vellum);
    --bs-popover-header-color: var(--h-aged-ink);
    --bs-popover-body-color: var(--h-aged-ink-light);
    --bs-popover-box-shadow: var(--h-shadow-lg);
}

/* --- Toast --- */
.toast {
    background-color: var(--h-aged-ink);
    color: var(--h-parchment);
    border: none;
    box-shadow: var(--h-shadow-lg);
}

.toast .toast-body {
    color: var(--h-parchment);
}

/* Close icon sits on the ink body (toast-header stays light, so skip it). */
.toast :not(.toast-header) > .btn-close {
    filter: var(--bs-btn-close-white-filter);
}

/* --- Profile Avatar --- */
.rounded-circle {
    border: 2px solid var(--h-border);
}

.bg-secondary.rounded-circle {
    background-color: var(--h-sepia) !important;
    border: 2px solid var(--h-parchment-dark);
}

/* --- Cookie Consent Banner --- */
#cookieConsent {
    background-color: var(--h-aged-ink) !important;
    border-top: 2px solid var(--h-gold);
    box-shadow: 0 -4px 16px rgba(61, 43, 31, 0.15);
}

#cookieConsent .btn-light {
    background-color: var(--h-parchment);
    border: none;
    color: var(--h-aged-ink);
    font-weight: 700;
    border-radius: var(--h-radius);
}

/* --- Dropdown --- */
.dropdown-menu {
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
    box-shadow: var(--h-shadow-lg);
    background-color: var(--h-bg-elevated);
}

.dropdown-item {
    font-size: 0.9rem;
    padding: 0.45rem 1rem;
    transition: all 0.15s ease;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--h-vellum);
    color: var(--h-gold-dark);
}

.dropdown-item.active {
    background-color: var(--h-gold);
    color: var(--h-aged-ink);
}

.dropdown-item.text-danger:hover,
.dropdown-item.text-danger:focus {
    background-color: var(--h-alert-danger-bg);
}

/* --- Links --- */
a {
    color: var(--h-gold-dark);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--h-aged-ink);
}

/* --- Text utility overrides --- */
.text-muted {
    color: var(--h-sepia) !important;
}

.text-success {
    color: var(--h-sage-dark) !important;
}

/* Finance: sign-based coloring for monetary figures — green = positive, red = negative, never the reverse. */
.finance-positive {
    color: var(--h-sage-dark) !important;
}

.finance-negative {
    color: var(--h-rust) !important;
}

.text-warning {
    color: var(--h-amber) !important;
}

.text-dark {
    color: var(--h-aged-ink) !important;
}

.text-danger {
    color: var(--h-rust) !important;
}

.text-primary {
    color: var(--h-gold-dark) !important;
}

.text-info {
    color: var(--h-alert-info-text) !important;
}

.text-secondary {
    color: var(--h-umber) !important;
}

/* --- Selection --- */
::selection {
    background-color: rgba(201, 169, 110, 0.25);
    color: var(--h-aged-ink);
}

/* --- Scrollbar (webkit) --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--h-parchment);
}

::-webkit-scrollbar-thumb {
    background: var(--h-parchment-dark);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--h-sepia-light);
}

/* --- About: the mark at full size, on its own aged-ink disc (the transparent
   master washes out on parchment, so it gets the same tile the icons bake in) --- */
.about-mark {
    width: 260px;
    height: 260px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background: var(--h-aged-ink);
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-mark img {
    width: 82%;
    height: auto;
}

/* --- Home (unauthenticated landing page) --- */
.home-hero {
    padding: 3.5rem 1rem 2.5rem;
    margin-bottom: 2rem;
}

.home-hero .display-4 {
    color: var(--h-aged-ink);
    margin-bottom: 0.5rem;
}

.home-hero-subtitle {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}

.home-hero-description {
    max-width: 600px;
    margin: 0 auto 1rem;
    color: var(--h-sepia);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Feature cards grid */
.home-feature-card {
    border-color: var(--h-border-light);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.home-feature-card:hover {
    box-shadow: var(--h-shadow-lg);
    transform: translateY(-2px);
}

.home-feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--h-parchment);
    color: var(--h-gold-dark);
    font-size: 1.4rem;
}

/* Onboarding steps */
.home-onboarding-card {
    border-left: 4px solid var(--h-gold);
}

.home-steps {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.home-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
}

.home-step-number {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--h-gold);
    color: var(--h-aged-ink);
    font-weight: 700;
    font-size: 0.9rem;
    font-family: var(--h-font-body);
}

/* Responsive: stack feature cards nicely on mobile */
@media (max-width: 767.98px) {
    .home-hero {
        padding: 2rem 0.5rem 1.5rem;
    }

    .home-hero .display-4 {
        font-size: 2.2rem;
    }

    .home-hero-subtitle {
        font-size: 1.1rem;
    }
}

/* --- Welcome / Thank You page (post-ticket-purchase landing) --- */
.welcome-hero {
    padding: 3rem 1rem 1.5rem;
}

.welcome-checkmark {
    font-size: 3rem;
    color: var(--h-sage);
    margin-bottom: 0.75rem;
}

.welcome-heading {
    font-family: var(--h-font-display);
    font-size: 2.2rem;
    color: var(--h-aged-ink);
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    font-size: 1.1rem;
    color: var(--h-sepia);
    margin-bottom: 0;
}

.welcome-shifts-card {
    background-color: var(--h-parchment-light);
    border: 1px solid var(--h-border-light);
    border-radius: 0.5rem;
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.75rem;
}

.welcome-shifts-title {
    font-family: var(--h-font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--h-aged-ink);
    margin-bottom: 0.75rem;
}

.welcome-shifts-body {
    font-size: 0.95rem;
    color: var(--h-sepia);
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

.welcome-shifts-body:last-child {
    margin-bottom: 0;
}

.welcome-cta {
    background-color: var(--h-sage);
    border-color: var(--h-sage);
    color: #fff;
    padding: 0.6rem 2rem;
    font-size: 1rem;
}

.welcome-cta:hover {
    background-color: var(--h-sage-dark);
    border-color: var(--h-sage-dark);
    color: #fff;
}

.welcome-footer {
    font-size: 0.85rem;
    color: var(--h-sepia-light);
    margin-bottom: 2rem;
}

.welcome-contact {
    border-top: 1px solid var(--h-border-light);
    padding-top: 1rem;
    margin-bottom: 2rem;
}

.welcome-contact p {
    font-size: 0.85rem;
    color: var(--h-sepia-light);
    margin-bottom: 0;
}

.welcome-contact a {
    color: var(--h-blue-muted);
}

@media (max-width: 767.98px) {
    .welcome-hero {
        padding: 2rem 0.5rem 1rem;
    }

    .welcome-heading {
        font-size: 1.8rem;
    }

    .welcome-shifts-card {
        padding: 1.25rem;
    }
}

/* --- Decorative rule — used as section separator --- */
hr {
    border-color: var(--h-border);
    opacity: 0.5;
}

/* --- Subtle entrance animation --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.3s ease-out both;
}

/* fadeInUp uses `transform` with `animation-fill-mode: both`, which leaves a
   non-default transform on every .card permanently — that creates a stacking
   context and traps any modal nested inside a card *under* .modal-backdrop,
   visibly dimming the dialog. Collapse the context while a modal is open. */
body.modal-open .card {
    transform: none !important;
    animation: none !important;
}

.row .col:nth-child(2) .card,
.row .col-md-6:nth-child(2) .card {
    animation-delay: 0.05s;
}

.row .col:nth-child(3) .card,
.row .col-md-6:nth-child(3) .card,
.row .col-lg-3:nth-child(3) .card {
    animation-delay: 0.1s;
}

.row .col:nth-child(4) .card,
.row .col-md-6:nth-child(4) .card {
    animation-delay: 0.15s;
}

.row .col:nth-child(5) .card {
    animation-delay: 0.2s;
}

/* --- Role description expander --- */
.role-desc-chevron {
    transition: transform 0.2s ease;
    display: inline-block;
}

[aria-expanded="true"] .role-desc-chevron {
    transform: rotate(180deg);
}

/* --- Reduced motion preference --- */
@media (prefers-reduced-motion: reduce) {
    .card {
        animation: none;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
    }
}

/* --- Clickable table rows --- */
tr[data-href] {
    cursor: pointer;
}

/* ==========================================================================
   Notification Inbox
   ========================================================================== */

/* --- Bell Button --- */
.notification-bell-wrapper {
    position: relative;
}

.notification-bell-btn {
    background: none;
    border: none;
    color: var(--h-parchment);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
    font-size: 1rem;
}

.notification-bell-btn:hover,
.notification-bell-btn[aria-expanded="true"] {
    background-color: rgba(255, 255, 255, 0.15);
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    border: 2px solid var(--h-aged-ink);
}

.notification-badge-danger {
    background-color: var(--h-rust);
    color: var(--h-text-on-dark);
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 9px;
    min-width: 16px;
    text-align: center;
}

.notification-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--h-sage);
    display: block;
}

/* --- Popup --- */
.notification-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: var(--h-bg-elevated);
    border-radius: var(--h-radius-lg);
    box-shadow: var(--h-shadow-lg);
    z-index: 1050;
    overflow: hidden;
    border: 1px solid var(--h-border);
}

.notification-popup-arrow {
    position: absolute;
    top: -6px;
    right: 12px;
    width: 12px;
    height: 12px;
    background: var(--h-aged-ink);
    transform: rotate(45deg);
    border: 1px solid var(--h-border);
    border-right: none;
    border-bottom: none;
}

.notification-popup-header {
    background-color: var(--h-aged-ink);
    color: var(--h-parchment);
    padding: 0.5rem 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--h-font-body);
    font-size: 0.85rem;
    font-weight: 600;
}

.notification-popup-close {
    background: none;
    border: none;
    color: var(--h-parchment);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.9rem;
    opacity: 0.7;
    transition: opacity 0.15s;
}

.notification-popup-close:hover {
    opacity: 1;
}

.notification-action-pill {
    background-color: var(--h-rust);
    color: var(--h-text-on-dark);
    font-size: 0.65rem;
    font-weight: 700;
}

.notification-popup-body {
    max-height: 350px;
    overflow-y: auto;
}

.notification-popup-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--h-sepia);
}

.notification-empty-icon {
    font-size: 2rem;
    color: var(--h-border);
    margin-bottom: 0.5rem;
    display: block;
}

.notification-popup-footer {
    padding: 0.5rem 0.75rem;
    background-color: var(--h-parchment-light);
    border-top: 1px solid var(--h-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-mark-all-read {
    background: none;
    border: none;
    color: var(--h-sepia);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

.notification-mark-all-read:hover {
    color: var(--h-aged-ink);
}

.notification-see-all {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--h-aged-ink);
    text-decoration: none;
}

.notification-see-all:hover {
    color: var(--h-aged-ink-light);
    text-decoration: underline;
}

/* --- Section Labels --- */
.notification-section-label {
    font-family: var(--h-font-body);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--h-sepia-light);
    padding: 0.4rem 0.75rem 0.2rem;
    background-color: var(--h-parchment-light);
    border-bottom: 1px solid var(--h-border-light);
}

/* --- Notification Row --- */
.notification-row {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--h-border-light);
    border-left: 3px solid transparent;
    transition: background-color 0.15s;
}

.notification-row:last-child {
    border-bottom: none;
}

.notification-border-danger { border-left-color: var(--h-rust); }
.notification-border-warning { border-left-color: var(--h-amber); }
.notification-border-success { border-left-color: var(--h-sage); }
.notification-border-muted { border-left-color: var(--h-border); }
.notification-border-resolved { border-left-color: var(--h-border-light); }

.notification-row-actionable { background-color: var(--h-bg-card); }
.notification-row-informational { background-color: var(--h-parchment-light); }
.notification-row-resolved { opacity: 0.6; background-color: var(--h-bg-card); }

.notification-row-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
}

a.notification-row-line:hover .notification-title {
    text-decoration: underline;
}

.notification-title {
    font-family: var(--h-font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--h-aged-ink);
    line-height: 1.3;
    flex: 1 1 auto;
    min-width: 0;
}

.notification-title-resolved {
    color: var(--h-sepia-light);
    font-weight: 500;
}

.notification-timestamp {
    font-family: var(--h-font-body);
    font-size: 0.7rem;
    color: var(--h-sepia-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.notification-resolved-label {
    font-family: var(--h-font-body);
    font-size: 0.7rem;
    color: var(--h-sepia-light);
    font-style: italic;
    margin-top: 0.15rem;
}

/* --- Inbox Page --- */
.notification-toolbar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.notification-search-form {
    flex: 0 1 280px;
}

.notification-filter-pills {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.notification-filter-pill {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
}

.notification-inbox-card {
    border: none;
    border-radius: var(--h-radius-lg);
    overflow: hidden;
    box-shadow: var(--h-shadow);
}

.notification-inbox-header {
    background-color: var(--h-sage-dark);
    color: var(--h-text-on-dark);
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.notification-tab-toggle {
    display: flex;
    gap: 0.5rem;
}

.notification-tab {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--h-radius-sm);
    transition: all 0.15s;
}

.notification-tab.active {
    color: var(--h-text-on-dark);
    background-color: rgba(255, 255, 255, 0.2);
}

.notification-tab:hover {
    color: var(--h-text-on-dark);
}

.notification-inbox-body {
    min-height: 200px;
}

.notification-inbox-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--h-border-light);
    background-color: var(--h-parchment-light);
}

.notification-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--h-sepia);
}

.notification-empty-state .notification-empty-icon {
    font-size: 2.5rem;
}

/* --- Bulk Actions --- */
.notification-bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background-color: var(--h-parchment);
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
}

.notification-bulk-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--h-sepia);
}

.notification-checkbox-col {
    padding: 0.6rem 0.5rem 0.6rem 0.75rem;
    display: flex;
    align-items: flex-start;
    flex-shrink: 0;
}

.notification-row-wrapper {
    border-bottom: 1px solid var(--h-border-light);
}

.notification-row-wrapper:last-child {
    border-bottom: none;
}

.notification-row-wrapper .notification-row {
    border-bottom: none;
}

/* --- Notification Meters --- */
.notification-meter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--h-border-light);
}

.notification-meter-row:last-child {
    border-bottom: none;
}

.notification-meter-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.notification-meter-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--h-ink);
}

.notification-meter-badge {
    font-size: 0.75rem;
    flex-shrink: 0;
}

.notification-meter-action {
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* --- Mobile (< 576px) --- */
@media (max-width: 575.98px) {
    .notification-popup {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        border-radius: 0;
    }

    .notification-popup-arrow {
        display: none;
    }

    .notification-popup-body {
        max-height: calc(100vh - 120px);
    }

    .notification-filter-pills {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .notification-filter-pill {
        flex-shrink: 0;
    }
}

/* ─── Guest Dashboard ─── */

.dashboard-callout {
    background: var(--h-aged-ink);
    color: var(--h-parchment-light);
}

.dashboard-callout-title {
    color: var(--h-parchment-light);
}

.dashboard-callout-copy {
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.3;
    color: var(--h-parchment-light);
}

.dashboard-callout-muted {
    color: var(--h-parchment-dark);
    line-height: 1.3;
}

.dashboard-callout-phase {
    background: rgba(255, 255, 255, 0.08);
}

.dashboard-callout-accent {
    color: var(--h-gold);
}

.dashboard-callout-primary {
    background: var(--h-gold);
    color: var(--h-aged-ink);
    font-weight: 600;
}

.dashboard-callout-primary:hover,
.dashboard-callout-primary:focus {
    background: var(--h-gold-light);
    color: var(--h-aged-ink);
}

.dashboard-action-card {
    color: inherit;
}

.dashboard-action-button {
    background: var(--h-bg-elevated);
    cursor: pointer;
}

.dashboard-action-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
}

.dashboard-action-icon-lg {
    width: 48px;
    height: 48px;
}

.dashboard-action-icon-sm {
    width: 40px;
    height: 40px;
}

.dashboard-action-icon-neutral {
    background: var(--h-parchment);
    color: var(--h-aged-ink);
}

.dashboard-action-icon-info {
    background: var(--h-alert-info-bg);
    color: var(--h-blue-muted);
}

.dashboard-action-icon-warning {
    background: var(--h-alert-warning-bg);
    color: var(--h-amber-dark);
}

.dashboard-action-icon-success {
    background: var(--h-alert-success-bg);
    color: var(--h-sage-dark);
}

.dashboard-action-icon-danger {
    background: var(--h-alert-danger-bg);
    color: var(--h-rust);
}

.dashboard-action-title {
    color: var(--h-text);
}

.dashboard-action-description {
    line-height: 1.3;
}

.dashboard-membership-badge {
    font-size: 0.4em;
    vertical-align: middle;
}

.guest-explore-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.guest-explore-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--h-shadow-lg) !important;
}

.guest-section-sub {
    line-height: 1.3;
}

/* ─── Build hash tooltip ─── */
.build-hash-tooltip .tooltip-inner {
    font-size: 2rem;
    font-family: var(--bs-font-monospace, monospace);
    max-width: none;
}

/* ─── Calendar Grid ─── */

.calendar-grid {
    border-collapse: collapse;
}

.calendar-day-cell {
    height: 7rem;
    vertical-align: top;
    padding: 0.25rem;
}

/* Multi-day banner bars. The "banner" is rendered in the SAME slot index inside each
   covered day cell so the bars visually line up across a week row. The start cell
   carries the title; continuation cells carry just the background stripe.
   Flat-capped ends indicate the banner continues into an adjacent week. */
.calendar-banner {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 1.25rem;
    margin: 0 -0.25rem 0.125rem;  /* bleed to cell edges so bars join across cells */
    padding: 0.0625rem 0.375rem;
    background: var(--h-gold-light, #d9c08e);
    color: var(--h-aged-ink, #3d2b1f);
    font-size: 0.75rem;
    line-height: 1.1;
    overflow: hidden;
    white-space: nowrap;
}

.calendar-banner-cap-left {
    border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
    margin-left: 0;
}

.calendar-banner-cap-right {
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
    margin-right: 0;
}

/* Banners that continue across a week boundary keep flat caps on the crossing edge
   AND show a subtle arrow cue so the user knows the event extends off-screen. */
.calendar-banner-open-left {
    margin-left: 0;
}

.calendar-banner-open-right {
    margin-right: 0;
}

.calendar-banner-cue {
    font-size: 0.7rem;
    color: var(--h-aged-ink, #3d2b1f);
    flex: 0 0 auto;
}

.calendar-banner-link {
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1 1 auto;
    min-width: 0;
}

.calendar-banner-link:hover {
    text-decoration: underline;
}

/* Empty slot placeholder keeps per-day items vertically aligned with banner rows
   when some slots in the week are empty for this particular day. */
.calendar-banner-spacer {
    background: transparent;
    visibility: hidden;
}

/* Mobile: keep the table scrollable horizontally rather than letting banners force
   a reflow that squeezes columns below legibility. */
@media (max-width: 576px) {
    .calendar-grid {
        font-size: 0.75rem;
    }

    .calendar-day-cell {
        height: 6rem;
        padding: 0.125rem;
    }

    .calendar-banner {
        font-size: 0.7rem;
        padding: 0.0625rem 0.25rem;
    }
}

/* ==========================================================================
   Availability Calendar Grid
   ========================================================================== */

.avail-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.avail-cal-head {
    font-size: 0.7rem;
    color: var(--h-muted-text);
    text-align: center;
    padding: 4px 0;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.avail-cal-day {
    text-align: center;
    padding: 6px 2px;
    border-radius: var(--h-radius);
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color 0.15s, border-color 0.15s;
    user-select: none;
}

.avail-cal-day:hover {
    background-color: var(--h-bg-hover);
}

.avail-cal-day:focus-visible {
    outline: 2px solid var(--h-blue-muted);
    outline-offset: 1px;
}

.avail-cal-empty {
    visibility: hidden;
}

.avail-cal-weekend {
    background-color: var(--h-bg-hover);
}

.avail-cal-selected {
    background-color: var(--h-green-tint, #e8f5e9) !important;
    border-color: var(--h-green-muted, #81c784);
}

.avail-day-num {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
}

.avail-day-month {
    display: block;
    font-size: 0.65rem;
    color: var(--h-muted-text);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

@media (max-width: 576px) {
    .avail-cal-day {
        padding: 4px 1px;
    }

    .avail-day-num {
        font-size: 0.8rem;
    }

    .avail-day-month {
        font-size: 0.6rem;
    }
}

/* --- Shifts Header Redesign --- */

/* Tabs: .shifts-nav-tabs used to hand-roll its own nav-link look (hardcoded
   'Cormorant Garamond' font stack, own sizing); the global .nav-tabs .nav-link
   rule (site.css component layer) now covers this — same active gold
   underline, display font via --h-font-display token, spec-matching size.
   Markup keeps the shifts-nav-tabs class (harmless, used by shifts.js as a
   scoping selector) but no longer needs page CSS to look right. */

/* Hero Banner */
.shifts-hero-banner {
    background: var(--h-parchment-light, #faf3e6);
    border: 1px solid var(--h-parchment-dark, #e8d4ab);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
}
.shifts-hero-icon {
    color: var(--h-gold, #c9a96e);
}

/* Phase Multiselect Cards */
.phase-card {
    border: 2px solid var(--h-parchment-dark, #e8d4ab);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    background: var(--h-warm-white, #fefaf3);
}
.phase-card:hover {
    border-color: var(--h-gold-light, #d9c08e);
}
.phase-card-active.phase-card-build {
    border-color: var(--h-blue-muted, #5b7d8f);
    background-color: rgba(91, 125, 143, 0.08);
}
.phase-card-active.phase-card-event {
    border-color: var(--h-sage, #6b8f71);
    background-color: rgba(107, 143, 113, 0.08);
}
.phase-card-active.phase-card-strike {
    border-color: var(--h-sepia-light, #a69178);
    background-color: rgba(166, 145, 120, 0.08);
}

/* Phase card checkbox colors — match the phase border */
.phase-card-build .form-check-input:checked {
    background-color: var(--h-blue-muted, #5b7d8f);
    border-color: var(--h-blue-muted, #5b7d8f);
}
.phase-card-event .form-check-input:checked {
    background-color: var(--h-sage, #6b8f71);
    border-color: var(--h-sage, #6b8f71);
}
.phase-card-strike .form-check-input:checked {
    background-color: var(--h-sepia-light, #a69178);
    border-color: var(--h-sepia-light, #a69178);
}

/* Shifts toast — bottom-right, auto-dismiss */
.shifts-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1080;
}
.shifts-toast-container .alert {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    animation: shifts-toast-in 0.3s ease-out;
}
@keyframes shifts-toast-in {
    from { opacity: 0; transform: translateY(1rem); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hide the info icon button but keep the modal markup accessible */
.shifts-hidden-info-btn > button {
    display: none;
}

/* Tag preferred highlight */
.shift-tag-preferred {
    border-color: var(--h-gold-light, #d9c08e);
}

/* ── Department coverage pies (Volunteer /Shifts page) ─────────────── */
.dept-pie-tip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .35rem .3rem .7rem;
    margin: .25rem 0 .6rem;
    background: var(--h-alert-info-bg);
    color: var(--h-alert-info-text);
    border: 1px solid color-mix(in srgb, var(--h-alert-info-text) 20%, transparent);
    border-radius: 999px;
    font-size: .85rem;
    line-height: 1.2;
}
.dept-pie-tip[hidden] { display: none; }
.dept-pie-tip .fa-solid { font-size: 1rem; }
.dept-pie-tip-dismiss {
    appearance: none;
    background: transparent;
    border: 0;
    color: inherit;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 .25rem;
    margin-left: .25rem;
    cursor: pointer;
    opacity: .65;
    transition: opacity 120ms ease;
}
.dept-pie-tip-dismiss:hover { opacity: 1; }

.dept-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .5rem .3rem .7rem;
    margin: .25rem 0 .6rem;
    background: var(--h-vellum);
    color: var(--h-text);
    border: 1px solid var(--h-gold);
    border-radius: 999px;
    font-size: .85rem;
    line-height: 1.2;
    text-decoration: none;
    transition: background 120ms ease;
}
.dept-filter-chip:hover {
    background: var(--h-parchment-dark);
    color: var(--h-text);
}
.dept-filter-chip-label { font-weight: 600; }
.dept-filter-chip-x { font-size: 1.1rem; line-height: 1; opacity: .65; }
.dept-filter-chip:hover .dept-filter-chip-x { opacity: 1; }

.dept-pie-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .5rem;
    margin: .5rem 0 1rem;
}
.dept-pie {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem .5rem;
    aspect-ratio: 1 / 1;
    width: 100%;
    border: 1px solid var(--h-border);
    border-radius: var(--h-radius);
    background: var(--h-bg-card);
    color: var(--h-text);
    cursor: pointer;
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.dept-pie:hover {
    border-color: var(--h-gold);
    background: var(--h-vellum);
}
.dept-pie.selected {
    outline: 2px solid var(--h-gold);
    outline-offset: 1px;
    border-color: var(--h-gold);
    background: var(--h-vellum);
}
.dept-pie.is-subteam {
    border-inline-start: 3px solid var(--h-gold-light);
}
.dept-pie.is-subteam .dept-pie-name {
    font-style: italic;
}
.dept-pie-disc {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: conic-gradient(
        var(--h-chart-success) 0 var(--pct, 0%),
        var(--h-chart-muted) 0 100%
    );
}
.dept-pie.coverage-warning .dept-pie-disc {
    background: conic-gradient(
        var(--h-amber) 0 var(--pct, 0%),
        var(--h-chart-muted) 0 100%
    );
}
.dept-pie.coverage-critical .dept-pie-disc {
    background: conic-gradient(
        var(--h-rust) 0 var(--pct, 0%),
        var(--h-chart-muted) 0 100%
    );
}
.dept-pie.coverage-complete {
    opacity: .55;
}
.dept-pie.coverage-complete:hover,
.dept-pie.coverage-complete.selected {
    opacity: 1;
}
.dept-pie-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.15;
    font-size: .85rem;
    text-align: center;
    width: 100%;
    min-width: 0;
}
.dept-pie-name {
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.15;
}
.dept-pie-stat {
    color: var(--h-text-secondary);
    font-size: .75rem;
}

/* --- City planning map shell --- */
body.city-map-fullscreen {
    height: 100vh;
    overflow: hidden;
}

body.city-map-fullscreen .main-content {
    display: flex;
    max-width: 100vw;
    padding: 0;
    min-height: 0;
}

body.city-map-fullscreen main {
    display: flex;
    flex: 1;
    padding: 0;
    min-height: 0;
}

.city-map-page {
    --container-fill: var(--h-sepia);
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.city-map-container-page {
    --container-fill-selected: var(--h-gold);
}

.city-map-canvas {
    height: 100%;
    width: 100%;
}

.city-map-controls {
    z-index: 10;
}

.city-map-panel-label {
    font-size: 10px;
    letter-spacing: .05em;
}

.city-map-legend {
    font-size: 11px;
    line-height: 1.4;
}

.city-map-legend-swatch {
    flex-shrink: 0;
}

.city-map-container-body {
    fill: var(--container-fill);
    fill-opacity: .7;
}

.city-map-container-door {
    fill: var(--container-fill);
}

.city-map-image-thumb {
    height: 96px;
    object-fit: cover;
    border-radius: 4px;
}

.city-map-help-image {
    max-height: 250px;
    object-fit: contain;
    object-position: top;
}

.city-map-history-panel {
    width: 360px;
}

.city-map-add-select {
    width: 200px;
}

/* ── Shift card readability (issue #755) ───────────────────────────────
   Larger sans-serif text and higher-contrast ink so shift descriptions and
   fill counts on /Shifts and team rota views scan easily and pass WCAG AA
   against the parchment card background. */
.shift-description {
    font-family: var(--h-font-body);
    font-size: .95rem;        /* up from .small (~0.875em), restores full body scale */
    line-height: 1.5;
    color: var(--h-aged-ink-light);  /* #5a4535 — ~6.5:1 on parchment card (AA) */
}
.shift-fill-count {
    font-family: var(--h-font-body);
    font-size: .95rem;        /* up from <small> (~0.875em) */
    font-weight: 600;
    color: var(--h-aged-ink); /* #3d2b1f — high contrast on parchment card */
}

/* ── Barrio image carousel (issue #956) ─────────────────────────────────
   Fixed slide height so mixed-aspect images don't reflow the page as the
   carousel advances; object-fit crops instead of the box auto-sizing. */
.camp-carousel-img {
    width: 100%;
    height: 400px;
    display: block;
    object-fit: cover;
}

@media (max-width: 575.98px) {
    .camp-carousel-img {
        height: 220px;
    }
}

/* ── Budget/Finance figure strips (peterdrier/Humans, /Finance year page) ────
   The accordion header lives inside an <h2>, so the display serif leaked into
   the numbers and <small> shrank them to ~13px — unreadable for a money
   figure. These keep the figures in the body face at full size, with the
   label as a quiet caption above-the-line rather than another sentence. */
.budget-figures {
    font-family: var(--h-font-body);
    font-variant-numeric: tabular-nums;
    font-size: 0.95rem;
}

.budget-figure + .budget-figure {
    margin-left: 0.9rem;
    padding-left: 0.9rem;
    border-left: 1px solid var(--h-border-light);
}

.budget-figure-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--h-sepia);
}

.budget-figure-value {
    font-weight: 600;
    color: var(--h-aged-ink);
}

/* Holded actuals are a different kind of number from the budget's own — they
   come from the books. Gold reads as "other source" on parchment; the old
   Bootstrap text-info blue did not. */
.budget-figure-holded {
    color: var(--h-gold-dark);
}

.budget-subhead {
    font-family: var(--h-font-body);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--h-sepia);
    background: var(--h-vellum);
}

.budget-table {
    font-family: var(--h-font-body);
    font-variant-numeric: tabular-nums;
}
