/* ============================================================
   Global Accessibility Styles — Reading CIC
   Requirements: High contrast, large text, large tap targets
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --color-primary:     #260140;
    --color-primary-dk:  #160026;
    --color-accent:      #ffbf47;
    --color-success:     #2e7d32;
    --color-danger:      #d32f2f;
    --color-text:        #111111;
    --color-text-muted:  #444444;
    --color-bg:          #ffffff;
    --color-bg-alt:      #f4f6f9;
    --color-border:      #000000;
    --font-base:         system-ui, -apple-system, 'Segoe UI', sans-serif;
    --radius:            10px;
    --min-tap:           48px; /* WCAG 2.5.5 minimum touch target */
}

html {
    font-size: 18px; /* Accessible base size */
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-base);
    color: var(--color-text);
    background-color: var(--color-bg);
    margin: 0;
    line-height: 1.6;
}

/* ── Skip link ───────────────────────────────────────────── */
.skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: 0.75rem 1.25rem;
    background: var(--color-primary);
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 0 0 var(--radius) var(--radius);
    text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ── Form hint text ───────────────────────────────────────────────────── */
.form-hint {
    display: block;
    font-size: .75rem;
    font-weight: 400;
    color: #777;
    margin-top: .15rem;
}

.form-hint code {
    background: #eee;
    border-radius: 3px;
    padding: .05em .3em;
    font-size: .9em;
}

/* ── Focus ring (visible, high-contrast) ────────────────── */
:focus-visible {
    outline: 4px solid var(--color-accent);
    outline-offset: 3px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn-large {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--min-tap);
    padding: 0.85rem 2rem;
    font-size: 1.2rem;
    font-weight: 700;
    border: 3px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s, transform 0.1s;
}
.btn-large:active { transform: scale(0.98); }

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus-visible {
    background-color: var(--color-primary-dk);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.btn-secondary:hover, .btn-secondary:focus-visible {
    background-color: #e8f0fa;
}

.btn-success {
    background-color: var(--color-success);
    color: #fff;
}

.btn-large:disabled {
    background-color: #9e9e9e;
    cursor: not-allowed;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-control-large {
    font-size: 1.15rem;
    padding: 0.85rem 1rem;
    border: 3px solid var(--color-border);
    border-radius: var(--radius);
    width: 100%;
    min-height: var(--min-tap);
    background: #fff;
}
.form-control-large:focus-visible {
    border-color: var(--color-primary);
    outline: 4px solid var(--color-accent);
    outline-offset: 0;
}

.form-label {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--color-text);
    display: block;
}

.form-group {
    /*margin-bottom: 1.5rem;*/
    display: flex;
    flex-direction: column;
}

.validation-msg {
    color: var(--color-danger);
    font-size: 1rem;
    margin-top: 0.3rem;
}

.error-banner {
    background-color: #fdecea;
    color: var(--color-danger);
    border: 2px solid var(--color-danger);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.success-banner {
    background-color: #e8f5e9;
    color: var(--color-success);
    border: 2px solid var(--color-success);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* ── Layout helpers ──────────────────────────────────────── */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.not-found-container {
    text-align: center;
    padding: 4rem 1.5rem;
}
.not-found-container h1 { font-size: 2.5rem; }
.not-found-container p  { font-size: 1.3rem; margin-bottom: 2rem; }

/* ── Spinner ─────────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    border: 3px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: 0.5em;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Splash / Loading screen ─────────────────────────────── */
.splash-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.loading-progress {
    display: block;
    width: 8rem;
    height: 8rem;
    margin-bottom: 1rem;
}
.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}
.loading-progress circle:last-child {
    stroke: var(--color-primary);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}
.loading-progress-text {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--color-text-muted);
}
.loading-progress-text::after {
    content: var(--blazor-load-percentage-text, "Loading…");
}

/* ── Blazor error UI ─────────────────────────────────────── */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 1rem;
}
#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    font-size: 1.1rem;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
    html { font-size: 16px; }
    .btn-large { width: 100%; }
}

/* ============================================================
   Site Header & Navigation
   ============================================================ */

.site-header {
    background-color: var(--color-primary);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ── Logo row (always full width) ─────────────────────────── */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.logo-icon { font-size: 1.4rem; }
.logo-text  { white-space: nowrap; }

/* ── Hamburger toggle (mobile only) ──────────────────────── */
.nav-toggle {
    display: none;
    background: none;
    border: 2px solid rgba(255,255,255,0.7);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    min-height: var(--min-tap);
    min-width: var(--min-tap);
    color: #fff;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    position: relative;
    transition: transform 0.2s;
}
.hamburger::before { content: ""; position: absolute; top: -7px; }
.hamburger::after  { content: ""; position: absolute; top:  7px; }

/* ── Primary nav row ─────────────────────────────────────── */
.primary-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;          /* items wrap to new row when narrow */
    gap: 0.25rem 0;
    padding: 0.35rem 0;
}

.primary-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;          /* nav items wrap naturally */
    align-items: center;
    gap: 0;
    flex: 1;
}

.primary-nav ul li { display: flex; }

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    min-height: var(--min-tap);
    white-space: nowrap;
    transition: background-color 0.15s;
}
.nav-link:hover,
.nav-link:focus-visible { background-color: rgba(255,255,255,0.18); }
.nav-link.active         { background-color: rgba(255,255,255,0.28); }

.nav-link-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* ── Language switcher ───────────────────────────────────── */
.lang-switcher {
    display: flex;
    gap: 0.4rem;
    margin-left: auto;
    padding: 0.25rem 0;
}

.lang-btn {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.5);
    color: #fff;
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    min-height: var(--min-tap);
    min-width: var(--min-tap);
    transition: background-color 0.15s;
}
.lang-btn:hover       { background: rgba(255,255,255,0.3); }
.lang-btn.lang-active { background: rgba(255,255,255,0.35); border-color: #fff; }

/* ── Mobile nav (hamburger collapsed) ───────────────────── */
@media (max-width: 768px) {
    .nav-toggle { display: flex; align-items: center; justify-content: center; }

    .primary-nav {
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 0.5rem 0;
        border-top: 1px solid rgba(255,255,255,0.2);
    }

    .primary-nav.nav-open { display: flex; }

    .primary-nav ul {
        flex-direction: column;
        width: 100%;
    }

    .primary-nav ul li { width: 100%; }

    .nav-link { width: 100%; }

    .lang-switcher {
        margin-left: 0;
        padding: 0.5rem 0.75rem;
        border-top: 1px solid rgba(255,255,255,0.2);
    }
}

/* ── Site main content ───────────────────────────────────── */
.site-main {
    min-height: calc(100vh - 120px);
}

/* ============================================================
   MemberListPage toolbar / pagination
   ============================================================ */

.ml-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ml-pagesize {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

.pagesize-select {
    font-size: 1rem;
    padding: 0.35rem 0.6rem;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    background: #fff;
    min-height: var(--min-tap);
    cursor: pointer;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
}

.btn-pagination {
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    min-height: var(--min-tap);
    transition: background-color 0.15s;
}
.btn-pagination:hover:not(:disabled) { background: var(--color-primary-dk); }
.btn-pagination:disabled { background: #9e9e9e; cursor: not-allowed; }

.page-info {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

/* ============================================================
   Staff Page Theme Override
   Applies to all pages under /staff/*, /member-fee,
   /staff/fee-payments, /staff/management etc.
   Resets to normal contrast, normal font sizes, standard blue.
   ============================================================ */
.staff-page {
    /* Override CSS variables for the staff context */
    --color-primary:     #0d6efd;
    --color-primary-dk:  #0a58ca;
    --color-accent:      #ffc107;
    --color-border:      #ced4da;
    --color-text:        #212529;
    --color-text-muted:  #6c757d;
    --color-bg-alt:      #f8f9fa;
    --radius:            6px;
    --min-tap:           36px;
    font-size: 14px;
}

/* ── Normal-size form controls ──────────────────────────── */
.staff-page .form-control-large,
.staff-page .form-control {
    font-size: 0.875rem;
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    min-height: unset;
}
.staff-page .form-control-large:focus-visible,
.staff-page .form-control:focus-visible {
    border-color: var(--color-primary);
    outline: 2px solid rgba(13,110,253,0.25);
    outline-offset: 0;
}

/* ── Normal-size labels ─────────────────────────────────── */
.staff-page .form-label {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* ── Normal-size headings ───────────────────────────────── */
.staff-page h1 { font-size: 1.5rem;  font-weight: 700; }
.staff-page h2 { font-size: 1.25rem; font-weight: 700; }
.staff-page h3 { font-size: 1.1rem;  font-weight: 600; }

/* ── Normal-weight text ─────────────────────────────────── */
.staff-page p,
.staff-page td,
.staff-page th,
.staff-page li { font-size: 0.875rem; }

/* ── Compact tables ──────────────────────────────────────── */
.staff-page table { font-size: 0.875rem; }
.staff-page th,
.staff-page td {
    padding: 0.4rem 0.6rem;
}

/* ── Status/badge selects ────────────────────────────────── */
.staff-page .status-select,
.staff-page .pagesize-select {
    font-size: 0.875rem;
    min-height: unset;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--color-border);
}

/* ── Pagination ──────────────────────────────────────────── */
.staff-page .btn--pagination,
.staff-page .btn-pagination {
    min-height: unset;
    font-size: 0.875rem;
    padding: 0.35rem 0.9rem;
}

/* ── Error / success banners ─────────────────────────────── */
.staff-page .error-banner,
.staff-page .success-banner {
    font-size: 0.875rem;
    padding: 0.6rem 0.9rem;
}

/* ── Alert utilities (Bootstrap-style used in staff pages) ── */
.staff-page .alert {
    padding: 0.6rem 0.9rem;
    font-size: 0.875rem;
    border-radius: var(--radius);
    border: 1px solid transparent;
    margin-bottom: 1rem;
}
.staff-page .alert-danger  { background: #f8d7da; color: #842029; border-color: #f5c2c7; }
.staff-page .alert-success { background: #d1e7dd; color: #0f5132; border-color: #badbcc; }
.staff-page .alert-warning { background: #fff3cd; color: #664d03; border-color: #ffecb5; }

/* ── Card component ─────────────────────────────────────── */
.staff-page .card {
    border: 1px solid #dee2e6;
    border-radius: var(--radius);
    background: #fff;
}
.staff-page .card-header {
    padding: 0.6rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.9rem;
    font-weight: 600;
}
.staff-page .card-body {
    padding: 0.75rem 1rem;
}

/* ── Section title ──────────────────────────────────────── */
.staff-page .section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text);
}

/* ── Page container spacing ─────────────────────────────── */
.staff-page .page-container {
    padding: 1.25rem 1.25rem;
}

/* ── Tier cards (MemberFee page) ─────────────────────────── */
.staff-page .tier-card {
    border: 1px solid #dee2e6;
    border-radius: var(--radius);
}
.staff-page .tier-amount { font-size: 1.25rem; }
.staff-page .tier-label  { font-size: 0.875rem; }
.staff-page .tier-months { font-size: 0.8rem; }

/* ── Modal ──────────────────────────────────────────────── */
.staff-page .modal-header { padding: 0.75rem 1rem; }
.staff-page .modal-body   { padding: 0.75rem 1rem; font-size: 0.875rem; }
.staff-page .modal-actions { padding: 0.75rem 1rem; gap: 0.5rem; }

/* ── Search / filter areas ──────────────────────────────── */
.staff-page .ml-search.card,
.staff-page .ap-filters.card {
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
}

/* ── Page-info text ─────────────────────────────────────── */
.staff-page .page-info {
    font-size: 0.875rem;
}

/* ── Buttons: keep btn system but override primary colour ── */
.staff-page .btn--primary {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}
.staff-page .btn--primary:hover:not(:disabled),
.staff-page .btn--primary:focus-visible:not(:disabled) {
    background-color: var(--color-primary-dk);
    border-color: var(--color-primary-dk);
}
.staff-page .btn--outline {
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.staff-page .btn--outline:hover:not(:disabled),
.staff-page .btn--outline:focus-visible:not(:disabled) {
    background-color: var(--color-primary);
    color: #fff;
}
.staff-page .btn--back-link { color: var(--color-primary); }
.staff-page .btn--back-link:hover:not(:disabled) { color: var(--color-primary-dk); }
.staff-page .btn--upload {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

/* ── Focus ring ─────────────────────────────────────────── */
.staff-page :focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ============================================================
   Staff Data Table System  (.staff-table)
   Shared by all staff pages — replaces per-page sa-table,
   ap-table, fee-table, ml-table, rfp-table definitions.
   ============================================================ */

/* ── Page header row (title + action button) ────────────── */
.staff-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.staff-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* ── Page-wide container ────────────────────────────────── */
.staff-container {
    max-width: 1200px;
    margin: 1rem auto;
    padding: 0 1rem;
}

/* ── Table scroll wrapper ───────────────────────────────── */
.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Base data table ────────────────────────────────────── */
.staff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: #fff;
}

.staff-table th,
.staff-table td {
    padding: 0.45rem 0.75rem;
    border: 1px solid #dee2e6;
    text-align: left;
    vertical-align: top;
}

.staff-table thead th {
    background: #f0f2f5;
    font-weight: 700;
    font-size: 0.8rem;
    border-bottom: 2px solid #ced4da;
    white-space: nowrap;
    vertical-align: middle;
}

.staff-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}
.staff-table thead th.sortable:hover { background: #e2e6ea; }

.staff-table tbody tr:hover { background: #f8f9fa; }

/* ── Row-state highlights ───────────────────────────────── */
.staff-table tbody tr.row-inactive    { opacity: 0.55; }
.staff-table tbody tr.row-pending     { background: #fff3cd; }
.staff-table tbody tr.row-suspended   { background: #f8d7da; }
.staff-table tbody tr.row-expiring    { background: #fff3cd; }
.staff-table tbody tr.row-expired     { background: #f8d7da; }
.staff-table tbody tr.row-dimmed      { background: #e2e3e5; color: #6c757d; }

/* ── Sub-row (indent) ───────────────────────────────────── */
.staff-table tbody tr.row-sub td      { background: #f0f4f8; font-size: 0.8rem; }
.staff-table tbody tr.row-sub:hover td { background: #e3ebf5; }
.staff-table .cell-indent             { padding-left: 1.5rem !important; font-weight: 500; }
.staff-table .cell-muted              { color: #6c757d; font-style: italic; }

/* ── Compact modifier ───────────────────────────────────── */
.staff-table--compact th,
.staff-table--compact td {
    padding: 0.3rem 0.55rem;
    font-size: 0.8rem;
}
.staff-table--compact .nowrap { white-space: nowrap; }

/* ── Utility cells ──────────────────────────────────────── */
.staff-table .cell-thumb  { width: 50px; padding: 0.2rem 0.4rem; }
.staff-table .cell-num    { width: 32px; text-align: center; color: #6c757d; }
.staff-table .cell-price  { width: 90px; }
.staff-table .cell-nowrap { white-space: nowrap; }

/* ── Thumbnail inside table ─────────────────────────────── */
.staff-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

/* ── Badges ─────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 10px;
    white-space: nowrap;
}
.badge-success     { background: #d1e7dd; color: #0f5132; }
.badge-secondary   { background: #e2e3e5; color: #383d41; }
.badge-warning     { background: #fff3cd; color: #664d03; }
.badge-warn        { background: #fff3cd; color: #664d03; }
.badge-danger      { background: #f8d7da; color: #842029; }
.badge-info        { background: #d1ecf1; color: #0c5460; }
.badge-role-admin       { background: #f8d7da; color: #842029; }
.badge-role-coordinator { background: #d1ecf1; color: #0c5460; }
.badge-role-viewer      { background: #d1e7dd; color: #0f5132; }
.badge-member      { background: var(--color-primary); color: #fff; }
.badge-guest       { background: #e2e3e5; color: #383d41; border: 1px solid #c6c8ca; }
.badge-nonmember   { background: #f8d7da; color: #58151c; border: 1px solid #f1aeb5; }

/* ── Action button cluster ──────────────────────────────── */
.result-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
}

/* ── Section divider title ──────────────────────────────── */
.staff-section-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-text);
}

/* ── Loading / empty state ──────────────────────────────── */
.staff-empty,
.staff-loading {
    color: #6c757d;
    font-style: italic;
    padding: 1.5rem 0;
    text-align: center;
}

/* ── Stats bar ──────────────────────────────────────────── */
.staff-stats {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

/* ── Image upload area ──────────────────────────────────── */
.image-upload-area {
    border: 2px dashed #ced4da;
    border-radius: 6px;
    padding: 0.75rem;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.image-preview-thumb {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}
.image-placeholder {
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    border-radius: 6px;
    color: #6c757d;
    font-size: 0.85rem;
}
.image-upload-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.upload-error { color: #d32f2f; font-size: 0.8rem; }
.upload-ok    { color: #2e7d32; font-size: 0.8rem; }
.image-hint   { font-size: 0.75rem; color: #6c757d; margin: 0; }

/* ── Field grid (2-col form layout) ────────────────────── */
.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.25rem;
}
.form-group--full { grid-column: 1 / -1; }

/* ── Action row (Cancel | Save) ─────────────────────────── */
.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.25rem;
}

/* ── Error / success banners (full colours, standalone) ─── */
.error-banner {
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #842029;
    padding: 0.6rem 0.9rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}
.success-banner {
    background: #d1e7dd;
    border: 1px solid #badbcc;
    color: #0f5132;
    padding: 0.6rem 0.9rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
    .staff-page-header { flex-direction: column; align-items: flex-start; }
    .staff-container   { padding: 0 0.5rem; }
    .field-grid        { grid-template-columns: 1fr; }
    .form-group--full  { grid-column: 1; }

    .staff-table { font-size: 0.78rem; }
    .staff-table th,
    .staff-table td { padding: 0.35rem 0.4rem; }

    .result-actions { flex-wrap: wrap; gap: 0.25rem; }
}

@media (max-width: 480px) {
    /* Nothing is made smaller than this. Below it a staff table is not readable, and the
       answer there is .staff-table--cards below, not a smaller font. */
    .staff-table th,
    .staff-table td { padding: 0.25rem 0.35rem; }

    .pagination { gap: 0.5rem; }
}

/* =============================================================
   Staff-admin density modifier (.staff-admin)
   Applied to staff-only pages (members, participants).
   ============================================================= */
.staff-admin {
    font-size: 0.82rem;
}
.staff-admin .staff-page-header h1 {
    font-size: 1.2rem;
}
.staff-admin .staff-page-header {
    margin-bottom: 0.6rem;
}
.staff-admin.staff-container {
    max-width: 1600px;
}
.staff-admin .filter-card {
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
}

/* Inline filter row */
.filter-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.35rem 0.65rem;
}
.filter-inline .fi-group {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}
.filter-inline .fi-group--wide   { min-width: 175px; flex: 2 1 175px; }
.filter-inline .fi-group--med    { min-width: 130px; flex: 1 1 130px; }
.filter-inline .fi-group--narrow { min-width: 90px;  flex: 1 1 90px; }
.filter-inline label {
    font-size: 0.71rem;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    margin: 0;
    line-height: 1.2;
}
.filter-inline input,
.filter-inline select {
    font-size: 0.78rem;
    padding: 0.18rem 0.4rem;
    height: 1.8rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}
.filter-inline .fi-actions {
    display: flex;
    align-items: flex-end;
    gap: 0.3rem;
    flex-shrink: 0;
    padding-bottom: 0.02rem;
}

/* Denser table */
.staff-admin .staff-table {
    font-size: 0.78rem;
}
.staff-admin .staff-table th,
.staff-admin .staff-table td {
    padding: 0.2rem 0.4rem;
}
.staff-admin .staff-table thead th {
    font-size: 0.73rem;
}

/* Participant list in cell */
.staff-admin .participant-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.staff-admin .participant-list li {
    padding: 0.08rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.18rem;
    align-items: baseline;
    border-bottom: 1px dotted #dee2e6;
}
.staff-admin .participant-list li:last-child {
    border-bottom: none;
}

/* Member search/filter bar */
.staff-admin .ml-search.card {
    padding: 0.4rem 0.65rem;
    margin-bottom: 0.4rem;
}

/* Smaller stats bar */
.staff-admin .staff-stats {
    font-size: 0.78rem;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.35rem;
}

/* ── Phones: the filter bar becomes a compact two-column grid ──────────────────
   The --wide / --med / --narrow modifiers set flex-basis, and in a column flex
   container the main axis is vertical, so that basis became the *height*: every
   field rendered as a 90-175 px band down the phone. A grid gives each field one
   row of its own. Inputs are 16 px because iOS zooms the whole page when a smaller
   control is focused, which left the page sideways and half off-screen. */
@media (max-width: 768px) {
    .staff-admin .filter-card { padding: 0.4rem 0.55rem; }

    .filter-inline {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.4rem 0.5rem;
        align-items: end;
    }
    .filter-inline .fi-group,
    .filter-inline .fi-group--wide,
    .filter-inline .fi-group--med,
    .filter-inline .fi-group--narrow {
        flex: none;
        min-width: 0;
        width: auto;
    }
    .filter-inline .fi-group--wide,
    .filter-inline .fi-group--med { grid-column: 1 / -1; }

    .filter-inline .fi-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        padding-bottom: 0;
    }

    .filter-inline input,
    .filter-inline select {
        height: 2.3rem;
        font-size: 1rem;
        padding: 0.25rem 0.45rem;
    }
    .filter-inline .fi-actions .btn { min-height: 42px; }
}

/* Folded filter panel: one row saying what it is, and how much of the list is
   currently being filtered while it is out of sight. */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.filter-bar-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.filter-bar-note {
    font-size: 0.76rem;
    color: #6c757d;
}
.filter-bar-note strong {
    color: #842029;
}

/* ── Phones: a table the phone cannot show across becomes one card per row ──────
   Opt-in. A table takes .staff-table--cards and every cell carries
   data-label="<the text of its column header>", which is what stands in for the
   header row once the header row is gone. Tables without the class keep scrolling
   sideways as before. */
@media (max-width: 768px) {
    .staff-table--cards,
    .staff-table--cards > tbody { display: block; width: 100%; }
    .staff-table--cards > thead { display: none; }

    .staff-table--cards > tbody > tr {
        display: block;
        border: 1px solid #dee2e6;
        border-radius: 10px;
        background: #fff;
        margin-bottom: 0.6rem;
        overflow: hidden;
    }

    /* Every rule here is scoped to the row's own cells: a participant cell contains its
       own small table, and those cells keep their own table layout inside the card.
       The .staff-admin pairing is there to out-rank the density rules that page class
       applies to its tables. */
    .staff-table--cards > tbody > tr > td,
    .staff-admin .staff-table--cards > tbody > tr > td {
        display: grid;
        grid-template-columns: 33% 1fr;
        gap: 0.5rem;
        border: none;
        border-bottom: 1px solid #eef1f4;
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
    }
    .staff-table--cards > tbody > tr > td:last-child,
    .staff-admin .staff-table--cards > tbody > tr > td:last-child { border-bottom: none; }
    .staff-table--cards > tbody > tr > td::before,
    .staff-admin .staff-table--cards > tbody > tr > td::before {
        content: attr(data-label);
        font-size: 0.74rem;
        font-weight: 700;
        color: #555;
    }

    /* The lists inside a cell keep their own lines, and the icon buttons in a row are
       the tap targets on a phone. */
    .staff-table--cards .p-inner-table { width: 100%; }
    .staff-table .btn--sm { min-height: 36px; min-width: 36px; }

    /* On a phone the per-participant columns are separate blocks, so each line says
       whose it is. On a desktop the columns already line up and the name would only
       be a duplicate. */
    .pt-who { display: none; }
    .staff-table--cards .pt-who {
        display: block;
        font-size: 0.74rem;
        color: #6c757d;
    }
}

/* =============================================================
   Staff hub pages
   Card-grid landing pages: /staff/ticketing, /staff/goldengroup,
   /staff/admin. One grid style shared by all three so the hubs look
   the same wherever a staff member lands.
   ============================================================= */
.hub-container { max-width: 900px; margin: 2rem auto; padding: 0 1.5rem; }
.hub-title { color: var(--color-text); }
.hub-note { color: var(--color-text-muted); }
.hub-denied { background: var(--color-bg-alt); border-radius: 10px; padding: 1.25rem; color: var(--color-text-muted); }
.hub-login-link { color: var(--color-primary); font-weight: 700; }
.hub-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
.hub-card { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; min-height: 140px; padding: 1.5rem; border: 2px solid var(--color-border); border-radius: 14px; background: #fff; text-decoration: none; color: var(--color-text); }
.hub-card:hover,
.hub-card:focus-visible { border-color: var(--color-primary); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.hub-card-icon { font-size: 2rem; }
.hub-card-title { font-size: 1.35rem; font-weight: 800; }
.hub-card-desc { color: var(--color-text-muted); font-size: .95rem; }
.hub-section-title { font-size: 1.1rem; font-weight: 800; color: var(--color-text); margin: 2rem 0 0; padding-bottom: .3rem; border-bottom: 2px solid var(--color-primary); }

@media (max-width: 600px) {
    .hub-container { padding: 0 1rem; margin-top: 1rem; }
    .hub-cards { grid-template-columns: 1fr; gap: .9rem; }
    .hub-card { min-height: 110px; padding: 1.1rem; }
}
