:root {
    --bg-1: #f3f6ff;
    --bg-2: #eef7f3;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --text: #1f2937;
    --text-soft: #4b5563;
    --border: #d9e2ec;
    --primary: #0f766e;
    --primary-dark: #0b5a54;
    --accent: #f59e0b;
    --danger: #b42318;
    --shadow: 0 18px 45px rgba(31, 41, 55, 0.08);
}

html,
body {
    min-height: 100%;
}

body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--text);
    padding-top: 0;
    padding-bottom: 48px;
    background: radial-gradient(circle at 0 0, #dbeafe 0%, transparent 45%),
                radial-gradient(circle at 100% 0, #dcfce7 0%, transparent 40%),
                linear-gradient(180deg, var(--bg-1), var(--bg-2));
}

.container {
    max-width: 1080px;
}

.navbar {
    background: linear-gradient(90deg, #0f172a, #1f2937) !important;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.35);
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}

.navbar .navbar-brand {
    font-weight: 800;
    letter-spacing: 0.2px;
}

.navbar .nav-link {
    color: #e5e7eb !important;
    font-weight: 600;
    transition: color 0.2s ease;
}

.navbar .nav-link:hover,
.navbar .nav-item.active .nav-link {
    color: #ffffff !important;
}

.jumbotron {
    margin: 0 auto;
    max-width: 1080px;
    background: linear-gradient(140deg, #ffffff, #f7fbff);
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

h1,
.h1,
h2,
.h2,
h3,
.h3,
h4,
.h4 {
    font-weight: 800;
    letter-spacing: -0.01em;
}

p,
.lead,
label,
.table,
.form-control,
.btn {
    font-size: 0.97rem;
}

.lead {
    color: var(--text-soft);
}

hr {
    border-top: 1px solid var(--border);
}

.card {
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #f7fafc, #ffffff);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
}

.card-body {
    background: var(--surface);
}

.form-group {
    margin-bottom: 1rem;
}

.form-control,
.custom-select,
select.form-control {
    min-height: 44px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
select.form-control:focus {
    border-color: rgba(15, 118, 110, 0.6);
    box-shadow: 0 0 0 0.22rem rgba(15, 118, 110, 0.18);
}

.btn {
    border-radius: 10px;
    font-weight: 700;
    padding: 0.52rem 0.95rem;
}

.btn-primary,
.btn-dark,
.btn-info {
    border: 0;
    background: linear-gradient(120deg, var(--primary), #0e9f93);
}

.btn-primary:hover,
.btn-dark:hover,
.btn-info:hover {
    background: linear-gradient(120deg, var(--primary-dark), var(--primary));
}

.btn-danger {
    border: 0;
    background: linear-gradient(120deg, var(--danger), #d92d20);
}

.btn-outline-primary,
.btn-outline-success,
.btn-outline-secondary {
    border-radius: 999px;
}

.table {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.table thead.thead-dark th {
    background: #1f2937;
    border-color: #1f2937;
}

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

.pagination .page-link {
    color: var(--primary);
    border: 1px solid var(--border);
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

.alert {
    border-radius: 12px;
}

.help-block {
    display: block;
    margin-top: 0.35rem;
    color: var(--danger);
    font-size: 0.88rem;
}

.has-error .form-control {
    border-color: #fda29b;
}

.table-pagination {
    margin-top: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.judge-container {
    max-width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
}

.posts-table th:nth-child(1),
.posts-table td:nth-child(1) {
    width: 8%;
}

.posts-table th:nth-child(2),
.posts-table td:nth-child(2) {
    width: 14%;
    white-space: nowrap;
}

.posts-table th:nth-child(3),
.posts-table td:nth-child(3) {
    width: 60%;
    white-space: pre-wrap;
    word-break: break-word;
}

.posts-table th:nth-child(4),
.posts-table td:nth-child(4) {
    width: 18%;
    word-break: break-all;
}

.pool-progress .progress {
    background-color: #e6edf5;
    border-radius: 999px;
}

.pooling-counters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.pooling-counters .badge {
    font-size: 0.82rem;
    padding: 0.4rem 0.6rem;
}

.page-title {
    margin-bottom: 0.4rem;
}

@media (max-width: 767px) {
    .jumbotron {
        border-radius: 14px;
        padding: 1.6rem 1rem;
    }

    .table-pagination {
        padding: 1rem;
    }

    .judge-container {
        padding-left: 0.8rem;
        padding-right: 0.8rem;
    }
}
