:root {
  --brand: #763944;
  --brand-dark: #542730;
  --ink: #241d1f;
  --muted: #746b6d;
  --paper: #ffffff;
  --surface: #f7f3f4;
  --line: #e6dddf;
  --success: #1f7a4d;
}

* { box-sizing: border-box; }

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

.topbar {
  min-height: 82px;
  padding: 16px clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.logo { width: 205px; height: auto; }
.identity { display: grid; text-align: right; font-size: 13px; gap: 3px; }
.logout { padding: 0; color: var(--brand); background: transparent; justify-self: end; font-size: 12px; }
.identity span, .muted { color: var(--muted); }

.container { width: min(1180px, calc(100% - 40px)); margin: 42px auto; }
.heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; }
.eyebrow { color: var(--brand); font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-size: 12px; }
h1 { margin: 4px 0 8px; font-size: clamp(30px, 5vw, 46px); }
.subtitle { color: var(--muted); margin: 0; }

button, .button {
  border: 0;
  border-radius: 10px;
  padding: 13px 18px;
  background: var(--brand);
  color: white;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:disabled { opacity: .55; }

.notice {
  margin: 28px 0 18px;
  padding: 14px 16px;
  background: #fff6dd;
  border: 1px solid #edda9d;
  border-radius: 10px;
  color: #684f13;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 220px auto;
  gap: 14px;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
}

label { display: grid; gap: 7px; font-size: 13px; font-weight: 700; }
input, select {
  min-height: 44px;
  border: 1px solid #cfc4c6;
  border-radius: 9px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.card-list { display: grid; gap: 12px; margin-top: 18px; }
.card-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr 1.2fr 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 5px 20px rgba(57, 29, 35, .04);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
.card-row:hover { border-color: var(--brand); transform: translateY(-1px); }
.card-row > div { display: grid; gap: 4px; }
.card-row strong { font-size: 14px; }
.muted { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.status { padding: 7px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status-ativo { color: var(--success); background: #e7f6ee; }
.status-inativo { color: #7b3434; background: #f9e8e8; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #f8f3f4, #eadcdf); }
.login-card { width: min(460px, 100%); padding: 42px; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 70px rgba(61, 28, 35, .14); }
.login-logo { width: 230px; max-width: 100%; margin-bottom: 30px; }
.login-card .button, .login-card > button { width: 100%; margin-top: 28px; min-height: 48px; }
.dev-login { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.dev-login > span { color: var(--muted); font-size: 12px; text-align: center; }
.dev-login button { width: 100%; min-height: 44px; }
.empty-state { padding: 40px; display: grid; gap: 6px; text-align: center; background: white; border: 1px dashed #cfc4c6; border-radius: 14px; }
.narrow { max-width: 920px; }
.back { color: var(--brand); font-weight: 700; text-decoration: none; }
.page-title { margin-top: 24px; }
.form-card, .detail-card, .audit-card { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 26px; }
.form-grid, .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.full { grid-column: 1 / -1; }
textarea { resize: vertical; padding-top: 12px; }
.field-error { color: #a22d36; font-size: 12px; }
.form-error { grid-column: 1 / -1; padding: 12px; color: #8b2430; background: #fbeaed; border-radius: 9px; }
.form-hint { margin: 16px 0 0; color: var(--muted); font-size: 12px; }
.actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 26px; }
.secondary { color: var(--brand); background: #f3e9eb; }
.detail-heading { display: flex; align-items: end; justify-content: space-between; margin: 24px 0; gap: 20px; }
.detail-grid { margin: 0; }
.detail-grid div { display: grid; gap: 5px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
dd { margin: 0; font-weight: 700; }
.sensitive-placeholder { margin-top: 16px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sensitive-placeholder div { display: grid; gap: 4px; }
.sensitive-placeholder span { color: var(--muted); font-size: 12px; }
.audit-card { margin-top: 18px; }
.audit-card h2 { margin-top: 0; }
.audit-row { display: grid; grid-template-columns: 1fr 1.5fr auto; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.audit-meta { margin-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }

@media (max-width: 900px) {
  .identity { display: none; }
  .heading { align-items: start; flex-direction: column; }
  .filters { grid-template-columns: 1fr; }
  .card-row { grid-template-columns: 1fr 1fr; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  .detail-heading { align-items: start; flex-direction: column; }
  .audit-row { grid-template-columns: 1fr; }
  .status { justify-self: start; }
}
