:root {
  --bg: #f3f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #dbe4f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #16a34a;
  --success-dark: #15803d;
  --purple: #7c3aed;
  --purple-dark: #6d28d9;
  --yellow: #facc15;
  --yellow-dark: #eab308;
  --teal: #0d9488;
  --teal-dark: #0f766e;
  --slate: #64748b;
  --slate-dark: #475569;
  --dark: #0f172a;
  --dark-soft: #1e293b;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

textarea {
  resize: vertical;
}

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #172554 100%);
  color: #fff;
  padding: 28px 20px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar__brand h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.1;
}

.sidebar__brand p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.6;
}

.sidebar__menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 28px;
}

.menu-btn {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-align: left;
  padding: 14px 16px;
  border-radius: 14px;
  transition: 0.2s ease;
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}

.menu-btn.ativo {
  background: #ffffff;
  color: #0f172a;
  border-color: #ffffff;
  font-weight: 700;
}

.main-content {
  padding: 28px;
}

.topbar {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.topbar__tag {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.topbar h2 {
  margin: 12px 0 6px;
  font-size: 34px;
  line-height: 1.1;
}

.topbar p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.btn-voltar-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  background: #e0e7ff;
  color: #1f2937;
  font-weight: 700;
  transition: 0.2s ease;
  border: 1px solid var(--border);
}

.btn-voltar-home:hover {
  background: #c7d2fe;
  transform: translateY(-1px);
}

.aba-conteudo {
  display: none;
}

.aba-conteudo.ativo {
  display: block;
}

.painel-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 20px;
}

.resumo-card {
  border-radius: var(--radius-lg);
  padding: 22px;
  color: #fff;
  box-shadow: var(--shadow);
}

.resumo-card span {
  display: block;
  font-size: 14px;
  opacity: 0.92;
  margin-bottom: 10px;
}

.resumo-card strong {
  display: block;
  font-size: 34px;
  line-height: 1;
}

.resumo-card.azul {
  background: linear-gradient(135deg, var(--teal-dark), var(--teal));
}

.resumo-card.verde {
  background: linear-gradient(135deg, var(--success), var(--success-dark));
}

.resumo-card.roxo {
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
}

.resumo-card.amarelo {
  background: linear-gradient(135deg, var(--yellow), var(--yellow-dark));
  color: #1f2937;
}

.painel-grid,
.duas-colunas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card__header h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

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

.campo {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.campo label {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.campo input,
.campo select,
.campo textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.campo input:focus,
.campo select:focus,
.campo textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.campo--full {
  grid-column: 1 / -1;
}

.btn {
  border: none;
  border-radius: 14px;
  min-height: 46px;
  padding: 0 18px;
  font-weight: 700;
  transition: 0.2s ease;
}

.btn--primario {
  background: var(--primary);
  color: #fff;
}

.btn--primario:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.lista-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lista-item {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.lista-item h4 {
  margin: 0 0 8px;
  font-size: 17px;
}

.lista-item p {
  margin: 4px 0;
  color: var(--muted);
  line-height: 1.5;
}

.estado-vazio {
  background: var(--surface-soft);
  border: 1px dashed var(--border);
  border-radius: 16px;
  padding: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.mapa-sala {
  min-height: 180px;
}

.mapa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.mapa-carteira {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
}

.mapa-carteira strong {
  display: block;
  margin-bottom: 6px;
}

.mapa-carteira span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.acoes-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.btn-secundario,
.btn-perigo {
  border: none;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
}

.btn-secundario {
  background: #e0e7ff;
  color: #1f2937;
}

.btn-perigo {
  background: #fee2e2;
  color: #b91c1c;
}

.tabela-simples {
  width: 100%;
  border-collapse: collapse;
}

.tabela-simples th,
.tabela-simples td {
  border-bottom: 1px solid var(--border);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

.tabela-simples th {
  color: #334155;
  font-size: 14px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #e0e7ff;
  color: #3730a3;
}

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

  .sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sidebar__menu {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .painel-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  .main-content {
    padding: 18px 14px 24px;
  }

  .painel-grid,
  .duas-colunas,
  .form-grid,
  .sidebar__menu {
    grid-template-columns: 1fr;
  }

  .painel-cards {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn-voltar-home {
    width: 100%;
  }

  .topbar h2 {
    font-size: 28px;
  }

  .card {
    padding: 18px;
  }
}
