/* RetractedIF — minimalist design tokens (Instituto Federal identity). No inline styles: the CSP forbids them. */
:root {
  --green: #379936;
  --green-d: #1F7A32;
  --green-soft: #eef7f0;
  --red: #C91518;
  --red-soft: #fdf0f0;
  --amber: #a15c00;
  --amber-soft: #fff7ea;
  --ink: #1b1b1a;
  --ink2: #52514e;
  --muted: #7a7974;
  --line: #e4e3df;
  --bg: #f7f7f5;
  --surface: #ffffff;
  --radius: 8px;
  --side: 232px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 15px; line-height: 1.5; }
a { color: var(--green-d); }
a:hover { color: var(--green); }
h1 { font-size: 1.55rem; margin: 0 0 .25rem; font-weight: 650; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; font-weight: 650; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
code, .mono { font-family: ui-monospace, "DejaVu Sans Mono", monospace; font-size: .88em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 6px 10px; z-index: 10; }

/* ---------- layout: left sidebar + content */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); padding: 18px 12px; position: sticky;
  top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 0 8px 18px; }
.brand img { width: 26px; height: 34px; }
.brand b { font-size: 1.15rem; letter-spacing: .2px; }
.brand b span { color: var(--green); }
.nav { list-style: none; margin: 0; padding: 0; }
.nav li { margin: 1px 0; }
.nav a { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-radius: 6px;
  color: var(--ink2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--bg); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--green-soft); color: var(--green-d); font-weight: 650; }
.nav .group { font-size: .72rem; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted);
  padding: 14px 10px 4px; }
.count { background: var(--red); color: #fff; border-radius: 10px; font-size: .72rem; padding: 0 7px; font-weight: 700; }
.count[hidden] { display: none; }
.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); font-size: .85rem; }
.side-foot form { display: inline; }
.main { padding: 26px 34px 60px; max-width: 1280px; width: 100%; min-width: 0; }
.sidewrap .menu-toggle { display: none; }

/* ---------- page header */
.kicker { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; color: var(--green-d); }
.lead { color: var(--ink2); margin: .2rem 0 1rem; max-width: 70ch; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.provenance { display: inline-flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px; font-size: .82rem; color: var(--ink2); }
.provenance b { color: var(--ink); }

/* ---------- blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px;
  margin-bottom: 18px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 600px), 1fr)); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0 18px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tile .v { font-size: 1.6rem; font-weight: 700; color: var(--green-d); line-height: 1.15; }
.tile.alert .v { color: var(--red); }
.tile .l { font-size: .82rem; color: var(--ink2); }
.insights { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--green);
  border-radius: var(--radius); padding: 12px 18px; margin-bottom: 18px; }
.insights h2 { margin-top: .3rem; }
.insights li { margin: .3rem 0; }
.note { background: var(--amber-soft); border-left: 4px solid var(--amber); padding: 8px 14px; border-radius: 4px;
  font-size: .9rem; color: var(--ink2); margin: 10px 0; }
.flash { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px; }
.flash.ok { background: var(--green-soft); border: 1px solid #bfe3c6; }
.flash.err { background: var(--red-soft); border: 1px solid #f2c2c3; }
.empty { text-align: center; padding: 28px; color: var(--muted); }

/* ---------- charts */
.chart { max-width: 100%; height: auto; display: block; }
.graph-svg.chart, .schematic { width: 100%; }
.chart .mark:hover path, .chart .mark:hover circle { opacity: .8; }
details.data { margin-top: 6px; font-size: .85rem; }
details.data summary { cursor: pointer; color: var(--ink2); }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th { text-align: left; color: var(--ink2); font-weight: 600; border-bottom: 1.5px solid var(--ink2); padding: 6px 8px;
  white-space: nowrap; }
td { border-bottom: 1px solid var(--line); padding: 6px 8px; vertical-align: top; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: #fafaf8; }
.pager { display: flex; gap: 12px; align-items: center; margin-top: 10px; font-size: .9rem; }

/* ---------- badges */
.badge { display: inline-block; font-size: .75rem; font-weight: 650; padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink2); white-space: nowrap; }
.badge.ok { background: var(--green-soft); color: var(--green-d); border-color: #bfe3c6; }
.badge.bad { background: var(--red-soft); color: var(--red); border-color: #f2c2c3; }
.badge.wait { background: var(--amber-soft); color: var(--amber); border-color: #f0d9b0; }

/* ---------- forms */
form.inline { display: inline; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 14px; align-items: end; }
label { display: block; font-size: .82rem; color: var(--ink2); font-weight: 600; margin-bottom: 3px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 7px 9px; border: 1px solid #cfcec9; border-radius: 6px; font: inherit; background: #fff; }
textarea { min-height: 70px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--ink); font-size: .92rem; }
.check input { margin-top: 4px; }
.field { margin-bottom: 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.btn { display: inline-block; border: 1px solid var(--green-d); background: var(--green); color: #fff; padding: 7px 14px;
  border-radius: 6px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--green-d); color: #fff; }
.btn.secondary { background: #fff; color: var(--green-d); }
.btn.secondary:hover { background: var(--green-soft); }
.btn.danger { background: #fff; color: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.small { padding: 3px 10px; font-size: .85rem; }
.linkbtn { background: none; border: 0; color: var(--green-d); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px 18px; }
.tools .check small { display: block; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 10px 0 14px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; text-decoration: none; color: var(--ink2); border-bottom: 2px solid transparent; }
.tabs a[aria-current="page"] { color: var(--green-d); border-bottom-color: var(--green); font-weight: 650; }

/* ---------- login & landing */
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 380px; }
.landing { max-width: 1040px; margin: 0 auto; padding: 0 20px 60px; }
.landing header { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; }
.hero { padding: 40px 0 26px; }
.hero h1 { font-size: 2.3rem; line-height: 1.15; max-width: 22ch; }
.hero p { font-size: 1.1rem; color: var(--ink2); max-width: 62ch; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 20px 0 30px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--green);
  border-radius: var(--radius); padding: 14px 16px; }
.feature h3 { margin-top: 0; }
.flow { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; margin: 10px 0 24px; }
.flow .step { flex: 1 1 150px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; font-size: .9rem; }
.flow .step b { display: block; color: var(--green-d); }
.landing footer { border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: .88rem; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; display: none; }
  .sidewrap { border-right: 0; border-bottom: 1px solid var(--line); }
  .side.open { display: flex; }
  .sidewrap .menu-toggle { display: inline-block; margin: 10px 16px 0; }
  .main { padding: 16px; }
  .grid.two { grid-template-columns: 1fr; }
}
@media print {
  .side, .menu-toggle, .filters, .actions, .pager { display: none !important; }
  .app { display: block; }
}
.sidewrap { min-width: 0; }
@media (max-width: 860px) { .sidewrap .side { display: none; } .sidewrap .side.open { display: flex; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.sidewrap { background: var(--surface); border-right: 1px solid var(--line); }
.card > h2:first-child, .card > .head:first-child h2 { margin-top: 0; }
td.mono a, td .mono { word-break: break-all; }
.grid.two > * { min-width: 0; }

/* ---------- network explorer */
.main.wide { max-width: none; }
.graph-app { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 14px; height: 78vh; min-height: 520px; }
.graph-stage { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); min-width: 0; overflow: hidden; }
.graph-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.graph-tools input[type=search] { width: 240px; }
.graph-tools input[type=range] { width: 140px; }
.inline-label { display: inline; margin: 0; }
.graph-svg { flex: 1; width: 100%; min-height: 0; cursor: grab; touch-action: none; background: #fff; }
.graph-svg.dragging { cursor: grabbing; }
.g-edge { stroke: #b9b8b3; stroke-opacity: .55; stroke-linecap: round; cursor: pointer; }
.g-edge:hover, .g-edge.hot { stroke: #52514e; stroke-opacity: .9; }
.g-edge.dim { stroke-opacity: .08; }
.g-node { stroke: #fff; stroke-width: 1.5; cursor: pointer; }
.g-node:hover, .g-node:focus { stroke: #1b1b1a; stroke-width: 2.5; outline: none; }
.g-node.sel { stroke: #1b1b1a; stroke-width: 3; }
.g-node.dim { opacity: .18; }
.g-label { fill: #1b1b1a; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; font-family: system-ui, sans-serif; }
.graph-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 10px; border-top: 1px solid var(--line); }
.graph-legend { display: flex; gap: 14px; flex-wrap: wrap; }
.graph-legend .check { font-size: .85rem; align-items: center; }
.g-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 6px 0 2px; flex: none; }
.graph-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; overflow-y: auto; }
.graph-panel h2 { margin-top: .4rem; display: flex; align-items: center; word-break: break-word; }
.g-list { list-style: none; padding: 0; margin: 0; }
.g-list li { display: flex; align-items: center; gap: 4px; padding: 4px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.g-list .linkbtn { text-align: left; }
.g-info th { width: 40%; border-bottom: 1px solid var(--line); font-weight: 600; }
.g-artlist { padding-left: 20px; }
.g-artlist li { margin-bottom: 10px; }
.g-art-title { font-weight: 600; }
@media (max-width: 960px) { .graph-app { grid-template-columns: 1fr; height: auto; } .graph-svg { height: 60vh; } }

/* ---------- dashboards v2 */
.toplinks { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.filterbox summary { cursor: pointer; }
.filterbox form { margin-top: 12px; }
.tiles.compact { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); margin: 6px 0 12px; }
.tiles.compact .v { font-size: 1.25rem; }
.chart a.drill { cursor: pointer; }
.chart a.drill:hover rect, .chart a.drill:hover path, .chart a.drill:hover circle { opacity: .8; }
.schematic { max-width: 1000px; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.doc { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--green); border-radius: var(--radius);
  padding: 14px 16px; display: flex; flex-direction: column; }
.doc h3 { margin: 0 0 6px; font-size: 1.02rem; }
.doc p { color: var(--ink2); font-size: .92rem; margin: 0 0 10px; flex: 1; }
.doc .actions { margin-top: 0; }
.g-node.hub { stroke: #1b1b1a; stroke-width: 2.5; }
.g-node.faded { opacity: .5; }
.g-facts { padding-left: 18px; font-size: .92rem; }
.g-facts li { margin: 4px 0; }
.small-select { width: auto !important; padding: 3px 6px !important; font-size: .85rem; }
.graph-tools .check { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  text-decoration: none; color: var(--green-d); font-size: .9rem; }
.chip:hover { border-color: var(--green); background: var(--green-soft); }
.chip.on { background: var(--green); color: #fff; border-color: var(--green); }

/* ---------- chart builder */
.explore { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.explore-form { position: sticky; top: 12px; }
.explore-form fieldset { border: 0; padding: 0; margin: 0 0 10px; }
.explore-form legend { font-weight: 700; margin-bottom: 4px; }
.explore-form .field { margin-bottom: 10px; }
.explore-result { min-height: 420px; transition: opacity .15s; }
.explore-result.loading { opacity: .45; }
.examples { margin: 6px 0 16px; align-items: center; }
.explore-filters summary { cursor: pointer; font-weight: 600; margin: 4px 0 8px; }
@media (max-width: 960px) { .explore { grid-template-columns: 1fr; } .explore-form { position: static; } }
.export-bar { display: flex; gap: 6px; align-items: center; justify-content: flex-end; font-size: .78rem; color: var(--muted); margin: 4px 0 6px; }
.export-bar .btn.small { padding: 1px 8px; font-size: .75rem; }
@media print { .export-bar { display: none; } }
.explore-status { min-height: 1.3em; font-size: .85rem; color: var(--ink2); margin-bottom: 6px; }

/* ---------- IF identity (official logo links to the campus site) */
.brand img { width: 24px; height: auto; display: block; }
.brand-name { text-decoration: none; color: var(--ink); }
.brand-name b { font-size: 1.15rem; }
.brand-name b span { color: var(--green); }
.if-logo { display: block; width: 150px; margin: 28px 0 8px; }
.if-logo img { width: 100%; height: auto; display: block; }
.if-logo.small { width: 96px; margin: 0 auto 12px; }
.if-logo { background: #fff; padding: 10px; border-radius: var(--radius); border: 1px solid var(--line); box-sizing: content-box; }
.login .brand-name { display: block; text-align: center; margin-bottom: 6px; }

/* Retraction network: article groups */
.group-pick { grid-column: 1 / -1; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 12px 8px; display: flex; gap: 6px 22px; flex-wrap: wrap; align-items: center; margin: 0; }
.group-pick legend { font-size: .82rem; color: var(--ink2); padding: 0 4px; }
.group-pick .check { align-items: center; white-space: nowrap; }
.filters > .check { grid-column: span 2; align-items: center; }
.tiles.groups { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.tiles.groups .tile { border-top-width: 4px; }
