/* =========================================================
   OAB — CSS isolado
   Prefixo exclusivo: oabx-
   Não depende de regras genéricas de table/label/input do style.css.
   ========================================================= */

.oabx-hero { padding: 52px 0 42px; }
.oabx-hero h1 { max-width: 980px; font-size: clamp(2.15rem, 5vw, 3.8rem); }
.oabx-hero p:not(.eyebrow) { margin-bottom: 0; }

.oabx-shell { padding: 34px 0 72px; background: #f5f8f7; }
.oabx-container { width: min(1320px, calc(100% - 40px)); margin: 0 auto; }

.oabx-shell .oabx-alert { display: flex; gap: 10px; margin-bottom: 18px; padding: 14px 16px; border: 1px solid; border-radius: 10px; }
.oabx-shell .oabx-alert-error { color: #7c2f27; border-color: #dba49c; background: #fff0ed; }
.oabx-shell .oabx-alert-warning { color: #765817; border-color: #dfc273; background: #fff8df; }

/* Filtros */
.oabx-shell .oabx-filters {
  display: grid;
  grid-template-columns: minmax(250px, 1.65fr) minmax(105px, .55fr) minmax(180px, 1fr) minmax(135px, .68fr) minmax(220px, 1.08fr) auto;
  gap: 12px;
  align-items: end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(24, 41, 37, .05);
}
.oabx-shell .oabx-field { display: block; min-width: 0; margin: 0; padding: 0; border: 0; }
.oabx-shell .oabx-field > span,
.oabx-shell .oabx-field > legend { display: block; margin: 0 0 6px; padding: 0; color: var(--muted); font-size: .78rem; font-weight: 760; }
.oabx-shell .oabx-field input,
.oabx-shell .oabx-field select {
  width: 100%; min-width: 0; min-height: 42px; margin: 0; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit;
}
.oabx-shell .oabx-exam-select { position: relative; }
.oabx-shell .oabx-exam-select summary {
  display: flex; align-items: center; justify-content: space-between; gap: 9px; min-height: 42px; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); cursor: pointer; list-style: none;
}
.oabx-shell .oabx-exam-select summary::-webkit-details-marker { display: none; }
.oabx-shell .oabx-exam-select summary svg { flex: 0 0 17px; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .15s ease; }
.oabx-shell .oabx-exam-select[open] summary { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,118,110,.08); }
.oabx-shell .oabx-exam-select[open] summary svg { transform: rotate(180deg); }
.oabx-shell .oabx-exam-panel {
  position: absolute; z-index: 60; top: calc(100% + 7px); right: 0; width: min(340px, 86vw); padding: 8px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: var(--shadow);
}
.oabx-shell .oabx-exam-actions { display: flex; gap: 7px; padding: 3px 3px 8px; border-bottom: 1px solid var(--line); }
.oabx-shell .oabx-exam-actions button { appearance: none; border: 0; padding: 5px 7px; background: transparent; color: var(--primary-dark); font: inherit; font-size: .75rem; font-weight: 760; cursor: pointer; }
.oabx-shell .oabx-exam-options { max-height: 300px; overflow-y: auto; padding-top: 6px; }
.oabx-shell .oabx-exam-option { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 7px; color: var(--ink); font-size: .84rem; font-weight: 520; cursor: pointer; }
.oabx-shell .oabx-exam-option:hover { background: var(--surface); }
.oabx-shell .oabx-exam-option.is-period-hidden { display: none; }
.oabx-shell .oabx-exam-option input { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: var(--primary); }
.oabx-shell .oabx-filter-actions { display: flex; gap: 8px; align-items: stretch; }
.oabx-shell .oabx-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 16px; border: 1px solid transparent; border-radius: 8px; font: inherit; font-weight: 760; line-height: 1.2; white-space: nowrap; cursor: pointer; text-decoration: none; }
.oabx-shell .oabx-btn-primary { color: #fff; background: var(--primary); border-color: var(--primary); }
.oabx-shell .oabx-btn-primary:hover { background: var(--primary-dark); }
.oabx-shell .oabx-btn-light { color: var(--ink); background: #fff; border-color: var(--line); }
.oabx-shell .oabx-btn-light:hover { background: var(--surface); }

.oabx-shell .oabx-summary { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0 16px; }
.oabx-shell .oabx-summary span { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: .76rem; }
.oabx-shell .oabx-summary .is-strong { color: var(--ink); font-weight: 800; }

/* Layout principal: 40% ranking + 60% análise */
.oabx-shell .oabx-main-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 14px; align-items: start; }
.oabx-shell .oabx-analysis { display: grid; gap: 14px; min-width: 0; }
.oabx-shell .oabx-card,
.oabx-shell .oabx-kpi { border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 10px 28px rgba(24,41,37,.05); }
.oabx-shell .oabx-card { min-width: 0; padding: 18px; }

/* Ranking */
.oabx-shell .oabx-ranking { padding: 18px; border-top: 3px solid var(--primary-dark); }
.oabx-shell .oabx-ranking-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.oabx-shell .oabx-kicker { margin: 0 0 4px; color: var(--accent); font-size: .72rem; font-weight: 820; text-transform: uppercase; }
.oabx-shell .oabx-ranking-head h2 { margin: 0; font-size: 1.06rem; line-height: 1.22; }
.oabx-shell .oabx-rank-count { flex: 0 0 auto; padding: 6px 9px; border-radius: 999px; background: #e7f4f1; color: var(--primary-dark); font-size: .68rem; font-weight: 820; white-space: nowrap; }
.oabx-shell .oabx-ranking-copy,
.oabx-shell .oabx-ranking-help { margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.oabx-shell .oabx-ranking-copy { margin-bottom: 5px; }
.oabx-shell .oabx-ranking-copy strong { color: var(--ink); }
.oabx-shell .oabx-ranking-help { margin-bottom: 12px; color: var(--primary-dark); font-weight: 680; }

.oabx-shell .oabx-rank-table-box { overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.oabx-shell table.oabx-rank-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; border-spacing: 0; background: #fff; }
.oabx-shell .oabx-rank-table .oabx-col-pos { width: 52px; }
.oabx-shell .oabx-rank-table .oabx-col-rate { width: 112px; }
.oabx-shell .oabx-rank-table th,
.oabx-shell .oabx-rank-table td { padding: 9px 9px; border: 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: normal; }
.oabx-shell .oabx-rank-table thead th { background: #edf5f3; color: #25413c; font-size: .66rem; font-weight: 820; text-transform: uppercase; letter-spacing: .015em; }
.oabx-shell .oabx-rank-table thead th:last-child { text-align: right; }
.oabx-shell .oabx-rank-table tbody tr:last-child td { border-bottom: 0; }
.oabx-shell .oabx-rank-row { cursor: pointer; transition: background .14s ease; }
.oabx-shell .oabx-rank-row:hover,
.oabx-shell .oabx-rank-row:focus-visible { background: #f7fbfa; outline: none; }
.oabx-shell .oabx-position { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e7f4f1; color: var(--primary-dark); font-size: .72rem; font-weight: 850; }
.oabx-shell .oabx-school { min-width: 0; }
.oabx-shell .oabx-school > strong { display: block; color: var(--ink); font-size: .78rem; line-height: 1.24; overflow-wrap: anywhere; }
.oabx-shell .oabx-school > small { display: block; margin-top: 2px; color: var(--muted); font-size: .66rem; line-height: 1.2; }
.oabx-shell .oabx-locality-toggle {
  appearance: none; display: inline-flex; align-items: center; gap: 4px; max-width: 100%; margin: 5px 0 0; padding: 3px 7px;
  border: 1px solid #cfe1dc; border-radius: 999px; background: #f3f8f6; color: var(--primary-dark); font: inherit; font-size: .64rem; font-weight: 760; line-height: 1.2; cursor: pointer;
}
.oabx-shell .oabx-locality-toggle:hover { border-color: #9fbfb7; background: #eaf4f1; }
.oabx-shell .oabx-locality-toggle svg { flex: 0 0 12px; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform .15s ease; }
.oabx-shell .oabx-locality-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.oabx-shell .oabx-rate { text-align: right; }
.oabx-shell .oabx-rate > strong { display: block; color: var(--primary-dark); font-size: .76rem; line-height: 1.1; }
.oabx-shell .oabx-rate-track { position: relative; display: block; width: 100%; height: 6px; margin-top: 5px; overflow: hidden; border-radius: 999px; background: #e8efec; }
.oabx-shell .oabx-rate-track i { position: absolute; inset: 0 auto 0 0; display: block; border-radius: inherit; background: var(--primary-dark); }
.oabx-shell .oabx-locality-row { background: #f8fbfa; cursor: pointer; }
.oabx-shell .oabx-locality-row:hover,
.oabx-shell .oabx-locality-row:focus-visible { background: #eef6f3; outline: none; }
.oabx-shell .oabx-locality-row td { padding-top: 7px; padding-bottom: 7px; }
.oabx-shell .oabx-school.is-detail > strong { color: #35524c; font-size: .72rem; }
.oabx-shell .oabx-rate.is-detail > strong { font-size: .7rem; }
.oabx-shell .oabx-detail-mark { color: #7d918b; font-size: .9rem; }

.oabx-shell .oabx-pagination { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; color: var(--muted); font-size: .68rem; }
.oabx-shell .oabx-pagination > div { display: flex; align-items: center; gap: 6px; }
.oabx-shell .oabx-pagination button { appearance: none; min-height: 30px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--primary-dark); font: inherit; font-weight: 760; cursor: pointer; }
.oabx-shell .oabx-pagination button:hover:not(:disabled) { border-color: #9bbab2; background: #f4f9f7; }
.oabx-shell .oabx-pagination button:disabled { opacity: .42; cursor: default; }
.oabx-shell .oabx-empty { padding: 18px; border: 1px dashed #bed0cb; border-radius: 8px; background: var(--surface); color: var(--muted); font-size: .78rem; }

/* KPIs */
.oabx-shell .oabx-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.oabx-shell .oabx-kpi { grid-column: span 2; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 14px; }
.oabx-shell .oabx-kpi:nth-child(4),
.oabx-shell .oabx-kpi:nth-child(5) { grid-column: span 3; }
.oabx-shell .oabx-kpi-icon { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; background: #e7f4f1; color: var(--primary-dark); font-size: .8rem; font-weight: 850; }
.oabx-shell .oabx-kpi > div:last-child { display: grid; min-width: 0; gap: 2px; }
.oabx-shell .oabx-kpi span:first-child { color: var(--muted); font-size: .7rem; font-weight: 700; line-height: 1.2; }
.oabx-shell .oabx-kpi strong { color: #103e38; font-size: clamp(1.18rem, 1.8vw, 1.52rem); line-height: 1.08; }
.oabx-shell .oabx-kpi small { min-height: 18px; color: var(--muted); font-size: .62rem; line-height: 1.25; }
.oabx-shell .oabx-delta { margin-left: 3px; color: var(--muted); font-size: inherit; font-weight: 780; }
.oabx-shell .oabx-delta.is-positive { color: #1d7a45; }
.oabx-shell .oabx-delta.is-negative { color: #a04337; }

/* Painéis e gráficos */
.oabx-shell .oabx-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 13px; }
.oabx-shell .oabx-panel-head h2 { margin: 0; font-size: 1rem; line-height: 1.2; }
.oabx-shell .oabx-panel-head p { margin: 4px 0 0; color: var(--muted); font-size: .71rem; }
.oabx-shell .oabx-legend { display: flex; flex-wrap: wrap; gap: 9px; color: var(--muted); font-size: .68rem; }
.oabx-shell .oabx-legend span { display: inline-flex; align-items: center; gap: 5px; }
.oabx-shell .oabx-legend i,
.oabx-shell .oabx-donut-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.oabx-shell .is-general { background: var(--primary-dark); }
.oabx-shell .is-first { background: #9ebf68; }
.oabx-shell .oabx-evolution { min-height: 278px; overflow-x: auto; }
.oabx-shell .oabx-evolution svg { display: block; width: 100%; min-width: 620px; height: 278px; max-width: none; }
.oabx-shell .oabx-bars { display: grid; gap: 10px; padding-top: 3px; }
.oabx-shell .oabx-bar-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) 54px; align-items: center; gap: 8px; font-size: .7rem; }
.oabx-shell .oabx-bar-row > span { color: var(--muted); }
.oabx-shell .oabx-bar-row > strong { text-align: right; font-size: .7rem; }
.oabx-shell .oabx-bar-track { position: relative; display: block; height: 8px; overflow: hidden; border-radius: 999px; background: #e8efec; }
.oabx-shell .oabx-bar-track i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--primary-dark); }

/* Blocos inferiores */
.oabx-shell .oabx-bottom-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(330px, .8fr); gap: 14px; margin-top: 14px; }
.oabx-shell .oabx-columns { display: grid; grid-template-columns: repeat(4, minmax(82px, 1fr)); align-items: end; gap: 14px; min-height: 250px; padding: 10px 3px 0; }
.oabx-shell .oabx-column-item { display: grid; grid-template-rows: 20px 178px auto; gap: 6px; height: 100%; text-align: center; }
.oabx-shell .oabx-column-item > strong { font-size: .74rem; }
.oabx-shell .oabx-column-item > span { color: var(--muted); font-size: .68rem; line-height: 1.2; }
.oabx-shell .oabx-column-track { position: relative; align-self: stretch; border-bottom: 1px solid #cfdad6; }
.oabx-shell .oabx-column-track::before,
.oabx-shell .oabx-column-track::after { content: ""; position: absolute; left: 0; right: 0; border-top: 1px dashed #e3ebe8; }
.oabx-shell .oabx-column-track::before { top: 33%; }
.oabx-shell .oabx-column-track::after { top: 66%; }
.oabx-shell .oabx-column-track i { position: absolute; right: 18%; bottom: 0; left: 18%; min-height: 2px; border-radius: 6px 6px 0 0; background: var(--primary-dark); }
.oabx-shell .oabx-column-item:nth-child(even) .oabx-column-track i { background: #9ebf68; }
.oabx-shell .oabx-donut-layout { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(210px, 1.2fr); gap: 20px; align-items: center; min-height: 240px; }
.oabx-shell .oabx-donut { position: relative; width: min(180px, 100%); aspect-ratio: 1; margin: 0 auto; border-radius: 50%; background: conic-gradient(var(--primary-dark) 0 calc(var(--oabx-donut-pct) * 1%), #9ebf68 calc(var(--oabx-donut-pct) * 1%) 100%); }
.oabx-shell .oabx-donut::after { content: ""; position: absolute; inset: 28%; border-radius: 50%; background: #fff; }
.oabx-shell .oabx-donut > div { position: absolute; z-index: 1; inset: 32%; display: grid; place-content: center; text-align: center; }
.oabx-shell .oabx-donut strong { font-size: 1.16rem; line-height: 1; }
.oabx-shell .oabx-donut span { margin-top: 5px; color: var(--muted); font-size: .61rem; line-height: 1.15; }
.oabx-shell .oabx-donut-legend { display: grid; gap: 13px; }
.oabx-shell .oabx-donut-legend > div { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 6px; font-size: .72rem; }
.oabx-shell .oabx-donut-legend span { color: var(--muted); }
.oabx-shell .oabx-donut-legend strong { font-size: .72rem; }

.oabx-shell .oabx-method-note { margin-top: 14px; padding: 13px 16px; border: 1px solid #c8ddd7; border-radius: 10px; background: #eef7f4; color: #3e5751; font-size: .75rem; }
.oabx-shell .oabx-method-note strong { color: var(--primary-dark); }
.oabx-shell .oabx-source { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); font-size: .76rem; }
.oabx-shell .oabx-source > div { display: grid; gap: 2px; }
.oabx-shell .oabx-source strong { color: var(--ink); }
.oabx-shell .oabx-source a { flex: 0 0 auto; color: var(--primary-dark); font-weight: 800; text-decoration: none; }
.oabx-shell .oabx-source a:hover { text-decoration: underline; }

@media (max-width: 1180px) {
  .oabx-shell .oabx-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .oabx-shell .oabx-filter-actions { grid-column: 1 / -1; }
  .oabx-shell .oabx-main-grid { grid-template-columns: minmax(390px, 2fr) minmax(0, 3fr); }
  .oabx-shell .oabx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oabx-shell .oabx-kpi,
  .oabx-shell .oabx-kpi:nth-child(4),
  .oabx-shell .oabx-kpi:nth-child(5) { grid-column: auto; }
}

@media (max-width: 940px) {
  .oabx-shell .oabx-main-grid,
  .oabx-shell .oabx-bottom-grid { grid-template-columns: 1fr; }
  .oabx-shell .oabx-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .oabx-container { width: min(100% - 28px, 1320px); }
  .oabx-shell .oabx-filters { grid-template-columns: 1fr; }
  .oabx-shell .oabx-filter-actions { grid-column: auto; flex-direction: column; }
  .oabx-shell .oabx-btn { width: 100%; }
  .oabx-shell .oabx-kpis { grid-template-columns: 1fr; }
  .oabx-shell .oabx-panel-head,
  .oabx-shell .oabx-ranking-head,
  .oabx-shell .oabx-source { align-items: flex-start; flex-direction: column; }
  .oabx-shell .oabx-rank-table .oabx-col-pos { width: 44px; }
  .oabx-shell .oabx-rank-table .oabx-col-rate { width: 94px; }
  .oabx-shell .oabx-rank-table th,
  .oabx-shell .oabx-rank-table td { padding: 8px 7px; }
  .oabx-shell .oabx-pagination { align-items: flex-start; flex-direction: column; }
  .oabx-shell .oabx-pagination > div { width: 100%; justify-content: space-between; }
  .oabx-shell .oabx-columns { grid-template-columns: repeat(2, minmax(80px, 1fr)); row-gap: 24px; }
  .oabx-shell .oabx-donut-layout { grid-template-columns: 1fr; }
  .oabx-shell .oabx-alert { flex-direction: column; }
}

@media print {
  .site-header, .site-footer, .oabx-shell .oabx-filters, .oabx-shell .oabx-summary { display: none !important; }
  .oabx-shell { padding: 0; background: #fff; }
  .oabx-shell .oabx-card, .oabx-shell .oabx-kpi { box-shadow: none; break-inside: avoid; }
}
