* { box-sizing: border-box; }
body { margin: 0; padding: 32px 16px; background: #154c8c; color: #172033; font: 16px/1.5 "Segoe UI", sans-serif; }
main { margin: 0 auto; padding: 28px; border-radius: 12px; background: white; box-shadow: 0 10px 30px #0003; }
.login-panel { max-width: 440px; }
.admin-page { width: 1200px; max-width: 1200px; padding: 20px; zoom: 100%; box-shadow: none; }
.admin-page .admin-panel { font-size: 80%; }
.admin-page .admin-panel h2 { font-size: 16.8px; }
.admin-page .admin-panel button { font-size: 12px; }
.admin-page .admin-panel .hint { font-size: 11.2px; }
.admin-page .admin-panel .create-action-button { font-size: 20.8px; }
header { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.admin-page > .admin-header { display: grid; grid-template-columns: 60px 495px 495px 110px; width: 100%; height: 60px; gap: 0; padding: 0; align-items: center; }
.admin-page > .admin-header > .admin-header-logo { display: flex; width: 60px; height: 60px; margin: 0; align-items: center; justify-content: flex-start; }
.admin-page > .admin-header > .admin-header-title { margin: 0 0 0 10px; text-align: left; }
.admin-page > .admin-header > .admin-header-user { justify-self: stretch; padding-right: 10px; text-align: right; white-space: nowrap; }
.admin-page > .admin-header > .admin-header-login { display: flex; width: 110px; height: 60px; margin: 0; padding: 0; align-items: center; justify-content: flex-end; }
.admin-page > .admin-header > .admin-header-login button { width: 100px; min-width: 100px; max-width: 100px; height: 44px; min-height: 44px; margin: 0; padding: 0; text-align: center; }
header form { margin-left: auto; }
.session-actions { display: flex; align-items: center; gap: 12px; }
.signed-in-name { color: #154c8c; font-weight: 600; }
.logo { width: 52px; height: auto; }
h1, h2 { color: #154c8c; }
h1 { font-size: 25px; }
h2 { font-size: 21px; }
section { border-top: 1px solid #bae6fd; margin-top: 26px; padding-top: 10px; }
.admin-panel { display: grid; width: 1160px; max-width: 1160px; grid-template-columns: 1fr; gap: 10px; margin-top: 24px; padding: 10px; border: 0; border-radius: 12px; background: #cbd9e8; }
.management-box { width: 1140px; max-width: 1140px; min-width: 0; margin: 0 auto; padding: 18px; border: 1px solid #e0e8f0; border-radius: 9px; background: #fbfdff; }
.management-box h2 { margin-top: 0; }
.box-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.heading-title { display: flex; align-items: center; gap: 4px; }
.table-heading-toggle { cursor: pointer; user-select: none; }
.table-heading-toggle:hover { filter: brightness(.94); }
.table-heading-toggle:focus-visible { outline: 3px solid #d97706; outline-offset: 3px; }
.admin-panel-users > .box-heading { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.admin-panel-users { border: 0; padding: 16px; }
.admin-panel-users > .box-heading .create-action-button { width: 32px; min-width: 32px; height: 32px; min-height: 32px; }
.admin-panel-users > .box-heading .create-action-button[hidden] { display: none; }
.admin-panel-users > .box-heading .heading-title h2 { display: flex; height: 32px; align-items: center; margin: 0; padding: 0 8px; border-radius: 6px; background: #154c8c; color: #fff; font-size: 20.8px; }
.admin-panel-users thead th { padding-top: 4px; padding-bottom: 4px; border: 0; border-radius: 6px; background-color: #154c8c; color: #fff; }
.admin-panel-events > .box-heading { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.admin-panel-events { border: 0; padding: 16px; }
.admin-panel-events > .box-heading .create-action-button { width: 32px; min-width: 32px; height: 32px; min-height: 32px; }
.admin-panel-events > .box-heading .create-action-button[hidden] { display: none; }
.admin-panel-events > .box-heading .heading-title h2 { display: flex; height: 32px; align-items: center; margin: 0; padding: 0 8px; border-radius: 6px; background: #154c8c; color: #fff; font-size: 20.8px; }
.admin-panel-events thead th { padding-top: 4px; padding-bottom: 4px; border: 0; border-radius: 6px; background-color: #154c8c; color: #fff; }
.box-heading h2 { margin-bottom: 0; }
.button-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 6px; background: #154c8c; color: white; font-weight: 700; text-decoration: none; }
.create-action-button { width: 44px; min-width: 44px; height: 44px; padding: 0; font-size: 26px; line-height: 1; white-space: nowrap; text-align: center; }
.button-link:hover { background: #0e3766; color: white; }
.button-link.secondary { background: #e0f2fe; color: #154c8c; }
.button-link.secondary:hover { background: #bae6fd; }
.number-format-hint { color: #154c8c; font-style: italic; font-weight: 400; }
.management-wide { grid-column: 1 / -1; }
label { display: block; margin: 16px 0; font-weight: 600; }
input, select { display: block; width: 100%; padding: 10px; margin-top: 5px; border: 1px solid #94a3b8; border-radius: 6px; font: inherit; }
fieldset { border: 1px solid #cbd5e1; border-radius: 6px; padding: 10px 16px; }
fieldset[hidden] { display: none; }
fieldset label { display: flex; align-items: center; gap: 8px; font-weight: 400; }
fieldset input { display: inline-block; width: auto; margin: 0; }
button { min-height: 44px; padding: 10px 18px; border: 0; border-radius: 6px; background: #154c8c; color: white; font: 700 15px "Segoe UI", sans-serif; cursor: pointer; }
button:hover { background: #0e3766; }
.secondary { background: #e0f2fe; color: #154c8c; }
.secondary:hover { background: #bae6fd; }
a { color: #154c8c; }
:focus-visible { outline: 3px solid #d97706; outline-offset: 3px; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hint { color: #526173; font-size: 14px; }
.assigned-event { margin: 18px 0; font-weight: 600; }
.error, .success { padding: 12px; border-radius: 6px; }
.error { color: #991b1b; background: #fee2e2; }
.success { color: #166534; background: #dcfce7; }
.table-wrap { overflow-x: auto; }
.admin-panel-events .table-wrap { overflow-x: hidden; overflow-y: hidden; }
.admin-panel-events .table-wrap.grandprix-scroll { max-height: 212px; overflow-y: auto; }
.admin-panel-events .grandprix-scroll thead th { position: sticky; top: 0; z-index: 1; }
.admin-panel-users .table-wrap { overflow-x: hidden; overflow-y: hidden; }
.admin-panel-users .table-wrap.users-scroll { max-height: 212px; overflow-y: auto; }
.admin-panel-users .users-scroll thead th { position: sticky; top: 0; z-index: 1; }
table { width: 100%; border-collapse: collapse; text-align: left; }
.admin-panel-events table { width: calc(100% + 8px); margin: -4px; padding-top: 16px; table-layout: fixed; border-collapse: separate; border-spacing: 4px; }
.admin-panel-users table { width: calc(100% + 8px); margin: -4px; padding-top: 16px; table-layout: fixed; border-collapse: separate; border-spacing: 4px; }
.admin-panel-users th:nth-child(1), .admin-panel-users td:nth-child(1) { width: 110px; padding-left: 0; padding-right: 0; text-align: center; }
.admin-panel-users th:nth-child(2), .admin-panel-users td:nth-child(2) { width: 210px; }
.admin-panel-users th:nth-child(3), .admin-panel-users td:nth-child(3) { width: 95px; }
.admin-panel-users th:nth-child(4), .admin-panel-users td:nth-child(4) { width: 491px; }
.admin-panel-users th:nth-child(5), .admin-panel-users td:nth-child(5) { width: 75px; }
.admin-panel-users th:nth-child(6), .admin-panel-users td:nth-child(6) { width: 69px; padding-left: 0; padding-right: 0; }
.admin-panel-users th:nth-child(4) { overflow-wrap: anywhere; }
.admin-panel-users .user-role-cell { white-space: nowrap; }
.admin-panel-events th:nth-child(1), .admin-panel-events td:nth-child(1) { width: 64px; padding-left: 0; padding-right: 0; text-align: center; }
.admin-panel-events th:nth-child(2), .admin-panel-events td:nth-child(2) { width: 277px; }
.admin-panel-events th:nth-child(3), .admin-panel-events td:nth-child(3) { width: 250px; }
.admin-panel-events th:nth-child(4), .admin-panel-events td:nth-child(4) { width: 94px; padding-left: 0; padding-right: 0; text-align: center; white-space: nowrap; }
.admin-panel-events th:nth-child(5), .admin-panel-events td:nth-child(5) { width: 92px; padding-left: 0; padding-right: 0; text-align: center; white-space: nowrap; }
.admin-panel-events th:nth-child(6), .admin-panel-events td:nth-child(6) { width: 50px; padding-left: 0; padding-right: 0; text-align: center; }
.admin-panel-events th:nth-child(6) .participants-cell-text, .admin-panel-events td:nth-child(6) .participants-cell-text { left: 0; }
.admin-panel-events th:nth-child(7), .admin-panel-events td:nth-child(7) { width: 49px; padding-left: 0; padding-right: 0; text-align: center; }
.admin-panel-events th:nth-child(8), .admin-panel-events td:nth-child(8) { width: 89px; padding-left: 0; padding-right: 0; text-align: center; white-space: nowrap; }
.admin-panel-events th:nth-child(9), .admin-panel-events td:nth-child(9) { width: 69px; padding-left: 0; padding-right: 0; }
.admin-panel-users td { vertical-align: top; }
.admin-panel-users thead th, .admin-panel-users tbody td { border: 0; background-clip: padding-box; }
.admin-panel-users tbody td:not(:last-child) { background-color: #e6e6e6; }
.admin-panel-users tbody td:last-child { background-color: #fff; }
.admin-panel-users tbody td:nth-child(4) { background-color: #e6e6e6; border-radius: 6px; }
.admin-panel-users tbody td:nth-child(2) .user-full-name { font-weight: 400; }
.admin-panel-users tbody tr { height: 32px; }
.admin-panel-users tbody td { height: 32px; padding-top: 0; padding-bottom: 0; vertical-align: middle; border-radius: 6px; }
.admin-panel-events th, .admin-panel-events td { border: 0; }
.admin-panel-events tbody td:not(:nth-child(9)) { background-color: #e6e6e6; }
.admin-panel-events tbody tr { height: 32px; }
.admin-panel-events tbody td { height: 32px; padding-top: 0; padding-bottom: 0; vertical-align: middle; border-radius: 6px; }
.admin-panel-users th:nth-child(2), .admin-panel-users td:nth-child(2) { padding-left: 10px; border-left: 0; }
.admin-panel-users th:last-child { position: relative; padding-left: 10px; padding-right: 0; }
.admin-panel-users td:last-child { padding-right: 0; border-right: 0; }
.admin-panel-events th:first-child, .admin-panel-events td:first-child { padding-left: 0; }
.admin-panel-events th:last-child { position: relative; padding-left: 0; padding-right: 0; }
.admin-panel-events td:last-child { padding-left: 0; padding-right: 0; }
.admin-panel-users th:last-child, .admin-panel-users td:last-child { padding-left: 0; padding-right: 0; }
.admin-panel-users th:nth-child(n+2):nth-child(-n+5), .admin-panel-users td:nth-child(n+2):nth-child(-n+5) { text-align: left; }
.admin-panel-users th:nth-child(n+3):nth-child(-n+5), .admin-panel-users td:nth-child(n+3):nth-child(-n+5) { padding-left: 8px; }
.admin-panel-events td:last-child > .row-actions, .admin-panel-users td:last-child > .user-action-icons { box-sizing: border-box; display: flex; width: 69px; min-width: 69px; max-width: 69px; height: 32px; margin-left: auto; margin-right: 0; align-items: center; justify-content: flex-end; gap: 5px; }
.admin-panel-events th:last-child .gp-action-heading { position: static; display: block; text-align: center; transform: none; }
.admin-panel-events .row-actions form button { min-height: 32px; padding-top: 4px; padding-bottom: 4px; }
.admin-panel-events .row-actions .icon-button, .admin-panel-users .user-action-icons .icon-button { box-sizing: border-box; display: inline-flex; flex: 0 0 32px; width: 32px; min-width: 32px; height: 32px; min-height: 32px; margin: 0; padding: 0; border: 0; align-items: center; justify-content: center; }
.admin-panel-events .row-actions .icon-button svg { width: 18px; height: 18px; }
.admin-panel-users .user-action-icons .icon-button svg { width: 18px; height: 18px; }
.admin-panel-users .user-action-icons > form { box-sizing: border-box; display: block; flex: 0 0 32px; width: 32px; height: 32px; margin: 0; padding: 0; }
.admin-panel-users .user-action-icons > form button { box-sizing: border-box; display: inline-flex; flex: 0 0 32px; width: 32px; min-width: 32px; height: 32px; min-height: 32px; margin: 0; padding: 0; border: 0; align-items: center; justify-content: center; }
.admin-panel-users th:last-child .user-action-heading { position: static; display: block; text-align: center; transform: none; }
.participants-cell-text { position: relative; left: -18px; }
.user-identity-row { display: grid; grid-template-columns: 30ch 16ch; align-items: baseline; }
.user-full-name, .user-login-name { min-width: 0; overflow-wrap: anywhere; }
.user-role-label { margin-top: 2px; }
th, td { padding: 10px; border-bottom: 1px solid #e2e8f0; }
.row-actions, .form-actions { display: flex; align-items: center; gap: 10px; }
.row-actions form button { width: 90px; padding-left: 6px; padding-right: 6px; white-space: nowrap; }
.row-actions form button.secondary { background: #e0f2fe; color: #154c8c; }
.row-actions form button.secondary:hover { background: #bae6fd; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 6px; background: #e0f2fe; }
.icon-button:not(.danger) { color: #154c8c; }
.user-action-icons form button { width: 44px; padding: 0; }
.user-actions { align-items: flex-start; justify-content: space-between; }
.user-action-icons { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.user-action-icons > .icon-button:only-child { margin-right: 37px; }
.user-action-heading { position: absolute; left: calc(100% - 98px); top: 50%; transform: translateY(-50%); white-space: nowrap; }
.gp-action-heading { position: absolute; left: calc(100% - 188px); top: 50%; transform: translateY(-50%); white-space: nowrap; }
.icon-button:hover { background: #bae6fd; }
.danger { background: #fee2e2; color: #991b1b; }
.danger:hover { background: #fecaca; }
.delete-panel { border: 1px solid #fecaca; border-radius: 8px; padding: 16px; }
.confirm-dialog { width: min(420px, calc(100vw - 32px)); border: 0; border-radius: 10px; padding: 24px; color: #172033; box-shadow: 0 16px 48px #0005; }
.confirm-dialog::backdrop { background: #0008; }
.confirm-dialog h2 { margin: 0 0 10px; }
.confirm-dialog p { margin: 0 0 22px; }
.confirm-dialog .form-actions { justify-content: flex-end; }
.confirm-dialog .form-actions button { min-width: 120px; }
@media (max-width: 700px) { .admin-panel { grid-template-columns: 1fr; padding: 12px; } .management-wide { grid-column: auto; } }
@media (max-width: 520px) { main { padding: 18px; } .two-columns { grid-template-columns: 1fr; gap: 0; } .management-box { padding: 14px; } }
