:root {
  --bg: #eef2f0;
  --bg-soft: #f7f9f8;
  --panel: #ffffff;
  --panel-2: #fbfcfb;
  --ink: #17231f;
  --muted: #65736e;
  --line: #d9e2de;
  --line-strong: #c8d4cf;
  --brand: #1f3f82;
  --brand-dark: #122a5f;
  --brand-soft: #e8eef9;
  --gold: #f2c438;
  --gold-soft: #fff7d7;
  --blue: #0069b4;
  --blue-soft: #e4f1fb;
  --mage-red: #ef3e42;
  --mage-green: #009c4a;
  --violet: #5c5470;
  --violet-soft: #ece9f0;
  --danger: #a13d35;
  --danger-soft: #f8e8e6;
  --shadow: 0 18px 45px rgba(24, 43, 38, .10);
  --shadow-soft: 0 8px 22px rgba(24, 43, 38, .07);
  --radius: 8px;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Roboto, Arial, Helvetica, sans-serif;
  background:
    linear-gradient(180deg, rgba(21, 88, 77, .08), transparent 260px),
    var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

a { color: inherit; text-decoration: none; }

h1, h2 {
  margin: 0;
  letter-spacing: 0;
  color: var(--ink);
}

h1 {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 750;
}

h2 {
  font-size: 17px;
  margin-bottom: 16px;
  font-weight: 720;
}

p { color: var(--muted); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 276px;
  background:
    linear-gradient(180deg, #173b34 0%, #102a25 58%, #0c211d 100%);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 18px 0 45px rgba(8, 30, 26, .18);
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 16px;
  border-bottom: 1px solid rgba(255,255,255,.10);
}

.brand strong {
  display: block;
  max-width: 112px;
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: 0;
}

.brand small,
.userbox small {
  display: block;
  color: rgba(255,255,255,.68);
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.25;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #d8b56a, var(--gold));
  color: #18231f;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}

.brand-logo {
  width: 128px;
  max-height: 64px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-logo-wrap {
  width: 128px;
  min-width: 128px;
  display: flex;
  align-items: center;
}

.login-logo {
  width: 178px;
  max-height: 78px;
}

nav {
  display: grid;
  gap: 5px;
  overflow-y: auto;
  padding-right: 3px;
}

nav a {
  position: relative;
  border-radius: var(--radius);
  padding: 11px 12px 11px 14px;
  color: rgba(255,255,255,.84);
  font-weight: 620;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}

nav a strong {
  display: block;
  line-height: 1.2;
}

nav a small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

nav a:hover {
  background: rgba(255,255,255,.10);
  color: #fff;
  transform: translateX(2px);
}

nav a:hover small {
  color: var(--brand);
}

.userbox {
  margin-top: auto;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(255,255,255,.07);
  flex: 0 0 auto;
}

.content {
  margin-left: 276px;
  padding: 30px;
  max-width: 1540px;
}

.auth-content {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 32px;
  padding: 18px 0 2px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.site-footer strong {
  color: var(--ink);
  font-weight: 750;
}

.site-footer a {
  color: var(--brand-dark);
  font-weight: 700;
  white-space: nowrap;
}

.site-footer a::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 0 12px 2px 0;
  border-radius: 50%;
  background: var(--line-strong);
}

.site-footer a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.login-shell { width: min(430px, 92vw); }

.login-card {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  display: grid;
  gap: 18px;
  box-shadow: var(--shadow);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, var(--mage-red), var(--gold), var(--mage-green), var(--blue));
}

.login-brand {
  padding: 0 0 14px;
  border-bottom: 1px solid var(--line);
}

.login-brand small { color: var(--muted); }

.privacy-notice {
  max-height: 220px;
  overflow: auto;
  padding: 14px;
  border: 1px solid #cfd8d4;
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  background: #f8faf8;
}

.privacy-notice strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brand-dark);
  font-size: 13px;
  letter-spacing: .05em;
}

.privacy-notice p {
  margin: 0 0 8px;
  color: #3e4a46;
  font-size: 13px;
}

.privacy-notice p:last-child {
  margin-bottom: 0;
}

.privacy-check {
  display: flex;
  grid-template-columns: none;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 700;
}

.privacy-check input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 1px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 22px;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(217,226,222,.80);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.page-header p {
  margin: 8px 0 0;
  max-width: 720px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-soft);
}

.panel h2 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.narrow { max-width: 620px; }

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric {
  position: relative;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-height: 116px;
  box-shadow: var(--shadow-soft);
}

.metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--brand);
}

.metric:nth-child(4)::before,
.metric:nth-child(6)::before,
.metric:nth-child(7)::before {
  background: var(--gold);
}

.metric span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 720;
}

.metric strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  margin-top: 15px;
  color: var(--brand-dark);
}

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }

.filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.inline-form {
  display: grid;
  grid-template-columns: 1.2fr 2fr auto;
  gap: 10px;
  margin-bottom: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .035em;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 10px 11px;
  min-height: 40px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(21, 88, 77, .13);
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}

.check input {
  width: auto;
  min-height: auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 14px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(20, 35, 31, .04);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(24, 43, 38, .10);
  border-color: var(--brand);
}

.button.primary {
  background: linear-gradient(180deg, #28519b, var(--brand));
  border-color: var(--brand);
  color: #fff;
}

.button.ghost {
  background: rgba(255,255,255,.08);
  color: #fff;
  margin-top: 12px;
  border-color: rgba(255,255,255,.16);
}

.button.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.button.danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.button.icon {
  width: 40px;
  padding: 0;
  font-size: 20px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #fff;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: middle;
}

tr:last-child td { border-bottom: 0; }

tbody tr:hover { background: var(--bg-soft); }

th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--panel-2);
}

td input,
td select {
  min-width: 150px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.actions form { display: inline; }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 28px;
  background: var(--panel-2);
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.section-title h2 { margin: 0; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.pagination-status {
  color: var(--muted);
  font-weight: 700;
}

.button.disabled {
  opacity: .48;
  pointer-events: none;
  cursor: not-allowed;
}

.step-row {
  display: grid;
  grid-template-columns: 1.2fr 1.5fr .9fr auto;
  gap: 8px;
  margin-bottom: 8px;
  padding: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  gap: 10px;
  margin: 4px -30px -30px;
  padding: 14px 30px;
  background: rgba(238,242,240,.90);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.form-helper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  border-top-color: var(--brand);
}

.form-helper strong {
  margin-right: 8px;
  color: var(--brand-dark);
}

.form-helper span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 750;
}

.form-section {
  padding: 0;
  overflow: hidden;
}

.form-section summary {
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-areas:
    "num title"
    "num hint";
  gap: 2px 12px;
  align-items: center;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  background: #fff;
}

.form-section summary::-webkit-details-marker {
  display: none;
}

.form-section summary::after {
  content: "Abrir";
  grid-column: 2;
  justify-self: end;
  align-self: center;
  margin-top: -32px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.form-section[open] summary::after {
  content: "Recolher";
}

.form-section summary span {
  grid-area: num;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 850;
}

.form-section summary strong {
  grid-area: title;
  font-size: 17px;
  color: var(--ink);
}

.form-section summary small {
  grid-area: hint;
  color: var(--muted);
  font-size: 13px;
}

.form-section > .grid,
.form-section > #steps,
.form-section > .section-title {
  padding: 18px;
}

.form-section > .section-title {
  padding-bottom: 0;
}

.form-section[open] summary {
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.flow-tip {
  margin: 18px 18px 0;
  padding: 12px 14px;
  border: 1px solid #d8c38a;
  border-left: 5px solid var(--gold);
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: #604719;
  font-weight: 650;
}

.report {
  max-width: 1120px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: 0;
  margin: 0;
}

.detail-grid dt,
.detail-grid dd {
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
  margin: 0;
}

.detail-grid dt {
  color: var(--muted);
  font-weight: 760;
  padding-right: 18px;
}

.detail-grid dd {
  color: var(--ink);
}

.mermaid {
  display: flex;
  justify-content: center;
  overflow-x: auto;
  padding: 18px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.signature { display: none; }

.flash {
  position: fixed;
  right: 24px;
  top: 18px;
  z-index: 10;
  display: grid;
  gap: 8px;
}

.alert {
  padding: 12px 14px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.alert.error {
  border-color: #e3aaa4;
  background: var(--danger-soft);
}

.alert.success {
  border-color: #a7d2c7;
  background: var(--brand-soft);
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.print-title { display: none; }

@media (max-width: 1180px) {
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.four,
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  body { background: var(--bg); }
  .sidebar {
    position: static;
    width: auto;
    border-radius: 0 0 var(--radius) var(--radius);
  }
  .content {
    margin-left: 0;
    padding: 18px;
  }
  .metrics,
  .grid.two,
  .grid.three,
  .grid.four,
  .filters,
  .inline-form,
  .step-row {
    grid-template-columns: 1fr;
  }
  .page-header {
    flex-direction: column;
  }
  .form-actions {
    margin: 4px -18px -18px;
    padding: 12px 18px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-grid dt {
    border-bottom: 0;
    padding-bottom: 2px;
  }
  .detail-grid dd {
    padding-top: 0;
  }
}

@media print {
  body { background: #fff; }
  .no-print,
  .sidebar,
  .page-header.no-print {
    display: none !important;
  }
  .content {
    margin: 0;
    padding: 0;
    max-width: none;
  }
  .panel {
    border: 0;
    padding: 0;
    margin: 0 0 18px;
    box-shadow: none;
    break-inside: avoid;
  }
  .panel h2 {
    border-bottom: 1px solid #999;
  }
  .print-title,
  .signature {
    display: block;
  }
  .detail-grid dt,
  .detail-grid dd,
  th,
  td {
    border-color: #999;
  }
  .table-wrap,
  .mermaid {
    border-color: #999;
  }
  .button {
    display: none;
  }
}

/* Domain-specific institutional layer */
body {
  background:
    linear-gradient(180deg, rgba(13, 91, 78, .10), transparent 300px),
    linear-gradient(90deg, rgba(185, 139, 45, .08), transparent 420px),
    var(--bg);
}

.brand-mark {
  width: 48px;
  height: 48px;
}

.brand-mark span {
  display: block;
  font-size: 12px;
  line-height: 1;
  letter-spacing: .08em;
}

.sidebar-stamp {
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.10), rgba(255,255,255,.04)),
    rgba(255,255,255,.04);
}

.sidebar-stamp span {
  display: block;
  color: rgba(255,255,255,.58);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 800;
}

.sidebar-stamp strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

nav a {
  padding-left: 42px;
}

nav a::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 4px;
  background: rgba(255,255,255,.08);
}

nav a[data-nav="painel"]::before { border-radius: 50%; }
nav a[data-nav="inventario"]::before { box-shadow: inset 0 -5px 0 rgba(255,255,255,.20); }
nav a[data-nav="mapear"]::before { background: linear-gradient(90deg, rgba(255,255,255,.14) 45%, rgba(255,255,255,.48) 45%); }
nav a[data-nav="campos"]::before { box-shadow: inset 5px 0 0 rgba(255,255,255,.22); }
nav a[data-nav="auditoria"]::before { border-radius: 50% 50% 4px 4px; }
nav a[data-nav="sair"]::before {
  border-color: #dfb6b2;
  background: var(--danger-soft);
}

.role-pill {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(216,181,106,.16);
  border: 1px solid rgba(216,181,106,.30);
  color: #f3d899;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 16px;
  border: 1px solid rgba(217,226,222,.84);
  border-radius: var(--radius);
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow-soft);
}

.topbar-kicker,
.eyebrow {
  display: block;
  color: var(--brand);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 850;
}

.topbar strong {
  display: block;
  margin-top: 2px;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.topbar-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 750;
}

.logout-button {
  border-color: #d7b6b2;
  color: var(--danger);
}

.nav-logout {
  margin-top: 8px;
  color: var(--danger) !important;
}

.page-header {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255,255,255,.94), rgba(255,255,255,.72)),
    radial-gradient(circle at 96% 18%, rgba(185,139,45,.17), transparent 240px);
}

.page-header::after {
  content: "LGPD";
  position: absolute;
  right: 18px;
  bottom: -20px;
  color: rgba(13,91,78,.055);
  font-size: 88px;
  font-weight: 900;
  letter-spacing: .02em;
  pointer-events: none;
}

.page-header > * {
  position: relative;
  z-index: 1;
}

.compliance-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.quick-actions a {
  display: block;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 22px rgba(25, 44, 39, .06);
}

.quick-actions a:nth-child(2) {
  border-left-color: var(--gold);
}

.quick-actions a:nth-child(3) {
  border-left-color: var(--blue);
}

.quick-actions strong {
  display: block;
  color: var(--ink);
}

.quick-actions small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.compliance-strip article {
  position: relative;
  min-height: 112px;
  padding: 18px 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.compliance-strip article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--brand);
}

.compliance-strip article:nth-child(2)::before { background: var(--blue); }
.compliance-strip article:nth-child(3)::before { background: var(--gold); }

.compliance-strip span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.compliance-strip strong {
  display: block;
  margin-top: 7px;
  font-size: 20px;
  color: var(--ink);
}

.compliance-strip small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.metric-2::before { background: var(--blue); }
.metric-5::before { background: var(--violet); }
.metric-4 strong,
.metric-6 strong,
.metric-7 strong {
  color: #8a631f;
}
.metric-5 strong { color: var(--violet); }

.panel h2::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--brand);
}

tbody td:first-child {
  font-weight: 650;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.status-chip.ok {
  background: var(--brand-soft);
  border-color: #b7d7cf;
  color: var(--brand-dark);
}

.status-chip.warning {
  background: var(--gold-soft);
  border-color: #dfc58b;
  color: #71501a;
}

.status-chip.neutral {
  background: var(--blue-soft);
  border-color: #b8ccd9;
  color: #23495f;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.admin-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--brand);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 8px 22px rgba(25, 44, 39, .06);
}

.admin-card:hover {
  border-color: #b9d8d0;
  transform: translateY(-1px);
}

.admin-card span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
}

.admin-card strong {
  font-size: 18px;
}

.admin-card small {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1180px) {
  .compliance-strip { grid-template-columns: 1fr; }
  .admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-actions { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .admin-grid { grid-template-columns: 1fr; }
}

/* Official municipal registry theme */
body {
  background:
    linear-gradient(180deg, #f5f7f6 0, #edf1ee 360px),
    var(--bg);
}

.sidebar {
  background: #ffffff;
  color: var(--ink);
  border-right: 1px solid var(--line);
  box-shadow: 12px 0 30px rgba(25, 44, 39, .08);
}

.sidebar::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, var(--mage-red), var(--gold), var(--mage-green), var(--blue));
}

.brand {
  border-bottom-color: var(--line);
  align-items: center;
}

.brand small,
.userbox small {
  color: var(--muted);
}

.brand-mark {
  background: #fff;
  border: 2px solid var(--brand);
  color: var(--brand);
  box-shadow: none;
}

.sidebar-stamp {
  background: #f8faf8;
  border-color: var(--line);
}

.sidebar-stamp span {
  color: var(--muted);
}

nav a {
  color: #31413c;
  border: 1px solid transparent;
}

nav a::before {
  border-color: #b9c7c2;
  background: #eef4f2;
}

nav a:hover {
  background: var(--brand-soft);
  border-color: #c4ddd6;
  color: var(--brand-dark);
}

.userbox {
  background: #f8faf8;
  border-color: var(--line);
}

.role-pill {
  background: var(--gold-soft);
  border-color: #ddc68d;
  color: #6c4c16;
}

.button.ghost {
  background: #fff;
  color: var(--brand);
  border-color: #b8d3cc;
}

.topbar,
.page-header,
.panel,
.metric,
.compliance-strip article,
.login-card {
  box-shadow: 0 8px 22px rgba(25, 44, 39, .06);
}

.topbar {
  background: #ffffff;
  border-top: 4px solid var(--brand);
}

.page-header {
  background: #ffffff;
  border-top: 4px solid var(--gold);
}

.page-header::after {
  color: rgba(13,91,78,.035);
}

.panel {
  border-top: 3px solid #e6ece9;
}

.auth-content {
  background:
    linear-gradient(90deg, rgba(31,63,130,.10), transparent 42%),
    linear-gradient(180deg, #ffffff, #edf1ee);
}

.login-shell {
  width: min(760px, 94vw);
}

.login-card {
  grid-template-columns: 1fr 1fr;
  align-items: start;
}

.login-brand,
.privacy-notice,
.privacy-check,
.login-card .button,
.login-card .muted {
  grid-column: 1 / -1;
}

.login-card label:not(.privacy-check) {
  text-transform: none;
  letter-spacing: 0;
  color: #34433f;
  font-size: 13px;
}

@media (max-width: 760px) {
  .site-footer {
    flex-direction: column;
    gap: 5px;
    text-align: center;
  }

  .site-footer a::before {
    display: none;
  }

  .login-card {
    grid-template-columns: 1fr;
  }
}
