:root {
  /* Paleta profissional */
  --bg: #0b1220;
  --card: #0f172a;
  --card-2: #111827;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --line: #1f2937;
  --primary: #2563eb;
  --primary-700: #1d4ed8;
  --accent: #22d3ee;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

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

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px;
}

.header .brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

h1 {
  font-size: 1.45rem;
  margin: 0;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }

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

fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

legend {
  font-weight: bold;
  font-size: 1.2em;
  margin-bottom: 0.5em;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01) 60%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px 18px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-sub {
  margin-top: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px 12px 4px;
  background: rgba(255, 255, 255, 0.02);
}

.is-hidden {
  display: none;
}

.switch {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
}

.switch input {
  accent-color: var(--primary);
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 8px;
}

h3 {
  font-size: 1rem;
  margin: 0 0 8px;
  color: var(--muted);
}

label {
  display: block;
  margin: 8px 0 6px;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}

input,
select,
button {
  width: 100%;
  background: #0b1220;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.97rem;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.row {
  margin-bottom: 12px;
}

.row.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .row.two {
    grid-template-columns: 1fr;
  }

  .row.two > div {
    margin-bottom: 12px;
  }

  .container {
    padding: 12px;
  }

  .card {
    padding: 14px;
  }

  input,
  select,
  button {
    font-size: 1rem;
    padding: 12px;
  }

  label {
    font-size: 0.95rem;
    margin-bottom: 6px;
  }

  .btn {
    width: 100%;
    font-size: 1rem;
    padding: 12px;
  }

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

  .metric {
    padding: 10px;
  }

  .table-wrap {
    overflow-x: auto;
  }

  table {
    min-width: 600px;
    font-size: 0.9rem;
  }

  .note {
    font-size: 0.8rem;
    line-height: 1.4;
  }
}

.btn {
  background: linear-gradient(90deg, var(--primary), var(--primary-700));
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 4px;
}

.btn:hover {
  filter: brightness(1.05);
}

.note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 8px 0 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.metric {
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}

.metric .label {
  color: var(--muted);
  font-size: 0.82rem;
}

.metric .value {
  font-weight: 800;
  font-size: 1.1rem;
  margin-top: 3px;
  color: #fff;
}

.chart-wrap {
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 12px;
}

.table-wrap {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #0b1220;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

thead th {
  background: #0f172a;
  color: #cbd5e1;
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

tbody td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

tbody {
  display: block;
  max-height: 420px;
  overflow: auto;
}

thead,
tbody tr {
  display: table;
  width: 100%;
  table-layout: fixed;
}

.footer {
  text-align: center;
  color: var(--muted);
  margin: 16px 0 10px;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}
