:root {
    --cg-blue: #003B70;
    --cg-blue-mid: #0054A4;
    --cg-blue-soft: #E8F1F8;
    --cg-red: #C8102E;
    --cg-gold: #B8956C;
    --cg-gold-soft: #F7F1E8;
    --bg: #EEF2F6;
    --bg-stripe: linear-gradient(180deg, #E8EEF4 0%, #EEF2F6 120px);
    --card: #FFFFFF;
    --text: #1A2332;
    --muted: #5C6B7A;
    --line: #D5DCE3;
    --line-strong: #B8C4D0;
    --success-bg: #E7F6ED;
    --success-text: #0B6B3A;
    --success-border: #A8D5B5;
    --error-bg: #FDECEC;
    --error-text: #8B1A1A;
    --error-border: #F0B0B0;
    --shadow: 0 1px 3px rgba(0, 40, 80, 0.06), 0 4px 14px rgba(0, 40, 80, 0.04);
    --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--bg);
    background-image: var(--bg-stripe);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}
.wrap { max-width: 1400px; margin: 0 auto; padding: 24px 20px 48px; }

/* Top bar */
.staff-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--cg-blue);
    color: #fff;
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border-bottom: 4px solid var(--cg-red);
}
.staff-top h1 {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0;
}
.staff-top .sub, .staff-top .user {
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
}
.staff-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.staff-brand .service {
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cg-gold);
    font-weight: 600;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
h1 {
    color: var(--cg-blue);
    font-size: 1.45rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.user { color: var(--muted); font-size: 0.9rem; }
.sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 16px; }

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: 10px 16px;
    background: var(--cg-blue);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
    box-shadow: 0 1px 2px rgba(0,40,80,0.12);
}
.btn:hover { background: var(--cg-blue-mid); }
.btn.secondary {
    background: #fff;
    color: var(--cg-blue);
    border: 1px solid var(--line-strong);
    box-shadow: none;
}
.btn.secondary:hover { background: var(--cg-blue-soft); }
.btn.danger {
    background: var(--cg-red);
    color: #fff;
}
.btn.danger:hover { filter: brightness(1.05); }
.btn.small { padding: 6px 12px; font-size: 0.75rem; border-radius: 6px; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.card h2 {
    color: var(--cg-blue);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: 0.02em;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--cg-gold);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
th, td {
    border: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}
th {
    background: var(--cg-blue);
    color: #fff;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}
tr:nth-child(even) { background: #F7FAFC; }
tr:hover td { background: var(--cg-blue-soft); }

.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    font-size: 0.9rem;
}
.alert.success {
    background: var(--success-bg);
    border: 1px solid var(--success-border);
    color: var(--success-text);
}
.alert.error {
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    color: var(--error-text);
}

label {
    display: block;
    margin-top: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
}
input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    margin-top: 4px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--cg-blue-mid);
    box-shadow: 0 0 0 3px rgba(0, 84, 164, 0.15);
}
textarea { min-height: 88px; resize: vertical; }
.hint { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 700px) {
    .grid-2 { grid-template-columns: 1fr; }
    .wrap { padding: 16px 12px 40px; }
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.badge.on {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}
.badge.off {
    background: #EEF1F4;
    color: var(--muted);
    border: 1px solid var(--line);
}
.count {
    background: var(--cg-blue);
    color: #fff;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.actions {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

/* Match cards (legacy) */
.match {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    background: #FAFBFC;
}
.match .mid {
    font-size: 0.75rem;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.login-wrap {
    max-width: 420px;
    margin: 64px auto;
    padding: 0 16px;
}
.login-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    border-top: 4px solid var(--cg-red);
}
.login-card h1 {
    text-align: center;
    margin-bottom: 6px;
}
.login-card .service {
    text-align: center;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: var(--cg-gold);
    font-weight: 600;
    margin-bottom: 20px;
}


/* ========== UX pass: actions, menus, mobile cards ========== */
/* Keep the events card (and its open More menu) above the next card (Add New Event) */
.card:has(.more-menu[open]) {
    position: relative;
    z-index: 50;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.row-actions form { display: inline; margin: 0; }

.btn.publish {
    background: var(--success-text);
    color: #fff;
}
.btn.publish:hover { filter: brightness(1.08); }
.btn.unpublish {
    background: #fff;
    color: var(--muted);
    border: 1px solid var(--line-strong);
    box-shadow: none;
}
.btn.unpublish:hover { background: #EEF1F4; color: var(--text); }

.more-menu {
    position: relative;
    display: inline-block;
    z-index: 1;
}
.more-menu[open] {
    z-index: 1000;
}
.more-menu > summary {
    list-style: none;
    cursor: pointer;
}
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu > summary::after {
    content: ' ▾';
    font-size: 0.7em;
    opacity: 0.8;
}
.more-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    min-width: 200px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 40, 80, 0.2);
    padding: 6px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
/* When JS positions the panel fixed (escapes table overflow), keep it on top */
.more-menu-panel.is-fixed-panel {
    position: fixed;
    z-index: 2000;
}
.more-menu-panel a,
.more-menu-panel button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}
.more-menu-panel a:hover,
.more-menu-panel button:hover {
    background: var(--cg-blue-soft);
    color: var(--cg-blue);
}
.more-menu-panel .danger-item {
    color: var(--error-text);
}
.more-menu-panel .danger-item:hover {
    background: var(--error-bg);
    color: var(--error-text);
}
.more-menu-panel .menu-hint {
    padding: 6px 12px 8px;
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 500;
    border-top: 1px solid var(--line);
    margin-top: 4px;
}

.empty-state {
    text-align: center;
    padding: 28px 16px;
    color: var(--muted);
}
.empty-state strong {
    display: block;
    color: var(--text);
    font-size: 1.05rem;
    margin-bottom: 6px;
}
.empty-state p { margin-bottom: 14px; font-size: 0.9rem; }

table caption {
    text-align: left;
    font-weight: 700;
    color: var(--cg-blue);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.toolbar .btn { white-space: nowrap; }
.staff-top a.btn:focus-visible {
    outline-color: #fff;
}

@media (max-width: 900px) {
    .staff-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* Card layout for event rows on small screens */
@media (max-width: 700px) {
    .events-table thead { display: none; }
    .events-table,
    .events-table tbody,
    .events-table tr,
    .events-table td {
        display: block;
        width: 100%;
    }
    .events-table tr {
        background: #FAFBFC;
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 12px 14px;
        margin-bottom: 12px;
    }
    .events-table td {
        border: none;
        padding: 4px 0;
    }
    .events-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--muted);
        margin-bottom: 2px;
    }
    .events-table td.row-actions::before { content: 'Actions'; }
    .row-actions { margin-top: 8px; }
    .more-menu-panel { right: auto; left: 0; }
    .toolbar .btn { flex: 1 1 auto; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
    }
}

.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}


/* ========== Edit event: sections + sticky save ========== */
.edit-section.card {
    padding: 0;
    overflow: hidden;
}
.edit-section-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--cg-blue);
    background: linear-gradient(180deg, #fff 0%, #F4F7FA 100%);
    border-bottom: 1px solid transparent;
    user-select: none;
}
.edit-section-summary::-webkit-details-marker { display: none; }
.edit-section-summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    transition: transform 0.15s;
    color: var(--cg-gold);
}
.edit-section[open] > .edit-section-summary::before {
    transform: rotate(90deg);
}
.edit-section[open] > .edit-section-summary {
    border-bottom-color: var(--line);
}
.edit-section-hint {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.edit-section[open] .edit-section-hint { visibility: hidden; }
.edit-section-body {
    padding: 16px 18px 20px;
}
.sticky-save {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
}
.sticky-save-top {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
}
.sticky-save-label {
    flex: 1;
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
}
@media (max-width: 700px) {
    .sticky-save-top { top: 0; }
    .sticky-save-top .btn { width: 100%; }
}


/* ========== Needs attention + roster + clone modal ========== */
.attention-card h2 { color: #8B5A00; }
.attention-list { list-style: none; margin: 0; padding: 0; }
.attention-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.attention-list li:last-child { border-bottom: none; }
.attention-issues { display: block; font-size: 0.85rem; color: #8B5A00; margin-top: 4px; }
.attention-main { flex: 1; min-width: 200px; }
.attention-actions { display: flex; gap: 6px; }

.roster-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}
.roster-toolbar input[type="search"] {
    flex: 1 1 200px;
    min-width: 160px;
    margin: 0;
}
.roster-toolbar select { margin: 0; min-width: 140px; }
.roster-check-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
    margin: 0;
}
.roster-check-filter input { width: auto; margin: 0; }
.roster-row.is-checked { background: #F3FBF6; }
.checkin-form { margin: 0; }

.staff-modal[hidden] { display: none !important; }
.staff-modal { position: fixed; inset: 0; z-index: 200; }
.staff-modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0, 30, 60, 0.45);
}
.staff-modal-panel {
    position: relative;
    max-width: 440px;
    margin: 10vh auto;
    background: #fff;
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: 0 16px 40px rgba(0, 40, 80, 0.2);
    border-top: 4px solid var(--cg-red);
}
.staff-modal-panel h2 { margin-bottom: 8px; }
.staff-modal-panel label { margin-top: 12px; }

@media print {
    .staff-top, .toolbar, .no-print, .attention-card, .more-menu,
    .sticky-save, form[action], .staff-modal, script { display: none !important; }
    .roster-card { box-shadow: none; border: none; }
    body { background: #fff; }
    .roster-row.is-checked td:first-child::after { content: " ✓"; }
}

@media (max-width: 700px) {
    .roster-table thead { display: none; }
    .roster-table, .roster-table tbody, .roster-table tr, .roster-table td {
        display: block; width: 100%;
    }
    .roster-table tr {
        border: 1px solid var(--line);
        border-radius: 10px;
        padding: 12px;
        margin-bottom: 10px;
    }
    .roster-table td { border: none; padding: 4px 0; }
    .roster-table td::before {
        content: attr(data-label);
        display: block;
        font-size: 0.68rem;
        font-weight: 700;
        text-transform: uppercase;
        color: var(--muted);
    }
}


/* Event list filter chips */
.events-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 14px;
}
.filter-chip {
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--cg-blue);
    font-weight: 700;
    font-size: 0.78rem;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
}
.filter-chip:hover { background: var(--cg-blue-soft); }
.filter-chip.active {
    background: var(--cg-blue);
    color: #fff;
    border-color: var(--cg-blue);
}

/* —— Background manager (Edit event) —— */
.bg-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.bg-manager-col {
  background: #fff;
  border: 1px solid var(--line, #c5d0c8);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bg-manager-title {
  margin: 0;
  font-size: 0.95rem;
  color: var(--cg-blue, #003087);
  font-weight: 700;
}
.bg-manager-preview {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line, #c5d0c8);
  max-height: 140px;
  background: #0a0a0c;
}
.bg-manager-preview img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
}
.bg-manager-upload {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.bg-manager-upload label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted, #5a6a7a);
}
.bg-manager-upload input[type="file"] {
  font-size: 0.85rem;
}
.btn.small {
  padding: 6px 12px;
  font-size: 0.8rem;
}


/* ============================================================
   Staff-only visual system (NOT used on public / leaderboard)
   USCG palette · restrained motion · prefers-reduced-motion safe
   ============================================================ */

:root {
    --cg-blue: #003087;
    --cg-blue-mid: #0055A4;
    --cg-blue-deep: #001a4d;
    --cg-red: #BF0A30;
    --cg-white: #FFFFFF;
    --staff-aurora-1: rgba(0, 48, 135, 0.35);
    --staff-aurora-2: rgba(191, 10, 48, 0.18);
    --staff-aurora-3: rgba(0, 85, 164, 0.25);
    --staff-glass: rgba(255, 255, 255, 0.72);
    --staff-glass-border: rgba(255, 255, 255, 0.55);
    --staff-spot: transparent;
}

/* Aurora page background */
body {
    background:
        radial-gradient(ellipse 80% 50% at 10% 0%, var(--staff-aurora-1), transparent 55%),
        radial-gradient(ellipse 60% 45% at 90% 10%, var(--staff-aurora-2), transparent 50%),
        radial-gradient(ellipse 70% 40% at 50% 100%, var(--staff-aurora-3), transparent 55%),
        linear-gradient(165deg, #e8eef6 0%, #f4f6f9 40%, #eef1f5 100%) !important;
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Floating ambient shapes (pure CSS, 4 blobs) */
body::before,
body::after {
    content: "";
    position: fixed;
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    will-change: transform;
}
body::before {
    width: 42vw;
    height: 42vw;
    max-width: 520px;
    max-height: 520px;
    background: radial-gradient(circle, rgba(0, 48, 135, 0.35), transparent 70%);
    top: -8%;
    left: -6%;
    animation: staff-drift-a 28s ease-in-out infinite alternate;
}
body::after {
    width: 36vw;
    height: 36vw;
    max-width: 440px;
    max-height: 440px;
    background: radial-gradient(circle, rgba(191, 10, 48, 0.22), transparent 70%);
    bottom: -10%;
    right: -4%;
    animation: staff-drift-b 34s ease-in-out infinite alternate;
}
@keyframes staff-drift-a {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(30px, 24px) scale(1.06); }
}
@keyframes staff-drift-b {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-24px, -18px) scale(1.08); }
}

/* Grain overlay */
.staff-grain {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 1;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
}

/* Keep content above ambient layers */
.wrap, .staff-top, header {
    position: relative;
    z-index: 2;
}

/* Mouse spotlight on staff-top hero */
.staff-top {
    background:
        radial-gradient(600px circle at var(--spot-x, 50%) var(--spot-y, 40%), rgba(255,255,255,0.16), transparent 45%),
        linear-gradient(135deg, #001a4d 0%, #003087 48%, #BF0A30 160%) !important;
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: 0 12px 40px rgba(0, 26, 77, 0.28);
    position: relative;
    overflow: hidden;
}
.staff-top::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    background-size: 200% 100%;
    animation: staff-sheen 8s linear infinite;
    pointer-events: none;
}
@keyframes staff-sheen {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Glass cards */
.card {
    background: var(--staff-glass) !important;
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    border: 1px solid var(--staff-glass-border) !important;
    border-radius: 16px !important;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.65) inset,
        0 8px 28px rgba(0, 26, 77, 0.06) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 1px 0 rgba(255,255,255,0.8) inset,
        0 14px 36px rgba(0, 26, 77, 0.1) !important;
    border-color: rgba(0, 48, 135, 0.18) !important;
}

/* Hero title gradient (one moment) */
.staff-top h1,
.staff-brand h1 {
    background: linear-gradient(92deg, #ffffff 0%, #e8f0ff 45%, #ffd6de 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
    -webkit-text-fill-color: transparent;
}

/* Buttons — soft lift + edge highlight */
.btn, button.btn, a.btn {
    border-radius: 11px !important;
    font-weight: 600;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease !important;
    box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 2px 8px rgba(0, 26, 77, 0.12);
}
.btn:hover, button.btn:hover, a.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 1px 0 rgba(255,255,255,0.35) inset, 0 8px 18px rgba(0, 48, 135, 0.2);
}
.btn:active, button.btn:active, a.btn:active {
    transform: translateY(0);
}
.btn:focus-visible, button.btn:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--cg-blue);
    outline-offset: 2px;
}

/* Featured / primary CTA border beam */
.btn:not(.secondary):not(.small):not(.unpublish):not(.danger-item) {
    position: relative;
}
.card.staff-featured {
    position: relative;
}
.card.staff-featured::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 17px;
    padding: 1px;
    background: linear-gradient(120deg, #003087, #BF0A30, #0055A4, #003087);
    background-size: 300% 300%;
    animation: staff-beam 6s linear infinite;
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
@keyframes staff-beam {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* Scroll reveal */
.staff-reveal {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.staff-reveal.is-in {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Forms */
input[type="text"], input[type="password"], input[type="date"],
input[type="number"], input[type="file"], select, textarea {
    border-radius: 10px !important;
    border: 1px solid #c5d0c8 !important;
    background: rgba(255,255,255,0.9) !important;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
input:focus, select:focus, textarea:focus {
    border-color: var(--cg-blue) !important;
    box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.14) !important;
}

.alert {
    border-radius: 12px !important;
    backdrop-filter: blur(8px);
}

.sticky-save {
    backdrop-filter: saturate(1.2) blur(12px) !important;
    -webkit-backdrop-filter: saturate(1.2) blur(12px) !important;
    border-radius: 12px;
}

/* Login card centering polish */
body.login-page .wrap,
.wrap.login-wrap {
    max-width: 420px;
}

@media (prefers-reduced-motion: reduce) {
    body::before, body::after,
    .staff-top::after,
    .card.staff-featured::before {
        animation: none !important;
    }
    .staff-reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .btn:hover, .card:hover {
        transform: none !important;
    }
}

/* Leaderboard panel — collapsed by default (details) */
.staff-lb-panel {
  margin-top: 16px;
}
.staff-lb-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  padding: 4px 2px;
  user-select: none;
}
.staff-lb-summary::-webkit-details-marker { display: none; }
.staff-lb-summary-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cg-blue, #003087);
}
.staff-lb-summary .hint { margin: 0; }
.staff-lb-body {
  margin-top: 12px;
  padding-top: 4px;
  border-top: 1px solid rgba(0, 48, 135, 0.08);
}
.staff-lb-manual {
  margin-top: 4px;
  padding: 8px 0;
}
.staff-lb-manual > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted, #5a6a7a);
  font-size: 0.9rem;
}
