* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f4f6f8;
  color: #1c2733;
  line-height: 1.5;
}
a { color: #1d5f8a; transition: color 0.15s ease; }

@keyframes surgir {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes crescerBarra {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
@keyframes girar {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px; flex-shrink: 0; background: #123049; color: #cfe3f2;
  display: flex; flex-direction: column; padding: 1rem 0;
}
.sidebar .marca {
  color: #fff; font-weight: 700; font-size: 1.05rem; padding: 0 1.2rem 1.2rem;
  text-decoration: none; display: block; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 0.8rem;
}
.sidebar nav { display: flex; flex-direction: column; gap: 0.15rem; }
.sidebar nav a {
  color: #cfe3f2; text-decoration: none; padding: 0.65rem 1.2rem; font-size: 0.95rem;
  display: flex; align-items: center; gap: 0.6rem; border-left: 3px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, padding-left 0.15s ease;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); padding-left: 1.4rem; }
.sidebar nav a.ativo { background: rgba(255,255,255,0.1); border-left-color: #4fb0e0; color: #fff; font-weight: 600; }

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

.topo {
  background: #fff; border-bottom: 1px solid #e6e9ec; padding: 0.7rem 1.2rem;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
}
.topo form { margin: 0; }
.topo button.sair {
  background: none; border: 1px solid #c3cfd8; color: #33414d;
  padding: 0.3rem 0.7rem; border-radius: 4px; cursor: pointer; font-size: 0.85rem;
}
.busca-topo { flex: 1; max-width: 360px; }
.busca-topo input {
  width: 100%; padding: 0.5rem 0.8rem; border: 1px solid #c3cfd8; border-radius: 20px;
  font-size: 0.9rem; font-family: inherit; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.busca-topo input:focus {
  outline: none; border-color: #4a90c2; box-shadow: 0 0 0 3px rgba(74,144,194,0.18);
}

.estrela {
  background: none; border: none; cursor: pointer; font-size: 1.05rem; padding: 0 0.3rem;
  opacity: 0.35; transition: opacity 0.15s ease, transform 0.15s ease; line-height: 1;
}
.estrela:hover { transform: scale(1.2); }
.estrela.ativa { opacity: 1; }

.container { max-width: 1600px; margin: 0 auto; padding: 1.2rem; width: 100%; animation: surgir 0.35s ease; }
.container.largo { max-width: none; }

@media (max-width: 720px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; padding: 0.6rem 0; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; padding: 0 0.6rem; }
  .sidebar .marca { border-bottom: none; margin-bottom: 0.4rem; padding-bottom: 0.4rem; }
}

.cartao {
  background: #fff;
  border-radius: 8px;
  padding: 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.cartao:hover { box-shadow: 0 6px 16px rgba(16,40,64,0.1); transform: translateY(-2px); }

.resumo { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.resumo .item {
  flex: 1; min-width: 190px;
  background: #fff; border-radius: 8px; padding: 1rem 1.2rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  display: flex; align-items: center; gap: 0.8rem;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.resumo .item:hover { box-shadow: 0 6px 16px rgba(16,40,64,0.12); transform: translateY(-2px); }
.resumo .item .icone {
  width: 42px; height: 42px; border-radius: 8px; background: #e8eef5;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0;
  transition: transform 0.2s ease;
}
.resumo .item:hover .icone { transform: scale(1.08) rotate(-4deg); }
.resumo .item .num { font-size: 1.35rem; font-weight: 700; color: #16324f; line-height: 1.2; }
.resumo .item .rotulo { font-size: 0.8rem; color: #5a6b7a; }

h1 { font-size: 1.4rem; margin-top: 0; }
h2 { font-size: 1.15rem; color: #16324f; }

.kanban-linha { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: 1rem; align-items: stretch; }
.kanban-coluna {
  background: #eef1f4; border-radius: 8px; padding: 0.8rem; min-width: 260px; max-width: 260px; flex-shrink: 0;
  transition: background 0.15s ease;
  display: flex; flex-direction: column; max-height: calc(100vh - 260px); min-height: 160px;
}
.kanban-coluna.sobre-drop { background: #d7e6f0; }
.kanban-coluna h3 {
  font-size: 0.78rem; text-transform: uppercase; color: #5a6b7a; margin: 0 0 0.7rem; flex-shrink: 0;
  display: flex; justify-content: space-between; align-items: center; letter-spacing: 0.02em;
}
.kanban-coluna h3 .contagem {
  background: #fff; border-radius: 10px; padding: 0.05rem 0.5rem; font-size: 0.75rem; color: #16324f;
}
.kanban-coluna-corpo { overflow-y: auto; flex: 1; min-height: 0; }
.kanban-cartao {
  background: #fff; border-radius: 6px; padding: 0.7rem; margin-bottom: 0.6rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08); cursor: grab; transition: box-shadow 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
  color: #fff;
}
.kanban-cartao:hover { box-shadow: 0 4px 10px rgba(0,0,0,0.22); transform: translateY(-1px); }
.kanban-cartao:active { cursor: grabbing; }
.kanban-cartao.arrastando { opacity: 0.35; }
.kanban-cartao .nome { font-weight: 600; font-size: 0.9rem; color: #fff; display: block; text-decoration: none; }
.kanban-cartao .nome:hover { text-decoration: underline; }
.kanban-cartao .tipo { font-size: 0.8rem; color: rgba(255,255,255,0.88); margin-top: 0.15rem; }
.kanban-cartao .detalhe-linha { color: rgba(255,255,255,0.75); }
.kanban-cartao .prazo {
  font-size: 0.75rem; margin-top: 0.5rem; display: inline-block;
  background: #fff; color: #33414d; padding: 0.15rem 0.55rem; border-radius: 10px; font-weight: 600;
}
.kanban-cartao .prazo.prazo-vencido { color: #b3261e; }
.kanban-cartao .prazo.prazo-perto { color: #a15c00; }
.kanban-vazio { font-size: 0.8rem; color: #9aa7b0; text-align: center; padding: 1rem 0; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.55rem 0.4rem; border-bottom: 1px solid #e6e9ec; font-size: 0.92rem; }
th { color: #5a6b7a; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: #f8fafb; }

.tabela-scroll { overflow-x: auto; }
.detalhe-linha { font-size: 0.74rem; color: #7c8a96; margin-top: 0.2rem; line-height: 1.3; }

.timeline { position: relative; padding-left: 1.6rem; margin-top: 0.5rem; }
.timeline::before { content: ''; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 2px; background: #dbe2e8; }
.timeline .entrada { position: relative; padding-bottom: 1.3rem; }
.timeline .entrada:last-child { padding-bottom: 0; }
.timeline .entrada::before {
  content: ''; position: absolute; left: -1.6rem; top: 3px;
  width: 10px; height: 10px; border-radius: 50%; background: #16324f;
}
.timeline .entrada .data { font-size: 0.78rem; color: #7c8a96; }
.timeline .entrada .etapa { font-weight: 600; color: #1c2733; }
.timeline .entrada .obs { font-size: 0.85rem; color: #5a6b7a; margin-top: 0.1rem; }

.grafico-barras { display: flex; align-items: flex-end; gap: 0.5rem; height: 140px; margin-top: 0.8rem; }
.grafico-barras .coluna { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.grafico-barras .barra {
  width: 100%; max-width: 26px; background: #4a90c2; border-radius: 3px 3px 0 0;
  min-height: 2px; transform-origin: bottom; animation: crescerBarra 0.6s ease;
  transition: background 0.15s ease;
}
.grafico-barras .coluna:hover .barra { background: #16324f; }
.grafico-barras .coluna .valor { font-size: 0.72rem; color: #5a6b7a; margin-bottom: 0.2rem; }
.grafico-barras .coluna .rotulo { font-size: 0.68rem; color: #7c8a96; margin-top: 0.35rem; writing-mode: vertical-rl; transform: rotate(180deg); height: 42px; }

.badge {
  display: inline-block; padding: 0.2rem 0.55rem; border-radius: 12px;
  font-size: 0.78rem; font-weight: 600; transition: transform 0.15s ease;
}
tr:hover .badge { transform: scale(1.05); }
.badge.judicial { background: #e8eef5; color: #16324f; }
.badge.administrativo { background: #eaf3ec; color: #2f6b3a; }
.badge.pago { background: #eaf3ec; color: #2f6b3a; }
.badge.pendente { background: #fcefe0; color: #a15c00; }

.valor-cifra { display: inline-flex; align-items: center; gap: 0.4rem; }
.valor-cifra .texto { font-variant-numeric: tabular-nums; }
.valor-cifra .olho {
  background: none; border: none; cursor: pointer; font-size: 0.95rem;
  padding: 0; line-height: 1; opacity: 0.55; transition: opacity 0.15s ease, transform 0.15s ease;
}
.valor-cifra .olho:hover { opacity: 1; transform: scale(1.15); }
.prazo-vencido { color: #b3261e; font-weight: 700; }
.prazo-perto { color: #a15c00; font-weight: 700; }

.botao {
  display: inline-block; background: #16324f; color: #fff; border: none;
  padding: 0.55rem 1rem; border-radius: 6px; cursor: pointer; text-decoration: none; font-size: 0.95rem;
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.botao:hover { background: #0f2438; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(16,40,64,0.25); }
.botao:active { transform: translateY(0) scale(0.97); box-shadow: none; }
.botao.secundario { background: #fff; color: #16324f; border: 1px solid #c3cfd8; }
.botao.secundario:hover { background: #f4f7f9; box-shadow: 0 4px 10px rgba(16,40,64,0.1); }
.botao.perigo { background: #fff; color: #b3261e; border: 1px solid #e5b9b5; }
.botao.perigo:hover { background: #fdecea; box-shadow: 0 4px 10px rgba(179,38,30,0.12); }
.botao.pequeno { padding: 0.3rem 0.65rem; font-size: 0.82rem; }
.botao.verde { background: #2f9e44; }
.botao.verde:hover { background: #26833a; box-shadow: 0 4px 10px rgba(47,158,68,0.3); }
.botao[disabled] { opacity: 0.65; cursor: default; transform: none !important; box-shadow: none !important; }

.acoes { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }

form .campo { margin-bottom: 0.9rem; }
form label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-size: 0.9rem; color: #33414d; }
form input[type=text], form input[type=date], form input[type=number], form input[type=email], form input[type=password],
form select, form textarea {
  width: 100%; padding: 0.55rem; border: 1px solid #c3cfd8; border-radius: 6px; font-size: 0.95rem;
  font-family: inherit; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
form input:focus, form select:focus, form textarea:focus {
  outline: none; border-color: #4a90c2; box-shadow: 0 0 0 3px rgba(74,144,194,0.18);
}
form textarea { min-height: 70px; }
.linha-form { display: flex; gap: 1rem; flex-wrap: wrap; }
.linha-form .campo { flex: 1; min-width: 200px; }

.erro { background: #fdecea; color: #b3261e; padding: 0.7rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
.vazio { color: #7c8a96; text-align: center; padding: 2rem 0; }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.login-caixa { background: #fff; padding: 2rem; border-radius: 10px; width: 100%; max-width: 380px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); animation: surgir 0.4s ease; }
.login-caixa h1 { text-align: center; color: #16324f; }
.login-caixa .sub { text-align: center; color: #7c8a96; margin-top: -0.8rem; margin-bottom: 1.2rem; font-size: 0.9rem; }
.login-caixa .botao { width: 100%; text-align: center; }

.campo-senha-wrap { position: relative; }
.campo-senha-wrap .alternar {
  position: absolute; right: 0.5rem; top: 0.5rem; background: none; border: none; color: #5a6b7a; cursor: pointer; font-size: 0.8rem;
}

@media (max-width: 600px) {
  th, td { font-size: 0.85rem; }
}
