/* Incubadora de Agentes. Formato Córtex.ai: mesmos tokens e fontes do magalu-reports-mcp. */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("/static/fonts/inter-400.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("/static/fonts/inter-500.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("/static/fonts/inter-600.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("/static/fonts/inter-700.ttf") format("truetype"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url("/static/fonts/plus-jakarta-sans-700.ttf") format("truetype"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 800; font-display: swap; src: url("/static/fonts/plus-jakarta-sans-800.ttf") format("truetype"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-display: swap; src: url("/static/fonts/jetbrains-mono-400.ttf") format("truetype"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-display: swap; src: url("/static/fonts/jetbrains-mono-500.ttf") format("truetype"); }

:root {
  --night: #0f1120;
  --night-card: #1d1f2d;
  --night-line: #2c2f42;
  --violet: #5b4fe8;
  --violet-soft: #ecebfc;
  --sky: #4a9eff;
  --sky-soft: #eaf3ff;
  --indigo: #4a3fd0;
  --indigo-soft: #f0eff9;
  --ink: #1a1c2b;
  --ink-soft: #3a3d55;
  --muted: #6b7180;
  --line: #e6e8ef;
  --paper: #f4f5f8;
  --login-glow: #3a1d7a;
  --login-orange: #ff8800;
  --login-coral: #ff3231;
  --login-coral-line: rgba(255, 60, 49, 0.4);
  --login-ice: #c9cbea;
  --login-ice-2: #8f93d8;
  --team-bg: #e8eaf2;
  --zebra: #faf9fb;
  --on-dark: #b4b9c8;
  --on-dark-muted: #8e94a8;
  --critical: #dc3545;
  --critical-soft: #fff5f5;
  --critical-line: #fbe4e6;
  --warning: #ff8c42;
  --warning-soft: #fff8f2;
  --warning-line: #ffe2cc;
  --warning-ink: #c2570c;
  --positive: #198754;
  --positive-soft: #eef6f1;
  --positive-line: #cfe7d8;
  --pending: #ffc107;
  --pending-soft: #fff3cd;
  --pending-ink: #7a5d00;
  --neutral: #6c757d;
  --white: #fff;

  /* Níveis de maturidade: do mais frio (concepção) ao mais quente (autônomo). */
  --n1: #9aa0b2;
  --n2: #5b9bd8;
  --n3: #5b4fe8;
  --n4: #198754;
  --n5: #ff8c42;

  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --display: "Plus Jakarta Sans", "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --gutter: clamp(16px, 4vw, 40px);
  --shadow: 0 1px 2px rgba(15, 17, 32, 0.04), 0 8px 24px -16px rgba(15, 17, 32, 0.18);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body { margin: 0; min-height: 100vh; background: var(--paper); }
h1, h2, h3, h4, p, pre, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, pre, time, .mono { font-family: var(--mono); }
code { padding: 1px 5px; font-size: 0.88em; color: var(--indigo); background: var(--indigo-soft); border-radius: 4px; }
:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; }
button { font: inherit; color: inherit; }
.num, td.num, .kpi-value { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

/* ------------------------------------------------------------ masthead */

.masthead {
  padding: 22px 0 32px;
  color: var(--white);
  background:
    radial-gradient(circle at 100% 0%, rgba(91, 79, 232, 0.55) 0, rgba(91, 79, 232, 0) 34%),
    radial-gradient(circle at 0% 100%, rgba(52, 104, 178, 0.5) 0, rgba(52, 104, 178, 0) 30%),
    var(--night);
  border-top: 4px solid var(--violet);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.partners {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.partners img { display: block; height: 22px; width: auto; }
.partners img.logo-magalu { height: 26px; }
.partners img.logo-monks { height: 15px; }
.partners .x {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.22);
}
.partners-note {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
  margin-left: 6px;
}

.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.pill-button.primary { background: var(--violet); border-color: var(--violet); }
.pill-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.primary-nav {
  display: flex;
  gap: 4px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.primary-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--on-dark);
  font-weight: 500;
  font-size: 13px;
}
.primary-nav a:hover { color: var(--white); text-decoration: none; background: rgba(255, 255, 255, 0.06); }
.primary-nav a[aria-current="page"] { color: var(--white); background: rgba(255, 255, 255, 0.12); }

.eyebrow {
  margin-top: 26px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}
.masthead h1 {
  margin-top: 6px;
  font: 800 clamp(28px, 4vw, 40px)/1.1 var(--display);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.masthead h1 .accent { color: var(--sky); }
.lede { margin-top: 10px; max-width: 64ch; color: var(--on-dark); font-size: 15px; }

.masthead-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px;
  align-items: end;
}

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px 24px;
  margin-top: 22px;
}
.meta dt { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-dark-muted); }
.meta dd { margin-top: 3px; font-weight: 600; font-size: 15px; }
.meta dd small { font-weight: 400; color: var(--on-dark-muted); margin-left: 4px; }

.health {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
}
.health strong { font-weight: 600; }
.health span { color: var(--on-dark); }
.health-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.25); }

/* Incubadora no masthead: 5 estágios em mini, com contagem */
.stage-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.stage-strip li { min-width: 0; display: grid; }
.stage-strip button {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  padding: 10px 10px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--white);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.stage-strip button:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); border-color: var(--stage); }
.stage-strip button:disabled { cursor: default; }
.stage-strip button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.16); border-color: var(--stage); box-shadow: 0 0 0 1px var(--stage); }
.stage-strip button:focus-visible { outline: 2px solid var(--white); outline-offset: 2px; }
.stage-strip span { display: block; }
.stage-strip .n { font: 500 11px/1 var(--mono); color: var(--on-dark-muted); }
.stage-strip .v { margin-top: 8px; font: 800 24px/1 var(--display); }
.stage-strip .l { margin-top: 5px; font-size: 10.5px; line-height: 1.2; color: var(--on-dark); }
.stage-strip button::before { content: ""; display: block; height: 3px; border-radius: 2px; margin-bottom: 8px; background: var(--stage, var(--on-dark-muted)); }

/* ------------------------------------------------------------ layout */

main.wrap { padding-block: 26px 56px; display: grid; gap: 22px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi {
  position: relative;
  padding: 16px 18px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.kpi h2 { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0.02em; }
.kpi-value { margin-top: 6px; font: 800 30px/1.05 var(--display); letter-spacing: -0.02em; }
.kpi-value small { font: 600 14px/1 var(--font); color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.kpi-sub { margin-top: 6px; font-size: 12px; color: var(--muted); }
.kpi::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--line); }
.kpi.tone-positive::after { background: var(--positive); }
.kpi.tone-violet::after { background: var(--violet); }
.kpi.tone-sky::after { background: var(--sky); }
.kpi.tone-warning::after { background: var(--warning); }
.kpi.tone-critical::after { background: var(--critical); }
.kpi .trend { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.trend.up { color: var(--positive); }
.trend.down { color: var(--critical); }
.kpi .spark { position: absolute; right: 16px; top: 16px; width: 72px; height: 28px; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  flex-wrap: wrap;
}
.card-head h2 { font: 700 17px/1.2 var(--display); letter-spacing: -0.01em; }
.card-head p { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.card-body { padding: 0 20px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
}
.ghost-button:hover { border-color: var(--violet); color: var(--indigo); text-decoration: none; }
.ghost-button.primary { background: var(--night); border-color: var(--night); color: var(--white); }
.ghost-button.primary:hover { background: var(--indigo); border-color: var(--indigo); color: var(--white); }

.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.two-col.even { grid-template-columns: 1fr 1fr; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; align-items: start; }
.stack { display: grid; gap: 22px; }

/* ------------------------------------------------------------ pílulas e selos */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--positive); background: var(--positive-soft); border-color: var(--positive-line); }
.pill.warn { color: var(--warning-ink); background: var(--warning-soft); border-color: var(--warning-line); }
.pill.fail { color: var(--critical); background: var(--critical-soft); border-color: var(--critical-line); }
.pill.run { color: var(--indigo); background: var(--indigo-soft); border-color: #dcd9f6; }
.pill.run::before { animation: pulse 1.4s infinite; }
.pill.off { color: var(--muted); background: var(--paper); border-color: var(--line); }
.pill.pending { color: var(--pending-ink); background: var(--pending-soft); border-color: #f5d77a; }
.pill.plain::before { display: none; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
}
.chip svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.chip.mcp { color: var(--indigo); background: var(--indigo-soft); border-color: #dcd9f6; }
.chip.db { color: #0b5a8c; background: var(--sky-soft); border-color: #cfe3fb; }
.chip.skill { color: #5c4a00; background: #fff8e1; border-color: #f2e3a6; }
.chip.delivery { color: var(--positive); background: var(--positive-soft); border-color: var(--positive-line); }
.chip.soon { color: var(--muted); background: var(--white); border-style: dashed; }
.chip.blocked { color: var(--critical); background: var(--critical-soft); border-color: var(--critical-line); text-decoration: line-through; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }

/* Selo de nível de maturidade */
.level {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.level .ring {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 9.5px/1 var(--mono);
  color: var(--white);
  background: var(--stage, var(--muted));
}
.level[data-n="1"] { --stage: var(--n1); }
.level[data-n="2"] { --stage: var(--n2); }
.level[data-n="3"] { --stage: var(--n3); }
.level[data-n="4"] { --stage: var(--n4); }
.level[data-n="5"] { --stage: var(--n5); }

/* ------------------------------------------------------------ tabelas */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; white-space: nowrap; }
tbody tr:nth-child(even) { background: var(--zebra); }
tbody tr:hover { background: var(--indigo-soft); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.mono { white-space: nowrap; }
td .sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
td a.row-link { font-weight: 600; }
td a.row-link:hover { color: var(--indigo); }

/* Matriz de acesso: agentes × ferramentas/bases */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }

/* ------------------------------------------------------------ rodapé */

.footer { padding: 18px 0 32px; border-top: 1px solid var(--line); background: var(--white); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.footer .partners img { height: 16px; filter: grayscale(1); opacity: 0.7; }
.footer .partners img.logo-magalu { height: 19px; }
.footer .partners img.logo-monks { height: 11px; }
.footer .partners .x { background: var(--line); height: 16px; }

/* ------------------------------------------------------------ responsivo */

@media (max-width: 1000px) {
  .masthead-grid { grid-template-columns: 1fr; }
  .two-col, .three-col { grid-template-columns: 1fr; }
  .run-detail { position: static; }
}
@media (max-width: 760px) {
  .lane-head, .lanes { grid-template-columns: 1fr; }
  .lanes { gap: 14px; }
  .lane { min-height: 0; }
  .lane-head { display: none; }
  .lane::before { content: attr(data-label); display: block; font: 700 12px/1 var(--display); color: var(--stage); margin-bottom: 2px; }
  .stage-strip { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .stage-strip button { padding: 8px 6px; }
  .stage-strip .v { font-size: 18px; }
  .stage-strip .l { font-size: 9.5px; }
  .ladder b { font-size: 11px; }
  .ladder small { display: none; }
  .agent-facts { grid-template-columns: 1fr 1fr; }
  .search { min-width: 0; width: 100%; }
  .tool { grid-template-columns: 38px 1fr; }
  .tool .state { grid-column: 2; justify-items: start; text-align: left; grid-auto-flow: column; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  .pill.run::before { animation: none; }
  .agent-chip { transition: none; }
}

/* ------------------------------------------------------------ versão simples: cards de experts + modal */

.experts { display: grid; grid-template-columns: 1fr; gap: 10px; }
.expert {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(190px, 0.8fr) minmax(0, 2fr) minmax(150px, 200px);
  gap: 14px 24px;
  align-items: start;
  padding: 16px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--stage);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s, box-shadow 0.35s, background 0.35s;
  min-width: 0;
}
.expert:hover { transform: translateY(-2px); border-color: var(--stage); box-shadow: 0 2px 4px rgba(15, 17, 32, 0.05), 0 14px 32px -16px rgba(15, 17, 32, 0.3); }
.expert[data-n="1"] { --stage: var(--n1); }
.expert[data-n="2"] { --stage: var(--n2); }
.expert[data-n="3"] { --stage: var(--n3); }
.expert[data-n="4"] { --stage: var(--n4); }
.expert[data-n="5"] { --stage: var(--n5); }
.expert-top { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.expert-top h3 { font: 700 15.5px/1.2 var(--display); letter-spacing: -0.01em; }
.expert-top p { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.expert-run { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 10px 12px; border-radius: 8px; background: var(--paper); }
.expert-run dt { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.expert-run dd { margin-top: 3px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.expert-run dd small { font-weight: 400; color: var(--muted); }
.expert-conn { display: grid; grid-template-columns: auto 1fr; gap: 6px 10px; align-items: baseline; font-size: 11px; color: var(--muted); }
.expert-conn dt { letter-spacing: 0.08em; text-transform: uppercase; padding-top: 3px; }
.expert-foot { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 10px; align-self: stretch; text-align: right; font-size: 12px; color: var(--muted); }
.expert-foot .link { background: none; border: 0; padding: 0; font: 600 12.5px var(--font); color: var(--indigo); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.expert-foot .link:hover { text-decoration: underline; text-underline-offset: 3px; }
.expert .spark { width: 84px; height: 22px; }

.stages-inline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.stages-inline li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--white); border: 1px solid var(--line); min-width: 0; }
.stages-inline .ring { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 600 10px/1 var(--mono); color: var(--white); background: var(--stage); }
.stages-inline b { display: block; font: 700 12.5px/1.2 var(--display); }
.stages-inline small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); line-height: 1.3; }
.stages-inline li:nth-child(1) { --stage: var(--n1); }
.stages-inline li:nth-child(2) { --stage: var(--n2); }
.stages-inline li:nth-child(3) { --stage: var(--n3); }
.stages-inline li:nth-child(4) { --stage: var(--n4); }
.stages-inline li:nth-child(5) { --stage: var(--n5); }

dialog.modal {
  width: min(880px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(15, 17, 32, 0.5);
  overflow: hidden;
}
dialog.modal::backdrop { background: rgba(15, 17, 32, 0.55); backdrop-filter: blur(2px); }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  color: var(--white);
  background:
    radial-gradient(circle at 100% 0%, rgba(91, 79, 232, 0.55) 0, rgba(91, 79, 232, 0) 40%),
    var(--night);
  border-top: 4px solid var(--stage, var(--violet));
}
.modal-head .eyebrow { margin-top: 0; }
.modal-head h2 { margin-top: 4px; font: 800 22px/1.15 var(--display); letter-spacing: -0.02em; }
.modal-head p.role { margin-top: 4px; font-size: 13px; color: var(--on-dark); }
.modal-head .badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.modal-head .level, .modal-head .pill, .modal-head .chip { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.14); color: var(--white); }
.modal-head .pill.ok { color: #7fd3a4; }
.modal-head .pill.warn { color: #ffb27a; }
.modal-close {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: var(--white);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.14); }
.modal-body { padding: 18px 22px 20px; display: grid; gap: 18px; max-height: calc(100vh - 48px - 130px); overflow: auto; }
.modal-body > * { min-width: 0; }
.modal-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.modal-stats div { padding: 10px 12px; border-radius: 8px; background: var(--paper); min-width: 0; }
.modal-stats dt { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.modal-stats dd { margin-top: 3px; font: 700 15px/1.1 var(--display); }
.modal-stats dd small { font: 400 11.5px/1 var(--font); color: var(--muted); }
.modal-section h3 { font: 700 12px/1 var(--display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 22px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.modal dialog table { font-size: 12.5px; }
.modal th, .modal td { padding: 8px 10px; }
.modal[data-n="1"] { --stage: var(--n1); }
.modal[data-n="2"] { --stage: var(--n2); }
.modal[data-n="3"] { --stage: var(--n3); }
.modal[data-n="4"] { --stage: var(--n4); }
.modal[data-n="5"] { --stage: var(--n5); }

@media (max-width: 1000px) {
  .expert { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .expert-conn { grid-column: 1 / -1; }
  .expert-foot { grid-column: 1 / -1; flex-direction: row; align-items: center; text-align: left; padding-top: 10px; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .expert { grid-template-columns: 1fr; }
  .expert-conn, .expert-foot { grid-column: auto; }
  .stages-inline { grid-template-columns: 1fr 1fr; }
  .stages-inline li:last-child { grid-column: span 2; }
  .modal-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .modal-head { padding: 16px; }
  .modal-body { padding: 14px 16px 16px; }
  .modal-foot { padding: 10px 16px; }
}

/* ------------------------------------------------------------ aplicação */

.lane-empty { min-height: 72px; border: 1.5px dashed var(--line); border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-size: 12.5px; text-align: center; padding: 10px; }
.eyebrow--flush { margin-top: 0; }
.stage-strip { margin-top: 10px; }
.stage-strip li[data-n="1"] { --stage: var(--n1); }
.stage-strip li[data-n="2"] { --stage: var(--n2); }
.stage-strip li[data-n="3"] { --stage: var(--n3); }
.stage-strip li[data-n="4"] { --stage: var(--n4); }
.stage-strip li[data-n="5"] { --stage: var(--n5); }
.health--warn .health-dot { background: var(--warning); box-shadow: 0 0 0 4px rgba(255, 140, 66, 0.25); }
.section-head { padding-bottom: 12px; }
.section-head h2 { font: 700 17px/1.2 var(--display); letter-spacing: -0.01em; }
.section-head p { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.flash { padding: 10px 14px; border-radius: 10px; background: var(--positive-soft); border: 1px solid var(--positive-line); color: var(--positive); font-weight: 500; }
.alert { padding: 10px 12px; border-radius: 8px; background: var(--critical-soft); border: 1px solid var(--critical-line); color: var(--critical); font-size: 13px; }
.expert-alert { grid-column: 2 / 4; }
.empty { padding: 32px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.empty h2 { font: 700 18px/1.2 var(--display); }
.empty p { color: var(--muted); }
.login-card { width: min(420px, 100%); margin: 0 auto; }
.stack-sm { display: grid; gap: 12px; justify-items: start; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 18px; align-items: end; }
.form-full { grid-column: 1 / -1; }
.field { display: grid; gap: 5px; min-width: 0; }
.field label, .maturity-form label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
input[type="text"], input[type="number"], input[type="password"], select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--white); color: var(--ink); font: 13.5px/1.3 var(--font);
}
input:focus-visible, select:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; }
.ghost-button.danger { color: var(--critical); border-color: var(--critical-line); }
.ghost-button.danger:hover { background: var(--critical-soft); border-color: var(--critical); color: var(--critical); }
.maturity-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; border-radius: 10px; background: var(--paper); }
.maturity-form select { width: auto; min-width: 190px; }
.maturity-form small { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.modal-head[data-n="1"] { --stage: var(--n1); }
.modal-head[data-n="2"] { --stage: var(--n2); }
.modal-head[data-n="3"] { --stage: var(--n3); }
.modal-head[data-n="4"] { --stage: var(--n4); }
.modal-head[data-n="5"] { --stage: var(--n5); }
@media (max-width: 1000px) { .expert-alert { grid-column: 1 / -1; } }

/* Atualizar no canto do card */
.refresh { position: absolute; top: 12px; right: 12px; z-index: 1; }
.refresh button {
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--white);
  color: var(--muted); cursor: pointer; transition: color 0.2s, border-color 0.2s;
}
.refresh button:hover { color: var(--indigo); border-color: var(--violet); }
.refresh svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.refresh.is-loading svg { animation: spin 0.8s linear infinite; }
.refresh.is-loading button { pointer-events: none; color: var(--violet); }
@keyframes spin { to { transform: rotate(360deg); } }
.expert-top, .expert-foot > span:first-child { padding-right: 34px; }
.foot-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.foot-actions small { font-size: 11px; color: var(--muted); }
@media (min-width: 1001px) {
  .expert-foot > span:empty + .foot-actions { margin-top: 32px; }
}
@media (max-width: 1000px) {
  .expert-foot > span:first-child { padding-right: 0; }
  .foot-actions { flex-direction: row; align-items: center; gap: 10px; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .refresh.is-loading svg { animation: none; } }

/* Filtro por estágio */
[hidden] { display: none !important; }
.filter-note { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 10px; font-size: 12.5px; color: var(--muted); }
.filter-note b { color: var(--ink); font-weight: 600; }
.filter-note .link { background: none; border: 0; padding: 0; font: 600 12.5px var(--font); color: var(--indigo); cursor: pointer; }
.filter-note .link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Rede de grafos no fundo do hero */
.masthead { position: relative; overflow: hidden; }
.masthead > .wrap { position: relative; z-index: 2; }
.graph-bg { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; opacity: 0.7; pointer-events: none; }

/* Link da execução para o portal da Draiven */
.run-link { white-space: nowrap; text-align: right; font-size: 12.5px; }
.run-link a { font-weight: 600; color: var(--indigo); }

/* Card selecionado: brilho na cor do estágio, sem contorno */
.expert:active:not(:has(button:active, a:active)) { transform: scale(0.997); }
.expert.is-selected {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--stage) 45%, var(--line));
  background: color-mix(in srgb, var(--stage) 5%, var(--white));
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--stage) 14%, transparent),
    0 18px 40px -20px color-mix(in srgb, var(--stage) 60%, transparent);
}
.expert.is-selected .expert-run { background: color-mix(in srgb, var(--stage) 8%, var(--white)); }
.expert-run { transition: background 0.35s; }
@media (prefers-reduced-motion: reduce) {
  .expert, .expert-run { transition: none; }
  .expert.is-selected, .expert:active:not(:has(button:active, a:active)) { transform: none; }
}

/* Próximo passo: parece texto e vira campo ao clicar */
.next-step { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); min-width: 0; }
.next-step label { flex: none; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.next-step input[type="text"] {
  flex: 1; min-width: 0; padding: 5px 8px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--ink); font-size: 13px; font-weight: 500; cursor: text;
  transition: background 0.15s, border-color 0.15s;
}
.next-step input[type="text"]::placeholder { color: var(--muted); font-weight: 400; }
.next-step input[type="text"]:hover { background: var(--paper); }
.next-step input[type="text"]:focus { background: var(--white); border-color: var(--violet); outline: none; }
.next-step button { display: none; flex: none; }
.next-step:focus-within button { display: inline-flex; }
@media (max-width: 760px) {
  .next-step { grid-column: auto; flex-wrap: wrap; }
  .next-step label { width: 100%; }
}

/* Times: um bloco por time, com a faixa acompanhando a rolagem */
.team-group { display: grid; gap: 10px; padding: 0 10px 10px; border-radius: 16px; background: var(--team-bg); }
.team-group + .team-group { margin-top: 26px; }
.team-head {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 0 -10px;
  padding: 14px 20px;
  border-radius: 16px 16px 10px 10px;
  color: var(--white);
  background:
    radial-gradient(circle at 100% 0%, rgba(91, 79, 232, 0.5) 0, rgba(91, 79, 232, 0) 45%),
    var(--night);
}
.team-kicker { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--on-dark-muted); }
.team-head h3 { margin-top: 2px; font: 800 21px/1.15 var(--display); letter-spacing: -0.015em; }
.team-about { margin-top: 3px; font-size: 12.5px; color: var(--on-dark); }
.team-stats { display: flex; gap: 22px; }
.team-stats dt { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--on-dark-muted); }
.team-stats dd { margin-top: 2px; font: 800 19px/1.1 var(--display); font-variant-numeric: tabular-nums; }

/* Filtro por time */
.team-filter { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 12px; }
.team-filter button {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white);
  color: var(--ink-soft); font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.team-filter button:hover { border-color: var(--violet); color: var(--indigo); }
.team-filter button[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: var(--white); }
.team-filter button span { font-size: 11.5px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.team-filter button[aria-pressed="true"] span { color: var(--on-dark); }
#filtro-vazio { margin-top: 4px; }

/* Demonstração */
.health--demo .health-dot { background: var(--sky); box-shadow: 0 0 0 4px rgba(74, 158, 255, 0.25); }
.next-step p { flex: 1; min-width: 0; padding: 5px 8px; font-size: 13px; font-weight: 500; color: var(--ink); }
.next-step-label { flex: none; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 760px) { .team-head { position: static; } }

/* Documentação */
.docs-row { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; padding: 0 0 2px; min-width: 0; }
.docs-links { display: flex; flex-wrap: wrap; gap: 4px 14px; min-width: 0; padding-left: 8px; font-size: 13px; }
.docs-links a, .doc-list a { font-weight: 600; color: var(--indigo); overflow-wrap: anywhere; }
.doc-name { font-weight: 500; color: var(--ink-soft); overflow-wrap: anywhere; }
.doc-list { display: grid; gap: 6px; }
.doc-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.doc-list small { color: var(--muted); font-size: 11.5px; }
.doc-list form { margin-left: auto; }
.doc-empty { font-size: 13px; }
.doc-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 12px; border-radius: 10px; background: var(--paper); }
.doc-upload label { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.doc-upload input[type="file"] { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-soft); }
.doc-upload input[type="file"]::file-selector-button {
  margin-right: 10px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--white); color: var(--ink-soft); font: 500 12.5px var(--font); cursor: pointer;
}
@media (max-width: 760px) {
  .docs-row { grid-column: auto; flex-wrap: wrap; }
  .docs-links { padding-left: 0; }
  .doc-upload input[type="file"] { flex-basis: 100%; }
}

/* Avatar do usuário */
.user-button { padding: 4px 12px 4px 4px; }
.avatar { position: relative; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; overflow: hidden; background: var(--violet); color: var(--white); font-size: 11px; font-weight: 700; flex: none; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Tela de login, no formato do Portal de Serviços */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 0.9fr; background: var(--white); }
.login-aside { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 56px 52px; background: var(--night); color: var(--white); }
.login-aside::before { content: ""; position: absolute; top: -140px; right: -120px; width: 460px; height: 460px; border-radius: 50%; filter: blur(80px); background: radial-gradient(circle, var(--login-glow), transparent 65%); }
.login-aside::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, var(--login-orange), var(--login-coral), var(--indigo)); }
.login-aside .inner, .login-aside .foot { position: relative; z-index: 2; }
.login-kick { margin-top: 40px; }
.login-kick span { display: inline-block; padding: 7px 14px; border: 1px solid var(--login-coral-line); border-radius: 999px; color: var(--login-coral); font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.login-aside h1 { margin-top: 28px; font: 800 clamp(30px, 4vw, 46px)/1.05 var(--display); letter-spacing: -0.03em; text-wrap: balance; }
.login-aside h1 .g { background: linear-gradient(90deg, var(--login-ice), var(--login-ice-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-lede { margin-top: 18px; max-width: 44ch; color: var(--on-dark); font-size: 16px; line-height: 1.5; }
.login-aside .foot { font-size: 12.5px; color: var(--on-dark-muted); }
.login-form-side { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.login-card { width: 100%; max-width: 380px; }
.lc-logo { margin-bottom: 26px; }
.lc-logo img { display: block; height: 28px; width: auto; }
.login-card h2 { font: 800 24px/1.2 var(--display); color: var(--ink); }
.login-card .sub { margin-top: 6px; margin-bottom: 26px; color: var(--muted); font-size: 14.5px; }
.form-err { margin-bottom: 16px; padding: 10px 12px; border: 1px solid var(--critical-line); border-radius: 10px; background: var(--critical-soft); color: var(--critical); font-size: 13.5px; }
.google-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px 18px; border: 1px solid var(--line); border-radius: 11px; background: var(--white); color: var(--ink); font-size: 14px; font-weight: 700; transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease); }
.google-button:hover { text-decoration: none; border-color: var(--indigo); box-shadow: var(--shadow); transform: translateY(-1px); }
@media (max-width: 820px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-aside { display: none; }
}

/* Ferramentas e bases: uma linha por lista, com balão para a lista inteira */
.expert-conn { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; min-width: 0; }
.conn-row { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; align-items: center; min-width: 0; }
.conn-row dt { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 0; }
.conn-chips { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 12px; }
.conn-chips > .chip { display: block; flex: 0 1 auto; min-width: 0; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.see-all { flex: none; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--indigo); font-size: 11px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.see-all:hover, .see-all[aria-expanded="true"] { border-color: var(--violet); background: var(--indigo-soft); }
.chip-hint { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 5; min-width: 240px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); box-shadow: 0 16px 40px -14px rgba(15, 17, 32, 0.35); cursor: default; }
.chip-hint p { margin-bottom: 8px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.chip-hint .chip { white-space: normal; overflow-wrap: anywhere; }
.expert:has(.chip-hint:not([hidden])) { z-index: 2; }
@media (max-width: 760px) { .chip-hint { min-width: 0; } }

/* Aviso de sucesso: some sozinho */
.flash { transition: opacity 0.3s; }
.flash.is-leaving { opacity: 0; }
