:root {
    --bg-main: #d7e4f3;
    --bg-card: #ffffff;
    --primary: #0f172a;
    --primary-soft: #1e293b;
    --accent: #e2bc10;
    --border-soft: #e5e7eb;
    --text-main: #1f2933;
    --text-muted: #64748b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Inter, Arial, Helvetica, sans-serif;
}

body {
    background-color: #d7e4f3;
    color: #1f2933;
}

[hidden] {
    display: none !important;
}

/* HEADER */
.app-header {
    height: 72px;
    background-color: #0f172a;
    color: #f7ecec;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-left .icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.header-left .title {
    display: flex;
    flex-direction: column;
}

.app-title {
    margin: 0;
    font-size: 18px;
}

.app-subtitle {
    font-size: 12px;
    color: #cbd5e1;
}


/* ÁREA DE CARACTERÍSTICAS */
.header-right {
    display: flex;
    gap: 24px;
}

.header-item {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.header-item .label {
    font-size: 11px;
    color: #94a3b8;
}

.header-item .value {
    font-size: 14px;
    font-weight: 500;
}

/* STATUS */
.status-online {
    color: #22c55e;
}

/* CONTEÚDO */
.content {
    padding: 24px;
}

.config-container {
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: 12px;
    max-width: 980px;
    margin: 40px auto;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.config-container h2 {
    font-size: 22px;
    margin-bottom: 32px;
    color: var(--primary);
}

.config-group h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-soft);
    text-transform: uppercase;
    letter-spacing: 0rem;
}

.config-group {
    margin-bottom: 36px;
    padding: 24px;
    border-radius: 10px;
    background-color: #f8fafc;
    border: 1px solid var(--border-soft);
}

.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.form-row.inline {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.form-row label {
    font-size: 13px;
    margin-bottom: 4px;
    color: #334155;
}

.form-row .hint {
    font-size: 12px;
    color: #64748b;
    margin: 6px 0 0;
    line-height: 1.5;
}

.form-row input,
.form-row textarea,
.form-row select {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    font-size: 14px;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.form-row input[type="text"]:focus,
.form-row input[type="number"]:focus,
.form-row input[type="range"]:focus,
.form-row textarea:focus,
.form-row select:focus {
    border-color: #e2bc10;
    outline: none;
    box-shadow: 0 0 0 0.1rem rgba(226, 176, 9, 0.25);
}

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

.config-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-primary {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.3);
}


.btn-primary:hover {
    background-color: #1a2b52;
    scale: 1.05;
}

.config-group {
    border-left: 3px solid #1a2b52;
    padding-left: 16px;
}

.app-footer {
    height: 42px;
    background-color: #0f172a;
    color: #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    font-size: 12px;
    border-top: 1px solid #1e293b;
}

.footer-left,
.footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.separator {
    opacity: 0.5;
}

input[type="checkbox"] {
    accent-color: #e2bc10;
    width: 18px;
    height: 18px;
    margin-bottom: 5px;
}

.form-row.inline {
    align-items: center;
    position: center;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 6px solid #ccc;
    border-top: 6px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    margin-top: 16px;
    font-size: 16px;
    color: #333;
}

#resultado {
    max-width: 1250px;
    margin: 40px auto;
    padding: 0 16px;
}

#resultado h3 {
    margin-bottom: 16px;
    font-size: 18px;
    color: #0f172a;
}

.leaderboard {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.leaderboard th {
    background-color: var(--primary);
    color: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 14px;
}

.leaderboard td {
    padding: 14px;
    font-size: 14px;
    color: var(--text-main);
    vertical-align: top;
    border-bottom: 1px solid var(--border-soft);
}

.leaderboard tr:hover td {
    background-color: #f1f5f9;
}

.leaderboard tr:nth-child(even) td {
    background-color: #f8fafc;
}

.leaderboard tr:hover td {
    background-color: #eef2ff;
}

.leaderboard td:first-child {
    font-weight: 600;
    font-size: 14px;
    text-align: left;
    min-width: 200px;
}

.leaderboard td:nth-child(2) {
    font-weight: 700;
    text-align: center;
    width: 120px;
}

.leaderboard td:nth-child(2):contains("SIM") {
    color: #15803d;
}

.leaderboard td:nth-child(2):contains("NÃO") {
    color: #b91c1c;
}

.leaderboard td:nth-child(3),
.leaderboard td:nth-child(4) {
    max-width: 260px;
    line-height: 1.5;
}

.leaderboard td:last-child {
    font-style: italic;
    color: #475569;
}

#resultado button {
    margin-top: 16px;
    margin-right: 8px;
    background-color: #0f172a;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: 0.2s ease;
}

#resultado button:hover {
    background-color: #1a2b52;
    transform: translateY(-1px);
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-ok {
    background-color: #dcfce7;
    color: #166534;
}

.badge-no {
    background-color: #fee2e2;
    color: #991b1b;
}

.candidate-link {
    color: #1e40af;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 1rem;
}

.candidate-link:hover {
    color: #173faf;
    text-decoration: underline;
}

.candidate-link:hover::after {
    opacity: 1;
}

.leaderboard td:first-child {
    font-weight: 700;
    font-size: 16px;
    text-align: center;
    width: 90px;

}

.leaderboard td:first-child {
    font-size: 15px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.leaderboard td:first-child {
    white-space: normal;
}

/* Pontos Positivos */
.leaderboard td:nth-child(4) {
    max-width: 325px;
    /* ajuste aqui */
    width: 360px;
    line-height: 1.6;
}

/* Pontos Negativos (mantém menor) */
.leaderboard td:nth-child(5) {
    max-width: 260px;
    width: 260px;
}

.leaderboard td:nth-child(1) {
    max-width: 180px;
    width: 200px;
    word-break: break-word;
}

.leaderboard td:nth-child(6) {
    max-width: 325px;
    width: 400px;
}

.leaderboard-controls {
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.leaderboard-controls label {
    font-weight: 500;
}

/* FOOTER DA LEADERBOARD */
.leaderboard-footer {
    margin-top: 16px;
    padding: 12px 16px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* CONTROLES DE EXIBIÇÃO */
.leaderboard-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.controls-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.leaderboard-controls {
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-info {
    margin-top: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.425);
    border-radius: 12px;
    background: rgba(172, 194, 255, 0.349);
}

.model-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 8px;
}

.model-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.chip {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 208, 0, 0.5);
    background: rgba(255, 208, 0, 0.13);
}

.model-desc {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.35;
}


/* ── SIDEBAR ─────────────────────────────────────────────── */

.sidebar-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
}
.sidebar-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: #cbd5e1;
    border-radius: 2px;
    transition: background 0.2s;
}
.sidebar-toggle:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.25);
}
.sidebar-toggle:hover span { background: #f1f5f9; }

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.sidebar-overlay.overlay--visible {
    opacity: 1;
    pointer-events: all;
}

.sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    width: 272px;
    background: #0f172a;
    border-right: 1px solid #1e293b;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,0.35);
}
.sidebar.sidebar--open { transform: translateX(0); }

.sidebar-header {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #1e293b;
    flex-shrink: 0;
}
.sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: 0.01em;
}
.sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    background: transparent;
    border: 1px solid #334155;
    border-radius: 7px;
    color: #94a3b8;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.sidebar-close:hover {
    background: #1e293b;
    color: #f1f5f9;
    border-color: #475569;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}
.sidebar-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #475569;
    padding: 0 8px;
    margin: 0 0 8px;
}
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 2px;
}
.sidebar-item:hover { background: #1e293b; color: #f1f5f9; }
.sidebar-item--active { background: #1e293b; color: #f1f5f9; }
.sidebar-item--active svg { color: #e2bc10; }
.sidebar-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 600;
    background: rgba(226,188,16,0.15);
    color: #e2bc10;
    border: 1px solid rgba(226,188,16,0.3);
    border-radius: 999px;
    padding: 2px 8px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #1e293b;
    font-size: 11px;
    color: #475569;
}

/* ---------- Evidências por requisito (detalhe do candidato) ---------- */
.tabela-evidencias { width: 100%; margin-top: 6px; border-collapse: collapse; font-size: 12px; }
.tabela-evidencias th, .tabela-evidencias td {
    padding: 4px 6px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: top;
}
.tabela-evidencias small { color: #6b7280; }
.dados-removidos { margin-top: 6px; color: #6b7280; font-size: 11px; }
.peso-efetivo { margin-top: 10px; font-weight: 600; }

/* ---------- Avisos por candidato e eliminados por regra ---------- */
.avisos { font-size: 11px; color: #92400e; margin-top: 4px; line-height: 1.4; }
.eliminados { max-width: 900px; margin: 18px auto 0; font-size: 13px; }
.eliminados summary { cursor: pointer; color: #b45309; user-select: none; }
.tabela-eliminados { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 12px; }
.tabela-eliminados th, .tabela-eliminados td {
    padding: 6px 8px; border-bottom: 1px solid #e5e7eb; text-align: left; vertical-align: top;
}

/* ---------- Botão e modal de evidências ---------- */
#resultado .btn-evidencias {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
    background: #ffffff;
    color: var(--primary);
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
#resultado .btn-evidencias:hover { background: #f1f5f9; border-color: #94a3b8; transform: none; }

/* o reset global zera margin, então a centralização é explícita */
.modal {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(920px, 92vw);
    max-height: min(86vh, 900px);
    border: 0;
    border-radius: 14px;
    padding: 0;
    background: #ffffff;
    color: var(--text-main);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.45);
    overflow: hidden;
}
.modal[open] { display: flex; flex-direction: column; }
.modal::backdrop { background: rgba(15, 23, 42, 0.6); }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px 18px;
    background: var(--primary);
    color: #f8fafc;
    flex-shrink: 0;
}
.modal-heading { display: grid; gap: 6px; min-width: 0; }
.modal-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #94a3b8;
}
.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #f8fafc;
    overflow-wrap: anywhere;
}
.modal-sub { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #cbd5e1; }
.modal-nota b { color: var(--accent); font-size: 15px; }
.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid #334155;
    border-radius: 8px;
    color: #cbd5e1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.modal-close:hover { background: #1e293b; color: #ffffff; border-color: #475569; }
.modal-close:focus { outline: none; }
.modal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.modal-body {
    padding: 20px 24px 22px;
    overflow: auto;
    display: grid;
    gap: 16px;
    align-content: start;
}
.modal-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.modal-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 999px;
    background: #eef2f7;
    border: 1px solid #dfe5ee;
    color: #334155;
}
.modal-chip b { font-size: 13px; color: var(--primary); }
.modal-chip small { color: var(--text-muted); }
.modal-just {
    font-size: 14px;
    line-height: 1.6;
    color: #334155;
    padding: 12px 16px;
    background: #f8fafc;
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
}
.modal-avisos {
    margin: 0;
    padding: 10px 16px 10px 32px;
    font-size: 13px;
    line-height: 1.5;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}
.modal-tablewrap { overflow-x: auto; border: 1px solid var(--border-soft); border-radius: 10px; }
.modal-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.modal-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: #f8fafc;
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
}
.modal-table td {
    padding: 11px 14px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: top;
    line-height: 1.5;
}
.modal-table tbody tr:last-child td { border-bottom: 0; }
.modal-table tbody tr:hover td { background: #fafbfd; }
.col-req { font-weight: 600; color: var(--text-main); min-width: 140px; }
.col-cat { white-space: nowrap; }
.cat-pill {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--text-muted);
}
.col-vd { white-space: nowrap; }
.vd { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.vd::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.vd-atende { color: #15803d; }
.vd-parcial { color: #b45309; }
.vd-nao_atende { color: #b91c1c; }
.col-ev { color: #334155; }
.ev-trecho { font-style: italic; }
.ev-vazio { color: var(--text-muted); }
.ev-flag {
    margin-left: 6px;
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
}
.ev-obs { margin-top: 3px; font-size: 12px; color: var(--text-muted); }
.modal-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: var(--text-muted); }

@media (max-width: 640px) {
    .modal { width: 100vw; max-height: 100vh; border-radius: 0; }
    .modal-header, .modal-body { padding-left: 16px; padding-right: 16px; }
}
