.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.no-spinner {
    appearance: textfield;
    -moz-appearance: textfield;
}

:root {
    --settings-control-height: 2rem;
    --settings-control-width: 4rem;
}

.contest-name-input {
    width: 100%;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    background: #f5f5f5;
    color: #222;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.theme-dark,
body.theme-dark h1,
body.theme-dark h2,
body.theme-dark h3,
body.theme-dark h4,
body.theme-dark h5,
body.theme-dark h6,
body.theme-dark p,
body.theme-dark label,
body.theme-dark span,
body.theme-dark td,
body.theme-dark th,
body.theme-dark li,
body.theme-dark dt,
body.theme-dark dd {
    color: #e5e7eb;
}

body.theme-dark {
    background: #0f172a;
    color-scheme: dark;
}

body.theme-dark a {
    color: #93c5fd;
}

body.theme-dark a:hover,
body.theme-dark a:focus {
    color: #bfdbfe;
}

body.theme-dark .page {
    background: #111827;
    box-shadow: 0 24px 48px rgba(2, 6, 23, 0.6);
}

body.theme-dark .settings-section,
body.theme-dark .contest-settings-section,
body.theme-dark .course-settings-section,
body.theme-dark .account-section,
body.theme-dark .debug-section,
body.theme-dark .danger-section,
body.theme-dark .auth-card {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 18px 36px rgba(8, 12, 24, 0.45);
}

body.theme-dark table th,
body.theme-dark table td {
    background: #16223b;
    border-color: #2b3651;
}

body.theme-dark table th {
    background: #1e2c48;
}

body.theme-dark .contests-table tbody tr:nth-child(even) td,
body.theme-dark .users-table tbody tr:nth-child(even) td,
body.theme-dark .members-table tbody tr:nth-child(even) td,
body.theme-dark .standings-table tbody tr:nth-child(even) td {
    background: #141f34;
}

body.theme-dark .contests-table tbody tr:nth-child(odd) td,
body.theme-dark .users-table tbody tr:nth-child(odd) td,
body.theme-dark .members-table tbody tr:nth-child(odd) td,
body.theme-dark .standings-table tbody tr:nth-child(odd) td {
    background: #111f2d;
}

body.theme-dark .users-table tr.current-user td,
body.theme-dark .members-table tr.current-user td {
    background: rgba(253, 186, 116, 0.18);
    color: #fdba74;
}

body.theme-dark .users-table tr.current-user td:first-child,
body.theme-dark .members-table tr.current-user td:first-child {
    border-left-color: rgba(251, 191, 36, 0.55);
}

body.theme-dark .users-table tr.current-user td:last-child,
body.theme-dark .members-table tr.current-user td:last-child {
    border-right-color: rgba(251, 191, 36, 0.55);
}

body.theme-dark .header-search-form .search-input,
body.theme-dark .contest-settings-input,
body.theme-dark .contest-task-short-input,
body.theme-dark .contest-task-datetime-input,
body.theme-dark .contest-task-title-input,
body.theme-dark .max-grade-input,
body.theme-dark .max-score-input,
body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
    background: #111f2d;
    border-color: #374151;
    color: #f9fafb;
    caret-color: #f9fafb;
}

body.theme-dark .contest-task-text,
body.theme-dark .contest-task-number {
    color: #f9fafb;
}

body.theme-dark select option {
    background-color: #0f172a;
    color: #f3f4f6;
}

body.theme-dark select option:checked,
body.theme-dark select option:hover,
body.theme-dark select option:focus {
    background-color: #2563eb;
    color: #f8fafc;
}

body.theme-dark input::placeholder,
body.theme-dark textarea::placeholder {
    color: #9ca3af;
}

body.theme-dark .profile-dropdown {
    background: #111f2d;
    color: #e5e7eb;
    border: 1px solid #374151;
    box-shadow: 0 24px 48px rgba(2, 6, 23, 0.6);
}

body.theme-dark .profile-submenu {
    background: #111f2d;
    border: 1px solid #374151;
    box-shadow: 0 20px 45px rgba(2, 6, 23, 0.6);
}

body.theme-dark .profile-manage.is-open .profile-menu-link-manage {
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
}

body.theme-dark .profile-dropdown-name {
    color: #f9fafb;
}

body.theme-dark .profile-menu-link {
    color: #d1d5db;
}

body.theme-dark .profile-menu-link:hover,
body.theme-dark .profile-menu-link:focus-visible {
    background: rgba(59, 130, 246, 0.15);
    color: #ffffff;
}

body.theme-dark .profile-menu-link-danger {
    color: #fca5a5;
}

body.theme-dark .profile-menu-link-danger:hover,
body.theme-dark .profile-menu-link-danger:focus-visible {
    background: rgba(248, 113, 113, 0.18);
    color: #fecaca;
}

body.theme-dark .profile-dropdown-avatar {
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
}

body.theme-dark .role-chip {
    border-color: #4b5563;
    color: #e5e7eb;
}

body.theme-dark .role-chip-god {
    background: rgba(147, 51, 234, 0.28);
    border-color: rgba(192, 132, 252, 0.55);
    color: #f3e8ff;
}

body.theme-dark .role-chip-admin {
    background: rgba(249, 115, 22, 0.22);
    border-color: rgba(251, 146, 60, 0.55);
    color: #ffedd5;
}

body.theme-dark .role-chip-manager {
    background: rgba(37, 99, 235, 0.25);
    border-color: rgba(59, 130, 246, 0.6);
    color: #dbeafe;
}

body.theme-dark .role-chip-user {
    background: rgba(37, 99, 235, 0.18);
    border-color: rgba(96, 165, 250, 0.5);
    color: #e0f2fe;
}

body.theme-dark .badge {
    background: rgba(148, 163, 184, 0.2);
    color: #f3f4f6;
}

body.theme-dark .badge-ejudge {
    background: rgba(59, 130, 246, 0.25);
    color: #bfdbfe;
}

body.theme-dark .badge-manual {
    background: rgba(147, 51, 234, 0.28);
    color: #ddd6fe;
}

body.theme-dark .badge-admin {
    background: rgba(249, 115, 22, 0.25);
    color: #fdba74;
}

body.theme-dark .badge-master {
    background: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
}

body.theme-dark .badge-god {
    background: rgba(168, 85, 247, 0.25);
    color: #e9d5ff;
}

body.theme-dark .badge-judge {
    background: rgba(234, 179, 8, 0.28);
    color: #fde68a;
}

body.theme-dark .badge-user {
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
}

body.theme-dark .badge.muted {
    background: rgba(107, 114, 128, 0.35);
    color: #cbd5f5;
}

body.theme-dark .icon-button {
    border-color: #374151;
    background: #1f2937;
    color: #93c5fd;
}

body.theme-dark .icon-button:hover,
body.theme-dark .icon-button:focus {
    background: #273449;
    border-color: #4b5563;
    color: #bfdbfe;
}

body.theme-dark .icon-button.danger {
    background: rgba(248, 113, 113, 0.2);
    border-color: rgba(248, 113, 113, 0.45);
    color: #fca5a5;
}

body.theme-dark .icon-button.danger:hover,
body.theme-dark .icon-button.danger:focus {
    background: rgba(248, 113, 113, 0.32);
    border-color: rgba(248, 113, 113, 0.65);
    color: #fecaca;
}

body.theme-dark .icon-button.enter {
    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;
}

body.theme-dark .icon-button.enter:hover,
body.theme-dark .icon-button.enter:focus {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

body.theme-dark .action-chip {
    background: rgba(59, 130, 246, 0.18);
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.45);
}

body.theme-dark .action-chip:hover,
body.theme-dark .action-chip:focus {
    background: rgba(59, 130, 246, 0.28);
    color: #dbeafe;
    border-color: rgba(147, 197, 253, 0.6);
}

body.theme-dark .modal-content {
    background: #1f2937;
    border: 1px solid #374151;
    color: #f3f4f6;
    box-shadow: 0 24px 48px rgba(2, 6, 23, 0.6);
}

body.theme-dark .modal-content h2 {
    color: #f9fafb;
}

body.theme-dark .modal-content p {
    color: #d1d5db;
}

body.theme-dark .bug-report-modal .modal-footer .button-secondary {
    background: rgba(59, 130, 246, 0.18);
    border-color: rgba(96, 165, 250, 0.45);
    color: #bfdbfe;
}

body.theme-dark .bug-report-modal .modal-footer .button-secondary:hover,
body.theme-dark .bug-report-modal .modal-footer .button-secondary:focus {
    background: rgba(59, 130, 246, 0.28);
    border-color: rgba(147, 197, 253, 0.6);
    color: #dbeafe;
}

body.theme-dark .theme-toggle-icon {
    transform: rotate(-15deg);
}

body.theme-dark .toast {
    background: #1f2937;
    color: #f3f4f6;
    border-color: #374151;
}

.page,
.settings-section,
.profile-dropdown,
.modal-content,
table th,
table td,
.icon-button,
.profile-menu-link,
.header-search-form .search-input,
.contest-task-short-input,
.contest-task-title-input,
.max-grade-input,
.max-score-input,
.contest-settings-input,
input,
select,
textarea {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.page {
    width: min(1100px, calc(100vw - 2rem));
    margin: 2rem auto;
    background: #fff;
    padding: 2rem;
    padding-bottom: 3.25rem;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.page.auth-page {
    width: min(480px, calc(100vw - 2rem));
    max-width: 480px;
    margin: 0;
}

header h1 {
    margin: 0 0 1.5rem;
    font-size: 2rem;
}

.page > section {
    margin-top: 2rem;
}

.page > section.teachers {
    margin-top: 1.25rem;
}

.page > section:first-of-type {
    margin-top: 0;
}

.messages {
    list-style: none;
    padding: 0;
}
body.modal-open {
    overflow: hidden;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, -12px, 0);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.modal.is-open {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    pointer-events: auto;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.55);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.modal.is-open .modal-backdrop {
    opacity: 1;
}

.modal-content {
    position: relative;
    z-index: 1;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
    padding: 2rem;
    width: min(90vw, 480px);
    max-height: 90vh;
    overflow-y: auto;
    transform: translate3d(0, -16px, 0);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.modal.is-open .modal-content {
    transform: translate3d(0, 0, 0);
    opacity: 1;
}

.modal-content p {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.modal-content.bug-report-modal {
    width: min(90vw, 420px);
    max-width: 420px;
}

.bug-report-text {
    margin: 0 0 1.5rem;
    line-height: 1.5;
    color: #1f2937;
}

.bug-report-text a {
    color: #1c64f2;
    font-weight: 600;
    text-decoration: none;
}

.bug-report-text a:hover,
.bug-report-text a:focus {
    color: #123f99;
    text-decoration: underline;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.modal-content.members-modal {
    width: min(90vw, 480px);
    max-width: 30rem;
}

.modal-content.task-create-modal {
    width: min(90vw, 520px);
    max-width: 32rem;
}

.modal-content.task-edit-modal {
    width: min(90vw, 520px);
    max-width: 32rem;
}

.modal-description {
    margin-top: -0.5rem;
    margin-bottom: 1.5rem;
    color: #4b5563;
}

.task-create-form .field,
.task-edit-form .field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.task-create-form input[type="text"],
.task-create-form input[type="number"],
.task-edit-form input[type="text"],
.task-edit-form input[type="number"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    font-size: 0.95rem;
    box-sizing: border-box;
}

body.theme-dark .task-create-form input[type="text"],
body.theme-dark .task-create-form input[type="number"],
body.theme-dark .task-edit-form input[type="text"],
body.theme-dark .task-edit-form input[type="number"] {
    background: #111f2d;
    border-color: #374151;
    color: #f9fafb;
    caret-color: #f9fafb;
}

.task-create-form input[type="text"]:focus,
.task-create-form input[type="number"]:focus,
.task-edit-form input[type="text"]:focus,
.task-edit-form input[type="number"]:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.task-edit-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}
.task-create-actions {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-create-actions button {
    width: 100%;
}

.task-create-secondary {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
}

.task-create-secondary .button[disabled] {
    cursor: not-allowed;
    opacity: 0.45;
}

.member-modal {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.member-modal-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.member-modal-section h3 {
    margin: 0;
    font-size: 1.1rem;
}

.member-modal-results {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    max-height: 24rem;
    overflow-y: auto;
}

.member-modal-results table {
    width: 100%;
    border-collapse: collapse;
}

.member-modal-results thead th {
    position: sticky;
    top: 0;
    background: #eef2ff;
    z-index: 1;
}

@media (min-width: 960px) {
    .member-modal {
        flex-direction: row;
        align-items: flex-start;
    }

    .member-modal-section {
        flex: 1;
    }
}

.contest-modal {
    width: min(90vw, 480px);
    max-width: 30rem;
}

.contest-picker-modal {
    max-width: 22rem;
}

.contest-action-picker {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
}

.contest-action-button {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.contest-action-button:hover,
.contest-action-button:focus {
    background: #eef2ff;
    border-color: #9ab4ff;
    box-shadow: 0 0 0 3px rgba(28, 100, 242, 0.12);
    outline: none;
}

body.theme-dark .contest-action-button {
    background: rgba(31, 41, 55, 0.95);
    border-color: #374151;
    color: #e5e7eb;
}

body.theme-dark .contest-action-button:hover,
body.theme-dark .contest-action-button:focus {
    background: rgba(37, 99, 235, 0.24);
    border-color: rgba(96, 165, 250, 0.45);
    color: #dbeafe;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28);
}

.contest-modal .modal-search-form {
    margin-bottom: 1.5rem;
}

.modal-search-form .search-input {
    width: 100%;
    padding: 0.5rem 0.9rem;
    border: 1px solid #cbd5f5;
    border-radius: 999px;
    background: #f7f9ff;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-search-form .search-input:focus {
    outline: none;
    border-color: #1c64f2;
    box-shadow: 0 0 0 3px rgba(28, 100, 242, 0.18);
}

body.theme-dark .modal-search-form .search-input {
    background: rgba(17, 24, 39, 0.85);
    border-color: #374151;
    color: #e5e7eb;
}

body.theme-dark .modal-search-form .search-input::placeholder {
    color: #9ca3af;
}

body.theme-dark .modal-search-form .search-input:focus {
    border-color: #4c6ef5;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.24);
}

.contest-modal-hint {
    margin: 0;
    color: #4b5563;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: none;
    background: #f2f6ff;
    color: #1c64f2;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
    background: #dbe6ff;
    color: #123f99;
}

body.theme-dark .modal-close {
    background: rgba(37, 99, 235, 0.18);
    color: #bfdbfe;
}

body.theme-dark .modal-close:hover,
body.theme-dark .modal-close:focus {
    background: rgba(37, 99, 235, 0.28);
    color: #e0f2fe;
}

.modal-form button[type="submit"] {
    width: 100%;
}

.confirm-modal {
    max-width: 26rem;
    text-align: left;
}

.confirm-modal-message {
    margin: 1rem 0 1.5rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.detach-options {
    margin: 1rem 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detach-option {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.detach-option label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 600;
}

.detach-option label input[type="checkbox"] {
    margin-top: 0.2rem;
}

.detach-option-description {
    margin: 0 0 0 1.75rem;
    color: #4b5563;
    font-size: 0.9rem;
    line-height: 1.4;
}

.detach-suboption {
    margin: 0 0 0 1.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: #4b5563;
    font-size: 0.9rem;
}

.detach-suboption input[type="checkbox"] {
    margin-top: 0.2rem;
}

.detach-option.is-hidden,
.detach-suboption.is-hidden {
    display: none;
}

.detach-suboption.is-disabled {
    opacity: 0.55;
}

.button-secondary,
.button-danger {
    border: none;
    border-radius: 999px;
    padding: 0.5rem 1.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.button-secondary {
    background: #eef2ff;
    color: #1c64f2;
}

.button-secondary:hover,
.button-secondary:focus {
    background: #dbe6ff;
    color: #123f99;
    box-shadow: 0 0 0 3px rgba(28, 100, 242, 0.15);
}

.button-danger {
    background: #c21717;
    color: #ffffff;
}

.button-danger:hover,
.button-danger:focus {
    background: #9f1313;
    color: #ffffff;
    box-shadow: 0 0 0 3px rgba(194, 23, 23, 0.2);
}

.messages li {
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.messages li.error {
    background: #ffe2e2;
    color: #a70000;
}

.messages li.success {
    background: #e2f9e5;
    color: #0f7a2a;
}

.toast-stack {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(90vw, 420px);
    z-index: 2500;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    box-shadow: 0 18px 45px rgba(17, 24, 39, 0.18);
    background: #f1f2f4;
    color: #1c1c1d;
    opacity: 0;
    transform: translate3d(0, -12px, 0);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.success {
    background: #e2f9e5;
    color: #0f7a2a;
}

.toast.error {
    background: #ffe2e2;
    color: #a70000;
}

.toast.warning {
    background: #fff4d6;
    color: #533306;
}

.toast.info {
    background: #dff1ff;
    color: #0a4c8b;
}

.toast-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.toast-text {
    flex: 1 1 auto;
}

.toast-close {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover,
.toast-close:focus {
    background: rgba(0, 0, 0, 0.08);
}

.toast.is-hiding {
    opacity: 0;
    transform: translate3d(0, -10px, 0);
}

.toast.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.page-header {
    margin-bottom: 1.75rem;
}

.auth-page .page-header {
    margin-bottom: 2rem;
}

.page-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.page-header-heading {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    flex: 1 1 16rem;
    min-width: 0;
}

.page-header-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.page-header-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.page-header-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.page-header-subtitle {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #4b5563;
}

.page-header-meta-separator {
    color: #9ca3af;
}

body.theme-dark .page-header-subtitle {
    color: #cbd5f5;
}

body.theme-dark .page-header-meta-separator {
    color: #64748b;
}

.page-header-heading h1 {
    margin: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.course-section + .page-footer,
.page-footer {
    padding-top: 2rem;
}

.page-footer {
    display: flex;
    justify-content: flex-end;
}

.page-footer .leave-course-form {
    margin: 0;
}

.page-footer .leave-course-form .button-danger {
    min-width: 10rem;
}


.brand-title {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    line-height: 1;
}

.brand-name {
    display: inline-flex;
    align-items: center;
    font-family: 'Segoe UI', 'Helvetica Neue', 'Montserrat', Arial, sans-serif;
    font-size: clamp(1.8rem, 1.05rem + 1.6vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #1c64f2;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .brand-name {
        background: linear-gradient(135deg, #1c64f2 0%, #4f46e5 45%, #9333ea 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }
}

.app-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #4f46e5, #1c64f2);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(28, 100, 242, 0.25);
}

.page-header-eyebrow {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    font-weight: 700;
}

.page-header-eyebrow-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.page-title {
    font-family: 'Segoe UI', 'Helvetica Neue', 'Montserrat', Arial, sans-serif;
    font-size: clamp(1.85rem, 1.15rem + 1.8vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #111827;
    line-height: 1.05;
}

.page-title strong {
    font-weight: inherit;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .page-title {
        background: linear-gradient(135deg, #0f172a 0%, #1c64f2 40%, #9333ea 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        -webkit-text-fill-color: transparent;
    }
}

.page-header-subtitle {
    margin: 0;
    color: #4b5563;
    font-size: 1rem;
    line-height: 1.5;
}

.page-greeting {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.profile-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.avatar-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.avatar-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(28, 100, 242, 0.25);
}

.avatar-ring {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #4c6ef5, #15aabf);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.03em;
    overflow: hidden;
}

.profile-menu.is-open .avatar-ring,
.avatar-button:hover .avatar-ring {
    filter: brightness(0.95);
}

.avatar-initials {
    text-transform: uppercase;
}

.avatar-ring-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-display {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #4c6ef5, #15aabf);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    overflow: hidden;
}

.avatar-display-medium {
    width: 3.25rem;
    height: 3.25rem;
    font-size: 1.1rem;
}

.avatar-display-large {
    width: 4rem;
    height: 4rem;
    font-size: 1.3rem;
}

.avatar-display-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-display-initials {
    text-transform: uppercase;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 0;
    width: min(18rem, 70vw);
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 20px 45px rgba(17, 24, 39, 0.12);
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1200;
}

.profile-menu.is-open .profile-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.profile-dropdown:focus {
    outline: none;
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.profile-dropdown-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #4c6ef5, #15aabf);
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.04em;
    overflow: hidden;
}

.profile-dropdown-initials {
    text-transform: uppercase;
}

.profile-dropdown-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-dropdown-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.profile-dropdown-name {
    font-weight: 700;
    font-size: 1rem;
    color: #111827;
}

.profile-dropdown-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.profile-menu-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 0.5rem;
    border-radius: 10px;
    border: none;
    background: transparent;
    text-decoration: none;
    color: #1f2937;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.2s ease, color 0.2s ease;
    cursor: pointer;
    text-align: left;
}

.profile-menu-link:hover,
.profile-menu-link:focus-visible {
    background: #f2f6ff;
    color: #123f99;
    outline: none;
}

.profile-menu-link-manage {
    padding-right: 0.75rem;
}

.profile-menu-link-manage .icon-chevron {
    margin-left: auto;
}

.profile-menu-link-danger {
    background: #c21717;
    color: #ffffff;
}

.profile-menu-link-danger:hover,
.profile-menu-link-danger:focus-visible {
    background: #a01010;
    color: #ffffff;
}

.profile-manage {
    position: relative;
}

.profile-manage.is-open .profile-menu-link-manage {
    background: #f2f6ff;
    color: #123f99;
}

.profile-submenu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    min-width: 14rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 16px 35px rgba(17, 24, 39, 0.15);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    z-index: 1300;
}

.profile-manage.is-open .profile-submenu {
    display: flex;
}

.server-clock-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0.5rem 1.25rem;
    background: rgba(17, 24, 39, 0.92);
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
    z-index: 1500;
    box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.35);
    font-variant-numeric: tabular-nums;
}

.server-clock-bar span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.server-clock-timezone {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.server-clock-separator {
    opacity: 0.7;
}

.profile-menu-form {
    margin: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid #cbd5f5;
    background: #f2f6ff;
    color: #1c64f2;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.back-link:hover,
.back-link:focus {
    background: #dbe6ff;
    border-color: #9ab4ff;
    color: #123f99;
    box-shadow: 0 0 0 3px rgba(28, 100, 242, 0.15);
}

body.theme-dark .back-link {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(147, 197, 253, 0.45);
    color: #bfdbfe;
}

body.theme-dark .back-link:hover,
body.theme-dark .back-link:focus {
    background: rgba(37, 99, 235, 0.34);
    border-color: rgba(191, 219, 254, 0.65);
    color: #e0f2fe;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.28);
}

.icon-arrow-left {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c64f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 18 9 12 15 6'/%3E%3Cline x1='9' y1='12' x2='21' y2='12'/%3E%3C/svg%3E") center/contain no-repeat;
}

.back-link:hover .icon-arrow-left,
.back-link:focus .icon-arrow-left {
    filter: drop-shadow(0 0 0 rgba(18, 63, 153, 0.4));
}

body.theme-dark .back-link .icon-arrow-left {
    filter: brightness(1.2);
}

body.theme-dark .back-link:hover .icon-arrow-left,
body.theme-dark .back-link:focus .icon-arrow-left {
    filter: brightness(1.1) drop-shadow(0 0 0 rgba(37, 99, 235, 0.45));
}

.page-header-actions .inline-form {
    margin: 0;
}


.icon-logout,
.icon-settings,
.icon-layers,
.icon-chevron,
.icon-flag,
.icon-users,
.icon-bug,
.icon-moon,
.icon-sun {
    display: inline-block;
    width: 1rem;
    height: 1rem;
}

.icon-logout {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpolyline points='16 17 21 12 16 7'/%3E%3Cline x1='21' y1='12' x2='9' y2='12'/%3E%3C/svg%3E") center/1rem 1rem no-repeat;
}

.icon-settings {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c64f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9c0 .69.4 1.31 1.01 1.59.3.14.64.21.99.21H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z'/%3E%3C/svg%3E") center/1rem 1rem no-repeat;
}

.icon-layers {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c64f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolygon points='12 2 2 7 12 12 22 7 12 2'/%3E%3Cpolyline points='2 17 12 22 22 17'/%3E%3Cpolyline points='2 12 12 17 22 12'/%3E%3C/svg%3E") center/1rem 1rem no-repeat;
}

.icon-chevron {
    width: 0.75rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c64f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") center/0.75rem 0.75rem no-repeat;
    transition: transform 0.2s ease;
}

.profile-manage.is-open .icon-chevron {
    transform: rotate(-180deg);
}

.icon-flag {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c64f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1v18'/%3E%3C/svg%3E") center/1rem 1rem no-repeat;
}

.icon-users {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c64f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3Cpath d='M23 21v-2a4 4 0 0 0-3-3.87'/%3E%3Cpath d='M16 3.13a4 4 0 0 1 0 7.75'/%3E%3C/svg%3E") center/1rem 1rem no-repeat;
}

.icon-bug {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c64f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v3'/%3E%3Cpath d='M16 2v3'/%3E%3Cpath d='M12 11v3'/%3E%3Cpath d='M2 12h3'/%3E%3Cpath d='M19 12h3'/%3E%3Cpath d='M3.4 6.6 5.5 8'/%3E%3Cpath d='M18.6 6.6 16.5 8'/%3E%3Cpath d='M3.4 17.4 5.5 16'/%3E%3Cpath d='M18.6 17.4 16.5 16'/%3E%3Cpath d='M12 19c-4 0-5-4-5-8a5 5 0 0 1 10 0c0 4-1 8-5 8Z'/%3E%3C/svg%3E") center/1rem 1rem no-repeat;
}

.icon-moon {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c64f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79Z'/%3E%3C/svg%3E") center/1rem 1rem no-repeat;
}

.icon-sun {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23facc15' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cline x1='12' y1='1' x2='12' y2='3'/%3E%3Cline x1='12' y1='21' x2='12' y2='23'/%3E%3Cline x1='4.22' y1='4.22' x2='5.64' y2='5.64'/%3E%3Cline x1='18.36' y1='18.36' x2='19.78' y2='19.78'/%3E%3Cline x1='1' y1='12' x2='3' y2='12'/%3E%3Cline x1='21' y1='12' x2='23' y2='12'/%3E%3Cline x1='4.22' y1='19.78' x2='5.64' y2='18.36'/%3E%3Cline x1='18.36' y1='5.64' x2='19.78' y2='4.22'/%3E%3C/svg%3E") center/1rem 1rem no-repeat;
}

.theme-toggle-icon {
    margin-right: 0;
    transition: transform 0.3s ease;
}

.page-header .subtitle {
    margin: 0.25rem 0 0.75rem;
    color: #555;
}

.auth {
    display: flex;
    justify-content: center;
}

.auth-card {
    width: min(100%, 360px);
    background: #ffffff;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(17, 24, 39, 0.12);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-title {
    margin: 0;
    font-size: 1.75rem;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-submit {
    padding: 0.65rem 1.4rem;
    font-size: 1.05rem;
    border-radius: 8px;
    border: none;
    background: #1c64f2;
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.auth-submit:hover,
.auth-submit:focus {
    background: #174fc4;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.users .section-actions {
    margin-left: auto;
    justify-content: flex-end;
}

.users .section-actions .header-search-form {
    margin-left: 0;
}

.section-actions .header-search-form {
    margin-left: auto;
}

.field {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.settings-form .field {
    margin-bottom: 0;
}

.settings-form .field + .field {
    margin-top: 0.25rem;
}

.field.compact {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.field.compact label {
    margin: 0;
}

.field input,
.field select,
.field textarea {
    padding: 0.5rem;
    border: 1px solid #d3d3d3;
    border-radius: 6px;
    font-size: 1rem;
}

form button:not(.action-chip):not(.icon-button):not(.button-danger):not(.button-secondary):not(.profile-menu-link):not(.profile-menu-link-danger) {
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    border-radius: 6px;
    border: none;
    background: #1c64f2;
    color: #fff;
    cursor: pointer;
    margin-top: 0.35rem;
}

form button:not(.action-chip):not(.icon-button):not(.button-danger):not(.button-secondary):not(.profile-menu-link):not(.profile-menu-link-danger):hover {
    background: #174fc4;
}

body.theme-dark form button:not(.action-chip):not(.icon-button):not(.button-danger):not(.button-secondary):not(.profile-menu-link):not(.profile-menu-link-danger) {
    background: rgba(59, 130, 246, 0.88);
    color: #f8fafc;
}

body.theme-dark form button:not(.action-chip):not(.icon-button):not(.button-danger):not(.button-secondary):not(.profile-menu-link):not(.profile-menu-link-danger):hover {
    background: rgba(37, 99, 235, 0.92);
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 0.4rem;
    text-align: left;
    border-bottom: 1px solid #ececec;
    background: #fff;
    color: #222;
}

table th {
    background: #f3f5f9;
    font-weight: 700;
}

.sortable {
    white-space: nowrap;
}

.login-column,
.login-cell {
    width: 7rem;
    min-width: 7rem;
    white-space: nowrap;
}

.role-column,
.role-cell {
    width: 10.5rem;
    min-width: 10.5rem;
}

.members-table tr > th,
.members-table tr > td,
.users-table tr > th,
.users-table tr > td {
  height: 2.1rem;
}


.members-table .login-cell,
.users-table .login-cell,
.search-results-table .login-cell {
    overflow: hidden;
    text-overflow: ellipsis;
}

.members-table .role-cell,
.users-table .role-cell,
.search-results-table .role-cell {
    white-space: nowrap;
}

.sort-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
    transition: color 0.2s ease;
}

.sort-link:hover,
.sort-link:focus {
    color: #123f99;
}

.sort-link .sort-label {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.sort-link .sort-indicator {
    width: 0.75rem;
    height: 0.75rem;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 0.65rem;
    opacity: 0.65;
    transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 2l2.5 3h-5zM6 10l-2.5-3h5z' fill='%2393a3d8'/%3E%3C/svg%3E");
}

.sort-link.is-active .sort-indicator {
    opacity: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 3l2.6 3.6H3.4z' fill='%231c64f2'/%3E%3C/svg%3E");
}

.sort-link.is-active.is-desc .sort-indicator {
    transform: rotate(180deg);
}

.id-column,
.id-cell {
    white-space: nowrap;
    width: 1%;
    font-variant-numeric: tabular-nums;
    color: #4b5563;
    text-align: right;
}

.id-cell {
    font-size: 0.95rem;
}

.users-table tr.current-user td,
.members-table tr.current-user td {
    background: #fff4d6;
    color: #533306;
    flex-wrap: wrap;
}

.users-table tr.current-user .role-cell,
.members-table tr.current-user .role-cell {
    font-weight: 700;

}

.users-table .badge,
.users-table .role-select-inline {
    font-weight: 700;
}

.users-table tr.current-user td:first-child,
.members-table tr.current-user td:first-child {
    border-left: 4px solid #f0b429;
}

.users-table tr.current-user td:last-child,
.members-table tr.current-user td:last-child {
    border-right: 4px solid #f0b429;
}

.badge-self {
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.3rem 0.85rem;
}

.role-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0 0.9rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    border: 2px solid transparent;
    line-height: 1;
}

.profile-greeting {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.profile-greeting .role-chip {
    margin-left: 0.25rem;
}

.role-chip-god {
    background: #f6e8ff;
    color: #4a148c;
    border-color: #d8b9ff;
}

.role-chip-admin {
    background: #ffe4c7;
    color: #a95515;
    border-color: #f1c796;
}

.role-chip-manager {
    background: #dff1ff;
    color: #0a4c8b;
    border-color: #a5d4ff;
}

.role-chip-user {
    background: #f2f6ff;
    color: #1c64f2;
    border-color: #cbd5f5;
}

.header-search-form {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.header-search-form .search-input {
    width: 16rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid #cbd5f5;
    border-radius: 999px;
    background: #f7f9ff;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search-form .search-input:focus {
    outline: none;
    border-color: #1c64f2;
    box-shadow: 0 0 0 3px rgba(28, 100, 242, 0.2);
}

.contest-subtitle {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.actions {
    white-space: nowrap;
    width: 1%;
}

.users-table th.actions {
    text-align: left;
}

.users-table td.actions {
    text-align: right;
}

.users-table td.actions .inline-form,
.members-table td.actions .inline-form {
    justify-content: flex-end;
}

.members-table th.actions {
    text-align: left;
}

.search-results-table th.actions {
    text-align: left;
}

.members-table td.actions {
    text-align: right;
}

.search-results-table td.actions {
    text-align: left;
}


.standings-table th.status-column,
.standings-table th.actions,
.standings-table td.status-cell,
.standings-table td.actions-cell,
.contests-table th.status-column,
.contests-table td.status-cell,
.courses-table th.status-column,
.courses-table td.status-cell {
    text-align: left;
}

.standings-table th.status-column,
.standings-table td.status-cell,
.standings-table th.grade-column,
.standings-table td.grade-cell,
.standings-table th.actions,
.standings-table td.actions-cell,
.contests-table th.status-column,
.contests-table td.status-cell,
.courses-table th.status-column,
.courses-table td.status-cell {
    white-space: nowrap;
    width: 1%;
}

.text-right {
    text-align: right !important;
}

.standings-table th.grade-column,
.standings-table td.grade-cell {
    text-align: left;
    padding-left: 0.75rem;
    padding-right: 0.25rem;
    width: 1%;
}

.standings-table td.grade-cell {
    white-space: nowrap;
}

.standings-table td.score-tier {
    position: relative;
    overflow: hidden;
    transition: background-color 0.2s ease, color 0.2s ease;
    background-color: inherit;
    --score-progress: 0;
    z-index: 0;
}

.standings-table td.score-tier::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.45), rgba(34, 197, 94, 0.45));
    transform-origin: left center;
    transform: scaleX(var(--score-progress, 0));
    transition: transform 0.2s ease;
    pointer-events: none;
    opacity: 0;
}

.standings-table td.score-tier.score-tier-partial::before {
    opacity: 1;
}

.standings-table td.score-tier-success {
    background-color: #dcfce7 !important;
    color: #166534;
    font-weight: 600;
}

.standings-table td.score-tier-fail {
    background-color: #fee2e2 !important;
    color: #b91c1c;
    font-weight: 600;
}

.standings-table td.score-tier-partial {
    color: #0f172a;
    font-weight: 600;
}

body.theme-dark .standings-table td.score-tier::before {
    background: linear-gradient(90deg, rgba(34, 197, 94, 0.5), rgba(34, 197, 94, 0.5));
}

body.theme-dark .standings-table td.score-tier-success {
    background-color: rgba(34, 197, 94, 0.32) !important;
    color: #bbf7d0;
}

body.theme-dark .standings-table td.score-tier-fail {
    background-color: rgba(239, 68, 68, 0.32) !important;
    color: #fecaca;
}

body.theme-dark .standings-table td.score-tier-partial {
    color: #e5e7eb;
}

.standings-view-table {
    width: 100%;
}

.standings-participant-column {
    width: 100%;
    text-align: left;
}

.standings-result-column {
    width: 1%;
    white-space: nowrap;
}

.max-grade-input {
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #d3d3d3;
    background: #ffffff;
    font-size: 1rem;
    text-align: center;
    box-sizing: border-box;
    min-height: var(--settings-control-height);
    height: var(--settings-control-height);
    min-width: var(--settings-control-height);
    width: var(--settings-control-width);
}

.standings-table .standings-max-grade-form .icon-button {
    flex: 0 0 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
}

.max-grade-input:focus {
    outline: none;
    border-color: #1c64f2;
    box-shadow: 0 0 0 3px rgba(28, 100, 242, 0.15);
}

.max-score-input {
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #d3d3d3;
    background: #ffffff;
    font-size: 1rem;
    text-align: center;
    box-sizing: border-box;
    min-height: var(--settings-control-height);
    height: var(--settings-control-height);
    min-width: var(--settings-control-height);
    width: var(--settings-control-width);
}

.max-score-input:focus {
    outline: none;
    border-color: #1c64f2;
    box-shadow: 0 0 0 3px rgba(28, 100, 242, 0.15);
}

.standings-table .standings-max-score-form .icon-button {
    flex: 0 0 2.5rem;
    width: 2.5rem;
    height: 2.5rem;
}

.standings-table .standings-max-score-form {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.standings-table .standings-visibility-form,
.contests-table .standings-visibility-form {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
}



.standings-table .standings-visibility-form .role-select-inline,
.contests-table .standings-visibility-form .role-select-inline {
    min-width: 6.5rem;
}

.standings-blocks-table th,
.standings-blocks-table td {
    vertical-align: middle;
}

.standings-blocks-table td.actions {
    width: 1%;
    white-space: nowrap;
}

.standings-blocks-table td.actions .inline-form {
    display: inline-flex;
    align-items: center;
}

.standings-blocks-table td.actions .form-errors {
    display: inline-block;
    margin-right: 0.75rem;
    color: #b91c1c;
    font-size: 0.8125rem;
}

.standings-blocks-table .block-title-field {
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.standings-blocks-table .block-title-field .block-title-input {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.standings-blocks-table .block-numeric-input {
    text-align: center;
    min-width: var(--settings-control-height);
    width: var(--settings-control-width);
}

.standings-blocks-table td.actions .form-errors ul,
.standings-blocks-table td.actions .errorlist {
    margin: 0;
    padding: 0;
    list-style: none;
}

body.theme-dark .standings-blocks-table td.actions .form-errors {
    color: #f87171;
}

.standings-contest-table td.actions .form-errors {
    display: inline-block;
    margin-right: 0.75rem;
    color: #b91c1c;
    font-size: 0.8125rem;
}

.standings-contest-table td.actions .form-errors ul,
.standings-contest-table td.actions .form-errors li,
.standings-contest-table td.actions .errorlist {
    margin: 0;
    padding: 0;
    list-style: none;
}

body.theme-dark .standings-contest-table td.actions .form-errors {
    color: #f87171;
}

.contest-management-section .contest-meta-form {
    margin-top: 1rem;
}

.contest-meta-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}


.contest-meta-form .field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.contest-meta-form label {
    font-weight: 600;
    color: #1f2937;
}

.contest-settings-input {
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    font-size: 1rem;
    box-sizing: border-box;
    min-height: var(--settings-control-height);
    height: var(--settings-control-height);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contest-settings-input.max-grade-input,
.contest-settings-input.max-score-input {
    text-align: center;
    min-width: var(--settings-control-height);
    width: var(--settings-control-width);
}

.contest-settings-form .block-numeric-input {
    text-align: center;
    min-width: var(--settings-control-height);
    width: var(--settings-control-width);
}

.contest-settings-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.contest-settings-section {
    width: min(100%, 460px);
    align-self: flex-start;
}

.course-settings-section {
    width: min(100%, 460px);
    align-self: flex-start;
}

.standings-settings {
    width: min(100%, 460px);
    align-self: flex-start;
}

.grade-input-group {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}


.contest-task-table .task-short-cell {
    vertical-align: middle;
    width: 3rem;
    min-width: 3rem;
    white-space: nowrap;
}

.task-short-cell-content {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.contest-task-text {
    display: inline-block;
    max-width: 100%;
    font-weight: 400;
    color: #1f2937;
    line-height: 1.4;
    white-space: normal;
}

.contest-task-number {
    display: inline-block;
    font-weight: 400;
    color: #1f2937;
    font-variant-numeric: tabular-nums;
    text-align: left;
    min-width: 3rem;
}

.contest-task-short-input {
    width: 5.25rem;
    min-width: 5.25rem;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    font-size: 1rem;
    text-align: left;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: var(--settings-control-height);
    height: var(--settings-control-height);
}

.contest-task-short-input:focus,
.contest-task-title-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.contest-task-table .task-long-cell {
    min-width: 18rem;
    vertical-align: middle;
}

.contest-task-title-input {
    width: 100%;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: var(--settings-control-height);
    height: var(--settings-control-height);
}

.contest-task-table .task-weight-cell,
.contest-task-table .task-score-cell {
    white-space: nowrap;
    vertical-align: middle;
    text-align: left;
}

.contest-task-table th.weight-column,
.contest-task-table th.score-column {
    width: 4rem;
    min-width: 4rem;
    text-align: right;
}

.contest-task-table th.deadline-column {
    min-width: 12rem;
    width: 12rem;
    text-align: left;
}

.contest-task-table th.penalty-column {
    min-width: 5rem;
    width: 5rem;
    text-align: left;
}

.contest-task-table td.contest-deadline-cell,
.contest-task-table td.contest-penalty-cell {
    vertical-align: middle;
    white-space: nowrap;
}

.contest-task-table td.contest-penalty-cell {
    text-align: right;
}

.contest-task-datetime-input {
    width: 12.5rem;
    min-width: 12.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    font-size: 1rem;
    box-sizing: border-box;
    min-height: var(--settings-control-height);
    height: var(--settings-control-height);
}

.contest-task-datetime-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.contest-task-table td.actions {
    white-space: nowrap;
    width: 1%;
    text-align: right;
}

.contest-task-table td.actions .inline-form {
    display: inline-flex;
    align-items: center;
}

.contest-task-empty {
    display: inline-block;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 3rem;
}

.contest-deadline-value {
    display: inline-block;
    white-space: nowrap;
    color: #1f2937;
}

.standings-contest-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.standings-contest-actions .inline-form {
    display: inline-flex;
    align-items: center;
}

.standings-contest-edit-form .field + .field {
    margin-top: 1rem;
}

.standings-contest-edit-form .field label,
.standings-contest-edit-form .field input,
.standings-contest-edit-form .field select,
.standings-contest-edit-form .field textarea {
    width: 100%;
    box-sizing: border-box;
}

.standings-contest-edit-form .field input,
.standings-contest-edit-form .field select,
.standings-contest-edit-form .field textarea {
    min-width: 100%;
}

.standings-contest-edit-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.standings-contest-table {
    table-layout: auto;
}

.standings-contest-table th {
    text-align: left;
}

.standings-contest-table td {
    text-align: right;
}

.standings-contest-table td.contest-column {
    text-align: left;
}

.standings-contest-table td.contest-column .contest-name {
    text-align: left;
}

.standings-contest-table th.weight-column,
.standings-contest-table th.score-column,
.standings-contest-table th.deadline-column,
.standings-contest-table td.task-weight-cell,
.standings-contest-table td.task-score-cell,
.standings-contest-table td.contest-deadline-cell,
.standings-contest-table th.penalty-column,
.standings-contest-table td.contest-penalty-cell  {
    min-width: 3.5rem;
    width: 1%;
}

.standings-contest-table th.weight-column,
.standings-contest-table th.score-column {
    text-align: right;
}

.standings-contest-table td.task-weight-cell,
.standings-contest-table td.task-score-cell,
.standings-contest-table td.contest-deadline-cell,
.standings-contest-table td.contest-penalty-cell,
.standings-contest-table .contest-task-number,
.standings-contest-table .contest-task-empty {
    text-align: left;
}

.standings-contest-table td.task-weight-cell span,
.standings-contest-table td.task-score-cell span,
.standings-contest-table td.contest-deadline-cell span,
.standings-contest-table td.contest-penalty-cell span {
    display: inline-block;
    text-align: left;
    width: 100%;
    white-space: nowrap;
}

.standings-contest-table td.actions {
    text-align: right;
}


.contest-task-table tr > th,
.contest-task-table tr > td {
    height: 2.1rem;
    vertical-align: middle;
}

.contest-task-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-end;
}

.contest-task-actions .inline-form {
    display: inline-flex;
}

.score-input-group {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}


.contest-grade-table .grade-column {
    width: 1%;
    min-width: 3.5rem;
    white-space: nowrap;
}

.contest-grade-table .grade-cell,
.contest-grade-table .grade-total-cell {
    vertical-align: middle;
    padding-top: 0.2;
    padding-bottom: 0.2;
    text-align: left;
    white-space: nowrap;
    width: 1%;
}

.contest-grade-table .grade-cell.is-override,
.contest-grade-table .grade-total-cell.is-override {
    background: #eff6ff;
}


.contest-grade-table .grade-cell.is-override .max-grade-input,
.contest-grade-table .grade-total-cell.is-override .max-grade-input {
    border-color: #60a5fa;
}

.contest-grade-table thead th {
    text-align: left;
}

.contest-grade-table thead th.grade-column {
    white-space: nowrap;
}

.grade-input-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem;
    margin-bottom: 0;
    width: auto;
    max-width: 100%;
}

.contest-grade-table .grade-cell {
    font-variant-numeric: tabular-nums;
}

.contest-grade-table .grade-cell .grade-default-note,
.contest-grade-table .grade-total-cell .grade-default-note {
    margin: 0;
}

.contest-grade-table .grade-cell .icon-button,
.contest-grade-table .grade-total-cell .icon-button {
    width: 2rem;
    height: 2rem;
}

.contest-grade-table tbody tr > td {
    height: 2.1rem;
    vertical-align: middle;
}

.contest-grade-table td.name-cell {
    vertical-align: middle;
    padding-top: 0;
    padding-bottom: 0;
}

.grade-header {
    font-weight: 600;
    color: #1f2937;
}

.grade-hint {
    font-size: 0.75rem;
    color: #6b7280;
    margin-left: 0.25rem;
}

.contest-grade-table .name-column {
    min-width: 14rem;
}

.contest-grade-table .grade-cell .max-grade-input,
.contest-grade-table .grade-total-cell .max-grade-input {
    margin-left: 0;
    flex-shrink: 0;
}

.contest-grade-table .grade-cell .max-grade-input::placeholder,
.contest-grade-table .grade-total-cell .max-grade-input::placeholder {
    color: #9ca3af;
}

.contest-display-name {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
}


.users-table th.role-column,
.users-table td.role-cell,
.search-results-table th.role-column,
.search-results-table td.role-cell {
    white-space: nowrap;
    width: 10.5rem;
    min-width: 10.5rem;
}

.members-table th.role-column,
.members-table td.role-cell {
    white-space: nowrap;
    width: 11.5rem;
    min-width: 11.5rem;
}

.search-results-table th.role-column,
.search-results-table td.role-cell {
    text-align: left;
}

.search-results-table td.role-cell .role-cell-content {
    justify-content: flex-start;
}

.search-results-table td.actions .inline-form {
    justify-content: flex-start;
}

.contest-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 0.3rem;
}

.contest-grading-scroller {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.contest-column {
    white-space: normal;
}

.contest-name {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.contest-column {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.contest-course-column {
    width: 20%;
    max-width: 20%;
    word-break: break-word;
    overflow-wrap: anywhere;
    vertical-align: middle;
}

.contest-course-name {
    display: block;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
    gap: 0.75rem;
}

.inline-form + .inline-form {
    margin-left: 0.5rem;
}

.inline-form .field {
    margin: 0;
}

.role-inline-form {
    gap: 0.5rem;
    width: 100%;
    justify-content: flex-start;
}

.role-inline-form .role-select,
.role-inline-form .role-select-inline {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
    min-width: 0;
}

.role-override-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.35rem;
    font-weight: 700;
    color: #a95515;
    cursor: default;
}

.role-cell-content {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.4rem;
    min-width: 10.5rem;
}

.role-cell-content > * {
    flex-shrink: 0;
}

.role-cell-content form {
    display: inline-flex;
}

.member-modal-results .role-cell {
    white-space: nowrap;
}

.member-modal-results .role-cell .badge {
    white-space: nowrap;
}

.settings-page {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}


.settings-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.settings-columns {
    display: grid;
    gap: 1.75rem;
    align-items: start;
}

.settings-columns-top,
.settings-columns-bottom {
    margin-top: 0;
}

.settings-columns-bottom {
    display: grid;
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 960px) {
    .settings-columns {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: flex-start;
    }

    .settings-columns-bottom {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: flex-start;
    }
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.settings-section h2 {
    margin: 0;
    font-size: 1.4rem;
}

.profile-section .settings-form,
.profile-settings-form {
    width: 100%;
}

.profile-avatar-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.profile-avatar-preview {
    flex: 0 0 auto;
}

.profile-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.profile-avatar-actions .field {
    margin: 0;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(100%, 440px);
}

.standings-settings .settings-form {
    width: min(100%, 440px);
}

.settings-form button[type="submit"] {
    align-self: flex-end;
}

.field-control-with-action {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.field-control-with-action .action-chip {
    margin: 0;
    align-self: auto;
}

.settings-form .textarea-field {
    width: 100%;
}

.settings-description {
    margin: 0 0 1rem;
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.4;
}

.course-description,
.contest-description {
    margin: 0 0 1.5rem;
    padding: 1rem 1.25rem;
    border-radius: 0.75rem;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: #1f2937;
}

.course-description-title,
.contest-description-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: inherit;
}

.course-description-body,
.contest-description-body {
    font-size: 0.95rem;
    line-height: 1.55;
    color: #4b5563;
}

body.theme-dark .course-description,
body.theme-dark .contest-description {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

body.theme-dark .course-description-body,
body.theme-dark .contest-description-body {
    color: #d1d5db;
}

.field-help {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: #6b7280;
}

body.theme-dark .field-help {
    color: #cbd5f5;
}

.checkbox-field {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-field label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    cursor: pointer;
}

.checkbox-field input[type="checkbox"] {
    width: auto;
    height: auto;
}

.account-section .settings-form,
.settings-columns-bottom .settings-form {
    width: 100%;
}

.debug-section {
    padding: 1.25rem 1.5rem;
    border-radius: 14px;
    border: 1px solid #dde0f5;
    background: #f8f9ff;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 8px 22px rgba(28, 100, 242, 0.05);
    max-width: 520px;
    align-self: flex-start;
}

.danger-section {
    border: 1px solid #f4c6a0;
    padding: 1.15rem 1.5rem;
    border-radius: 14px;
    background: #fff6ee;
    max-width: 100%;
    box-shadow: 0 8px 22px rgba(200, 97, 33, 0.08);
    gap: 0.85rem;
}

.danger-section h2 {
    color: #a95515;
}

.danger-section p {
    margin: 0;
}

.delete-hint {
    margin: 0 0 1rem;
}

button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

.action-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.85rem;
    margin: 0.1rem;
    border-radius: 999px;
    border: 1px solid #cbd5f5;
    background: #f2f6ff;
    color: #1c64f2;
    font-size: 0.85rem;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

button.action-chip {
    border: none;
    background: #f2f6ff;
    cursor: pointer;
}

.action-chip:hover,
.action-chip:focus {
    background: #dbe6ff;
    border-color: #9ab4ff;
    color: #123f99;
}

.action-chip.action-primary,
.action-chip.action-primary:hover {
    background: #1c64f2;
    border-color: #1c64f2;
    color: #fff;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid #cbd5f5;
    background: #f2f6ff;
    color: #1c64f2;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.icon-button.compact {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 1rem;
}

.icon-button[disabled] {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.icon-button:hover,
.icon-button:focus {
    background: #dbe6ff;
    border-color: #9ab4ff;
    color: #123f99;
}

.icon-button.enter {
    border-color: #1c64f2;
    background: #1c64f2;
    color: #ffffff;
    box-shadow: 0 6px 14px rgba(28, 100, 242, 0.2);
}

.icon-button.enter:hover,
.icon-button.enter:focus {
    background: #174fc4;
    border-color: #174fc4;
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(23, 79, 196, 0.25);
}

a.icon-button.enter,
a.icon-button.enter:visited,
a.icon-button.enter:hover,
a.icon-button.enter:focus {
    color: #ffffff;
}

.icon-button.danger {
    border-color: #f7c2c2;
    background: #ffe9e9;
    color: #c21717;
}

.icon-button.danger:hover,
.icon-button.danger:focus {
    background: #ffd0d0;
    border-color: #f29393;
    color: #8a1010;
}

.icon-button.success {
    border-color: #b5e3c1;
    background: #e9fbef;
    color: #0f773d;
}

.icon-button.success:hover,
.icon-button.success:focus {
    background: #d3f4dc;
    border-color: #8ed3a2;
    color: #0b5c2d;
}

.icon-button.confirm {
    border: none;
    background: transparent;
    color: inherit;
    box-shadow: none;
    transition: transform 0.15s ease;
}

.icon-button.confirm {
    border: none;
    background: transparent;
    color: inherit;
    box-shadow: none;
    transition: transform 0.15s ease;
}

.icon-button.confirm:hover,
.icon-button.confirm:focus {
    background: transparent;
    border: none;
    transform: scale(1.05);
}

.icon-button.confirm:focus-visible {
    box-shadow: 0 0 0 3px rgba(142, 211, 162, 0.45);
}

.icon-button.warning {
    border-color: #f7e3a7;
    background: #fff6da;
    color: #8c5d00;
}

.icon-button.warning:hover,
.icon-button.warning:focus {
    background: #ffeab0;
    border-color: #f0c36d;
    color: #704703;
}

.icon-trash {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c21717' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3 6 5 6 21 6'/%3E%3Cpath d='M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6'/%3E%3Cpath d='M10 11v6'/%3E%3Cpath d='M14 11v6'/%3E%3Cpath d='M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2'/%3E%3C/svg%3E");
}

.icon-checkmark {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f773d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 12 10 17 19 8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.icon-refresh {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f773d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='23 4 23 10 17 10'/%3E%3Cpolyline points='1 20 1 14 7 14'/%3E%3Cpath d='M3.51 9a9 9 0 0 1 14.13-3.36L23 10'/%3E%3Cpath d='M20.49 15a9 9 0 0 1-14.13 3.36L1 14'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.icon-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    border: 1px solid #8ed3a2;
    background-color: #e0f7e8;
}

.icon-check::before {
    content: '';
    display: block;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f773d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='5 12 10 17 19 8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.icon-pencil {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c64f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4Z'/%3E%3C/svg%3E") center/contain no-repeat;
}



.icon-enter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    color: inherit;
}

.icon-enter::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3Cpath d='M4 4h7a4 4 0 0 1 4 4'/%3E%3Cpath d='M15 16a4 4 0 0 1-4 4H4'/%3E%3C/svg%3E") no-repeat center/contain;
}

.icon-button.enter .icon-enter::before {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3Cpath d='M4 4h7a4 4 0 0 1 4 4'/%3E%3Cpath d='M15 16a4 4 0 0 1-4 4H4'/%3E%3C/svg%3E") no-repeat center/contain;
}

.button-demo-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.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;
}

.teacher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.teacher-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    background: linear-gradient(160deg, #ffffff, #f8fafc);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
}

body.theme-dark .teacher-card {
    border-color: #374151;
    background: linear-gradient(160deg, #1f2937, #111827);
    box-shadow: 0 20px 40px rgba(2, 6, 23, 0.6);
    color: #e5e7eb;
}

.teacher-info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.teacher-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.teacher-avatar {
    flex: 0 0 auto;
}

.teacher-name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
}

body.theme-dark .teacher-name {
    color: #f3f4f6;
}

.teacher-contacts,
.teacher-bio {
    margin: 0;
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.4;
}

body.theme-dark .teacher-contacts,
body.theme-dark .teacher-bio {
    color: #cbd5f5;
}

.teacher-bio {
    margin-top: 0.25rem;
}

.management-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.badge-admin {
    background: #ffe4c7;
    color: #a95515;
}

.badge-master {
    background: #dff1ff;
    color: #0a4c8b;
}

.badge-god {
    background: #f6e8ff;
    color: #5c1f96;
}

.badge-judge {
    background: #fff4d6;
    color: #533306;
}

.badge-user {
    background: #f2f6ff;
    color: #1c64f2;
}

.badge-ejudge {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-manual {
    background: #ede9fe;
    color: #5b21b6;
}

.badge.muted {
    background: #f1f2f4;
    color: #7a869a;
}

.task-source-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    padding: 0.15rem 0.6rem;
}

.contest-role-badge {
    font-size: 0.85rem;
    line-height: 1;
}

.page-header-heading h1 .contest-role-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.role-select {
    width: 100%;
    max-width: 11.25rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    border: 1px solid #cbd5f5;
    background: linear-gradient(145deg, #eef3ff, #ffffff);
    color: #1c64f2;
    font-size: 0.85rem;
    font-weight: 600;
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 0.65rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%231c64f2' d='M4.47 6.97a.75.75 0 0 1 1.06 0L8 9.44l2.47-2.47a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 0 1 0-1.06Z'/%3E%3C/svg%3E");
    box-shadow: 0 5px 18px rgba(28, 100, 242, 0.12);
}


.score-system-select {
    max-width: 7rem;
    font-weight: 700;
}

.score-system-select[data-role="acm"] {
    background-color: #e2edff;
    border-color: #bfd7ff;
    color: #1c4fd7;
}

.score-system-select[data-role="kirov"] {
    background-color: #fff3d9;
    border-color: #f5c58b;
    color: #b45309;
}

.score-system-select option[value="acm"] {
    background-color: #e8f1ff;
    color: #1c4fd7;
}

.score-system-select option[value="kirov"] {
    background-color: #fff3d9;
    color: #b45309;
}

body.theme-dark .role-select {
    border-color: #374151;
    background: linear-gradient(145deg, #111f2d, #1f2937);
    color: #bfdbfe;
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.18);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23bfdbfe' d='M4.47 6.97a.75.75 0 0 1 1.06 0L8 9.44l2.47-2.47a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 0 1 0-1.06Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 0.65rem;
}

body.theme-dark .score-system-select[data-role="acm"] {
    background-color: rgba(37, 99, 235, 0.28);
    border-color: rgba(59, 130, 246, 0.55);
    color: #dbeafe;
}

body.theme-dark .score-system-select[data-role="kirov"] {
    background-color: rgba(234, 88, 12, 0.3);
    border-color: rgba(234, 88, 12, 0.55);
    color: #fcd19c;
}

body.theme-dark .score-system-select option[value="acm"] {
    background-color: rgba(37, 99, 235, 0.25);
    color: #eef2ff;
}

body.theme-dark .score-system-select option[value="kirov"] {
    background-color: rgba(234, 88, 12, 0.25);
    color: #fed7aa;
}

.role-select:focus {
    border-color: #1c64f2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(28, 100, 242, 0.25);
}

body.theme-dark .role-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.role-select.visibility-select {
    width: 7rem;
    min-width: 7rem;
    max-width: 7rem;
    padding: 0.35rem 1.6rem 0.35rem 0.75rem;
    border-radius: 999px;
    border: 2px solid #cbd5f5;
    font-size: 0.85rem;
    font-weight: 700;
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 0.6rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%231c64f2' d='M4.47 6.97a.75.75 0 0 1 1.06 0L8 9.44l2.47-2.47a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 0 1 0-1.06Z'/%3E%3C/svg%3E");
    background-color: #f3f4f6;
    color: #374151;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

body.theme-dark .role-select.visibility-select {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #e0f2fe;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23e0f2fe' d='M4.47 6.97a.75.75 0 0 1 1.06 0L8 9.44l2.47-2.47a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 0 1 0-1.06Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 0.6rem;
}

.role-select.visibility-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(28, 100, 242, 0.2);
}

body.theme-dark .role-select.visibility-select:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.role-select.visibility-select.score-system-select[data-role="acm"] {
    background-color: #e2edff;
    border-color: #bfd7ff;
    color: #1c4fd7;
}

.role-select.visibility-select.score-system-select[data-role="kirov"] {
    background-color: #fff3d9;
    border-color: #f5c58b;
    color: #b45309;
}

.role-select.visibility-select[data-role="1"],
.role-select.visibility-select[data-role="true"],
.role-select.visibility-select[data-role="True"],
.role-select.visibility-select[data-role="visible"],
.role-select.visibility-select[data-role="Visible"] {
    background-color: #e9fbef;
    border-color: #b5e3c1;
    color: #0f773d;
}

body.theme-dark .role-select.visibility-select[data-role="1"],
body.theme-dark .role-select.visibility-select[data-role="true"],
body.theme-dark .role-select.visibility-select[data-role="True"],
body.theme-dark .role-select.visibility-select[data-role="visible"],
body.theme-dark .role-select.visibility-select[data-role="Visible"] {
    background-color: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.55);
    color: #bbf7d0;
}

body.theme-dark .role-select.visibility-select.score-system-select[data-role="acm"] {
    background-color: rgba(37, 99, 235, 0.28);
    border-color: rgba(59, 130, 246, 0.55);
    color: #dbeafe;
}

body.theme-dark .role-select.visibility-select.score-system-select[data-role="kirov"] {
    background-color: rgba(234, 88, 12, 0.3);
    border-color: rgba(234, 88, 12, 0.55);
    color: #fcd19c;
}

.role-select.visibility-select[data-role="0"],
.role-select.visibility-select[data-role="false"],
.role-select.visibility-select[data-role="False"],
.role-select.visibility-select[data-role="hidden"],
.role-select.visibility-select[data-role="Hidden"] {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #4b5563;
}

body.theme-dark .role-select.visibility-select[data-role="0"],
body.theme-dark .role-select.visibility-select[data-role="false"],
body.theme-dark .role-select.visibility-select[data-role="False"],
body.theme-dark .role-select.visibility-select[data-role="hidden"],
body.theme-dark .role-select.visibility-select[data-role="Hidden"] {
    background-color: rgba(75, 85, 99, 0.35);
    border-color: rgba(107, 114, 128, 0.55);
    color: #d1d5db;
}

.visibility-indicator {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #4b5563;
}

body.theme-dark .visibility-indicator {
    background-color: rgba(75, 85, 99, 0.35);
    border-color: rgba(107, 114, 128, 0.55);
    color: #d1d5db;
}

.visibility-indicator.is-visible {
    background-color: #e9fbef;
    border-color: #b5e3c1;
    color: #0f773d;
}

body.theme-dark .visibility-indicator.is-visible {
    background-color: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.55);
    color: #bbf7d0;
}

.visibility-indicator.is-hidden {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: #4b5563;
}

body.theme-dark .visibility-indicator.is-hidden {
    background-color: rgba(75, 85, 99, 0.35);
    border-color: rgba(107, 114, 128, 0.55);
    color: #d1d5db;
}

.role-select option[value="god"] {
    background: #f6e8ff;
    color: #5c1f96;
}

.role-select option[value="administrator"] {
    background: #ffe4c7;
    color: #a95515;
}

.role-select option[value="master"] {
    background: #dff1ff;
    color: #0a4c8b;
}
.role-select option[value="judge"] {
    background: #fff4d6;
    color: #533306;
}

.role-select option[value="participant"] {
    background: #f2f6ff;
    color: #1c64f2;
}

.role-select-inline option[data-role="participant"] {
    background: #f2f6ff;
    color: #1c64f2;
}

.role-select-inline option[data-role="judge"] {
    background: #fff4d6;
    color: #533306;
}

.role-select-inline option[data-role="master"] {
    background: #dff1ff;
    color: #0a4c8b;
}

.role-select-inline option[data-role="visible"] {
    background: #e9fbef;
    color: #0f773d;
}

.role-select-inline option[data-role="hidden"] {
    background: #f3f4f6;
    color: #4b5563;
}

.role-select-form {
    max-width: 20rem;
    border-width: 2px;
    border-radius: 12px;
    font-weight: 700;
}

.role-select-form[data-role="god"] {
    background: #f6e8ff;
    color: #5c1f96;
    border-color: #d8b9ff;
}

.role-select-form[data-role="administrator"] {
    background: #ffe4c7;
    color: #a95515;
    border-color: #f1c796;
}

.role-select-form[data-role="master"] {
    background: #dff1ff;
    color: #0a4c8b;
    border-color: #a5d4ff;
}

.role-select-form[data-role="participant"] {
    background: #f2f6ff;
    color: #1c64f2;
    border-color: #cbd5f5;
}

.role-select-form[data-role="judge"] {
    background: #fff4d6;
    color: #533306;
    border-color: #f0b429;
}

.role-select-inline {
    width: 7rem;
    min-width: 7rem;
    max-width: 7rem;
    padding: 0.35rem 1.6rem 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    border-width: 2px;
    border-style: solid;
    border-color: #d1d5db;
    appearance: none;
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 0.6rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%231c64f2' d='M4.47 6.97a.75.75 0 0 1 1.06 0L8 9.44l2.47-2.47a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 0 1 0-1.06Z'/%3E%3C/svg%3E");
    background-color: #f3f4f6;
    color: #374151;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

body.theme-dark .role-select-inline {
    border-color: #374151;
    background-color: #1f2937;
    color: #e5e7eb;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath fill='%23cbd5f5' d='M4.47 6.97a.75.75 0 0 1 1.06 0L8 9.44l2.47-2.47a.75.75 0 1 1 1.06 1.06l-3 3a.75.75 0 0 1-1.06 0l-3-3a.75.75 0 0 1 0-1.06Z'/%3E%3C/svg%3E");
}

.role-select-inline[data-role="god"] {
    background-color: #f6e8ff;
    color: #5c1f96;
    border-color: #d8b9ff;
}

.role-select-inline[data-role="administrator"] {
    background-color: #ffe4c7;
    color: #a95515;
    border-color: #f1c796;
}

.role-select-inline[data-role="master"] {
    background-color: #dff1ff;
    color: #0a4c8b;
    border-color: #a5d4ff;
}

.role-select-inline[data-role="participant"] {
    background-color: #f2f6ff;
    color: #1c64f2;
    border-color: #cbd5f5;
}

.role-select-inline[data-role="judge"] {
    background-color: #fff4d6;
    color: #533306;
    border-color: #f0b429;
}

.role-select-inline:focus {
    box-shadow: 0 0 0 3px rgba(28, 100, 242, 0.2);
}
.role-inline-form .role-select,
.role-inline-form .role-select-inline {
    min-width: 7rem;
    width: 7rem;
}

.member-add,
.member-search {
    text-align: center;
}

.member-add h2,
.member-search h2 {
    text-align: center;
}

.centered-row {
    display: flex;
    justify-content: center;
    margin: 1.25rem 0;
}

.search-inline-form {
    justify-content: center;
}

.members-section .badge {
    font-weight: 700;
}

.members-table .inline-form,
.search-results-table .inline-form {
    gap: 0.5rem;
    justify-content: flex-start;
    flex-wrap: nowrap;
}

.members-table .actions,
.search-results-table .actions {
    white-space: nowrap;
}

.search-results-table tr.already-registered td {
    background: #f7fbff;
}

.icon-plus,
.icon-cross,
.icon-minus,
.icon-detach {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1;
    width: 1.85rem;
    height: 1.85rem;
}

.icon-plus::before {
    content: '+';
}

.icon-minus::before {
    content: '-';
}

.icon-detach {
    width: auto;
    height: auto;
    padding: 0 0.25rem;
    border-radius: 0;
    color: #8c5d00;
    font-weight: 600;
    font-size: 1.3rem;
}

.icon-detach::before {
    content: '↳';
}

.icon-cross {
    border-radius: 50%;
    border: 1px solid #f0c36d;
    background: #fff6da;
    color: #8c5d00;
}

.icon-cross::before {
    content: '✕';
}
