:root {
  --bg: #0f1115;
  --card: #181b22;
  --card2: #1f232c;
  --line: #2a2f3a;
  --text: #e8eaf0;
  --muted: #9aa3b2;
  --brand: #6c5ce7;
  --brand2: #00d2a8;
  --fit: #22c55e;
  --partial: #f59e0b;
  --nofit: #ef4444;
  --shadow: 0 10px 40px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #1c1f3a 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.logo { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.logo b { color: var(--brand2); font-weight: 800; }
.brand .sub { color: var(--muted); font-weight: 600; font-size: 14px; }
.tag { color: var(--muted); font-size: 13px; border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; }

.wrap { max-width: 920px; margin: 0 auto; padding: 32px 20px 80px; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 28px; box-shadow: var(--shadow);
}
.form-card h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.5px; }
.muted { color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field select {
  background: var(--card2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 13px 14px; font-size: 15px; font-family: inherit;
  outline: none; transition: border .15s;
}
.field input:focus, .field select:focus { border-color: var(--brand); }
.row { display: flex; gap: 14px; }
.grow { flex: 1; }

.comp-edit { margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px; }
.comp-edit summary { cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px 0; }
.comp-fields { display: grid; gap: 8px; padding: 8px 0 12px; }
.comp-fields input {
  background: var(--card2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 9px 12px; font-size: 13px; font-family: inherit;
}

.btn-primary {
  margin-top: 22px; width: 100%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--brand), #8b7bf0);
  color: #fff; font-weight: 700; font-size: 16px; padding: 14px; border-radius: 11px;
  transition: transform .08s, opacity .15s; font-family: inherit;
}
.btn-primary.small { width: auto; margin: 0; padding: 10px 18px; font-size: 14px; }
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 10px 16px; border-radius: 10px; cursor: pointer; font-family: inherit; font-size: 14px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

.status { margin-top: 14px; font-size: 14px; color: var(--muted); min-height: 20px; text-align: center; }
.status.err { color: var(--nofit); }
.status.load::after { content: ''; animation: dots 1.4s steps(4,end) infinite; }
@keyframes dots { 0%{content:''}25%{content:'.'}50%{content:'..'}75%{content:'...'} }

.hidden { display: none !important; }

.result-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.report { padding: 30px; }
.report-head { display: flex; gap: 18px; align-items: center; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--card2); border: 2px solid var(--line); }
.report-head-info { flex: 1; }
.report-head-info h2 { margin: 0; font-size: 22px; }
.report-head-info .meta { margin: 6px 0 0; font-size: 13px; color: var(--muted); }

.verdict { padding: 10px 16px; border-radius: 12px; font-weight: 800; font-size: 15px; text-align: center; white-space: nowrap; }
.verdict.FIT { background: rgba(34,197,94,.15); color: var(--fit); border: 1px solid rgba(34,197,94,.4); }
.verdict.FIT_PARCIAL { background: rgba(245,158,11,.15); color: var(--partial); border: 1px solid rgba(245,158,11,.4); }
.verdict.NO_FIT { background: rgba(239,68,68,.15); color: var(--nofit); border: 1px solid rgba(239,68,68,.4); }

.summary { margin: 20px 0; padding: 14px 16px; background: var(--card2); border-left: 3px solid var(--brand); border-radius: 8px; font-size: 15px; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.panel { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.panel h3 { margin: 0 0 14px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }

.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row .bar-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.bar-row .bar-name { color: var(--text); font-weight: 500; }
.bar-row .bar-val { font-weight: 700; }
.bar-track { height: 8px; background: #11141a; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; transition: width .6s; }
.bar-ev { font-size: 12px; color: var(--muted); margin-top: 5px; line-height: 1.4; }

.totalbox { text-align: center; margin-top: 14px; }
.totalnum { font-size: 40px; font-weight: 800; color: var(--brand2); }
.totallbl { display: block; font-size: 12px; color: var(--muted); }

.loc { font-size: 14px; line-height: 1.5; margin: 0; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.pill.yes { background: rgba(34,197,94,.15); color: var(--fit); }
.pill.no { background: rgba(239,68,68,.15); color: var(--nofit); }

#rKnockouts .ko { background: rgba(239,68,68,.12); color: #fca5a5; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 6px; }
#rKnockouts .none { color: var(--fit); font-size: 14px; }

.notes { margin: 0; padding-left: 18px; }
.notes li { margin-bottom: 8px; font-size: 14px; line-height: 1.5; }

.profile-data { font-size: 13px; color: var(--muted); line-height: 1.6; }
.profile-data b { color: var(--text); }
.profile-data .exp { margin-bottom: 6px; }

.footer-note { margin-top: 22px; text-align: center; font-size: 12px; color: var(--muted); }

@media (max-width: 680px) {
  .grid { grid-template-columns: 1fr; }
  .report-head { flex-wrap: wrap; }
}

/* PDF: forzar fondo claro para impresion */
.pdf-mode { background: #fff !important; color: #1a1a1a !important; }
.pdf-mode .panel, .pdf-mode .summary { background: #f5f6f8 !important; color: #1a1a1a !important; border-color: #ddd !important; }
.pdf-mode .muted, .pdf-mode .bar-ev, .pdf-mode .panel h3 { color: #555 !important; }
.pdf-mode .bar-track { background: #e5e7eb !important; }
.pdf-mode .report-head-info h2, .pdf-mode .bar-name, .pdf-mode .notes li, .pdf-mode .loc { color: #1a1a1a !important; }
