*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #F4F4F5; color: #1A1A1A; line-height: 1.45;
    font-size: 14px;
    transition: background-color 0.3s ease;
}
/* ── HEADER ── */
.top-strip { height: 7px; background: var(--c); }
.page-header {
    background: #fff; padding: 18px 32px; display: flex;
    align-items: center; gap: 20px;
    border-bottom: 1px solid #E4E4E7;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    position: relative;
}
.back-home {
    text-decoration: none; color: #71717A; font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.2s, transform 0.2s;
    margin-right: 10px;
}
.back-home:hover { color: var(--c); transform: scale(1.1); }

.page-header img { height: 68px; width: 68px; object-fit: contain; flex-shrink:0; }
.h-wrapper { min-width: 0; }
.h_sigla_row { display: flex; align-items: center; gap: 10px; }
.h-sigla { font-size: 2rem; font-weight: 800; color: var(--c); letter-spacing: -.5px; line-height: 1.1; }
.h-prog  { font-size: .9rem; color: #71717A; margin-top: 2px; }
/* ── KPIs ── */
.kpi-row {
    display: flex; gap: 10px; flex-wrap: wrap;
    padding: 14px 32px; background: #FAFAFA;
    border-bottom: 1px solid #E4E4E7;
}
.kpi-card {
    flex: 1; min-width: 110px; max-width: 150px;
    padding: 10px 12px; border-radius: 10px; text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.kpi-card:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.kpi-icon { font-size: 1.3rem; display: block; margin-bottom: 3px; }
.kpi-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .5px; color: #71717A; }
.kpi-value { font-size: 1.2rem; font-weight: 700; margin-top: 2px; }
/* ── COTAS MSG ── */
.cotas-msg {
    background: #FFF8E1; border: 1px solid #FFECB3; border-left: 4px solid #FFC107;
    padding: 10px 16px; margin: 0 32px; /* Same h-margin as kpi-row padding */
    font-size: .8rem; color: #5D4037; border-radius: 6px;
    display: flex; align-items: start; gap: 8px; line-height: 1.4;
    margin-top: -1px; /* Glue to kpi-row */
    border-top-left-radius: 0; border-top-right-radius: 0;
}
.cotas-msg i { color: #FFA000; font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
/* ── META ── */
.meta-bar {
    padding: 10px 32px; background: #fff;
    border-bottom: 1px solid #E4E4E7;
    font-size: .82rem; color: #3F3F46;
    display: flex; gap: 20px; flex-wrap: wrap; align-items: center;
}
.meta-bar b { color: var(--c); }
.meta-bar a { color: var(--c); text-decoration: none; }
.meta-bar a:hover { text-decoration: underline; }
.meta-refs { font-size: .72rem; color: #A1A1AA; font-style: italic; }
/* ── CONTEÚDO ── */
.content { padding: 20px 32px; }
.legenda { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.leg-item { display: flex; align-items: center; gap: 5px; font-size: .74rem; color: #52525B; }
.leg-badge {
    font-size: .65rem; font-weight: 800; padding: 2px 7px;
    border-radius: 20px; color: #fff;
}
.leg-pres {
    width: 13px; height: 13px; background: #FEE2E2;
    border: 1.5px solid #FCA5A5; border-radius: 3px; flex-shrink: 0;
}
.warn-pres {
    display: inline-flex; align-items: center; gap: 6px;
    background: #FEF2F2; color: #B91C1C; border: 1px solid #FCA5A5;
    border-radius: 8px; padding: 7px 14px; font-size: .82rem; font-weight: 600;
    margin-bottom: 16px;
}
.sec-title {
    font-size: .78rem; font-weight: 700; color: #71717A;
    text-transform: uppercase; letter-spacing: .6px;
    margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.sec-title::after { content: ''; flex: 1; height: 1px; background: #E4E4E7; }
/* ── LINHA DE PESQUISA ── */
.linha-card {
    background: #fff; border-radius: 12px; margin-bottom: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07); overflow: hidden;
    transition: transform 0.2s ease;
}
.linha-card:hover { transform: translateY(-2px); }
.linha-pres {
    box-shadow: 0 0 0 1.5px #FCA5A5, 0 2px 8px rgba(185,28,28,.10);
}
.linha-header {
    padding: 10px 16px; display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap; background: #FAFAFA; border-bottom: 1px solid #F0F0F0;
}
.nivel-badge {
    font-size: .68rem; font-weight: 700; padding: 3px 10px;
    border-radius: 20px; color: #fff; white-space: nowrap;
}
.linha-nome { font-size: .9rem; font-weight: 600; flex: 1; color: #18181B; }
.pres-flag {
    font-size: .7rem; font-weight: 700; color: #B91C1C;
    background: #FEE2E2; padding: 2px 9px; border-radius: 20px;
    display: flex; align-items: center; gap: 4px;
}
.vagas-row { display: flex; gap: 5px; align-items: center; }
.chip {
    font-size: .68rem; font-weight: 600; padding: 2px 8px;
    border-radius: 12px; white-space: nowrap;
}
.chip.ac { background: #DBEAFE; color: #1D4ED8; }
.chip.co { background: #DCFCE7; color: #15803D; }
.chip.pt { background: #F3E8FF; color: #7E22CE; }
/* ── STAGES ── */
.stages-row {
    display: flex; align-items: stretch; gap: 4px;
    padding: 14px 16px; overflow-x: auto;
}
.stage-arrow {
    display: flex; align-items: center;
    color: #D4D4D8; font-size: 1.3rem; flex-shrink: 0; padding: 0 2px;
}
.stage-card {
    flex: 1; min-width: 155px; max-width: 215px; flex-shrink: 0;
    border: 1.5px solid #E4E4E7; border-radius: 10px;
    padding: 12px 12px 10px; background: #fff; position: relative;
    transition: box-shadow .12s, transform .12s;
    cursor: default;
}
.stage-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.09); transform: translateY(-1px); }
.stage-presencial { border-color: #FCA5A5; }
.stage-badge {
    position: absolute; top: 8px; right: 8px;
    font-size: .62rem; font-weight: 800; padding: 2px 7px;
    border-radius: 20px; color: #fff; letter-spacing: .3px;
}
.stage-icon { font-size: 1.7rem; color: var(--sc); line-height: 1; margin-bottom: 7px; }
.stage-name { font-size: .84rem; font-weight: 700; color: #18181B; margin-bottom: 6px; line-height: 1.3; padding-right: 28px; }
.stage-insts { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 5px; }
.inst-tag {
    font-size: .65rem; background: #F4F4F5; color: #52525B;
    padding: 2px 7px; border-radius: 9px; border: 1px solid #E4E4E7;
}
.stage-peso { font-size: .74rem; font-weight: 700; color: var(--sc); margin-bottom: 3px; }
.stage-obs  { font-size: .67rem; color: #A1A1AA; line-height: 1.4; margin-top: 4px; cursor: help; }
.linha-detalhe {
    font-size: .73rem; color: #A1A1AA; padding: 0 16px 10px;
    font-style: italic; border-top: 1px dashed #F0F0F0; padding-top: 8px;
}
.sem-dados { color: #A1A1AA; font-style: italic; padding: 12px 0; }
/* ── PROFICIÊNCIA ── */
.prof-box {
    background: #fff; border-radius: 10px; padding: 12px 16px;
    margin-top: 4px; border-left: 4px solid var(--c);
    font-size: .82rem; color: #3F3F46;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.prof-box b { color: var(--c); }
/* ── FOOTER ── */
.footer {
    text-align: center; padding: 20px 32px;
    font-size: .72rem; color: #D4D4D8;
    border-top: 1px solid #E4E4E7; margin-top: 12px;
}
/* ── NOTA CAPES ── */
.capes-badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: var(--c); font-weight: 800;
    font-size: 0.9rem; border-radius: 6px; padding: 4px 8px;
    border: 1px solid #E4E4E7; margin-left: auto;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    height: 38px;
}
.capes-badge span { font-size: 0.65rem; color: #A1A1AA; margin-right: 6px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
/* ── CITATION - FOOTER ── */
.app-footer {
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
  color: #71717A;
  border-top: 1px solid #E4E4E7;
  margin-top: 40px;
}
.app-version {
  display: inline-block;
  background: #F4F4F5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  margin-left: 8px;
}
.cite-btn {
  background: transparent;
  border: 1px solid #D4D4D8;
  color: #52525B;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  margin-top: 8px;
  transition: all 0.2s;
}
.cite-btn:hover {
  background: #E4E4E7;
  color: #18181B;
}

/* ── MODAL ── */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-overlay.active { display: flex; }
.modal-content {
  background: white;
  padding: 24px;
  border-radius: 8px;
  width: 90%; max-width: 500px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none; font-size: 1.5rem;
  cursor: pointer; color: #71717A;
}
.citation-box {
  background: #F4F4F5;
  padding: 12px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85rem;
  margin-top: 10px;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid #E4E4E7;
}
  border: 1px solid #E4E4E7;
}
