:root {
  --bg: #101418;
  --bg-2: #0f141b;
  --surface: #1d2025;
  --surface-2: #272a2f;
  --border: #414751;
  --text: #e0e2e9;
  --text-2: #c0c7d3;
  --primary: #4894e2;
  --ok: #6de19b;
  --warning: #ffe4a3;
  --danger: #ffb3b3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.content {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 0 20px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  white-space: nowrap;
}

.topbar-main {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.nav-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: #171d25;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.tab-button,
.zoom-button {
  border: 1px solid transparent;
  color: var(--text-2);
  background: transparent;
  cursor: pointer;
  font: inherit;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tab-button {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
}

.tab-button:hover,
.tab-button.is-active {
  color: var(--text);
  background: var(--surface-2);
  border-color: #536170;
}

.tab-panel[hidden] {
  display: none;
}

.badge {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--ok);
  background: #0d2a17;
  border: 1px solid #1f6f45;
  border-radius: 999px;
}

.badge.erro {
  color: var(--danger);
  background: #311313;
  border-color: #7f2a2a;
}

.badge.aguardando {
  color: var(--warning);
  background: #2f2612;
  border-color: #826326;
}

.main {
  padding: 16px;
}

.section-heading {
  margin: 18px 0 10px;
  font-size: 20px;
  font-weight: 600;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.details-grid {
  display: grid;
  grid-template-columns: 34% 64%;
  gap: 2%;
  margin-top: 16px;
}

.charts-grid {
  display: grid;
  grid-template-columns: 65% 34%;
  gap: 1%;
  margin-top: 10px;
}

.card,
.chart-card,
.table-wrapper,
.logs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.card {
  padding: 12px;
}

.chart-card {
  min-height: 380px;
  padding: 6px;
}

.chart-card--with-toolbar {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 4px;
}

.chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 6px 0;
}

.chart-toolbar-title {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.zoom-controls {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  background: #171d25;
  border: 1px solid var(--border);
  border-radius: 7px;
}

.zoom-button {
  min-width: 42px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 12px;
}

.zoom-button:hover,
.zoom-button.is-active {
  color: var(--text);
  background: var(--surface-2);
  border-color: #536170;
}

.zoom-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.table-wrapper {
  overflow: hidden;
}

.muted {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text-2);
}

.value {
  margin: 0;
  font-size: 24px;
}

.sub {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-2);
}

.progress-wrap {
  margin-top: 10px;
}

.progress-bg {
  width: 100%;
  height: 7px;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 999px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--primary);
}

.diagnostico {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-2);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-2);
  background: #182029;
}

.chart-inner {
  min-height: 320px;
}

.chart-frame {
  display: grid;
  gap: 8px;
  height: 100%;
}

.chart-title {
  margin: 4px 6px 0;
  font-size: 14px;
  color: var(--text-2);
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 16px;
  text-align: center;
  color: var(--text-2);
  background: #161b22;
  border: 1px dashed #38404a;
  border-radius: 8px;
}

.chart-svg {
  display: block;
  width: 100%;
  height: 240px;
  background: #161b22;
  border-radius: 8px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 0 6px 4px;
  font-size: 12px;
  color: var(--text-2);
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: 0 0 auto;
}

.chart-stack {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.panel-title {
  margin: 0 0 12px;
  font-size: 18px;
}

.section-title {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-title--spaced {
  margin-top: 12px;
}

.info-list {
  display: grid;
  gap: 8px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  font-size: 13px;
  border-bottom: 1px dashed #38404a;
}

.info-chave {
  color: var(--text-2);
}

.info-valor {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.logs {
  min-height: 150px;
  height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  white-space: pre-wrap;
  background: #0b0e13;
  color: #d8deea;
  font-family: Consolas, monospace;
  font-size: 12px;
}

.project-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.project-band {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.project-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #171d25;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
}

.project-callout {
  background: #101621;
  border-color: #38404a;
  border-top: 4px solid var(--primary);
}

.project-callout h3 {
  margin-bottom: 8px;
}

.project-callout p {
  margin: 0 0 10px;
  font-size: 12px;
}

.project-card {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.project-card h2,
.project-card h3 {
  margin: 0 0 10px;
}

.project-card p,
.project-card li {
  color: var(--text-2);
  line-height: 1.55;
}

.project-card p {
  margin: 0 0 10px;
}

.project-card ul,
.project-card ol {
  margin: 0;
  padding-left: 20px;
}

.project-card--hero {
  padding: 24px;
}

.project-card--guide {
  padding: 20px;
  background: linear-gradient(180deg, #101621 0%, #171d25 100%);
}

.project-card--feature,
.project-card--flow {
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.project-card--feature:hover,
.project-card--flow:hover {
  border-color: #5a6675;
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.project-card--flow {
  padding: 24px;
}

.project-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-card-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(192, 199, 211, 0.18);
}

.project-card-header h3 {
  margin: 0;
}

.project-guide-list {
  display: grid;
  gap: 10px;
}

.project-note {
  margin-top: 8px;
  padding: 12px;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
  background: #2a3038;
  border: 1px solid rgba(192, 199, 211, 0.14);
  border-radius: 8px;
}

.project-feature-list {
  display: grid;
  gap: 14px;
  padding-left: 0;
  list-style: none;
}

.project-feature-list li {
  padding-left: 14px;
  border-left: 2px solid rgba(159, 202, 255, 0.28);
}

.project-feature-list code {
  padding: 2px 6px;
  color: #ffb86e;
  background: #2a3038;
  border: 1px solid rgba(192, 199, 211, 0.14);
  border-radius: 6px;
  font-family: Consolas, monospace;
  font-size: 12px;
}

.project-tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-left: 0;
  list-style: none;
}

.project-tech-list li {
  padding: 10px 12px;
  color: var(--text);
  background: #272a2f;
  border: 1px solid rgba(192, 199, 211, 0.14);
  border-radius: 8px;
}

.read-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.flow-step {
  padding: 16px;
  background: #272a2f;
  border: 1px solid rgba(192, 199, 211, 0.14);
  border-radius: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.flow-step:hover {
  border-color: rgba(159, 202, 255, 0.32);
  transform: translateY(-2px);
}

.flow-step strong {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 13px;
}

.flow-step span {
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
}

.flow-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  color: var(--text);
  background: #171d25;
  border: 1px solid rgba(192, 199, 211, 0.14);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.flow-step--featured {
  border-color: rgba(72, 148, 226, 0.36);
  box-shadow: 0 0 0 1px rgba(72, 148, 226, 0.14);
}

.flow-step--featured .flow-step-number {
  color: #0f141b;
  background: var(--primary);
  border-color: rgba(72, 148, 226, 0.45);
}

@media (max-width: 1200px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .details-grid,
  .charts-grid,
  .project-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .project-hero {
    grid-template-columns: 1fr;
  }

  .read-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .topbar-main,
  .chart-toolbar {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-tabs,
  .zoom-controls {
    width: 100%;
  }

  .tab-button,
  .zoom-button {
    flex: 1;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .read-flow {
    grid-template-columns: 1fr;
  }
}
