/* ── Navbar ─────────────────────────────────────────────────────────────── */
.topnav {
  border-bottom: 1px solid var(--pico-muted-border-color);
  padding-block: 0.6rem;
}

.nav-brand {
  text-decoration: none;
  color: inherit;
}

.nav-user {
  color: var(--pico-muted-color);
}

/* ── Flash messages ──────────────────────────────────────────────────────── */
.flash {
  padding: 0.75rem 1rem;
  border-radius: var(--pico-border-radius);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.flash-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

.flash-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-ativa      { background: #d1fae5; color: #065f46; }
.badge-pausada    { background: #fef3c7; color: #92400e; }
.badge-concluida  { background: #e5e7eb; color: #374151; }
.badge-pendente   { background: #dbeafe; color: #1e40af; }
.badge-em_andamento { background: #fef3c7; color: #92400e; }
.badge-inativa    { background: #fee2e2; color: #991b1b; }
.badge-admin      { background: #ede9fe; color: #4c1d95; }
.badge-engenheiro { background: #dbeafe; color: #1e40af; }

/* Badge clicável (toggle) */
.badge-btn {
  cursor: pointer;
  border: none;
  background: inherit;
  font-family: inherit;
}

/* ── Layout helpers ──────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.page-header h2,
.page-header h3 {
  margin-bottom: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 1rem;
}

.form-actions button,
.form-actions a {
  margin-bottom: 0;
}

/* ── Filter bar ──────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-bar select {
  margin-bottom: 0;
  width: auto;
  min-width: 160px;
}

.filter-bar button,
.filter-bar a[role="button"],
.filter-bar a {
  margin-bottom: 0;
}

/* ── Buttons (small) ─────────────────────────────────────────────────────── */
.btn-sm {
  padding: 0.3rem 0.65rem !important;
  font-size: 0.8rem !important;
}

/* ── Inline form (for delete/toggle buttons in tables) ───────────────────── */
.inline-form {
  display: inline;
  margin: 0;
  padding: 0;
}

.inline-form button {
  margin-bottom: 0;
}

/* ── Table tweaks ────────────────────────────────────────────────────────── */
.table-sm {
  font-size: 0.85rem;
}

.table-sm td,
.table-sm th {
  padding: 0.4rem 0.6rem;
}

.col-texto {
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions {
  white-space: nowrap;
}

.group-id {
  font-size: 0.8rem;
}

/* ── Obra info grid ──────────────────────────────────────────────────────── */
.obra-info {
  margin-bottom: 1rem;
}

.obra-info p {
  margin-bottom: 0.25rem;
}

.label {
  color: var(--pico-muted-color);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

/* ── Etapa card ──────────────────────────────────────────────────────────── */
.etapa-card {
  margin-bottom: 1.5rem;
}

.etapa-card header {
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}

.etapa-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.etapa-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.empty-tarefas {
  padding: 0.5rem 0;
}

/* ── Login ───────────────────────────────────────────────────────────────── */
.login-wrap {
  display: flex;
  justify-content: center;
  padding-top: 4rem;
}

.login-wrap article {
  width: 100%;
  max-width: 400px;
}

.login-wrap h2 {
  margin-bottom: 0.25rem;
}

/* ── Empty states ────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--pico-muted-color);
}

.empty-state p {
  margin-bottom: 1rem;
}

/* ── Misc ────────────────────────────────────────────────────────────────── */
.muted {
  color: var(--pico-muted-color);
}

.error-msg {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}
