:root {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    color: #e6e6e7;
    background: #171719;
    color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: #dcc67b; text-decoration: none; }
a:hover { color: #f2dea0; text-decoration: underline; }
header { min-height: 80px; padding: 12px 4%; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid #353538; background: #202023; }
.brand { display: flex; align-items: center; gap: 14px; font-size: 18px; font-weight: 600; color: #f1f1f1; white-space: nowrap; }
.brand:hover { color: white; text-decoration: none; }
.logo { width: 55px; height: 55px; object-fit: contain; }
nav { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; font-size: 13px; }
nav a { color: #c8c8cc; }
.identity { display: flex; align-items: center; gap: 8px; }
main { max-width: 1400px; margin: 0 auto; padding: 32px 4% 60px; }
h1 { font-size: 28px; line-height: 1.25; font-weight: 600; margin: 0 0 10px; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 12px; }
p { color: #b6b6bd; line-height: 1.6; margin: 10px 0 18px; }
.eyebrow { color: #a7a7ad; font-size: 12px; }
.heading, .row, .actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.heading { margin-bottom: 24px; }
.heading p { margin: 0; }
.button, button { display: inline-block; border: 1px solid #dac67f; border-radius: 4px; padding: 10px 16px; background: #dac67f; color: #25221b; font: inherit; font-weight: 600; cursor: pointer; }
.button:hover, button:hover { background: #ecda98; border-color: #ecda98; color: #25221b; text-decoration: none; }
.quiet { padding: 6px 8px; border-color: transparent; background: transparent; color: #bcbcc3; font-weight: 400; }
.quiet:hover { background: #343437; border-color: transparent; color: #eee; }
.danger { color: #e89b9b; }
.badge { display: inline-block; padding: 3px 6px; border: 1px solid #424246; background: #2c2c30; border-radius: 3px; color: #c4c4cb; font-size: 11px; white-space: nowrap; }
.panel { padding: 22px; margin-bottom: 20px; border: 1px solid #39393e; border-radius: 5px; background: #222225; }
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; margin: 20px 0 26px; }
.grow { flex: 1; }
.filters > span { align-self: center; }
label { display: flex; flex-direction: column; gap: 7px; color: #c5c5cb; font-size: 13px; }
input, select, textarea { width: 100%; min-width: 100px; border: 1px solid #49494f; border-radius: 3px; padding: 10px; background: #19191c; color: #eee; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid #c5ad63; outline-offset: 2px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.event { padding: 0; margin: 0; overflow: hidden; }
.banner { height: 200px; display: grid; place-items: center; overflow: hidden; background: #2c2c30; color: #909098; }
.banner img { width: 100%; height: 100%; object-fit: cover; }
.event-body { padding: 20px; }
.event h2 { margin: 14px 0 6px; }
.muted { font-size: 13px; color: #97979f; }
.description { white-space: pre-wrap; font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0; }
.actions { margin-top: 20px; padding-top: 16px; border-top: 1px solid #3a3a3f; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.wide { grid-column: 1 / -1; }
.editor { max-width: 1000px; margin-top: 24px; }
.notice, .error { padding: 14px 18px; border: 1px solid #406050; border-radius: 4px; margin-bottom: 22px; background: #243b30; color: #c3e1ce; }
.error { background: #382729; border-color: #6f4248; color: #efc3c6; }
.error ul { margin: 0; padding-left: 18px; }
.login-page main { max-width: 780px; padding-top: 60px; }
.login { max-width: 400px; margin: 30px auto; padding: 30px; text-align: center; }
.login-logo { width: 96px; height: 96px; object-fit: contain; margin-bottom: 18px; }
.login h1 { font-size: 24px; margin-bottom: 8px; }
.login .discord { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin: 24px 0; background: #5865f2; border-color: #5865f2; color: white; }
.login .discord:hover { background: #4752c4; border-color: #4752c4; }
.login .muted { margin-bottom: 0; }
.user-row { display: flex; align-items: center; gap: 24px; }
.user-row .filters { margin: 0; }
.metrics strong { display: block; margin-top: 14px; font-size: 34px; font-weight: 600; }
.stat-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 14px 0; border-bottom: 1px solid #39393e; }
meter { max-width: 45%; flex: 1; }
.pagination { margin-top: 28px; }
.pagination nav { justify-content: space-between; }
.empty { grid-column: 1 / -1; padding: 44px; text-align: center; }
.image-preview { margin-top: 28px; max-width: 500px; }
[hidden] { display: none !important; }
@media (max-width: 1100px) {
    header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
    .grid, .form-grid { grid-template-columns: 1fr; }
    .heading, .user-row { flex-direction: column; align-items: stretch; }
    .wide { grid-column: auto; }
    nav { gap: 14px; }
    .filters label { flex-basis: 100%; }
    .login-page main { padding-top: 24px; }
    .login { padding: 24px; }
}

/* User management */
.admin-heading { margin-bottom: 28px; }
.member-count { padding: 7px 12px; border: 1px solid #42413a; border-radius: 4px; color: #d4c694; font-size: 13px; white-space: nowrap; }
.admin-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.member-list { padding: 0; overflow: hidden; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-heading h2 { margin: 0; font-size: 16px; }
.member-list > .section-heading { padding: 22px 24px; border-bottom: 1px solid #39393e; }
.member-columns, .member-entry { display: grid; grid-template-columns: minmax(180px, 1fr) 130px 140px; gap: 20px; }
.member-columns { padding: 12px 24px; background: #1e1e21; border-bottom: 1px solid #39393e; color: #93939c; font-size: 12px; }
.member-entry { padding: 24px; align-items: center; border-bottom: 1px solid #39393e; }
.member-entry:last-child { border-bottom: 0; }
.member-summary { display: flex; align-items: center; gap: 12px; min-width: 0; }
.member-avatar { display: grid; place-items: center; flex: 0 0 42px; height: 42px; background: #38342b; border: 1px solid #56503c; border-radius: 50%; color: #e0cd8b; font-size: 17px; font-weight: 600; }
.member-details { min-width: 0; }
.member-name { font-weight: 600; overflow-wrap: anywhere; }
.you-label { display: inline-block; margin-left: 6px; padding: 2px 5px; border-radius: 3px; background: #343437; color: #b7b7bf; font-size: 10px; font-weight: 400; vertical-align: middle; }
.discord-id { display: block; margin-top: 5px; font-family: Consolas, monospace; font-size: 12px; color: #95959e; overflow-wrap: anywhere; }
.member-actions { display: flex; align-items: center; gap: 8px; }
.secondary { background: #303033; border-color: #4a4a50; color: #dddde1; font-weight: 400; }
.secondary:hover { background: #3d3d42; border-color: #62626a; color: white; }
.member-edit-name { display: flex; align-items: center; gap: 12px; grid-column: 1 / -1; padding-left: 54px; }
.member-edit-name label { color: #92929b; font-size: 12px; white-space: nowrap; }
.member-edit-name input { max-width: 300px; padding: 8px 10px; font-size: 13px; }
.member-role-form select { font-size: 13px; }
select:disabled { opacity: .65; cursor: not-allowed; }
.add-member-form { display: grid; gap: 20px; margin-top: 22px; }
.add-member-form > button { margin-top: 3px; }
.field-help { color: #8e8e98; font-size: 12px; line-height: 1.5; margin-top: 2px; }
.role-guide { padding: 4px 4px 8px; }
.role-guide h2 { color: #b6b6bf; font-size: 13px; }
.role-guide dl { margin: 18px 0 0; }
.role-guide dt { font-size: 13px; color: #d0d0d6; margin-top: 16px; }
.role-guide dd { margin: 5px 0 0; color: #93939d; font-size: 12px; line-height: 1.6; }
.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; }
@media (max-width: 1050px) {
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
    .role-guide { padding: 22px; }
}
@media (max-width: 650px) {
    .admin-heading { flex-direction: row; align-items: center; }
    .admin-heading h1 { font-size: 24px; }
    .admin-layout, .admin-sidebar { display: block; }
    .member-columns { display: none; }
    .member-list > .section-heading { flex-wrap: wrap; }
    .member-entry { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
    .member-edit-name { grid-row: 2; padding-left: 0; flex-direction: column; align-items: stretch; gap: 7px; }
    .member-edit-name input { max-width: none; }
    .member-role-form { max-width: none; }
    .member-actions { justify-content: flex-end; }
}

/* Event flag selection */
.flag-picker { min-width: 0; margin: 0; padding: 18px; border: 1px solid #414147; border-radius: 4px; }
.flag-picker legend { padding: 0 7px; color: #c5c5cb; font-size: 13px; }
.flag-picker-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
.flag-picker-heading .muted { font-size: 12px; }
.flag-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.flag-option { flex-direction: row; align-items: center; gap: 10px; padding: 12px; background: #1b1b1e; border: 1px solid #3c3c42; border-radius: 4px; cursor: pointer; }
.flag-option:has(input:checked) { border-color: #c2ac64; background: #302d24; }
.flag-option input { width: 17px; min-width: 17px; height: 17px; padding: 0; margin: 0; accent-color: #dac67f; }
.flag-option strong { font-size: 13px; font-weight: 600; }
.flag-option small { display: block; color: #a5a5af; margin-top: 3px; }
.flag-admin-list > .section-heading { margin-bottom: 20px; }
.flag-admin-row { display: flex; align-items: end; gap: 10px; padding: 18px 0; border-top: 1px solid #39393e; }
.flag-admin-row > form:first-child { display: flex; align-items: end; gap: 12px; flex: 1; min-width: 0; }
.flag-admin-row label:first-child { width: 110px; }
@media(max-width: 650px) { .flag-admin-row, .flag-admin-row > form:first-child { flex-wrap: wrap; } .flag-admin-row .grow { flex-basis: 100%; } }

/* Team access */
.team-admin { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; }
.members-title { display: flex; align-items: center; gap: 10px; }
.list-count { min-width: 23px; padding: 3px 7px; border-radius: 4px; text-align: center; background: #343437; color: #c4c4cc; font-size: 11px; }
.team-columns, .team-member-summary { display: grid; grid-template-columns: minmax(0, 1fr) 100px 65px; gap: 18px; align-items: center; }
.team-columns { padding: 12px 24px; color: #92929b; background: #1c1c1f; font-size: 11px; border-bottom: 1px solid #36363b; }
.team-member { border-bottom: 1px solid #39393e; }
.team-member:last-child { border-bottom: 0; }
.team-member-summary { padding: 22px 24px; cursor: pointer; list-style: none; transition: background .15s; }
.team-member-summary::-webkit-details-marker { display: none; }
.team-member-summary:hover { background: #29292d; }
.team-member-summary:focus-visible, .discord-id-help summary:focus-visible { outline: 2px solid #c5ad63; outline-offset: -3px; }
.team-member-summary .member-avatar { width: 38px; height: 38px; flex-basis: 38px; font-size: 15px; }
.team-member-summary .discord-id { margin-top: 6px; color: #90909a; }
.member-edit-toggle { display: flex; align-items: center; justify-content: flex-end; gap: 5px; color: #bbb6a8; font-size: 12px; }
.member-edit-toggle svg { transition: transform .15s; }
.team-member[open] .member-edit-toggle svg { transform: rotate(180deg); }
.access-badge { display: inline-block; justify-self: start; padding: 4px 8px; border: 1px solid #4a4a50; border-radius: 4px; color: #c7c7ce; font-size: 11px; line-height: 1.4; white-space: nowrap; }
.access-admin { background: #342f22; border-color: #655735; color: #dfcc8f; }
.access-senior { background: #273330; border-color: #425e52; color: #a4c6b6; }
.access-member { background: #2b2e34; border-color: #464c57; color: #b6c0d0; }
.team-member-editor { padding: 20px 24px; border-top: 1px solid #36363b; background: #1c1c1f; }
.team-edit-form { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 18px; }
.team-edit-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.team-edit-footer button { font-size: 12px; }
.remove-member-form { margin-top: 12px; }
.remove-member-form button { padding-left: 0; font-size: 12px; }
.add-member-mark { display: grid; place-items: center; width: 25px; height: 25px; color: #ddc884; background: #363022; border-radius: 4px; font-size: 20px; font-weight: 400; }
.team-admin .add-member-panel { padding: 24px; margin-bottom: 18px; }
.team-admin .add-member-form { gap: 18px; margin-top: 24px; }
.team-admin .add-member-form > button { margin-top: 6px; }
.discord-id-help { margin-top: 20px; padding-top: 16px; border-top: 1px solid #39393e; color: #94949d; font-size: 12px; }
.discord-id-help summary { cursor: pointer; }
.discord-id-help p { font-size: 12px; margin-bottom: 0; }
.team-permissions { padding: 8px 4px; }
.team-permissions h2 { margin-bottom: 16px; font-size: 12px; color: #a5a5af; font-weight: 500; }
.team-permissions > div { display: grid; grid-template-columns: 65px 1fr; gap: 12px; align-items: start; padding: 11px 0; }
.team-permissions p { margin: 1px 0 0; font-size: 12px; color: #94949f; line-height: 1.5; }
@media(max-width: 1050px) {
    .team-admin { grid-template-columns: 1fr; }
    .team-admin .admin-sidebar { grid-template-columns: 1fr 1fr; }
    .team-permissions { padding: 12px; }
}
@media(max-width: 650px) {
    .team-admin .admin-sidebar { display: block; }
    .team-columns { display: none; }
    .team-member-summary { grid-template-columns: minmax(0, 1fr) auto; padding: 18px; gap: 12px; }
    .team-member-summary .access-badge { grid-row: 2; margin-left: 50px; }
    .member-edit-toggle { grid-row: 1 / 3; grid-column: 2; }
    .team-member-editor { padding: 18px; }
    .team-edit-form { grid-template-columns: 1fr; }
    .team-edit-footer { align-items: start; flex-direction: column; }
}
