:root {
  --color-bg: #f5f4f2;
  --color-card: #ffffff;
  --color-ink: #1a1a1a;
  --color-gray-500: #6b6b6b;
  --color-gray-300: #d8d6d2;
  --color-gray-100: #ececea;
  --color-red: #b23b3b;
  --color-green: #3a7a4e;
  --radius: 10px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-ink);
}

a { color: inherit; }

.topbar {
  background: var(--color-ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}
.topbar .marca { font-weight: 700; letter-spacing: 0.02em; text-decoration: none; color: #fff; }
.topbar nav { display: flex; align-items: center; gap: 1.25rem; font-size: 0.9375rem; }
.topbar nav a { text-decoration: none; opacity: 0.85; }
.topbar nav a:hover { opacity: 1; }
.topbar form { margin: 0; }
.topbar button.link-btn {
  background: none; border: none; color: #fff; opacity: 0.85; cursor: pointer; font: inherit; padding: 0;
}

.container { max-width: 1100px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }

.page-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-header h1 { font-size: 1.375rem; margin: 0; }

.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--color-ink); color: #fff; border: none;
  padding: 0.6rem 1.1rem; border-radius: var(--radius); font-size: 0.9375rem;
  text-decoration: none; cursor: pointer;
}
.btn:hover { opacity: 0.9; }
.btn-secondary { background: var(--color-gray-100); color: var(--color-ink); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8125rem; }

.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 1.25rem;
}

.list-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.item-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  text-decoration: none; color: inherit;
}
.item-title { font-weight: 600; margin: 0 0 0.2rem; }
.item-sub { color: var(--color-gray-500); font-size: 0.875rem; margin: 0; }
.item-progress { min-width: 140px; text-align: right; }

.progress-track { background: var(--color-gray-100); border-radius: 999px; height: 8px; overflow: hidden; }
.progress-fill { background: var(--color-ink); height: 100%; }
.progress-label { font-size: 0.8125rem; color: var(--color-gray-500); margin-top: 0.3rem; }

.status-badge {
  display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
}
.badge-green { background: #e5f0e8; color: var(--color-green); }
.badge-gray { background: var(--color-gray-100); color: var(--color-gray-500); }
.badge-blue { background: #e5edf5; color: #35597f; }
.badge-red { background: #f5e5e5; color: var(--color-red); }

.form-card { display: flex; flex-direction: column; gap: 1rem; max-width: 640px; }
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field-label { font-size: 0.8125rem; font-weight: 600; color: var(--color-gray-500); }
.field-input, .field-select, textarea.field-input {
  padding: 0.6rem 0.75rem; border: 1px solid var(--color-gray-300);
  border-radius: var(--radius); font-size: 0.9375rem; font-family: inherit; background: #fff;
}
.field-checkbox { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9375rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.text-sm { font-size: 0.8125rem; }
.text-gray-500 { color: var(--color-gray-500); }

.btn-submit {
  background: var(--color-ink); color: #fff; border: none;
  padding: 0.65rem 1.25rem; border-radius: var(--radius); font-size: 0.9375rem; cursor: pointer; align-self: flex-start;
}
.btn-delete {
  background: none; color: var(--color-red); border: 1px solid var(--color-red);
  padding: 0.5rem 1rem; border-radius: var(--radius); font-size: 0.875rem; cursor: pointer;
}
.btn-back {
  background: none; border: none; color: var(--color-gray-500); cursor: pointer; font-size: 0.875rem; padding: 0;
}
.error-banner {
  background: #f5e5e5; color: var(--color-red); padding: 0.75rem 1rem;
  border-radius: var(--radius); font-size: 0.9375rem; margin: 0 0 1rem;
}
.alert-banner { padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.9375rem; margin: 0 0 1rem; }
.alert-green { background: #e5f0e8; color: var(--color-green); }

.dashed-empty {
  border: 1px dashed var(--color-gray-300); border-radius: var(--radius-lg);
  padding: 2rem; text-align: center; color: var(--color-gray-500);
}

.tabela-progresso { width: 100%; border-collapse: collapse; }
.tabela-progresso th { text-align: left; font-size: 0.75rem; color: var(--color-gray-500); padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--color-gray-300); }
.tabela-progresso td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--color-gray-100); font-size: 0.9375rem; }
.tabela-progresso tr.linha-fase td { background: var(--color-gray-100); font-weight: 700; padding-top: 0.75rem; padding-bottom: 0.4rem; }
.tabela-progresso input[type="number"] { width: 70px; padding: 0.35rem 0.5rem; border: 1px solid var(--color-gray-300); border-radius: 6px; }

/* ── Login ── */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--color-ink); }
.auth-card { background: #fff; border-radius: var(--radius-lg); padding: 2.5rem; width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 1.25rem; margin: 0 0 1.5rem; text-align: center; }
.auth-error { color: var(--color-red); font-size: 0.875rem; margin: 0 0 1rem; }

/* ── Gantt (compartilhado com a página pública) ──────────────────────────
   Layout de 2 colunas: nomes fixos (não rolam) + trilha rolável horizontal
   com as barras. As duas colunas têm as MESMAS alturas de linha, pra ficar
   tudo alinhado. As linhas de "hoje"/"entrega prevista" são absolutas
   dentro da área de trilha inteira (atravessam todas as fases). */
.gantt-wrap { display: flex; border: 1px solid var(--color-gray-300); border-radius: var(--radius-lg); background: #fff; overflow: hidden; }
.gantt-col-nomes { flex-shrink: 0; width: 240px; border-right: 1px solid var(--color-gray-300); }
.gantt-col-scroll { flex: 1; overflow-x: auto; }
.gantt-timeline { position: relative; }

.gantt-row-fase { background: var(--color-gray-100); font-weight: 700; font-size: 0.875rem; padding: 0.6rem 1rem; display: flex; align-items: center; height: 38px; box-sizing: border-box; }
.gantt-row-tarefa { padding: 0 1rem; font-size: 0.8125rem; display: flex; align-items: center; height: 40px; box-sizing: border-box; border-top: 1px solid var(--color-gray-100); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-row-eixo { height: 28px; box-sizing: border-box; }

.gantt-track-fase { height: 38px; box-sizing: border-box; border-bottom: none; }
.gantt-track-tarefa { position: relative; height: 40px; box-sizing: border-box; border-top: 1px solid var(--color-gray-100); }
.gantt-eixo { position: relative; height: 28px; box-sizing: border-box; border-bottom: 1px solid var(--color-gray-300); font-size: 0.6875rem; color: var(--color-gray-500); }
.gantt-eixo span { position: absolute; top: 6px; white-space: nowrap; }

.gantt-bar { position: absolute; top: 9px; height: 22px; border: 1.5px solid var(--color-ink); border-radius: 6px; background: #fff; overflow: hidden; }
.gantt-bar-fill { height: 100%; background: var(--color-ink); }
.gantt-bar-link { position: absolute; inset: 0; }

.gantt-linha-hoje, .gantt-linha-entrega { position: absolute; top: 0; bottom: 0; width: 2px; z-index: 3; }
.gantt-linha-hoje { background: #2f6fb2; }
.gantt-linha-entrega { background: #c47f1f; }

.gantt-legenda { display: flex; gap: 1.25rem; padding: 0.75rem 1rem; font-size: 0.8125rem; color: var(--color-gray-500); border-top: 1px solid var(--color-gray-300); }
.gantt-legenda span { display: inline-flex; align-items: center; gap: 0.4rem; }
.gantt-legenda i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
