:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-2: #f8fbff;
  --text: #1f2937;
  --muted: #5f6b7a;
  --line: #d9e4f1;

  --primary: #0f6ea9;
  --primary-2: #0a96cf;
  --secondary: #4b1841;
  --ok: #138a5a;
  --warn: #bc4f18;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 40px rgba(8, 34, 72, 0.1);
  --shadow-soft: 0 8px 24px rgba(11, 41, 82, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", "Inter", "Roboto", sans-serif;
  background: radial-gradient(circle at 85% -5%, #dff3ff 0%, var(--bg) 45%, #eef3f8 100%);
  color: var(--text);
  line-height: 1.5;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 1.2rem 1.4rem 2.2rem;
  margin: 1rem auto;
  width: min(1220px, calc(100% - 2rem));
  border-radius: 22px;
  background:
    linear-gradient(126deg, #fdfefe 0%, #f3f9ff 52%, #eef8ff 100%);
  box-shadow: var(--shadow);
  border: 1px solid #d6e7fb;
}

.hero__glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero__glow--one {
  width: 420px;
  height: 420px;
  right: -120px;
  top: -150px;
  background: radial-gradient(circle, rgba(15, 110, 169, 0.16), rgba(15, 110, 169, 0));
}

.hero__glow--two {
  width: 380px;
  height: 380px;
  left: -140px;
  bottom: -200px;
  background: radial-gradient(circle, rgba(75, 24, 65, 0.1), rgba(75, 24, 65, 0));
}

.hero__topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.brand-logo {
  height: 54px;
  width: auto;
  object-fit: contain;
  background: #fff;
  border: 1px solid #e4edf8;
  border-radius: 10px;
  padding: 0.4rem 0.65rem;
  box-shadow: var(--shadow-soft);
}

.hero__meta {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: center;
}

.badge {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(10, 150, 207, 0.14);
  border: 1px solid rgba(10, 150, 207, 0.24);
  color: #005f87;
  font-weight: 600;
  font-size: 0.83rem;
}

.badge--soft {
  background: rgba(75, 24, 65, 0.08);
  border-color: rgba(75, 24, 65, 0.18);
  color: #5e2a53;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 900px;
}

.hero__actions {
  position: relative;
  z-index: 2;
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.58rem 0.95rem;
  border-radius: 10px;
  border: 1px solid #c5d9ef;
  background: #ffffff;
  color: #22445f;
  font-weight: 700;
  font-size: 0.87rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
  border-color: #97bfdf;
}

.action-btn--primary {
  border-color: #0b6da7;
  background: linear-gradient(180deg, #0f6ea9, #0b5f92);
  color: #ffffff;
}

.action-btn--primary:hover {
  border-color: #0b5f92;
}

.eyebrow {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  font-size: 0.79rem;
}

.hero h1 {
  margin: 0.4rem 0 0;
  font-size: clamp(1.45rem, 3.3vw, 2.45rem);
  line-height: 1.15;
  color: #0f2336;
}

.subtitle {
  margin: 0.9rem 0 1rem;
  color: #35506a;
  font-size: clamp(0.98rem, 1.9vw, 1.1rem);
  max-width: 78ch;
}

.meta-list {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  color: #23384d;
  font-size: 0.94rem;
}

.kpi-grid {
  position: relative;
  z-index: 2;
  margin-top: 1.4rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid #d7e6f6;
  border-radius: 14px;
  padding: 0.95rem 0.95rem 0.85rem;
  box-shadow: var(--shadow-soft);
}

.kpi-card__label {
  margin: 0;
  color: #4e6378;
  font-size: 0.82rem;
}

.kpi-card__value {
  margin: 0.35rem 0 0.2rem;
  font-size: 1.62rem;
  line-height: 1;
  font-weight: 800;
  color: #10324b;
}

.kpi-card__hint {
  margin: 0;
  color: #6e7f8f;
  font-size: 0.76rem;
}

.kpi-card--alert {
  border-color: #f0c7a9;
  background: #fff8f4;
}

.kpi-card--alert .kpi-card__value {
  color: #8f3b12;
}

.container {
  width: min(1220px, calc(100% - 2rem));
  margin: 0 auto 1rem;
}

.tabs {
  background: var(--surface);
  border: 1px solid #dce8f5;
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tabs input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tab-list {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  background: linear-gradient(180deg, #f5faff, #edf5fc);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.tab-list label {
  cursor: pointer;
  text-align: center;
  font-weight: 700;
  color: #31516d;
  padding: 0.85rem 0.4rem;
  border-right: 1px solid #d9e7f6;
  transition: 0.2s ease;
  font-size: 0.9rem;
}

.tab-list label:last-child {
  border-right: 0;
}

.tab-list label:hover {
  background: #e6f3ff;
  color: #113956;
}

.tab-panels {
  padding: 1rem;
}

.tab-panel {
  display: none;
  animation: fade 0.25s ease;
}

/* Modo de pre-impressao: abre todas as secoes antes de chamar o dialogo. */
body.is-printing .tab-list {
  display: none;
}

body.is-printing .tab-panel {
  display: block !important;
  animation: none;
}

@keyframes fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

#tab-resumo:checked ~ .tab-list label[for="tab-resumo"],
#tab-metricas:checked ~ .tab-list label[for="tab-metricas"],
#tab-gargalos:checked ~ .tab-list label[for="tab-gargalos"],
#tab-projetos:checked ~ .tab-list label[for="tab-projetos"],
#tab-conclusoes:checked ~ .tab-list label[for="tab-conclusoes"],
#tab-referencias:checked ~ .tab-list label[for="tab-referencias"] {
  background: linear-gradient(180deg, #0f6ea9, #0a5d8f);
  color: #fff;
}

#tab-resumo:checked ~ .tab-panels #panel-resumo,
#tab-metricas:checked ~ .tab-panels #panel-metricas,
#tab-gargalos:checked ~ .tab-panels #panel-gargalos,
#tab-projetos:checked ~ .tab-panels #panel-projetos,
#tab-conclusoes:checked ~ .tab-panels #panel-conclusoes,
#tab-referencias:checked ~ .tab-panels #panel-referencias {
  display: block;
}

.tab-panel h2 {
  margin: 0.2rem 0 0.9rem;
  color: #10293f;
}

.tab-panel h3 {
  margin: 0.1rem 0 0.65rem;
  color: #1a3d5a;
}

.tab-panel p {
  color: #2a445c;
}

.callout {
  border-left: 5px solid var(--primary);
  background: #f1f8ff;
  border-radius: 12px;
  padding: 0.8rem 0.95rem;
  margin: 0.95rem 0 1rem;
}

.callout h3 {
  margin-top: 0;
}

.callout--warn {
  border-left-color: var(--warn);
  background: #fff7f2;
}

.callout--success {
  border-left-color: var(--ok);
  background: #effbf5;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

.panel-card {
  background: var(--surface-2);
  border: 1px solid #d9e9f8;
  border-radius: 14px;
  padding: 0.9rem;
  margin-bottom: 0.95rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  background: #fff;
  border: 1px solid #dbe8f5;
  border-radius: 10px;
  overflow: hidden;
}

thead {
  background: linear-gradient(180deg, #193b59, #142f49);
  color: #fff;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid #e3edf8;
  padding: 0.65rem 0.65rem;
  font-size: 0.9rem;
}

tbody tr:nth-child(even) {
  background: #f8fbff;
}

.bars {
  display: grid;
  gap: 0.7rem;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.5fr) minmax(180px, 3fr) auto;
  gap: 0.65rem;
  align-items: center;
}

.bar-row span {
  font-size: 0.88rem;
  color: #2d4a62;
}

.bar-row strong {
  font-size: 0.87rem;
  color: #20364b;
}

.bar-track {
  height: 12px;
  background: #e2edf8;
  border-radius: 999px;
  overflow: hidden;
}

.bar {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: 999px;
}

.bar--semia-max {
  background: linear-gradient(90deg, #3f5f7a, #224964);
}

.bar--comia-max {
  background: linear-gradient(90deg, #06a0d4, #0b6da7);
}

.formula code {
  display: inline-block;
  background: #eef5fd;
  border: 1px solid #d8e5f5;
  color: #22374d;
  border-radius: 8px;
  padding: 0.24rem 0.45rem;
}

.formula-note {
  color: #5f7388;
  font-size: 0.88rem;
}

.stack-card p {
  margin-top: 0;
}

.stack-track {
  height: 18px;
  background: #e3edf8;
  border-radius: 999px;
  display: flex;
  overflow: hidden;
  margin: 0.45rem 0 0.6rem;
}

.stack {
  display: block;
  width: var(--w);
}

.stack--setup { background: #0f6ea9; }
.stack--reconnect { background: #4b1841; }

.legend {
  display: grid;
  gap: 0.3rem;
  color: #355069;
  font-size: 0.88rem;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.35rem;
}

.dot--setup { background: #0f6ea9; }
.dot--reconnect { background: #4b1841; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.95rem;
}

.project-card {
  border: 1px solid #d8e8f7;
  border-radius: 14px;
  padding: 0.9rem;
  background: #f9fcff;
}

.project-card h3 {
  margin: 0 0 0.25rem;
}

.project-card__tag {
  margin: 0 0 0.65rem;
  color: #4b5f74;
  font-size: 0.83rem;
  font-weight: 600;
}

.project-card ul {
  margin: 0;
  padding-left: 1rem;
  color: #2c445b;
}

.mini-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.mini-kpi-grid article {
  border: 1px solid #d7e6f6;
  border-radius: 10px;
  padding: 0.75rem;
  background: #fff;
}

.mini-kpi__label {
  margin: 0;
  color: #5a6d7f;
  font-size: 0.8rem;
}

.mini-kpi__value {
  margin: 0.3rem 0 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #10324b;
}

.references {
  margin: 0;
  padding-left: 1.1rem;
}

.references li {
  margin-bottom: 0.75rem;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.footer {
  width: min(1220px, calc(100% - 2rem));
  margin: 0 auto 1.2rem;
  color: #597086;
  font-size: 0.83rem;
  text-align: center;
}

@media (max-width: 1100px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .project-grid,
  .mini-kpi-grid,
  .split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .hero {
    width: calc(100% - 1rem);
    margin: 0.5rem auto;
    padding: 0.9rem 0.8rem 1.5rem;
  }

  .hero__topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions {
    margin-bottom: 0.85rem;
  }

  .action-btn {
    width: 100%;
  }

  .brand-logo {
    height: 48px;
    max-width: 100%;
  }

  .meta-list {
    flex-direction: column;
    gap: 0.35rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .container {
    width: calc(100% - 1rem);
  }

  .tab-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab-list label {
    font-size: 0.85rem;
    padding: 0.7rem 0.35rem;
  }

  .tab-panels {
    padding: 0.75rem;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

@media print {
  body {
    background: #fff;
  }

  .hero,
  .tabs,
  .footer {
    box-shadow: none;
    border: 1px solid #d7d7d7;
  }

  .no-print,
  .hero__actions {
    display: none !important;
  }

  .hero__glow {
    display: none;
  }

  .tab-list {
    display: none;
  }

  .tab-panel {
    display: block !important;
    page-break-inside: avoid;
    break-inside: avoid;
    margin-bottom: 1rem;
  }

  body.is-printing .tab-panel {
    display: block !important;
  }

  .tab-panel h2 {
    margin-top: 0;
  }
}
