/* Shooter recruitment — shared styles for the public form and admin panel. */

:root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --surface-2: #f7f7f8;
    --text: #1f2328;
    --muted: #6b7078;
    --border: #e3e4e8;
    --border-strong: #cfd2d8;
    --primary: #3a3f47;
    --primary-hover: #24282e;
    --primary-fg: #ffffff;
    --focus: #5b6470;
    --danger: #c62828;
    --danger-bg: #fdecec;
    --success: #1b7a3a;
    --success-bg: #e8f6ed;
    --info-bg: #f0f1f3;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--primary); }
a:hover { color: var(--primary-hover); }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.05rem; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: 820px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 1400px; margin: 0 auto; padding: 0 16px; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); font-size: .9em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.inline { display: inline; }

/* ---------- Brand & headers ---------- */

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: inherit; text-decoration: none; }
.brand-mark {
    width: 22px; height: 22px; border-radius: 50%;
    background: radial-gradient(circle, var(--primary) 0 22%, transparent 23% 42%, var(--primary) 43% 58%, transparent 59% 76%, var(--primary) 77%);
    flex: none;
}
.brand-logo { height: 30px; width: auto; max-width: 140px; object-fit: contain; flex: none; }


.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 2px; background: var(--surface); }
.lang-switch a { text-decoration: none; color: var(--muted); font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.lang-switch a.active { background: var(--primary); color: var(--primary-fg); }

.public-main { padding-top: 40px; padding-bottom: 32px; }
.public-footer { padding-bottom: 40px; color: var(--muted); font-size: .9rem; text-align: center; }

.admin-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.admin-header-inner { display: flex; align-items: center; gap: 24px; min-height: 58px; flex-wrap: wrap; }
.admin-nav { display: flex; gap: 4px; flex: 1; }
.admin-nav a { text-decoration: none; color: var(--muted); font-weight: 500; padding: 8px 12px; border-radius: var(--radius-sm); }
.admin-nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-nav a.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--primary); }
.admin-user { display: flex; align-items: center; gap: 12px; }
.user-name { font-size: .9rem; color: var(--muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-main { padding-top: 24px; padding-bottom: 48px; }

.form-status {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
    font-size: .8rem; font-weight: 600; text-decoration: none; white-space: nowrap; border: 1px solid;
}
.form-status .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.form-status.is-open { color: var(--success); background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.form-status.is-closed { color: var(--muted); background: var(--surface-2); border-color: var(--border); }
a.form-status:hover { filter: brightness(.96); }

/* ---------- Cards, flash ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}
.card.narrow { max-width: 480px; margin: 40px auto; }
.card.empty { text-align: center; color: var(--muted); padding: 40px; }
.table-card { padding: 0; overflow-x: auto; }

.flash { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid transparent; }
.flash-success { background: var(--success-bg); color: var(--success); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.flash-error { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.flash-info { background: var(--info-bg); color: var(--text); }

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font: inherit; font-weight: 600; font-size: .9rem;
    padding: 8px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
    text-decoration: none; cursor: pointer; line-height: 1.2;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-fg); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); color: #fff; }
.btn-danger-ghost { background: transparent; border-color: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-bg); color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: .82rem; }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-ms { background: var(--surface); border-color: var(--border-strong); }
.icon-btn {
    font: inherit; width: 28px; height: 28px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn:disabled { opacity: .35; cursor: default; }

/* ---------- Forms ---------- */

.field { margin-bottom: 16px; min-width: 0; }
.field > label, .field > .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: .85rem; margin: 4px 0 6px; }
.field-error { color: var(--danger); font-size: .85rem; margin: 6px 0 0; }

input[type=text], input[type=email], input[type=tel], input[type=url], input[type=search],
input[type=number], input[type=password], select, textarea {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 9px 11px;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
[aria-invalid=true] { border-color: var(--danger) !important; }
input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }

fieldset { border: 0; padding: 0; margin: 0 0 12px; }
legend { font-size: 1.05rem; font-weight: 700; padding: 0; margin-bottom: 12px; width: 100%; border-bottom: 1px solid var(--border); padding-bottom: 8px; }

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

.choice-row { display: flex; gap: 10px; flex-wrap: wrap; }
.choice {
    display: inline-flex; align-items: center; gap: 8px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    padding: 8px 14px; cursor: pointer; min-width: 110px; background: var(--surface);
}
.choice:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.choice input { margin: 0; accent-color: var(--primary); }

.checkbox { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-weight: 500; }
.checkbox input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.checkbox.small { font-size: .85rem; margin-top: 6px; }
.checkbox.small input { width: 15px; height: 15px; }

.conditional[hidden] { display: none; }

.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Public form ---------- */

/* Logo spans the title row and the description row; app.js sizes it to their height. */
.hero {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 20px;
    row-gap: 6px;
    margin-bottom: 24px;
}
.hero-logo { grid-row: 1 / 3; grid-column: 1; position: relative; width: var(--logo-w, 88px); }
.hero-logo img, .hero-logo .logo-placeholder { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-logo img { object-fit: contain; object-position: left center; }
.hero-title { grid-column: 2; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.hero-title h1 { font-size: 1.9rem; margin: 0; }
.hero .lead { grid-column: 2; }
.lead { font-size: 1.05rem; color: var(--muted); margin: 0; }
.logo-placeholder {
    display: grid; place-items: center;
    background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.logo-placeholder .brand-mark { width: 40%; height: auto; aspect-ratio: 1; }


.form.card { padding: 24px; }
.agree { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.agree-title { font-size: 1rem; margin-bottom: 10px; }
.conditions-text {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px 14px; margin-bottom: 14px; max-height: 280px; overflow-y: auto;
    font-size: .92rem; line-height: 1.6; overflow-wrap: anywhere;
}
.agree.has-error { border-color: var(--danger); }

.check-icon {
    width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 16px;
    display: grid; place-items: center; font-size: 28px; font-weight: 700;
    background: var(--success-bg); color: var(--success);
}

.login-card { position: relative; padding-top: 48px; }
.login-top { position: absolute; top: 14px; right: 14px; }
.login-logo { display: block; max-height: 72px; max-width: 200px; margin: 0 auto 16px; object-fit: contain; }
.login-card .btn-ms { margin: 12px 0; }
.dev-login { margin-top: 24px; border-top: 1px dashed var(--border); padding-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.dev-login p { width: 100%; margin: 0; }
.dev-login input { max-width: 220px; }

/* ---------- Admin: list ---------- */

.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; }

/* Baseline drawn with an inset shadow so the active underline never overflows the row
   (overflow-x: auto would otherwise show a vertical scrollbar). */
.year-tabs, .tabs {
    display: flex; gap: 4px;
    box-shadow: inset 0 -1px 0 var(--border);
    overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none;
}
.year-tabs::-webkit-scrollbar, .tabs::-webkit-scrollbar { display: none; }
.year-tabs { margin-bottom: 16px; }
.year-tabs a, .tabs a {
    text-decoration: none; color: var(--muted); font-weight: 600; padding: 10px 16px;
    border-bottom: 2px solid transparent; white-space: nowrap;
}
.year-tabs a:hover, .tabs a:hover { color: var(--text); }
.year-tabs a.active, .tabs a.active { color: var(--text); border-bottom-color: var(--primary); }
.tabs { margin-bottom: 20px; }

.status-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.status-chip {
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text);
    border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: .88rem;
}
.status-chip strong { font-variant-numeric: tabular-nums; }
.status-chip:hover { border-color: var(--border-strong); color: var(--text); }
.status-chip.active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); display: inline-block; }

.filters {
    display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 12px;
}
.filters .filter { display: flex; flex-direction: column; gap: 4px; min-width: 112px; }
.filters .filter.search { flex: 1 1 200px; }
.filters label { font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.filters .actions { flex-direction: row; min-width: 0; }
.result-count { margin: 0 0 8px; font-size: .9rem; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
/* Sticky header row: only possible when the wrapper does not scroll sideways, so app.js adds
   .fits when the whole table fits; the header then sticks just below the admin top bar. */
.table-wrap .data-table thead th { position: sticky; top: 0; z-index: 2; box-shadow: inset 0 -1px 0 var(--border); }
.table-wrap.fits { overflow: visible; }
.table-wrap.fits .data-table thead th { top: var(--sticky-top, 0px); }
/* Too wide for the screen: the table scrolls inside its own box (both ways) with the header pinned at its top. */
.table-wrap:not(.fits) { max-height: calc(100vh - var(--sticky-top, 0px) - 16px); max-height: calc(100dvh - var(--sticky-top, 0px) - 16px); overflow: auto; }
/* ...and the name column stays visible when swiping sideways. */
.table-wrap:not(.fits) .data-table th:nth-child(2),
.table-wrap:not(.fits) .data-table td:nth-child(2) { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--border); max-width: 46vw; }
.table-wrap:not(.fits) .data-table th:nth-child(2) { z-index: 3; background: var(--surface-2); box-shadow: inset -1px 0 0 var(--border), inset 0 -1px 0 var(--border); }
.table-wrap:not(.fits) .data-table tbody tr:hover td:nth-child(2) { background: var(--surface-2); }
.table-wrap:not(.fits) .data-table td:nth-child(2) .sub { overflow: hidden; text-overflow: ellipsis; }
.table-wrap.fits .data-table thead th:first-child { border-top-left-radius: var(--radius); }
.table-wrap.fits .data-table thead th:last-child { border-top-right-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.data-table th, .data-table td { padding: 10px 8px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table th { background: var(--surface-2); font-size: .72rem; text-transform: uppercase; letter-spacing: .01em; color: var(--muted); font-weight: 600; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr[data-href] { cursor: pointer; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table td .sub { color: var(--muted); font-size: .82rem; }
.data-table td.right { text-align: right; }
.data-table input[type=text] { padding: 6px 9px; }
.sort { color: inherit; text-decoration: none; display: inline-flex; gap: 4px; align-items: center; }
.sort:hover, .sort.active { color: var(--text); }
.sort .arrow { font-size: .65rem; }
.row-link { font-weight: 600; text-decoration: none; color: var(--text); }
.row-link:hover { text-decoration: underline; }

.badge {
    display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600;
    background: var(--c, #6b7280); color: var(--fg, #fff); white-space: nowrap;
}
.badge-lg { font-size: .85rem; padding: 4px 12px; vertical-align: middle; }
.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); margin-left: 4px; }
.yn { font-size: .82rem; font-weight: 600; }
.yn.yes { color: var(--success); }
.yn.no { color: var(--muted); }

.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 16px; }

/* ---------- Admin: detail ---------- */

.detail-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.detail-nav .back { text-decoration: none; font-weight: 500; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.detail-side { position: sticky; top: 76px; }

.dl-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 10px 16px; margin: 0; }
.dl-grid dt { color: var(--muted); font-size: .88rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: .5em; }
.card-head h2 { margin: 0; }
.card-editing { border-top: 3px solid var(--primary); }
.card-editing .field { margin-bottom: 12px; }
.grid-zip-city { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 0 12px; }
.edit-changes { margin: 4px 0 0; padding-left: 18px; list-style: disc; font-size: .85rem; overflow-wrap: anywhere; }
/* Details and Shooting cards side by side on wide screens. */
.detail-pair { display: grid; grid-template-columns: 1fr; gap: 0 16px; align-items: stretch; }
.detail-pair > .card { min-width: 0; }
@media (min-width: 1200px) {
    .detail-pair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .detail-pair .dl-grid { grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); }
}
.dl-grid dd { margin: 0; overflow-wrap: anywhere; }
.prose { white-space: normal; overflow-wrap: anywhere; line-height: 1.6; }

.admin-box { border-top: 3px solid var(--primary); }
.timeline { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow-y: auto; }
#history .timeline { max-height: none; overflow: visible; }
.timeline > li.is-note::before { background: var(--primary); }
.note-text {
    margin-top: 4px; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); white-space: normal; overflow-wrap: anywhere; line-height: 1.5;
}
.timeline > li { padding: 8px 0 8px 14px; border-left: 2px solid var(--border); position: relative; font-size: .88rem; }
.timeline > li::before { content: ""; position: absolute; left: -5px; top: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }
.danger-zone h2 { color: var(--danger); }

/* ---------- Admin: settings ---------- */

.settings-form { max-width: 760px; }
.inline-form { max-width: 760px; }
.inline-form .row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .row .field { flex: 1 1 180px; margin-bottom: 0; }
.inline-form .row .narrow-field { flex: 0 0 auto; }
.inline-form .row .field-btn { flex: 0 0 auto; }
.inline-form .hint { margin-top: 12px; }

/* Rows where a button sits next to fields (filters, inline forms): one shared height, so the button
   lines up with the fields instead of sitting lower. */
:root { --control-h: 42px; }
.filters input[type=search], .filters select, .filters .actions .btn,
.inline-form .row input:not([type=checkbox]):not([type=radio]), .inline-form .row select, .inline-form .field-btn .btn {
    height: var(--control-h);
}
.filters select, .inline-form .row select { padding-top: 0; padding-bottom: 0; }
.inline-form .row input[type=color] { width: var(--control-h); }
.status-table td { padding: 8px 10px; }
.status-table input[type=text] { min-width: 140px; }

.logo-setting { display: flex; gap: 16px; align-items: flex-start; }
.logo-setting > div:last-child { flex: 1; min-width: 0; }
.logo-setting input[type=file] { max-width: 100%; }
.logo-preview { width: 96px; height: 96px; flex: none; position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.logo-preview img { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); object-fit: contain; }
.logo-preview .logo-placeholder { position: absolute; inset: 0; border: 0; }
.notify-option { margin-top: 10px; font-size: .9rem; }
.oauth-panel { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 12px 14px; margin-bottom: 16px; }
.oauth-panel .reg-state { margin: 0 0 10px; }
.oauth-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.oauth-help { margin-top: 12px; font-size: .88rem; }
.oauth-help summary { cursor: pointer; color: var(--primary); font-weight: 500; }
.oauth-help ol { margin: 8px 0 0; padding-left: 20px; }
.oauth-help li { margin-bottom: 6px; }
.dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); box-shadow: 0 20px 50px rgba(16, 24, 40, .25); color: var(--text); background: var(--surface); }
.dialog-confirm { width: min(440px, calc(100vw - 32px)); }
.dialog-confirm .dialog-body { padding: 20px; }
.dialog-confirm h2 { font-size: 1.1rem; margin: 0 0 8px; }
.confirm-message { margin: 0 0 16px; overflow-wrap: anywhere; }
.form-actions-left { margin-right: auto; }
.dialog-wide { width: min(820px, calc(100vw - 32px)); }
.dialog fieldset { margin-bottom: 8px; }
.dialog::backdrop { background: rgba(16, 24, 40, .45); }
.dialog form { padding: 20px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 4px; }
.dialog-head h2 { margin: 0; font-size: 1.15rem; }
.dialog .flash { margin-bottom: 14px; }
.template-picker { border: 0; padding: 0; margin: 0 0 16px; }
.template-picker legend { margin-bottom: 6px; border: 0; padding: 0; }
.template-options { display: flex; flex-wrap: wrap; gap: 6px; }
.template-option { display: inline-flex; cursor: pointer; }
.template-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.template-option span {
    display: inline-block; padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 999px;
    background: var(--surface); font-size: .88rem; line-height: 1.3; user-select: none;
}
.template-option:hover span { background: var(--surface-2); }
.template-option input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.template-option input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.template-langs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; }
.template-lang legend { font-size: .95rem; }
.template-lang textarea { font-size: .9rem; }
.page-head-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head-row p { margin: 0; }
@media (max-width: 900px) { .template-langs { grid-template-columns: 1fr; } }
code.cmd { display: block; margin-top: 8px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: var(--mono); font-size: .82rem; color: var(--text); overflow-wrap: anywhere; }
.version-tag { font-size: .85rem; color: var(--muted); border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 3px 12px; font-variant-numeric: tabular-nums; }
.audit-table td { vertical-align: top; }
.log-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.log-bar .result-count { margin: 0; }
.log-bar .pagination { margin-top: 0; }
.audit-details { font-size: .82rem; overflow-wrap: anywhere; min-width: 200px; }
.audit-cat { display: inline-block; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; padding: 1px 6px; border-radius: 4px; margin-right: 4px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.audit-cat-auth { color: #1d4ed8; border-color: #bfdbfe; background: #eff6ff; }
.audit-cat-settings { color: #7c3aed; border-color: #ddd6fe; background: #f5f3ff; }
.audit-cat-mail { color: #b45309; border-color: #fde68a; background: #fffbeb; }
.audit-cat-recruit { color: #15803d; border-color: #bbf7d0; background: #f0fdf4; }
.role { font-size: .82rem; font-weight: 600; color: var(--muted); }
.role-super { color: var(--text); }

.date-range-sep { padding-bottom: 10px; color: var(--muted); }
.reg-state { margin: 8px 0 0; font-size: .88rem; font-weight: 600; }
.reg-state::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.reg-state.is-open { color: var(--success); }
.reg-state.is-open::before { background: var(--success); }
.reg-state.is-closed { color: var(--muted); }
.reg-state.is-closed::before { background: var(--muted); }
.period-card h2 { margin-bottom: 8px; }
.period-list { list-style: none; margin: 0 0 8px; padding: 0; }
.period-list li { font-size: 1.1rem; font-weight: 600; padding: 2px 0; }
#periods h2 { margin-bottom: 4px; }
#periods .reg-state { margin: 4px 0 14px; }
.period-table { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 16px; box-shadow: none; }
.period-add h3 { font-size: .95rem; margin: 0 0 8px; }
.period-add-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.md-picker { display: flex; flex-direction: column; gap: 4px; }
.md-selects { display: flex; gap: 6px; }
.md-picker select { width: auto; }
.md-picker select:first-of-type { min-width: 70px; }

/* ---------- Responsive ---------- */

@media (max-width: 980px) {
    .detail-grid { grid-template-columns: 1fr; }
    .detail-side { position: static; }
}

@media (max-width: 640px) {
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .span-2, .span-3 { grid-column: auto; }
    .dl-grid { grid-template-columns: 1fr; gap: 2px; }
    .dl-grid dd { margin-bottom: 10px; }
    /* On phones the top bar scrolls away; only the table header row stays pinned. */
    .admin-header { position: static; }
    .admin-header-inner { gap: 4px 12px; padding-top: 8px; }
    .brand { flex: 1 1 auto; min-width: 0; }
    .brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .admin-user { gap: 8px; }
    /* Navigation gets its own full-width row below logo, language and logout. */
    .admin-nav { order: 3; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; }
    .admin-nav::-webkit-scrollbar { display: none; }
    .admin-nav a { white-space: nowrap; padding: 8px 10px; }
    .user-name { display: none; }
    .hero { column-gap: 14px; row-gap: 10px; }
    .hero-logo { grid-row: 1; }
    .hero .lead { grid-column: 1 / 3; }
    .hero-title { flex-wrap: wrap; gap: 8px; }
    .hero-title h1 { font-size: 1.45rem; }
    .hero .lead { font-size: .95rem; }
    .form.card { padding: 16px; }
    .form-actions .btn { width: 100%; }
    .choice { flex: 1; }
    .filters .filter { flex: 1 1 45%; min-width: 0; }
}
