@font-face {
    font-family: Montserrat;
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/montserrat-latin.woff2") format("woff2");
}

:root {
    color-scheme: light;
    font-family: Montserrat, "Helvetica Neue", Arial, sans-serif;
    color: #0a2533;
    background: #f3f5f7;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
a { color: #005379; }
a:hover { color: #00364f; }
input, button { font: inherit; }
:focus-visible { outline: 3px solid #005379; outline-offset: 3px; }
.admin-header :focus-visible { outline-color: #fffb4c; }
.skip-link { position: absolute; top: -100px; left: 16px; padding: 12px; background: #fff; z-index: 1; }
.skip-link:focus { top: 12px; }

.admin-header {
    background: #005379;
    padding: 14px 40px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 32px;
}
.admin-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; }
.event-brand, .event-brand:hover { color: #fffb4c; text-decoration: none; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.event-brand strong { font-size: 30px; font-weight: 700; }
.area-label { color: #fff; font-size: 15px; font-weight: 500; }
.partner-logos { display: flex; align-items: center; gap: 16px; }
.partner-logos img { display: block; height: auto; }
.eagle-logo { width: 120px; }
.via-logo { width: 44px; }
.logo-divider { width: 1px; height: 40px; background: #fffb4c; }

.login-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 64px 24px; }
.login-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: #fff;
    border: 1px solid #d5dce2;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}
h1 { margin: 0; font-size: 26px; font-weight: 700; color: #005379; }
.login-card h1 { margin-bottom: 4px; }
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field label { font-size: 14px; font-weight: 600; }
.form-field input { width: 100%; height: 48px; padding: 0 14px; border: 1.5px solid #8a99a6; border-radius: 4px; background: #fff; color: #0a2533; font-size: 16px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 12px 24px; border: 0; border-radius: 4px; background: #005379; color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.button:hover { background: #00364f; }
.login-button { margin-top: 6px; width: 100%; }
.message { margin: 0; padding: 12px; border-radius: 4px; font-size: 14px; line-height: 1.6; }
.message-error { color: #862626; background: #fff0f0; border: 1px solid #e5baba; }
.message-success { color: #215b36; background: #edf8f0; border: 1px solid #b9d6c1; }

.admin-main { width: 100%; max-width: 1440px; margin: 0 auto; padding: 40px; }
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.admin-panel { background: #fff; border: 1px solid #d5dce2; border-radius: 8px; padding: 24px; line-height: 1.6; }
.admin-panel p { margin: 0; }

@media (max-width: 600px) {
    .admin-header { padding: 16px 20px; }
    .admin-heading { flex-direction: column; gap: 4px; }
    .login-main { padding: 32px 20px; }
    .login-card { padding: 28px 24px; }
    .admin-main { padding: 28px 20px; }
}

[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.header-logout { min-height: 42px; padding: 10px 20px; border: 1px solid #fff; margin-left: 12px; }
.registrations-main { max-width: none; }
.readonly-label, .result-count, .table-help { color: #526775; font-size: 14px; }
.totals-section { margin-bottom: 28px; }
.attendance-totals { display: flex; flex-wrap: wrap; gap: 20px; margin: 0; }
.total-card { display: flex; align-items: center; gap: 24px; flex: 0 1 280px; min-width: 0; padding: 20px 28px; background: #fff; border: 1px solid #d5dce2; border-radius: 8px; }
.total-card dt { color: #435765; font-size: 16px; font-weight: 700; white-space: nowrap; }
.total-card dd { margin: 0; color: #005379; font-size: clamp(32px, 4vw, 52px); line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; }
.totals-scope { margin: 12px 0 0; color: #526775; font-size: 13px; line-height: 1.5; }
.table-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 20px; }
.search-field { width: 420px; max-width: 100%; }
.result-count { margin: 0 0 14px auto; }
.secondary-button { min-height: 48px; background: #fff; color: #005379; border: 1px solid #a0b0bc; }
.secondary-button:hover { background: #e8f1f6; }
.button:disabled { opacity: .5; cursor: default; }
.table-help { margin: 20px 0 18px; line-height: 1.6; }
#table-error, #export-error { margin: 16px 0; }
#export-status:empty { margin: 0; }
.text-button { border: 0; background: transparent; padding: 6px 0; color: #005379; cursor: pointer; font-weight: 600; }
.text-button:hover { text-decoration: underline; }

#registration-table { min-height: 240px; border: 1px solid #d5dce2; border-radius: 6px; background: #fff; font-family: inherit; font-size: 14px; }
#registration-table .tabulator-header { background: #e6ebef; color: #0a2533; border-bottom: 1px solid #cbd6de; }
#registration-table .tabulator-col { background: #e6ebef; border-right: 1px solid #d5dce2; }
#registration-table .tabulator-col-content { padding: 12px 10px; }
#registration-table .tabulator-col-title { overflow: visible; }
#registration-table .tabulator-col.tabulator-sortable:hover { background: #dce6ec; }
#registration-table .tabulator-row { background: #fff; color: #3f5866; }
#registration-table .tabulator-row.tabulator-row-even { background: #fbfcfd; }
#registration-table .tabulator-row:hover { background: #eff6fa; }
#registration-table .tabulator-cell { padding: 14px 10px; border-right: 1px solid #e0e6eb; border-bottom: 1px solid #e0e6eb; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
#registration-table .tabulator-cell:focus { outline: 2px solid #005379; outline-offset: -2px; }
#registration-table .tabulator-col:focus-visible { outline-offset: -3px; }
.column-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.column-filter-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 30px; width: 30px; height: 30px; padding: 5px; border: 1px solid #bdcbd6; border-radius: 4px; background: #fff; color: #526775; cursor: pointer; }
.column-filter-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.column-filter-button.filter-active { color: #fff; background: #005379; border-color: #005379; }
.attendance { display: inline-block; min-width: 54px; padding: 1px 12px; border-radius: 20px; text-align: center; font-weight: 600; }
.attendance-yes { color: #fff; background: #005379; border: 1px solid #005379; }
.attendance-no { color: #526775; background: #fff; border: 1px solid #a0b0bc; }

.filter-dialog { position: fixed; margin: 0; width: 310px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); padding: 18px; border: 1px solid #bdcbd6; border-radius: 6px; background: #fff; color: #0a2533; box-shadow: 0 8px 30px #0a253326; font: inherit; }
.filter-dialog::backdrop { background: transparent; }
.filter-dialog h2 { margin: 0; font-size: 16px; }
.filter-dialog p { margin: 8px 0 12px; font-size: 13px; color: #526775; }
.filter-dialog input[type="search"] { width: 100%; min-height: 40px; border: 1px solid #a0b0bc; padding: 8px; border-radius: 4px; }
.filter-values { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; margin: 12px 0; font-size: 14px; }
.filter-values label { display: flex; align-items: start; gap: 10px; padding: 7px 2px; overflow-wrap: anywhere; cursor: pointer; }
.filter-values input { width: 18px; height: 18px; flex: 0 0 18px; margin: 1px 0; accent-color: #005379; }
.filter-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid #e0e6eb; padding-top: 12px; }
.filter-actions .button { min-height: 40px; padding: 8px 16px; font-size: 14px; }

@media (max-width: 600px) {
    .registrations-main .admin-toolbar { gap: 10px; }
    .attendance-totals { gap: 12px; }
    .total-card { flex: 1 1 140px; gap: 14px; padding: 16px; }
    .total-card dt { font-size: 14px; }
    .table-toolbar { gap: 12px; }
    .search-field { width: 100%; }
    .result-count { margin: 0 auto 14px 0; }
    .header-logout { margin-left: 4px; }
}
