:root {
    color-scheme: light;
    --ink: #182334;
    --ink-soft: #2f3b4f;
    --muted: #667085;
    --line: #d8dee8;
    --line-strong: #b7c0cf;
    --paper: #eef1f5;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --primary: #182334;
    --primary-dark: #101927;
    --primary-soft: #f1f4f8;
    --accent: #ffd21a;
    --accent-soft: #fff8d8;
    --danger: #d7261e;
    --warning: #d97706;
    --sidebar: #182334;
    --sidebar-soft: #223047;
    --sport-navy: #182334;
    --sport-blue: #182334;
    --sport-green: #ffd21a;
    --sport-yellow: #ffd21a;
    --brand-red: #d7261e;
    --shadow: 0 10px 26px rgba(8, 19, 36, 0.06);
    --shadow-soft: 0 4px 12px rgba(16, 24, 40, 0.035);
    --radius: 6px;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-width: 0;
    overflow-x: hidden;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(180deg, #f8fafc 0%, var(--paper) 280px);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.48;
    overflow-x: hidden;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(255, 210, 26, 0.35);
    outline-offset: 2px;
}

.app-shell {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns 0.18s ease;
}

.app-shell.sidebar-collapsed {
    grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 18px 14px;
    background:
        linear-gradient(180deg, #182334 0%, #121b2a 58%, #0f1724 100%);
    color: #e5edf8;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 10px 0 28px rgba(8, 19, 36, 0.14);
}

.brand {
    display: flex;
    gap: 11px;
    align-items: center;
    min-height: 76px;
    margin-bottom: 22px;
    padding: 8px 6px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-copy {
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 62px;
    height: 70px;
    flex: 0 0 auto;
    border-radius: 16px;
    background: #ffffff;
    color: #fff;
    font-size: 0.84rem;
    font-weight: 900;
    letter-spacing: 0;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    padding: 6px;
    position: relative;
}

.brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    position: relative;
    z-index: 1;
}

.brand-mark > span {
    align-items: center;
    background: #182334;
    color: #ffffff;
    display: flex;
    font-size: 0.78rem;
    font-weight: 950;
    inset: 4px;
    justify-content: center;
    position: absolute;
    z-index: 0;
}

.brand-mark img + span {
    opacity: 0;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    color: #fff;
    font-size: 0.98rem;
    font-weight: 820;
}

.brand small {
    margin-top: 2px;
    color: #9aa8bd;
    font-size: 0.78rem;
}

.sidebar-toggle {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 820;
    line-height: 1;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
}

.nav-section {
    margin: 0 8px 12px;
    color: #7f90aa;
    font-size: 0.66rem;
    font-weight: 820;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    border: 0;
    border-radius: var(--radius);
    padding: 10px 11px;
    margin-bottom: 3px;
    background: transparent;
    color: #b9c6d8;
    text-align: left;
    font-size: 0.92rem;
    font-weight: 760;
    position: relative;
}

.nav-button::before {
    content: "";
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    background: currentColor;
    opacity: 0.72;
    -webkit-mask: var(--nav-icon) center / contain no-repeat;
    mask: var(--nav-icon) center / contain no-repeat;
}

.nav-button::after {
    content: "";
    position: absolute;
    left: 0;
    width: 3px;
    height: 17px;
    border-radius: 99px;
    background: transparent;
}

.nav-button:hover,
.nav-button.active {
    background: rgba(255, 255, 255, 0.075);
    color: #fff;
}

.nav-button.active {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035);
}

.nav-button.active::before {
    opacity: 0.96;
}

.nav-button.active::after {
    background: var(--sport-green);
    box-shadow: 0 0 0 4px rgba(0, 168, 120, 0.08);
}

.nav-button.muted-nav {
    color: #96a4b8;
}

.nav-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-collapsed .sidebar {
    align-items: center;
    padding-inline: 8px;
}

.sidebar-collapsed .brand {
    justify-content: center;
    width: 100%;
    min-height: 86px;
    margin-bottom: 16px;
    padding: 8px 0 16px;
}

.sidebar-collapsed .brand-copy,
.sidebar-collapsed .nav-section,
.sidebar-collapsed .sidebar-context,
.sidebar-collapsed .nav-text {
    display: none;
}

.sidebar-collapsed .brand-mark {
    width: 54px;
    height: 66px;
    border-radius: 16px;
    padding: 5px;
    font-size: 0.72rem;
}

.sidebar-collapsed .sidebar-toggle {
    position: absolute;
    top: 24px;
    right: -13px;
    right: -11px;
    top: 24px;
    z-index: 3;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: var(--sport-navy);
    font-size: 0.9rem;
    box-shadow: 0 6px 14px rgba(8, 19, 36, 0.16);
}

.sidebar-collapsed .nav-button {
    justify-content: center;
    width: 40px;
    min-height: 38px;
    margin-bottom: 6px;
    padding: 0;
    border-radius: 8px;
    background: transparent;
}

.sidebar-collapsed .nav-button:hover {
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-collapsed .nav-button.active {
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-collapsed .nav-button::before {
    width: 18px;
    height: 18px;
}

.sidebar-collapsed .nav-button::after {
    left: -4px;
    height: 22px;
    box-shadow: none;
}

.nav-button[data-short="CO"],
.nav-button[data-short="OP"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1'/%3E%3C/svg%3E");
}

.nav-button[data-short="NC"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
}

.nav-button[data-short="IN"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14H4V6a2 2 0 0 1 2-2h2'/%3E%3Crect x='8' y='2' width='8' height='4' rx='1'/%3E%3Cpath d='M8 12h8M8 16h5'/%3E%3C/svg%3E");
}

.nav-button[data-short="CR"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='18' rx='2'/%3E%3Ccircle cx='12' cy='9' r='2'/%3E%3Cpath d='M8 16c.8-2 7.2-2 8 0'/%3E%3C/svg%3E");
}

.nav-button[data-short="BA"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11l3 3L22 4'/%3E%3Cpath d='M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11'/%3E%3C/svg%3E");
}

.nav-button[data-short="AJ"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.9l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.9-.3 1.7 1.7 0 0 0-1 1.6V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.6 1.7 1.7 0 0 0-1.9.3l-.1.1A2 2 0 1 1 4.2 17l.1-.1a1.7 1.7 0 0 0 .3-1.9 1.7 1.7 0 0 0-1.6-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.6-1 1.7 1.7 0 0 0-.3-1.9l-.1-.1A2 2 0 1 1 7 4.2l.1.1a1.7 1.7 0 0 0 1.9.3 1.7 1.7 0 0 0 1-1.6V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.6 1.7 1.7 0 0 0 1.9-.3l.1-.1A2 2 0 1 1 19.8 7l-.1.1a1.7 1.7 0 0 0-.3 1.9 1.7 1.7 0 0 0 1.6 1h.1a2 2 0 1 1 0 4H21a1.7 1.7 0 0 0-1.6 1Z'/%3E%3C/svg%3E");
}

.nav-button[data-short="RK"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='m7 14 4-4 3 3 5-6'/%3E%3Cpath d='M18 7h1v1'/%3E%3C/svg%3E");
}

.nav-button[data-short="SA"] {
    --nav-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 17l5-5-5-5'/%3E%3Cpath d='M15 12H3'/%3E%3Cpath d='M21 19V5a2 2 0 0 0-2-2h-5'/%3E%3C/svg%3E");
}

.sidebar-context {
    display: grid;
    gap: 3px;
    margin-top: auto;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius);
    padding: 13px;
    background: var(--sidebar-soft);
}

.sidebar-context p {
    margin: 0;
    color: #8fa0b8;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sidebar-context strong {
    color: #fff;
    font-size: 0.92rem;
}

.sidebar-context small {
    color: #9aa8bd;
}

.content {
    width: 100%;
    max-width: none;
    padding: 0 clamp(18px, 3vw, 34px) 34px;
    overflow-x: hidden;
}

.judge-mode .panel:not(#judge-panel) {
    display: none !important;
}

.ranking-mode .panel:not(#dashboard) {
    display: none !important;
}

.ranking-mode .workspace {
    grid-template-columns: minmax(0, 1fr);
}

.ranking-mode .detail-panel,
.ranking-mode .contest-card-actions a.secondary,
.ranking-mode .contest-card-actions a.tertiary,
.ranking-mode .contest-card-actions form,
.ranking-mode .empty-state [data-open-panel],
.ranking-mode #dashboard [data-open-panel]:not([data-open-panel="dashboard"]) {
    display: none !important;
}

.ranking-mode .contest-card-actions .primary {
    min-width: 132px;
    text-align: center;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    background: linear-gradient(180deg, #f8fafc 0%, var(--paper) 100%);
    padding: 190px 24px 32px;
}

.login-card {
    width: min(420px, 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
    padding: 34px 22px 22px;
    position: relative;
    overflow: visible;
}

.login-card .brand {
    position: absolute;
    top: -174px;
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    justify-items: center;
    gap: 0;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    text-align: center;
}

.login-card .brand-mark {
    width: 148px;
    height: 174px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    overflow: visible;
}

.login-card .brand-mark img {
    filter: drop-shadow(0 20px 28px rgba(8, 19, 36, 0.18));
}

.login-card .brand-copy {
    display: none;
}

.login-card .brand strong {
    color: var(--ink);
    font-size: 0.98rem;
    font-weight: 850;
}

.login-card .brand small {
    margin: 0;
    color: #7a8699;
    font-size: 0.78rem;
    font-weight: 650;
}

.login-heading {
    margin-bottom: 18px;
    padding-top: 4px;
}

.login-heading span {
    color: var(--muted);
    display: block;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.login-heading h1 {
    font-size: 1.65rem;
    margin-bottom: 6px;
}

.login-heading p {
    color: var(--muted);
    line-height: 1.45;
}

.login-card form {
    display: grid;
    gap: 14px;
}

.login-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.login-actions .primary,
.login-actions .secondary {
    min-height: 46px;
}

.login-footer {
    border-top: 1px solid var(--line);
    margin-top: 18px;
    padding-top: 14px;
    text-align: center;
}

.login-footer a {
    color: var(--primary-dark);
    font-size: 0.86rem;
    font-weight: 900;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 8;
    margin: 0 calc(clamp(18px, 3vw, 34px) * -1) 14px;
    min-height: 72px;
    padding: 10px clamp(18px, 3vw, 34px);
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.985);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 14px rgba(8, 19, 36, 0.025);
}

.topbar > div:first-child {
    min-width: 0;
}

.breadcrumb {
    margin: 0 0 3px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 620;
}

.eyebrow {
    display: none;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 860px;
    margin-bottom: 0;
    font-size: clamp(1.08rem, 1.45vw, 1.38rem);
    font-weight: 780;
    line-height: 1.12;
    letter-spacing: 0;
}

h2 {
    font-size: 0.98rem;
    font-weight: 820;
    line-height: 1.25;
}

h3 {
    margin: 22px 0 10px;
    font-size: 0.98rem;
}

.topbar-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
    min-width: 0;
    border: 1px solid #d9e1ec;
    border-radius: var(--radius);
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
    min-height: 46px;
    padding: 4px;
}

.contest-picker {
    display: grid;
    gap: 1px;
    min-width: 0;
    width: min(230px, 100%);
    align-self: start;
    justify-self: end;
    border: 0;
    border-radius: 4px;
    padding: 3px 10px 3px 8px;
    background: transparent;
    box-shadow: none;
}

.contest-picker label {
    color: #7b8798;
    font-size: 0.55rem;
    font-weight: 760;
    letter-spacing: 0.052em;
    text-transform: uppercase;
}

.contest-picker select {
    min-height: 22px;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 760;
}

.user-session {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    border-left: 1px solid #e1e7f0;
    padding: 0 4px 0 12px;
}

.user-session form {
    margin: 0;
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 850;
}

.user-session span,
.user-session strong {
    display: block;
}

.user-session > div:not(.user-avatar) {
    min-width: 92px;
}

.user-session span {
    color: var(--muted);
    font-size: 0.52rem;
    font-weight: 760;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.user-session strong {
    margin-top: 2px;
    color: var(--ink);
    font-size: 0.8rem;
    font-weight: 780;
    line-height: 1.15;
}

.session-logout {
    align-self: flex-end;
    min-height: 22px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #667085;
    padding: 0 8px;
    font-size: 0.72rem;
    font-weight: 760;
    line-height: 1;
}

.session-logout:hover {
    background: #f2f4f7;
    color: var(--danger);
}

label {
    display: grid;
    gap: 7px;
    color: var(--ink-soft);
    font-size: 0.9rem;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 9px 11px;
    background: #fff;
    color: var(--ink);
    font-weight: 600;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

textarea {
    min-height: 112px;
    resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--line-strong);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(20, 86, 217, 0.48);
    box-shadow: 0 0 0 4px rgba(20, 86, 217, 0.1);
}

.panel {
    display: none;
}

.panel.active {
    display: block;
}

.flash {
    border-radius: var(--radius);
    margin-bottom: 18px;
    padding: 12px 14px;
    background: #edf3ff;
    border: 1px solid #cbdcff;
    color: #173c91;
    font-weight: 800;
}

.flash.error {
    background: #fdecec;
    border-color: #efb9b9;
    color: var(--danger);
}

.empty-state,
.form-card,
.rank-panel,
.detail-panel,
.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.command-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 13px 15px;
    background: #0f172a;
    color: #fff;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
}

.command-bar strong,
.command-bar small,
.command-label {
    display: block;
}

.command-label {
    color: #9fb1d1;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.command-bar strong {
    margin-top: 3px;
    font-size: 1.05rem;
}

.command-bar small {
    margin-top: 3px;
    color: #c8d2e3;
    font-weight: 700;
}

.command-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ops-header .primary {
    background: #ffffff;
    color: var(--sport-navy);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.16);
}

.ops-header .secondary {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.20);
    color: #ffffff;
}

.ops-header .tertiary {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.22);
    color: #d9e3f3;
}

.empty-state {
    display: grid;
    align-content: center;
    min-height: 320px;
    padding: clamp(24px, 5vw, 46px);
}

.empty-state h2 {
    margin-bottom: 8px;
    font-size: clamp(1.25rem, 3vw, 1.7rem);
}

.empty-state p {
    max-width: 580px;
    color: var(--muted);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(118px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.stat {
    min-height: 86px;
    padding: 14px 15px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.stat::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), rgba(23, 92, 211, 0));
}

.stat:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-soft);
}

.stat span,
td small,
.muted {
    color: var(--muted);
}

.stat span {
    display: block;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stat strong {
    display: block;
    margin-top: 6px;
    font-size: clamp(1.08rem, 1.55vw, 1.32rem);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.stat small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.quick-insights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.quick-insights div {
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 10px 12px;
}

.quick-insights span,
.quick-insights strong {
    display: block;
}

.quick-insights span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.quick-insights strong {
    margin-top: 3px;
    color: var(--ink);
    font-size: 0.88rem;
    line-height: 1.2;
}

.dashboard-empty .dashboard-grid,
.dashboard-empty > .empty-state {
    display: none;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.65fr);
    gap: 14px;
    margin-bottom: 14px;
}

.dashboard-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: none;
    padding: 16px 18px;
}

.dashboard-card .section-heading p,
.dashboard-card > p {
    margin: 4px 0 0;
    color: var(--muted);
}

.ops-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(255, 210, 26, 0.16) 0%, rgba(255, 255, 255, 0.06) 48%, rgba(8, 19, 36, 0) 100%),
        var(--sport-navy);
    color: #fff;
    padding: 14px 18px;
    box-shadow: 0 14px 32px rgba(8, 19, 36, 0.13);
}

.ops-header strong,
.ops-header small {
    display: block;
}

.ops-header .command-label,
.ops-panel .command-label {
    color: #9fb1d1;
}

.ops-header strong {
    margin-top: 3px;
    font-size: clamp(1rem, 1.35vw, 1.22rem);
    font-weight: 850;
    line-height: 1.15;
}

.ops-header small {
    margin-top: 4px;
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 650;
}

.ops-statusline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.ops-statusline span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #e5edf8;
    font-size: 0.7rem;
    font-weight: 780;
    padding: 0 10px;
}

.ops-kpis {
    display: grid;
    grid-template-columns: repeat(6, minmax(108px, 1fr));
    gap: 6px;
    margin-bottom: 10px;
}

.ops-kpis div {
    min-height: 60px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    padding: 9px 12px;
    box-shadow: 0 6px 16px rgba(8, 19, 36, 0.035);
    position: relative;
    overflow: hidden;
}

.ops-kpis div::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: #c3ccda;
}

.ops-kpis div.is-warning::before {
    background: var(--sport-yellow);
}

.ops-kpis div.is-ok::before {
    background: var(--sport-green);
}

.ops-kpis span,
.ops-kpis strong {
    display: block;
}

.ops-kpis span {
    color: #536176;
    font-size: 0.64rem;
    font-weight: 820;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.ops-kpis strong {
    margin-top: 4px;
    color: var(--sport-navy);
    font-size: 1.18rem;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.ops-focus {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
    gap: 12px;
    margin-bottom: 12px;
}

.ops-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid #dbe3ef;
    border-radius: var(--radius);
    background: #ffffff;
    padding: 13px 15px;
    box-shadow: none;
}

.ops-panel .command-label {
    color: #536176;
}

.ops-panel strong,
.ops-panel small {
    display: block;
}

.ops-panel strong {
    margin-top: 3px;
    font-size: 1rem;
    line-height: 1.2;
}

.ops-panel small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.82rem;
}

.ops-progress {
    display: grid;
    gap: 9px;
}

.contest-management {
    margin-top: 14px;
}

.contest-list {
    display: grid;
    gap: 10px;
}

.contest-card {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(420px, 1.25fr) auto;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    padding: 14px;
}

.contest-card-main span,
.contest-card-main h3,
.contest-card-main p {
    display: block;
}

.contest-card-main span {
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 820;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.contest-card-main h3 {
    margin-top: 5px;
    color: var(--ink);
    font-size: 1rem;
    font-weight: 820;
    line-height: 1.2;
}

.contest-card-main p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 650;
}

.contest-card-metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.contest-card-metrics div {
    border: 1px solid #e6ebf2;
    border-radius: var(--radius);
    background: #fbfcfe;
    padding: 9px;
}

.contest-card-metrics span,
.contest-card-metrics strong {
    display: block;
}

.contest-card-metrics span {
    color: var(--muted);
    font-size: 0.58rem;
    font-weight: 820;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.contest-card-metrics strong {
    margin-top: 4px;
    color: var(--sport-navy);
    font-size: 1rem;
    font-weight: 820;
}

.contest-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
    min-width: 220px;
}

.contest-card-actions a {
    text-decoration: none;
}

.judge-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.55fr) minmax(0, 1.15fr);
    gap: 12px;
    align-items: start;
}

.judge-stage {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
    gap: 12px;
    margin-bottom: 12px;
}

.judge-check-card,
.proof-roster-card {
    min-height: 0;
}

.proof-roster-card .table-wrap {
    max-height: 330px;
    overflow: auto;
}

.proof-roster-card table {
    min-width: 760px;
}

.judge-command {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    background:
        linear-gradient(135deg, rgba(255, 210, 26, 0.12), rgba(24, 35, 52, 0.04)),
        #ffffff;
    box-shadow: 0 14px 30px rgba(8, 19, 36, 0.07);
}

.judge-command span,
.judge-command strong,
.judge-command small {
    display: block;
}

.judge-command span {
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.judge-command strong {
    margin-top: 3px;
    color: var(--sport-navy);
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    letter-spacing: 0.02em;
    line-height: 1;
    text-transform: uppercase;
}

.judge-command small {
    margin-top: 8px;
    color: var(--muted);
    font-weight: 700;
}

.judge-progress {
    display: grid;
    gap: 7px;
    margin-top: 12px;
    max-width: 360px;
}

.judge-progress b {
    display: block;
    height: 7px;
    border-radius: 999px;
    background: var(--primary);
}

.judge-progress::before {
    content: "";
    display: block;
    height: 7px;
    border-radius: 999px;
    background: #e4e7ec;
    grid-area: 1 / 1;
}

.judge-progress b {
    grid-area: 1 / 1;
}

.judge-progress em {
    color: var(--ink-soft);
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 900;
}

#judge-panel .judge-command .secondary {
    background: #f2f4f7;
    border-color: #e4e7ec;
    color: var(--primary-dark);
}

#judge-panel .form-actions .primary {
    min-height: 48px;
    background: var(--primary);
    box-shadow: 0 14px 28px rgba(24, 35, 52, 0.18);
}

.judge-mode #judge-panel .credential-layout {
    display: none;
}

.queue-card,
.judge-card {
    min-height: 420px;
}

#judge-panel .queue-card,
#judge-panel .judge-card {
    border-color: var(--line);
    background:
        linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    color: var(--ink);
    box-shadow: 0 14px 30px rgba(8, 19, 36, 0.06);
}

#judge-panel .section-heading h2,
#judge-panel .judge-entry-heading h2 {
    color: var(--sport-navy);
}

#judge-panel .section-heading p,
#judge-panel .judge-entry-heading p {
    color: var(--muted);
}

.compact-tabs {
    margin-bottom: 10px;
}

.queue-list {
    display: grid;
    gap: 8px;
}

.queue-list::-webkit-scrollbar {
    width: 8px;
}

.queue-list::-webkit-scrollbar-thumb {
    background: #cfd6e3;
    border-radius: 999px;
}

.queue-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #ffffff;
    padding: 12px 13px;
    color: var(--ink);
    text-decoration: none;
}

.queue-item:hover,
.queue-item.active {
    border-color: rgba(255, 210, 26, 0.62);
    background: var(--primary-soft);
}

.queue-item strong,
.queue-item small {
    display: block;
}

.queue-item small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.78rem;
}

.queue-item em,
.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 8px;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 900;
    white-space: nowrap;
}

.queue-item em.pending,
.status-pill.pending {
    background: #fffaeb;
    color: var(--warning);
}

.queue-item em.done,
.status-pill.done {
    background: var(--accent-soft);
    color: var(--primary);
}

.quick-score-form {
    display: grid;
    gap: 16px;
}

#judge-panel .quick-score-form > label {
    color: var(--ink-soft);
    font-weight: 900;
}

#judge-panel .quick-score-form > label input,
#judge-panel .quick-score-form > label textarea,
#judge-panel .score-tile > input {
    border-color: var(--line);
    background: #ffffff;
    color: var(--ink);
}

#judge-panel .score-tile > input {
    margin-top: 12px;
}

#judge-panel .quick-score-form > label input::placeholder,
#judge-panel .quick-score-form > label textarea::placeholder {
    color: #98a2b3;
}

.timer-console {
    align-items: center;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius);
    display: flex;
    justify-content: space-between;
    padding: 16px 18px;
}

.timer-console span,
.timer-console strong {
    display: block;
}

.timer-console span {
    color: #d9e3f3;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.timer-console strong {
    color: #fff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 2.85rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
    line-height: 1.1;
    margin-top: 6px;
}

.timer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.timer-actions button {
    min-width: 86px;
}

.score-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.score-summary div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: #ffffff;
}

.score-summary span,
.score-summary strong {
    display: block;
}

.score-summary span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.score-summary strong {
    margin-top: 4px;
    color: var(--sport-navy);
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
}

.evaluation-context {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin: -2px 0 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #edf1f7;
}

.evaluation-context div {
    background: #ffffff;
    padding: 10px 12px;
}

.evaluation-context span,
.evaluation-context strong {
    display: block;
}

.evaluation-context span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.evaluation-context strong {
    margin-top: 4px;
    color: var(--sport-navy);
    overflow-wrap: anywhere;
}

.quick-score-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.quick-score-grid label {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-soft);
    color: var(--ink);
}

.quick-score-grid label span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--ink);
    font-size: 1.08rem;
    font-weight: 950;
}

.quick-score-grid small {
    color: var(--muted);
    font-weight: 900;
    white-space: nowrap;
}

.advanced-score-tile {
    background: #ffffff;
    border: 1px solid #d7e0ec;
    border-radius: 10px;
    display: grid;
    gap: 12px;
    padding: 14px;
}

.score-tile-head {
    align-items: start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.score-tile-head span {
    color: var(--sport-navy);
    font-size: 1rem;
    font-weight: 900;
}

.score-tile-head small {
    color: #667085;
    font-size: 0.74rem;
    text-transform: uppercase;
}

.score-resource-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-score-grid .score-resource-grid label {
    background: #f8fafc;
    border-radius: 8px;
    padding: 10px;
    color: #667085;
    display: grid;
    gap: 8px;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.score-resource-grid input,
.score-resource-grid select {
    min-height: 42px;
}

.criterion-live-score {
    align-items: center;
    background: #f1f6ff;
    border: 1px solid #cfe0ff;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
}

.criterion-live-score span {
    color: #475467;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.criterion-live-score strong {
    color: var(--primary);
    font-size: 1.1rem;
}

.boolean-tile select {
    margin-top: 12px;
    max-width: 180px;
    min-height: 48px;
    border: 1px solid #d6deea;
    border-radius: var(--radius);
    background: #ffffff;
    color: var(--sport-navy);
    font-size: 1rem;
    font-weight: 850;
}

.score-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 950;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.score-section-title::after {
    content: "";
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, rgba(255, 210, 26, 0.56), transparent);
}

.score-control {
    display: grid;
    grid-template-columns: 58px minmax(76px, 112px) 58px;
    align-items: center;
    margin-top: 12px;
    margin-left: auto;
    width: max-content;
    border: 1px solid #d6deea;
    border-radius: 18px;
    background: #eef2f7;
    padding: 6px;
}

.score-control button {
    display: grid;
    place-items: center;
    height: 54px;
    border: 0;
    border-radius: 14px;
    background: #ffffff;
    color: var(--ink-soft);
    font-size: 2rem;
    font-weight: 950;
    line-height: 1;
}

.score-control button:last-child {
    color: var(--primary);
}

.score-control button:hover {
    background: var(--primary-soft);
}

.score-control input {
    height: 54px;
    border: 0;
    background: transparent;
    color: var(--sport-navy);
    font-size: 2rem;
    font-weight: 950;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.score-control input::-webkit-outer-spin-button,
.score-control input::-webkit-inner-spin-button {
    appearance: none;
    margin: 0;
}

.score-control input[type="number"] {
    appearance: textfield;
}

.progress-list {
    display: grid;
    gap: 12px;
}

.progress-row {
    display: grid;
    gap: 8px;
}

.progress-row > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.progress-row span {
    color: var(--ink-soft);
    font-weight: 800;
}

.progress-row strong {
    color: var(--ink);
}

.progress-track {
    height: 8px;
    border-radius: 999px;
    background: #ece9e2;
    overflow: hidden;
}

.progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: #d05d4d;
}

.progress-track.success span {
    background: var(--primary);
}

.efficiency-card {
    display: grid;
    align-content: start;
    justify-items: center;
    text-align: center;
    background:
        linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.efficiency-card h2 {
    justify-self: start;
    margin-bottom: 4px;
}

.efficiency-card > p {
    justify-self: start;
    text-align: left;
    width: 100%;
}

.donut {
    display: grid;
    place-items: center;
    width: 104px;
    height: 104px;
    margin-top: 14px;
    border-radius: 999px;
    background:
        radial-gradient(circle at center, #fff 61%, transparent 62%),
        conic-gradient(var(--primary) calc(var(--value) * 1%), #e4e7ec 0);
}

.donut strong,
.donut span {
    grid-area: 1 / 1;
}

.donut strong {
    margin-bottom: 18px;
    font-size: 1.35rem;
}

.donut span {
    margin-top: 26px;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
    gap: 12px;
    align-items: start;
}

.rank-panel,
.detail-panel,
.form-card {
    padding: clamp(14px, 1.6vw, 18px);
}

.general-ranking-panel {
    grid-column: 1 / -1;
}

.compact-ranking table {
    min-width: 640px;
}

.rank-panel,
.detail-panel {
    min-width: 0;
    border-color: #cfd8e6;
    box-shadow: 0 14px 30px rgba(8, 19, 36, 0.06);
    position: relative;
    overflow: hidden;
}

.rank-panel::before,
.detail-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--sport-blue), var(--sport-green));
}

.detail-panel {
    position: sticky;
    top: 14px;
    border-color: #cfd8e6;
    box-shadow: 0 16px 32px rgba(8, 19, 36, 0.07);
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.section-heading h2 {
    margin: 0;
}

.entry-detail-heading {
    align-items: stretch;
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

.entry-detail-heading h2 {
    color: var(--sport-navy);
    font-size: 1.34rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.entry-select-button {
    appearance: none;
    background: transparent;
    border: 0;
    color: var(--ink);
    cursor: pointer;
    display: inline;
    font: inherit;
    font-weight: 900;
    line-height: 1.25;
    padding: 0;
    text-align: left;
}

.entry-select-button:hover,
.entry-select-button:focus-visible {
    color: var(--primary);
}

.entry-select-button:focus-visible {
    border-radius: 4px;
    outline: 3px solid rgba(23, 92, 211, 0.18);
    outline-offset: 3px;
}

.entry-actions,
.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.entry-actions {
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.detail-panel .entry-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
}

.detail-panel .entry-actions .inline-form {
    display: block;
}

.detail-panel .entry-actions .primary,
.detail-panel .entry-actions .secondary,
.detail-panel .entry-actions .danger-button {
    min-height: 38px;
    padding-inline: 10px;
    width: 100%;
    white-space: nowrap;
}

.detail-panel .entry-actions .primary {
    grid-column: 1 / -1;
}

.category-tabs {
    display: flex;
    gap: 8px;
    margin: 0 0 10px;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 2px;
    scrollbar-width: thin;
}

.category-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    flex: 0 0 auto;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    padding: 0 11px;
    background: #fff;
    color: var(--ink-soft);
    font-size: 0.88rem;
    font-weight: 900;
    text-decoration: none;
}

.category-tabs small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
}

.category-tabs a.active small {
    color: var(--primary);
}

.category-tabs a.active {
    border-color: rgba(255, 210, 26, 0.72);
    background: linear-gradient(180deg, #fff8d8 0%, #ffffff 100%);
    color: var(--primary-dark);
    box-shadow: inset 0 -3px 0 var(--accent);
}

.category-tabs span {
    display: grid;
    place-items: center;
    min-width: 24px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 210, 26, 0.28);
    font-size: 0.74rem;
    color: var(--sport-navy);
    font-weight: 950;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid #d6deea;
    border-radius: var(--radius);
    background: #fff;
    scrollbar-width: thin;
    box-shadow: inset 0 1px 0 #fff;
}

.table-wrap::-webkit-scrollbar,
.category-tabs::-webkit-scrollbar {
    height: 8px;
}

.table-wrap::-webkit-scrollbar-thumb,
.category-tabs::-webkit-scrollbar-thumb {
    background: #cfd6e3;
    border-radius: 999px;
}

.category-tabs.is-loading {
    opacity: 0.72;
    pointer-events: none;
}

.judge-category-tabs {
    margin: 12px 0 14px;
    padding: 2px 2px 8px;
}

.judge-category-tabs a {
    min-height: 42px;
    padding-inline: 14px;
}

.judge-category-tabs a.active {
    background: #fffdf2;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 0.9rem;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 11px 12px;
    text-align: left;
    vertical-align: middle;
}

td {
    color: var(--ink-soft);
    line-height: 1.32;
}

td strong {
    color: var(--ink);
}

th {
    background: #f4f7fb;
    color: #42526a;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}

.rank-number,
.score-badge,
.bench-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
}

.rank-number {
    width: 30px;
    height: 30px;
    background: #edf3ff;
    color: var(--primary-dark);
}

.score-badge {
    min-width: 58px;
    min-height: 30px;
    background: var(--sport-navy);
    color: #fff;
    padding: 0 10px;
}

.bench-badge {
    min-width: 34px;
    min-height: 28px;
    background: #ecfdf3;
    color: #047857;
    padding: 0 9px;
}

tbody tr:hover {
    background: #f7fbff;
}

tbody tr:last-child td {
    border-bottom: 0;
}

td a {
    color: var(--ink);
    font-weight: 900;
    text-decoration: none;
}

td a:hover {
    color: var(--primary);
    text-decoration: none;
}

td small {
    display: block;
    margin-top: 2px;
    font-size: 0.76rem;
}

td code {
    display: inline-block;
    max-width: 150px;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
}

.selected-row {
    box-shadow: inset 4px 0 0 var(--accent);
    background: #fff8d8;
}

.muted-row {
    color: var(--muted);
    text-align: center;
}

.details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
}

.details div {
    border: 1px solid #dbe3ef;
    border-radius: var(--radius);
    padding: 10px 11px;
    background: #f8fafc;
}

dt {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

dd {
    margin: 4px 0 0;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.entry-facts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    overflow: hidden;
    border: 1px solid #d5dfec;
    border-radius: var(--radius);
    background: #e8eef6;
}

.entry-facts div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    border: 0;
    border-bottom: 1px solid #dbe3ef;
    border-radius: 0;
    padding: 9px 12px;
    background: #fff;
}

.entry-facts div:last-child {
    border-bottom: 0;
}

.entry-facts dt {
    font-size: 0.68rem;
    color: #536176;
}

.entry-facts dd {
    margin: 0;
    line-height: 1.25;
    color: var(--sport-navy);
    font-size: 0.98rem;
    font-weight: 950;
}

.member-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 18px;
}

.member-list li {
    padding: 2px 0;
}

.member-list span,
.member-list small {
    display: block;
}

.member-list small {
    color: var(--muted);
    font-weight: 800;
}

.credential-layout {
    display: grid;
    gap: 12px;
}

.scan-console {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: #101828;
}

.scan-console label {
    color: #d9e3f3;
}

.scan-console input {
    border-color: rgba(255, 255, 255, 0.2);
}

.credential-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.proof-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.credential-stats div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--surface-soft);
}

.credential-stats span,
.credential-stats strong {
    display: block;
}

.credential-stats span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.credential-stats strong {
    margin-top: 5px;
    font-size: 1.24rem;
}

.badge-toolbar {
    margin-bottom: 12px;
}

.badge-sheet {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90mm, 90mm));
    gap: 14px;
    justify-content: start;
}

.member-badge {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 4mm;
    width: 90mm;
    min-height: 120mm;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 5mm;
    background: #fff;
    box-shadow: var(--shadow-soft);
    break-inside: avoid;
}

.member-badge header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.member-badge .brand-mark {
    width: 15mm;
    height: 18mm;
}

.member-badge header strong,
.member-badge header small,
.badge-body span,
.badge-body p {
    display: block;
}

.member-badge header small,
.badge-body span,
.badge-body p {
    color: var(--muted);
    font-weight: 800;
}

.badge-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 4mm;
    align-items: center;
    justify-items: center;
    text-align: center;
}

.badge-body h3 {
    margin: 4px 0;
    font-size: 1.45rem;
    line-height: 1.08;
}

.badge-body img {
    width: 38mm;
    height: 38mm;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.member-badge dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5mm;
    margin: 0;
}

.member-badge dl div {
    min-width: 0;
}

.member-badge dt {
    font-size: 0.64rem;
}

.member-badge dd {
    font-size: 0.82rem;
}

.member-editor {
    display: grid;
    gap: 10px;
    margin-top: 6px;
}

.member-editor-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
}

.member-editor-heading h3 {
    margin-bottom: 4px;
}

.member-editor-heading p {
    margin-bottom: 0;
    color: var(--muted);
}

.member-header,
.member-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.35fr);
    gap: 10px;
}

.member-header {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.evaluation-list {
    display: grid;
    gap: 10px;
}

.evaluation-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--surface-soft);
}

.evaluation-card header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.evaluation-card span {
    display: inline-grid;
    place-items: center;
    min-width: 58px;
    min-height: 32px;
    border-radius: 6px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 900;
}

.evaluation-card p {
    margin: 0;
    color: #475467;
}

.empty-detail {
    display: grid;
    min-height: 280px;
    align-content: center;
    color: var(--muted);
}

.form-card {
    max-width: 980px;
}

.settings-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: start;
}

.settings-main-card {
    max-width: none;
    min-width: 0;
    overflow: hidden;
}

.settings-aside {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(280px, 1fr) minmax(260px, 1fr) minmax(260px, 1fr);
    gap: 10px;
    min-width: 0;
    position: static;
}

.settings-side-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 8px 18px rgba(8, 19, 36, 0.04);
}

.settings-side-panel h3,
.settings-side-panel p {
    margin: 0;
}

.settings-side-panel h3 {
    margin-top: 4px;
    font-size: 0.88rem;
}

.settings-side-panel p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.45;
}

.status-panel {
    border-left: 4px solid var(--accent);
}

.status-panel.is-ready {
    border-left-color: var(--success);
}

.settings-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
}

.settings-metrics div {
    min-width: 0;
    border: 1px solid #dbe3ef;
    border-radius: 8px;
    padding: 7px 8px;
    background: #f8fafc;
}

.settings-metrics span,
.settings-checklist li {
    color: var(--muted-strong);
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.settings-metrics strong {
    display: block;
    margin-top: 3px;
    color: var(--text);
    font-size: 0.98rem;
}

.settings-checklist {
    display: grid;
    gap: 7px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.settings-checklist li {
    display: flex;
    align-items: center;
    gap: 9px;
}

.settings-checklist span {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #cbd5e1;
}

.settings-checklist .is-done span {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.settings-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.settings-actions .primary,
.settings-actions .secondary {
    width: 100%;
    min-height: 36px;
    padding-inline: 10px;
}

.entry-card {
    max-width: 1040px;
}

.operation-strip {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(160px, 0.7fr) minmax(120px, 0.35fr);
    gap: 10px;
    margin-bottom: 18px;
}

.operation-strip div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--surface-soft);
}

.operation-strip span,
.operation-strip strong {
    display: block;
}

.operation-strip span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.operation-strip strong {
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.entry-flow {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.split-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.wizard-card {
    max-width: 1040px;
}

.wizard-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 4px 0 20px;
}

.wizard-steps button {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px 10px;
    background: var(--surface-soft);
    color: var(--ink-soft);
    font-weight: 900;
}

.wizard-steps button.active {
    border-color: rgba(20, 86, 217, 0.28);
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.wizard-steps span {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #fff;
    color: var(--primary-dark);
    font-size: 0.78rem;
}

.wizard-panel {
    display: none;
}

.wizard-panel.active {
    display: block;
}

.wizard-copy {
    max-width: 720px;
    margin-bottom: 16px;
}

.wizard-copy span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wizard-copy h3 {
    margin: 4px 0 6px;
    font-size: 1.08rem;
}

.wizard-copy p {
    margin-bottom: 0;
    color: var(--muted);
}

.review-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.review-grid div {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--surface-soft);
}

.review-grid span,
.review-grid strong {
    display: block;
}

.review-grid span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.review-grid strong {
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.wizard-actions .primary {
    margin-left: auto;
}

.form-grid,
.score-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.criteria-editor {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.category-editor {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.module-heading {
    align-items: end;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin: 18px 0 12px;
}

.module-heading h3,
.module-heading p {
    margin: 0;
}

.module-heading p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.category-stack {
    display: grid;
    gap: 14px;
    overflow: visible;
}

.category-config-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 8px 18px rgba(8, 19, 36, 0.04);
    padding: 14px;
}

.category-card-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5ebf3;
}

.category-card-head strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: 1.08rem;
}

.category-card-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.category-card-badges label {
    align-items: center;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #fff;
    color: var(--ink-soft);
    display: inline-flex;
    gap: 7px;
    min-height: 30px;
    padding: 0 9px;
    font-size: 0.68rem;
    font-weight: 900;
}

.category-card-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1.4fr) minmax(180px, 0.8fr) repeat(4, minmax(96px, 0.44fr));
    gap: 10px;
    margin-top: 14px;
}

.category-card-grid label {
    min-width: 0;
}

.category-card-grid label:last-child {
    grid-column: 1 / -1;
}

.category-criteria-editor {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    overflow: visible;
    padding-bottom: 0;
}

.category-criterion-header {
    display: none;
}

.category-criterion-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(250px, 1.1fr) minmax(138px, 0.52fr) minmax(128px, 0.48fr) minmax(110px, 0.38fr) minmax(104px, 0.34fr) minmax(150px, 0.5fr);
    gap: 8px;
    min-width: 0;
    align-items: start;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    padding: 10px;
    margin-bottom: 0;
}

.category-criterion-row > input:not([type="hidden"]),
.category-criterion-row > select,
.category-criterion-row .time-range-inputs,
.category-criterion-row .criterion-field {
    align-self: start;
}

.criterion-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.criterion-field > span {
    color: var(--muted-strong);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    line-height: 1.1;
    text-transform: uppercase;
}

.criterion-field input,
.criterion-field select {
    width: 100%;
}

.criterion-field-name input {
    min-height: 72px;
    font-weight: 850;
}

.global-criteria-editor {
    margin-bottom: 16px;
}

.time-range-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.time-range-inputs input {
    min-width: 0;
}

.grade-score-panel {
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #f8fafc;
    margin: 0 0 14px;
    padding: 12px;
}

.grade-score-panel label {
    max-width: 360px;
    margin: 0;
}

.category-header,
.category-row {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(150px, 0.7fr) minmax(118px, 0.42fr) minmax(78px, 0.28fr) minmax(70px, 0.24fr) minmax(90px, 0.32fr) minmax(82px, 0.28fr) minmax(98px, 0.34fr) minmax(86px, 0.3fr);
    gap: 10px;
    min-width: 980px;
}

.check-cell {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 44px;
}

.check-cell input {
    height: 18px;
    width: 18px;
}

.rule-status {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin-top: 12px;
    padding: 12px;
}

.rule-status.ok {
    background: #ecfdf3;
    border-color: #abefc6;
}

.rule-status.warning {
    background: #fffaeb;
    border-color: #fedf89;
}

.rule-status strong,
.rule-status span,
.rule-status li {
    display: block;
}

.rule-status span,
.rule-status li {
    color: #475467;
    font-size: 0.85rem;
    font-weight: 750;
}

.rule-status ul {
    display: grid;
    gap: 4px;
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.judge-editor {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
}

.judge-row {
    display: grid;
    grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
    gap: 12px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    padding: 12px;
}

.judge-category-scope {
    display: grid;
    gap: 8px;
}

.judge-category-scope > span {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.judge-criteria-group {
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
}

.judge-criteria-group > strong {
    display: block;
    color: var(--text);
    font-size: 0.82rem;
    margin-bottom: 8px;
}

.judge-criteria-group > div {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.judge-category-scope label,
.judge-criteria-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f8fafc;
    padding: 7px 10px;
    font-weight: 850;
    font-size: 0.78rem;
}

.judge-category-scope label:has(input:checked),
.judge-criteria-group label:has(input:checked) {
    background: #eff6ff;
    border-color: rgba(20, 86, 217, 0.38);
    color: var(--primary-dark);
}

.judge-category-scope input,
.judge-criteria-group input {
    width: 16px;
    height: 16px;
}

.judge-category-scope small {
    color: var(--muted);
    font-weight: 750;
}

.judge-checkin-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #dbe3ef;
    border-radius: var(--radius);
    background: #fff;
    padding: 11px 12px;
    font-weight: 850;
}

.judge-checkin-box input {
    width: 18px;
    height: 18px;
}

.judge-identity {
    border: 1px solid #abefc6;
    border-radius: var(--radius);
    background: #ecfdf3;
    padding: 12px;
}

.judge-identity span,
.judge-identity strong {
    display: block;
}

.judge-identity span {
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.judge-identity strong {
    margin-top: 4px;
    color: var(--ink);
}

.criterion-header,
.criterion-row {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(135px, 0.58fr) minmax(126px, 0.55fr) minmax(132px, 0.5fr) minmax(118px, 0.48fr) minmax(94px, 0.32fr) minmax(82px, 0.28fr) minmax(96px, 0.34fr) 58px;
    gap: 8px;
    min-width: 1180px;
}

.criterion-row {
    align-items: start;
}

.criterion-row > select[name="criteria_scoring_type[]"] {
    display: none;
}

.criterion-resource-cell {
    align-content: start;
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: relative;
    padding-top: 20px;
}

.criterion-resource-cell::before,
.category-criterion-row > input[name="criteria_score_options[]"]::placeholder {
    color: var(--muted-strong);
}

.criterion-resource-cell::before {
    content: "Recursos";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--muted-strong);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.criterion-resource-cell label {
    align-items: center;
    background: #fff;
    border: 1px solid #dbe3ef;
    border-radius: 7px;
    color: #344054;
    display: inline-flex;
    gap: 6px;
    min-height: 36px;
    padding: 7px 7px;
    font-size: 0.64rem;
    font-weight: 850;
    line-height: 1.1;
    position: relative;
}

.criterion-resource-cell label:has(input:checked) {
    background: #eff6ff;
    border-color: rgba(20, 86, 217, 0.38);
    box-shadow: inset 3px 0 0 var(--primary);
}

.criterion-resource-cell label > span {
    display: grid;
    min-width: 0;
}

.criterion-resource-cell strong,
.criterion-resource-cell small {
    display: block;
}

.criterion-resource-cell strong {
    color: var(--text);
    font-size: 0.68rem;
    line-height: 1.05;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.criterion-resource-cell small {
    background: #0f172a;
    border-radius: 7px;
    box-shadow: 0 10px 24px rgba(8, 19, 36, 0.2);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 750;
    left: 50%;
    line-height: 1.25;
    max-width: 190px;
    min-width: 150px;
    opacity: 0;
    padding: 7px 8px;
    pointer-events: none;
    position: absolute;
    text-align: center;
    top: calc(100% + 8px);
    transform: translate(-50%, -2px);
    transition: opacity 0.16s ease, transform 0.16s ease;
    white-space: nowrap;
    z-index: 12;
}

.criterion-resource-cell small::before {
    border: 6px solid transparent;
    border-bottom-color: #0f172a;
    content: "";
    left: 50%;
    position: absolute;
    top: -12px;
    transform: translateX(-50%);
}

.criterion-resource-cell label:hover small,
.criterion-resource-cell label:focus-within small {
    opacity: 1;
    transform: translate(-50%, 0);
}

.criterion-resource-cell input {
    height: 12px;
    width: 12px;
    flex: 0 0 auto;
}

.criterion-header {
    margin-bottom: -2px;
    padding: 0 2px;
    color: var(--muted);
    font-size: 0.6rem;
    font-weight: 820;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.category-header {
    margin-bottom: -2px;
    padding: 0 2px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.category-criteria-editor .category-criterion-header {
    display: none;
    min-width: 0;
}

.category-criteria-editor .criterion-row.category-criterion-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.12fr) minmax(138px, 0.48fr) minmax(128px, 0.46fr) minmax(110px, 0.36fr) minmax(104px, 0.32fr) minmax(150px, 0.48fr);
    gap: 8px;
    min-width: 0;
}

.score-grid label {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.score-grid label span {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.score-grid small {
    color: var(--muted);
    font-weight: 900;
    white-space: nowrap;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.primary,
.secondary,
.tertiary,
.danger-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--radius);
    min-height: 40px;
    padding: 0 14px;
    font-weight: 900;
    text-align: center;
    white-space: nowrap;
    transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

a.primary,
a.secondary,
a.tertiary,
a.danger-button {
    text-decoration: none;
}

.primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 18px rgba(24, 35, 52, 0.16);
}

.primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 10px 22px rgba(24, 35, 52, 0.20);
}

.secondary {
    background: #f2f4f7;
    color: var(--primary-dark);
    border: 1px solid #e4e7ec;
}

.secondary:hover {
    background: #fff8d8;
    border-color: #f4d45c;
}

.tertiary {
    background: #fff;
    color: var(--ink-soft);
    border: 1px solid var(--line);
}

.command-bar .secondary {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.command-bar .tertiary {
    background: transparent;
    color: #d9e3f3;
    border-color: rgba(255, 255, 255, 0.22);
}

.danger-button {
    background: #fff;
    color: var(--danger);
    border: 1px solid #fecdca;
}

.danger-button:hover {
    background: #fffbfa;
    border-color: #fda29b;
}

.notice-inline {
    margin: 6px 0 14px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
}

.compact {
    min-height: 36px;
}

@media (max-width: 1180px) {
    .stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ops-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ops-focus {
        grid-template-columns: 1fr;
    }

    .workspace {
        grid-template-columns: 1fr;
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }

    .settings-aside {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        position: static;
    }

    .contest-card {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .contest-card-actions {
        justify-content: stretch;
    }

    .contest-card-actions a {
        flex: 1 1 auto;
        text-align: center;
    }

    .detail-panel {
        position: static;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .judge-layout,
    .judge-stage {
        grid-template-columns: 1fr;
    }

    .judge-command {
        align-items: stretch;
        flex-direction: column;
    }

    .timer-console {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .timer-actions {
        justify-content: stretch;
    }

    .timer-actions button {
        flex: 1;
    }
}

@media (max-width: 920px) {
    .app-shell {
        grid-template-columns: 1fr;
        align-content: start;
    }

    .app-shell.sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: sticky;
        z-index: 4;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        height: 64px;
        min-height: auto;
        max-height: 64px;
        padding: 8px 10px;
        overflow-x: auto;
        overflow-y: hidden;
        background: rgba(255, 255, 255, 0.98);
        border-right: 0;
        border-bottom: 1px solid var(--line);
        box-shadow: 0 4px 14px rgba(8, 19, 36, 0.04);
    }

    .sidebar-collapsed .sidebar {
        align-items: center;
        padding-inline: 10px;
    }

    .brand {
        min-width: 56px;
        margin: 0 4px 0 0;
        padding: 0;
    }

    .sidebar-collapsed .brand-copy,
    .sidebar-collapsed .nav-text,
    .brand-copy,
    .nav-text {
        display: none;
    }

    .sidebar-collapsed .brand {
        justify-content: flex-start;
    }

    .sidebar-toggle {
        display: none;
    }

    .brand-mark {
        width: 48px;
        height: 52px;
        font-size: 0.72rem;
        border-radius: 14px;
        padding: 4px;
    }

    .sidebar-collapsed .brand-mark {
        width: 48px;
        height: 52px;
    }

    .nav-button {
        display: inline-flex;
        justify-content: center;
        width: auto;
        flex: 0 0 auto;
        min-width: 42px;
        min-height: 38px;
        margin-right: 4px;
        margin-bottom: 0;
        padding: 0 10px;
        background: #f8fafc;
        color: var(--ink-soft);
        white-space: nowrap;
    }

    .sidebar-collapsed .nav-button {
        width: auto;
        min-height: 38px;
        margin-bottom: 0;
        padding: 0 10px;
    }

    .nav-button.active,
    .nav-button:hover {
        background: var(--primary-soft);
        color: var(--primary-dark);
    }

    .nav-button::before {
        display: none;
    }

    .nav-button::after,
    .sidebar-collapsed .nav-button::after {
        content: attr(data-short);
        color: inherit;
        font-size: 0.68rem;
        font-weight: 950;
        letter-spacing: 0.04em;
    }

    .nav-section,
    .sidebar-context {
        display: none;
    }

    .topbar {
        grid-template-columns: 1fr;
        align-items: stretch;
        top: 64px;
        margin-top: 0;
        border-top: 1px solid var(--line);
        min-height: auto;
    }

    .topbar-tools {
        justify-content: stretch;
        width: 100%;
    }

    .contest-picker {
        width: 100%;
        flex: 1 1 auto;
    }

    .user-session {
        flex: 0 0 auto;
    }

    .content {
        padding-top: 0;
    }
}

@media (max-width: 680px) {
    body {
        font-size: 14px;
    }

    .login-shell {
        padding: 156px 14px 24px;
    }

    .login-card {
        padding-top: 30px;
    }

    .login-card .brand {
        top: -142px;
        display: grid;
    }

    .login-card .brand-copy {
        display: none;
    }

    .login-card .brand-mark {
        width: 120px;
        height: 142px;
        padding: 0;
    }

    * {
        min-width: 0;
    }

    .content {
        padding: 0 10px 26px;
    }

    .topbar {
        gap: 8px;
        margin-bottom: 10px;
        padding: 9px 10px;
    }

    .topbar-tools {
        display: grid;
        grid-template-columns: 1fr;
        padding: 4px;
    }

    .user-session {
        justify-content: space-between;
        border-left: 0;
        border-top: 1px solid #e3e8f0;
        padding-top: 6px;
        padding-left: 0;
    }

    .login-actions {
        grid-template-columns: 1fr;
    }

    .breadcrumb,
    .eyebrow {
        display: none;
    }

    h1 {
        font-size: 1.1rem;
    }

    .contest-picker {
        width: 100%;
        justify-self: stretch;
        padding: 8px;
    }

    .contest-picker label {
        font-size: 0.62rem;
    }

    .stats-grid,
    .ops-kpis,
    .contest-card-metrics,
    .ops-header,
    .ops-focus,
    .quick-insights,
    .form-grid,
    .score-grid,
    .command-bar,
    .operation-strip,
    .entry-flow,
    .scan-console,
    .credential-stats,
    .score-summary,
    .evaluation-context,
    .wizard-steps,
    .review-grid,
    .details {
        grid-template-columns: 1fr;
    }

    .dashboard-card,
    .rank-panel,
    .detail-panel,
    .form-card {
        padding: 12px;
    }

    #judge-panel .credential-layout {
        gap: 10px;
    }

    #judge-panel .dashboard-card .section-heading p {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    .command-bar {
        display: grid;
        align-items: stretch;
    }

    .ops-header,
    .ops-panel {
        display: grid;
        align-items: stretch;
    }

    .entry-detail-heading {
        display: grid;
    }

    .command-actions {
        justify-content: stretch;
    }

    .entry-actions {
        width: 100%;
    }

    .entry-actions {
        display: grid;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .detail-panel .entry-actions {
        grid-template-columns: 1fr;
    }

    .entry-actions > * {
        width: 100%;
    }

    .section-heading .entry-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .entry-facts div {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    .command-actions > * {
        flex: 1 1 100%;
    }

    .primary,
    .secondary,
    .tertiary,
    .danger-button {
        white-space: normal;
    }

    .scan-console {
        align-items: stretch;
    }

    .scan-console button {
        width: 100%;
    }

    .scan-console label {
        font-size: 0.82rem;
    }

    .scan-console input {
        min-height: 38px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ops-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .credential-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .contest-card {
        padding: 10px;
    }

    .contest-card-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-tabs {
        gap: 6px;
        margin-inline: -2px;
        padding-inline: 2px;
    }

    .category-tabs a {
        min-height: 32px;
        padding-inline: 9px;
        font-size: 0.78rem;
    }

    .category-tabs small {
        display: none;
    }

    .quick-score-grid {
        grid-template-columns: 1fr;
    }

    .judge-mode .content {
        padding-bottom: 96px;
    }

    .judge-mode .topbar {
        display: none;
    }

    .judge-mode #judge-panel .judge-command {
        margin-bottom: 10px;
        padding: 12px;
    }

    .judge-mode #judge-panel .judge-command strong {
        font-size: 1.35rem;
        line-height: 1.05;
    }

    .judge-mode #judge-panel .judge-command small {
        margin-top: 5px;
        font-size: 0.72rem;
    }

    .judge-mode #judge-panel .judge-progress {
        max-width: none;
        margin-top: 9px;
    }

    #judge-panel .queue-card {
        max-height: 220px;
        overflow: hidden;
    }

    #judge-panel .queue-card .section-heading {
        margin-bottom: 8px;
    }

    #judge-panel .queue-list {
        max-height: 138px;
        overflow-y: auto;
        padding-right: 4px;
        scrollbar-width: thin;
    }

    #judge-panel .queue-item {
        padding: 9px 10px;
    }

    #judge-panel .queue-item strong {
        font-size: 0.84rem;
    }

    #judge-panel .queue-item small {
        font-size: 0.7rem;
    }

    .judge-mode #judge-panel .queue-card {
        min-height: 0;
        max-height: 178px;
        padding: 10px;
    }

    .judge-mode #judge-panel .queue-card .section-heading h2 {
        font-size: 0.95rem;
    }

    .judge-mode #judge-panel .queue-card .section-heading p {
        display: none;
    }

    .judge-mode #judge-panel .queue-list {
        max-height: 112px;
    }

    .judge-mode #judge-panel .judge-card {
        min-height: 0;
    }

    .judge-mode #judge-panel .judge-entry-heading {
        margin-bottom: 10px;
    }

    .judge-mode #judge-panel .score-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .judge-mode #judge-panel .score-summary div,
    .judge-mode #judge-panel .evaluation-context div {
        padding: 9px;
    }

    .judge-mode #judge-panel .evaluation-context {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .judge-mode #judge-panel .judge-identity {
        padding: 10px;
    }

    .judge-mode #judge-panel .timer-console {
        position: sticky;
        top: 74px;
        z-index: 2;
        box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
    }

    .judge-mode #judge-panel .timer-console strong {
        font-size: clamp(2.35rem, 13vw, 3.25rem);
    }

    .judge-mode #judge-panel .judge-save-actions {
        position: fixed;
        right: 10px;
        bottom: 10px;
        left: 10px;
        z-index: 10;
        margin: 0;
        padding: 10px;
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 18px 45px rgba(8, 19, 36, 0.18);
    }

    .judge-mode #judge-panel .judge-save-actions .primary {
        width: 100%;
        min-height: 52px;
    }

    .score-control {
        grid-template-columns: 54px minmax(68px, 1fr) 54px;
        width: 100%;
    }

    .stat {
        min-height: auto;
    }

    .section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .table-wrap {
        border: 0;
        overflow: visible;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
    }

    thead {
        display: none;
    }

    tbody {
        display: grid;
        gap: 10px;
    }

    tr {
        border: 1px solid var(--line);
        border-radius: var(--radius);
        background: #fff;
        box-shadow: 0 10px 26px rgba(16, 24, 40, 0.06);
        overflow: hidden;
    }

    td {
        display: grid;
        grid-template-columns: minmax(104px, 40%) minmax(0, 1fr);
        gap: 10px;
        align-items: start;
        border-bottom: 1px solid var(--line);
        padding: 10px 12px;
    }

    td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 900;
        text-transform: uppercase;
    }

    .muted-row {
        display: block;
        text-align: left;
    }

    .muted-row::before {
        content: none;
    }

    .category-header,
    .member-header,
    .criterion-header {
        display: none;
    }

    .criterion-row,
    .category-row,
    .category-card-grid,
    .category-criterion-row,
    .judge-row,
    .member-row {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .module-heading,
    .category-card-head {
        align-items: stretch;
        flex-direction: column;
    }

    .category-card-badges {
        justify-content: flex-start;
    }

    .category-criteria-editor {
        overflow: visible;
        max-height: 360px;
    }

    .settings-aside {
        grid-template-columns: 1fr;
    }

    .criterion-field-name input {
        min-height: 44px;
    }

    .criterion-resource-cell {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-actions,
    .wizard-actions,
    .split-actions,
    .entry-actions,
    .inline-form,
    .primary,
    .secondary,
    .tertiary,
    .danger-button {
        width: 100%;
    }

    .entry-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .member-editor-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .wizard-actions {
        flex-direction: column;
    }

    .wizard-actions .primary {
        margin-left: 0;
    }

    .split-actions {
        flex-direction: column;
    }
}

@media (max-width: 360px) {
    .stats-grid,
    .ops-kpis,
    .credential-stats,
    .score-summary,
    .evaluation-context {
        grid-template-columns: 1fr;
    }

    .dashboard-card,
    .rank-panel,
    .detail-panel,
    .form-card {
        padding: 10px;
    }

    .sidebar {
        gap: 5px;
        padding-inline: 8px;
    }

    .nav-button {
        min-width: 36px;
        padding-inline: 8px;
    }

    td {
        grid-template-columns: 1fr;
        gap: 3px;
    }
}

@media (max-width: 430px) {
    .brand strong {
        font-size: 0.95rem;
    }

    .brand small {
        font-size: 0.76rem;
    }

    .nav-button::before {
        display: none;
    }

    td {
        grid-template-columns: 1fr;
    }
}

@media print {
    @page {
        margin: 10mm;
        size: A4;
    }

    body {
        background: #fff;
    }

    .sidebar,
    .topbar,
    .flash,
    .badge-toolbar,
    .panel:not(#credentialing-panel),
    #credentialing-panel .dashboard-card:not(.badge-toolbar) {
        display: none !important;
    }

    .app-shell,
    .content {
        display: block;
        max-width: none;
        min-height: auto;
        padding: 0;
        width: 100%;
    }

    #credentialing-panel {
        display: block !important;
    }

    .badge-sheet {
        display: grid !important;
        grid-template-columns: repeat(2, 90mm);
        gap: 6mm;
        justify-content: center;
    }

    .member-badge {
        width: 90mm;
        min-height: 120mm;
        border-color: #111827;
        box-shadow: none;
        page-break-inside: avoid;
    }
}
