html, body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
.admin-shell, .login-shell { overflow: visible; }

.login-shell { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-form { container-type: inline-size; width: min(100%, 430px); padding: clamp(28px, 7cqi, 42px); border: 1px solid var(--line); background: rgba(247,248,237,.84); box-shadow: 0 28px 70px rgba(0,72,43,.12); }
.login-form img { width: 72px; margin-bottom: 30px; }
.login-form h1 { max-width: 100%; margin-bottom: 32px; font-size: clamp(36px, 12cqi, 52px); line-height: .88; }
.login-form h1 span { display: block; }
.login-form label, .admin-form label { display: grid; gap: 8px; font-size: 13px; font-weight: 700; }
.login-form input, .admin-form input:not([type="file"]), .admin-form select { width: 100%; border: 1px solid rgba(7,26,23,.34); padding: 12px 13px; color: var(--ink); background: rgba(255,255,255,.7); }
.login-form button { width: 100%; margin-top: 18px; }
.login-form > a { display: inline-block; margin-top: 20px; color: inherit; font-size: 13px; }
.form-error { color: var(--danger); font-size: 13px; }

.admin-shell { position: relative; width: min(1500px, 100%); min-height: 100dvh; margin: auto; padding: clamp(24px,4vw,60px); }
.admin-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 28px; border-bottom: 1px solid var(--ink); }
.admin-title { display: flex; align-items: flex-start; gap: clamp(16px,2vw,28px); }
.admin-home { flex: 0 0 auto; display: block; border-radius: 2px; }
.admin-home img { display: block; width: clamp(48px,4.2vw,68px); height: auto; }
.admin-home:focus-visible { outline: 3px solid var(--gold); outline-offset: 5px; }
.admin-header h1 { font-size: clamp(48px,7vw,100px); }
.admin-header nav { display: flex; gap: 20px; }
.admin-header a, .template-link { color: inherit; text-underline-offset: 4px; }
.notice { margin-top: 22px; padding: 14px 16px; border-left: 4px solid var(--green); background: rgba(255,255,255,.64); }
.error-notice { border-color: var(--danger); }
.import-errors { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); background: rgba(255,255,255,.55); }
.import-errors li { margin: 6px 0; }
.admin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px,6vw,90px); padding: clamp(38px,6vw,82px) 0; }
.admin-form { display: grid; align-content: start; gap: 18px; }
.form-heading { display: grid; grid-template-columns: 34px 1fr; gap: 16px; margin-bottom: 8px; }
.form-heading > span { font: 12px/1 Consolas,"Courier New",monospace; color: var(--green); }
.form-heading h2 { margin: 0; font-size: clamp(28px,3vw,44px); letter-spacing: -.04em; }
.form-heading p { margin: 7px 0 0; line-height: 1.4; }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.admin-form .primary-action { justify-self: start; min-width: 170px; }
.file-drop { min-height: 150px; place-content: center; justify-items: center; border: 1px dashed rgba(7,26,23,.48); background: rgba(255,255,255,.45); cursor: pointer; }
.file-drop input { width: 1px; height: 1px; opacity: 0; position: absolute; }
.file-drop b { font-size: 18px; }
.file-drop span { font: 11px/1 Consolas,"Courier New",monospace; font-weight: 400; }
.column-guide { margin: 0; font-size: 13px; line-height: 1.6; }
.template-link { font-size: 13px; }
.participant-register { margin-top: 30px; padding: 30px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); }
.register-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.register-heading h2 { margin: 0; font-size: clamp(28px,4vw,52px); letter-spacing: -.04em; }
.register-tools { display: flex; align-items: center; gap: 18px; }
.register-tools p { margin: 0; font: 11px/1 Consolas,"Courier New",monospace; }
.register-tools button { border: 1px solid rgba(150,38,31,.48); padding: 9px 11px; color: var(--danger); background: rgba(255,255,255,.48); font: 700 10px/1 Consolas,"Courier New",monospace; letter-spacing: .05em; text-transform: uppercase; }
.register-tools .print-qr-action { border-color: var(--green); color: #fff; background: var(--green); }
.register-tools .print-qr-action:disabled { opacity: .42; cursor: not-allowed; }
.print-qr-action span { display: inline-grid; min-width: 18px; height: 18px; margin-left: 5px; place-items: center; border-radius: 50%; color: var(--green); background: #fff; }
.selection-help { margin-top: 20px; font-size: 13px; }
.table-scroll-shell { position: relative; margin-top: 26px; padding-right: 22px; }
.table-wrap { max-height: min(48vh, 560px); overflow: auto; scrollbar-width: none; border: 1px solid var(--line); }
.table-wrap::-webkit-scrollbar { display: none; }
.table-scrollbar { position: absolute; top: 0; right: 0; bottom: 0; width: 12px; border-radius: 8px; background: rgba(7,26,23,.14); cursor: pointer; touch-action: none; }
.table-scrollbar span { display: block; width: 12px; min-height: 52px; border-radius: 8px; background: var(--green); box-shadow: 0 0 0 1px rgba(0,72,43,.2); cursor: grab; touch-action: none; }
.table-scrollbar span:active { cursor: grabbing; background: #005d37; }
.table-scrollbar:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
table { width: 100%; border-collapse: collapse; background: rgba(255,255,255,.38); }
th, td { padding: 14px 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { font: 10px/1 Consolas,"Courier New",monospace; letter-spacing: .08em; text-transform: uppercase; }
thead th { position: sticky; top: 0; z-index: 1; background: #f4f7e9; }
td { font-size: 13px; }
.empty-table { padding: 34px 12px; color: rgba(7,26,23,.58); text-align: center; }
.select-column { width: 54px; text-align: center; }
.select-column label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.select-column input { width: 17px; height: 17px; accent-color: var(--green); }
.inactive-participant td { color: rgba(7,26,23,.55); background: rgba(7,26,23,.035); }
.status-badge { display: inline-flex; align-items: center; gap: 6px; font: 700 9px/1 Consolas,"Courier New",monospace; letter-spacing: .06em; text-transform: uppercase; }
.status-badge::before { width: 7px; height: 7px; border-radius: 50%; background: currentColor; content: ""; }
.status-badge.active { color: var(--green); }
.status-badge.inactive { color: var(--danger); }
.row-actions { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.row-actions form { margin: 0; }
.table-action { border: 1px solid rgba(7,26,23,.28); padding: 7px 8px; color: var(--ink); background: rgba(255,255,255,.58); font: 700 9px/1 Consolas,"Courier New",monospace; text-transform: uppercase; }
.table-action:hover { border-color: var(--green); color: var(--green); }
.table-action.danger { color: var(--danger); }
.edit-dialog { width: min(520px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); color: var(--ink); background: rgba(247,248,237,.98); box-shadow: 0 30px 90px rgba(7,26,23,.28); }
.edit-dialog::backdrop { background: rgba(7,26,23,.48); backdrop-filter: blur(5px); }
.edit-dialog .admin-form { padding: 30px; }
.dialog-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.dialog-heading h2 { margin: 5px 0 0; font-size: 36px; letter-spacing: -.04em; }
.dialog-close { border: 0; padding: 0; color: inherit; background: transparent; font: 32px/1 Arial,sans-serif; }
.dialog-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.secondary-action { border: 1px solid rgba(7,26,23,.32); padding: 12px 16px; color: inherit; background: transparent; font-weight: 700; }

@media (max-width: 760px) {
  .admin-header { display: grid; }
  .admin-actions { grid-template-columns: 1fr; }
  .field-pair { grid-template-columns: 1fr; }
  .register-heading { align-items: flex-start; flex-direction: column; }
  .register-tools { align-items: flex-start; flex-direction: column; }
  .login-form { padding: 30px 24px; }
}
