:root {
    --bg: #f3f6fb;
    --bg-soft: #eef3f9;
    --card: #ffffff;
    --card-border: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --secondary-hover: #475569;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success-bg: #ecfdf5;
    --success-text: #047857;
    --warning-bg: #fffbeb;
    --warning-text: #b45309;
    --info-bg: #eff6ff;
    --info-text: #1d4ed8;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 32rem),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.10), transparent 28rem),
        var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.55;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.page {
    width: min(1180px, calc(100% - 32px));
    margin: 28px auto;
}

.container {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    backdrop-filter: blur(12px);
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--card-border);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    font-weight: 800;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.brand-title {
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 14px;
    margin-top: 2px;
}

.userbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 14px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--muted);
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--bg-soft);
    font-size: 14px;
}

.nav-links a:hover {
    color: var(--text);
    text-decoration: none;
    background: #e2e8f0;
}

h1 {
    margin: 0 0 22px;
    font-size: clamp(28px, 3vw, 40px);
    line-height: 1.12;
    letter-spacing: -0.045em;
}

h2 {
    margin: 0 0 14px;
    font-size: 24px;
    line-height: 1.25;
    letter-spacing: -0.025em;
}

h3 {
    margin: 0 0 10px;
    font-size: 19px;
    line-height: 1.3;
}

p {
    margin-top: 0;
}

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.card:hover {
    border-color: #cbd5e1;
}

.muted {
    color: var(--muted);
}

.message {
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    background: var(--info-bg);
    color: var(--info-text);
    margin-bottom: 14px;
    border: 1px solid #bfdbfe;
}

button,
a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    gap: 8px;
    background: var(--primary);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 12px;
    border: none;
    text-decoration: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

button:hover,
a.button:hover {
    background: var(--primary-hover);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(37, 99, 235, 0.22);
}

a.button.secondary {
    background: var(--secondary);
    box-shadow: 0 10px 20px rgba(100, 116, 139, 0.16);
}

a.button.secondary:hover {
    background: var(--secondary-hover);
}

a.button.danger {
    background: var(--danger);
    box-shadow: 0 10px 20px rgba(220, 38, 38, 0.16);
}

a.button.danger:hover {
    background: var(--danger-hover);
}

form.card {
    margin-top: 16px;
}

label {
    font-weight: 650;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
input[type="number"],
textarea,
select {
    width: 100%;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--text);
    border-radius: 12px;
    padding: 11px 13px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input[type="file"] {
    width: 100%;
    border: 1px dashed #94a3b8;
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
    transform: scale(1.08);
    accent-color: var(--primary);
}

.criterion {
    margin-bottom: 18px;
    padding: 18px;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    background: #f8fafc;
}

.score-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.score-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    cursor: pointer;
}

.score-row label:hover {
    border-color: var(--primary);
    background: #eff6ff;
}

table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

th {
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

th,
td {
    border-color: #e2e8f0 !important;
    vertical-align: top;
}

tbody tr:hover {
    background: #f8fafc;
}

ol,
ul {
    padding-left: 22px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.stat-card {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 18px;
}

.stat-value {
    font-size: 32px;
    font-weight: 850;
    letter-spacing: -0.05em;
}

.stat-label {
    color: var(--muted);
    font-size: 14px;
}

.action-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.action-list p {
    margin: 0;
}

.action-list a.button {
    width: 100%;
    justify-content: flex-start;
    padding: 14px 16px;
}

@media (max-width: 860px) {
    .page {
        width: min(100% - 20px, 1180px);
        margin: 10px auto;
    }

    .container {
        padding: 18px;
        border-radius: 18px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .userbar {
        justify-content: flex-start;
    }

    .dashboard-grid,
    .action-list {
        grid-template-columns: 1fr;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    h1 {
        font-size: 30px;
    }
}

.jury-hero {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr;
    gap: 18px;
    margin-bottom: 18px;
}

.jury-welcome {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(6, 182, 212, 0.10)),
        #ffffff;
}

.jury-name {
    font-size: 28px;
    font-weight: 850;
    letter-spacing: -0.035em;
    margin-bottom: 6px;
}

.jury-region {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 7px 11px;
    border-radius: 999px;
    color: #1e40af;
    background: #dbeafe;
    font-weight: 700;
    font-size: 14px;
}

.progress-card {
    min-height: 210px;
}

.progress-number {
    font-size: 46px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.06em;
    margin-bottom: 8px;
}

.progress-bar {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin: 18px 0 12px;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #06b6d4);
}

.next-video-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 24px;
}

.video-meta {
    display: grid;
    gap: 8px;
    color: var(--muted);
}

.video-meta strong {
    color: var(--text);
}

.empty-state {
    text-align: center;
    padding: 44px 24px;
}

.empty-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: #ecfdf5;
    color: #047857;
    font-size: 36px;
    font-weight: 900;
}

.help-card {
    background: #f8fafc;
}

.help-list {
    margin-bottom: 0;
}

@media (max-width: 860px) {
    .jury-hero,
    .next-video-card {
        grid-template-columns: 1fr;
    }

    .next-video-card a.button {
        width: 100%;
    }
}

.evaluate-layout {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: 18px;
    align-items: start;
}

.video-panel {
    position: sticky;
    top: 18px;
}

.video-card-highlight {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(6, 182, 212, 0.08)),
        #ffffff;
}

.video-number {
    display: inline-flex;
    align-items: center;
    padding: 7px 11px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1e40af;
    font-weight: 800;
    font-size: 14px;
    margin-bottom: 12px;
}

.video-title {
    font-size: 28px;
    font-weight: 850;
    line-height: 1.15;
    letter-spacing: -0.04em;
    margin-bottom: 12px;
}

.open-video-button {
    width: 100%;
    margin-top: 16px;
    min-height: 54px;
    font-size: 17px !important;
}

.scoring-panel {
    display: grid;
    gap: 16px;
}

.criterion-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.criterion-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 14px;
}

.criterion-number {
    min-width: 34px;
    height: 34px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 850;
}

.criterion-title-wrap {
    flex: 1;
}

.criterion-title {
    font-size: 20px;
    font-weight: 850;
    letter-spacing: -0.025em;
}

.criterion-description {
    color: var(--muted);
    margin-top: 4px;
    margin-bottom: 0;
}

.score-scale {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.score-pill {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #f8fafc;
    cursor: pointer;
    font-size: 18px;
    font-weight: 850;
    transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.score-pill input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.score-pill:hover {
    transform: translateY(-1px);
    border-color: var(--primary);
    background: #eff6ff;
}

.score-pill:has(input:checked) {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    border-color: transparent;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.22);
}

.score-hint {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.comment-card textarea {
    min-height: 150px;
}

.submit-panel {
    position: sticky;
    bottom: 18px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: 0 18px 36px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(12px);
}

.submit-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.submit-actions button,
.submit-actions a.button {
    min-height: 48px;
}

@media (max-width: 980px) {
    .evaluate-layout {
        grid-template-columns: 1fr;
    }

    .video-panel {
        position: static;
    }

    .score-scale {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .submit-panel {
        position: static;
    }
}

@media (max-width: 560px) {
    .score-scale {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .video-title {
        font-size: 24px;
    }

    .submit-actions button,
    .submit-actions a.button {
        width: 100%;
    }
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.admin-page-header p {
    margin-bottom: 0;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.table-card {
    padding: 0;
    overflow: hidden;
}

.table-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--card-border);
    background: #f8fafc;
}

.table-header h2 {
    margin-bottom: 4px;
}

.modern-table {
    width: 100%;
    border: none !important;
    border-radius: 0;
    box-shadow: none;
}

.modern-table th,
.modern-table td {
    padding: 13px 14px !important;
    border-left: none !important;
    border-right: none !important;
}

.modern-table th {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 1;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 850;
}

.rank-badge.top {
    color: #92400e;
    background: #fef3c7;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-weight: 800;
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eef2ff;
    color: #4338ca;
    font-weight: 800;
}

.row-title {
    font-weight: 800;
    color: var(--text);
}

.row-subtitle {
    color: var(--muted);
    font-size: 14px;
    margin-top: 3px;
}

.link-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
    font-size: 14px;
}

.link-pill:hover {
    background: #e2e8f0;
    text-decoration: none;
}

.empty-table-state {
    text-align: center;
    padding: 36px 20px !important;
    color: var(--muted);
}

@media (max-width: 860px) {
    .admin-page-header {
        flex-direction: column;
    }

    .toolbar a.button {
        width: 100%;
    }
}

.progress-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.progress-mini {
    min-width: 160px;
}

.progress-mini-bar {
    width: 100%;
    height: 9px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    margin-top: 8px;
}

.progress-mini-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #06b6d4);
}

.percent-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 850;
}

.percent-badge.done {
    background: #ecfdf5;
    color: #047857;
}

.percent-badge.zero {
    background: #f1f5f9;
    color: #64748b;
}

.activity-muted {
    color: var(--muted);
    font-size: 14px;
}

@media (max-width: 860px) {
    .progress-summary-grid {
        grid-template-columns: 1fr;
    }
}

.check-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.health-card {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 18px;
}

.health-card.good {
    border-color: #bbf7d0;
    background: linear-gradient(180deg, #ffffff, #f0fdf4);
}

.health-card.warning {
    border-color: #fde68a;
    background: linear-gradient(180deg, #ffffff, #fffbeb);
}

.health-value {
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.055em;
    margin-bottom: 8px;
}

.health-label {
    color: var(--muted);
    font-size: 14px;
}

.issue-section {
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    background: #ffffff;
    margin-bottom: 16px;
    overflow: hidden;
}

.issue-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 20px;
    background: #f8fafc;
    border-bottom: 1px solid var(--card-border);
}

.issue-section-header h2 {
    margin-bottom: 0;
}

.issue-body {
    padding: 18px 20px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 850;
}

.status-pill.ok {
    color: #047857;
    background: #d1fae5;
}

.status-pill.warn {
    color: #b45309;
    background: #fef3c7;
}

.status-pill.bad {
    color: #b91c1c;
    background: #fee2e2;
}

.ok-state {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #047857;
    font-weight: 750;
}

.ok-dot {
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #d1fae5;
    color: #047857;
    font-weight: 900;
}

.region-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.region-list {
    display: grid;
    gap: 8px;
}

.region-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: #f8fafc;
}

.region-row strong {
    color: var(--text);
}

@media (max-width: 860px) {
    .check-summary-grid,
    .region-grid {
        grid-template-columns: 1fr;
    }

    .issue-section-header {
        align-items: flex-start;
        flex-direction: column;
    }
}