/* ───────────────────────────────────────────────────────────────
   BASE — tipografia, cores, layout e estados gerais.
   Produto para escritório de advocacia: sóbrio, legível, sem ruído.
   ─────────────────────────────────────────────────────────────── */

:root {
  --tinta: #16191d;
  --tinta-media: #4b5259;
  --tinta-fraca: #767d85;
  --papel: #ffffff;
  --fundo: #f4f4f1;
  --fundo-suave: #fafaf8;
  --linha: #e0e0da;
  --linha-forte: #cdcdc5;

  --acento: #1f4a58;
  --acento-claro: #eaf1f3;
  --acento-escuro: #16363f;

  --critico: #a52019;
  --critico-fundo: #fbeceb;
  --critico-linha: #e8c3c0;

  --alta: #1c5f3f;
  --alta-fundo: #e8f2ec;
  --media: #7a5300;
  --media-fundo: #f8f1e0;
  --baixa: #8a2c22;
  --baixa-fundo: #f7ebe9;

  --raio: 6px;
  --raio-grande: 10px;
  --sombra: 0 1px 2px rgba(22, 25, 29, 0.06), 0 4px 14px rgba(22, 25, 29, 0.05);
  --sombra-forte: 0 10px 40px rgba(22, 25, 29, 0.16);

  --largura-lateral: 296px;
  --altura-topo: 60px;

  --fonte: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --fonte-dados: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--fonte);
  font-size: 15px;
  line-height: 1.55;
  color: var(--tinta);
  background: var(--fundo);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

h1 { font-size: 19px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--acento);
  outline-offset: 2px;
}

/* ── Topo ─────────────────────────────────────────────────────── */

.topo {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--altura-topo);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  background: var(--papel);
  border-bottom: 1px solid var(--linha);
}

.marca {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.marca strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.marca span {
  font-size: 13px;
  color: var(--tinta-fraca);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.abas {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.aba {
  border: 1px solid transparent;
  background: transparent;
  color: var(--tinta-media);
  padding: 7px 14px;
  border-radius: var(--raio);
  font-size: 14px;
}

.aba:hover {
  background: var(--fundo);
  color: var(--tinta);
}

.aba[aria-selected="true"] {
  background: var(--acento-claro);
  border-color: #cfe0e4;
  color: var(--acento-escuro);
  font-weight: 500;
}

.identificacao {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 20px;
  border-left: 1px solid var(--linha);
  white-space: nowrap;
}

.identificacao .nome {
  font-size: 13px;
  font-weight: 500;
}

.identificacao .papel {
  font-size: 12px;
  color: var(--tinta-fraca);
}

.inicial {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--acento);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
}

.botao-gaveta {
  display: none;
  border: 1px solid var(--linha);
  background: var(--papel);
  border-radius: var(--raio);
  padding: 7px 12px;
  color: var(--tinta-media);
  font-size: 13px;
}

/* ── Estrutura ────────────────────────────────────────────────── */

.corpo {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - var(--altura-topo));
}

.lateral {
  width: var(--largura-lateral);
  flex: 0 0 var(--largura-lateral);
  background: var(--fundo-suave);
  border-right: 1px solid var(--linha);
  padding: 24px 20px 40px;
  overflow-y: auto;
  max-height: calc(100vh - var(--altura-topo));
  position: sticky;
  top: var(--altura-topo);
}

.principal {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.vista {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.vista[hidden] {
  display: none;
}

.faixa {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 28px 40px;
  width: 100%;
}

.faixa-larga {
  max-width: 1060px;
}

/* ── Barra lateral: blocos ────────────────────────────────────── */

.bloco-lateral + .bloco-lateral {
  margin-top: 32px;
}

.titulo-lateral {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}

.titulo-lateral h2 {
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--tinta-fraca);
  font-weight: 600;
}

.titulo-lateral .contagem {
  font-size: 12px;
  color: var(--tinta-fraca);
  font-variant-numeric: tabular-nums;
}

.item-lateral {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--papel);
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  padding: 12px 13px;
  margin-bottom: 8px;
  color: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.item-lateral:hover {
  border-color: var(--linha-forte);
  box-shadow: var(--sombra);
}

.item-lateral .numero {
  font-family: var(--fonte-dados);
  font-size: 11.5px;
  color: var(--tinta-fraca);
  letter-spacing: -0.02em;
}

.item-lateral .titulo {
  font-size: 13.5px;
  font-weight: 500;
  margin: 3px 0 4px;
  line-height: 1.35;
}

.item-lateral .apoio {
  font-size: 12px;
  color: var(--tinta-fraca);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.item-lateral.novo {
  border-left: 3px solid var(--acento);
}

.rodape-lateral {
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--linha);
  font-size: 12px;
  color: var(--tinta-fraca);
}

.rodape-lateral p {
  margin-bottom: 10px;
}

/* ── Botões ───────────────────────────────────────────────────── */

.botao {
  border: 1px solid var(--linha-forte);
  background: var(--papel);
  color: var(--tinta);
  padding: 9px 16px;
  border-radius: var(--raio);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.botao:hover {
  background: var(--fundo);
  border-color: var(--tinta-fraca);
}

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

.botao-primario {
  background: var(--acento);
  border-color: var(--acento);
  color: #fff;
}

.botao-primario:hover {
  background: var(--acento-escuro);
  border-color: var(--acento-escuro);
}

.botao-critico {
  background: var(--critico);
  border-color: var(--critico);
  color: #fff;
}

.botao-critico:hover {
  background: #8a1a14;
  border-color: #8a1a14;
}

.botao-discreto {
  border-color: transparent;
  background: transparent;
  color: var(--tinta-media);
  padding: 7px 10px;
}

.botao-discreto:hover {
  background: var(--fundo);
  border-color: var(--linha);
}

.botao-pequeno {
  font-size: 13px;
  padding: 6px 11px;
}

/* ── Utilitários ──────────────────────────────────────────────── */

.oculto {
  display: none !important;
}

.so-leitor {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.dado {
  font-family: var(--fonte-dados);
  font-size: 12.5px;
  letter-spacing: -0.02em;
}

.vazio {
  border: 1px dashed var(--linha-forte);
  border-radius: var(--raio);
  padding: 20px;
  color: var(--tinta-fraca);
  font-size: 13.5px;
  text-align: center;
}

/* ── Celular ──────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .botao-gaveta {
    display: block;
  }

  .marca span,
  .identificacao {
    display: none;
  }

  .abas {
    gap: 2px;
  }

  .aba {
    padding: 7px 10px;
    font-size: 13px;
  }

  .lateral {
    position: fixed;
    top: var(--altura-topo);
    left: 0;
    bottom: 0;
    z-index: 30;
    width: min(320px, 86vw);
    flex-basis: auto;
    max-height: none;
    transform: translateX(-102%);
    transition: transform 0.18s ease;
    box-shadow: var(--sombra-forte);
  }

  .lateral.aberta {
    transform: translateX(0);
  }

  .faixa {
    padding: 20px 16px 32px;
  }
}

@media (max-width: 560px) {
  .topo {
    padding: 0 12px;
    gap: 10px;
  }

  body {
    font-size: 14.5px;
  }
}
