:root {
  --bg: #f5f7fb;
  --nav: #142337;
  --nav-border: #25384f;
  --surface: #ffffff;
  --text: #1f2a37;
  --muted: #667085;
  --border: #d8dee8;
  --border-strong: #c5cfdd;
  --green: #2fb344;
  --green-dark: #25963a;
  --gray: #6b7280;
  --shadow: 0 2px 7px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

body.modal-open {
  overflow: hidden;
}

.honeypot {
  display: none;
}

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

.app-header {
  min-height: 68px;
  background: var(--nav);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 24px;
  border-bottom: 1px solid var(--nav-border);
}

.brand {
  display: flex;
  align-items: center;
  width: 210px;
}

.brand img {
  display: block;
  width: 170px;
  height: auto;
}

.top-user-menu {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
}

.user-menu-trigger {
  display: grid;
  justify-items: center;
  gap: 3px;
}

.user-menu-button {
  position: relative;
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.top-user-name {
  display: block;
  max-width: 150px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-button svg,
.user-menu-item svg,
.modal-close-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.user-menu-button:hover,
.user-menu-button[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.46);
}

.user-menu-button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.26);
  outline-offset: 2px;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--nav);
  border-radius: 999px;
  background: #d63939;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 0 5px;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 40;
  width: 280px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 18px 38px rgba(16, 24, 40, 0.18);
  overflow: hidden;
}

.user-menu-profile {
  display: grid;
  gap: 2px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid #eef2f7;
  background: #f8fafc;
}

.user-menu-profile strong {
  font-size: 14px;
  line-height: 1.25;
}

.user-menu-profile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.user-menu-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
  color: #344054;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 12px 14px;
  text-align: left;
}

.user-menu-item span {
  flex: 1 1 auto;
}

.menu-notification {
  display: inline-flex;
  min-width: 22px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #fff1f1;
  color: #b42318;
  font-size: 12px;
  font-weight: 900;
  padding: 2px 7px;
}

.user-menu-item:last-child {
  border-bottom: 0;
}

.user-menu-item:hover {
  background: #f3f7fb;
  color: #3268b1;
}

.user-menu-item.danger {
  color: #b42318;
}

.user-menu-item.danger:hover {
  background: #fff1f1;
}

.page-shell {
  width: min(1220px, calc(100% - 48px));
  margin: 24px auto 0;
}

.management-shell {
  width: min(1880px, calc(100% - 24px));
}

.page-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 18px;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 650;
}

.form-card {
  background: var(--surface);
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

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

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: #344054;
  font-weight: 600;
}

.group-options {
  border: 0;
  margin: 0;
  padding: 0;
}

.group-options legend {
  padding: 0;
}

.field b {
  color: #d63939;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: #fff;
  color: #1f2937;
  font: inherit;
  font-weight: 400;
  padding: 8px 12px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.field select {
  appearance: auto;
}

.field textarea {
  min-height: 56px;
  resize: vertical;
}

.field select[multiple] {
  min-height: 78px;
}

.field input::placeholder {
  color: #a3aab7;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #69a6e9;
  box-shadow: 0 0 0 3px rgba(50, 104, 177, 0.12);
}

.field input.is-invalid {
  border-color: #d63939;
  box-shadow: 0 0 0 3px rgba(214, 57, 57, 0.12);
}

.field-error {
  height: 16px;
  color: #d63939;
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
}

.field select:disabled {
  color: #9aa3b2;
  background: #f8fafc;
}

.input-icon {
  position: relative;
  display: block;
}

.input-icon input {
  padding-right: 40px;
}

.input-icon span {
  position: absolute;
  right: 12px;
  top: 50%;
  translate: 0 -50%;
  color: #20a875;
  font-size: 15px;
}

.full-width {
  grid-column: 1 / -1;
}

.hidden {
  display: none !important;
}

.single-column {
  grid-template-columns: 1fr;
}

.profile-options {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 10px 110px;
  min-height: 38px;
  align-items: center;
  justify-content: start;
}

.profile-option {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 28px;
  color: #344054;
  font-weight: 400;
}

.profile-option input {
  appearance: none;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  display: inline-grid;
  place-content: center;
  background: #fff;
  border: 1px solid #d8dee8;
  border-radius: 50%;
  cursor: pointer;
}

.profile-option input::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 120ms ease;
  background: var(--green);
}

.profile-option input:checked {
  border-color: var(--green);
}

.profile-option input:checked::before {
  transform: scale(1);
}

.profile-option input:focus-visible {
  outline: 3px solid rgba(47, 179, 68, 0.2);
  outline-offset: 2px;
}

.empty-options {
  color: #9aa3b2;
  font-weight: 400;
}

.form-feedback {
  min-height: 20px;
  margin: 16px 0 0;
  color: var(--green-dark);
  font-weight: 600;
}

.form-feedback.error {
  color: #d63939;
}

.actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 16px 0 44px;
}

.btn {
  border: 0;
  border-radius: 8px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn.primary {
  background: var(--green);
}

.btn.primary:hover {
  background: var(--green-dark);
}

.btn.secondary {
  background: #475467;
}

.btn.secondary:hover {
  background: #344054;
}

.btn.excel-button {
  background: #1f8f3a;
}

.btn.excel-button:hover {
  background: #187430;
}

.btn.excel-button .btn-icon {
  width: 16px;
  height: 16px;
}

.btn.danger {
  background: #d63939;
}

.btn.danger:hover {
  background: #b42318;
}

.btn.ghost {
  border: 1px solid var(--border);
  background: #fff;
  color: #344054;
}

.btn.ghost:hover {
  background: #f3f7fb;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.72;
}

.btn-icon {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
}

.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  margin: 20px 0 16px;
  color: #53606f;
  background: transparent;
  font-size: 14px;
}

.app-footer img {
  height: 28px;
  width: auto;
}

.app-footer a {
  color: #3268b1;
}

.management-shell h2 {
  margin: 0 0 16px;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 650;
}

.auth-grid {
  display: grid;
  grid-template-columns: minmax(320px, 520px);
  gap: 18px;
  align-items: start;
  justify-content: center;
}

.auth-grid.register-open {
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr);
  justify-content: stretch;
}

.form-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.compact-actions {
  margin: 14px 0 0;
}

.login-actions {
  flex-wrap: wrap;
}

.text-button {
  border: 0;
  background: transparent;
  color: #3268b1;
  font: inherit;
  font-weight: 700;
  min-height: 36px;
  padding: 7px 0;
  cursor: pointer;
}

.text-button:hover {
  color: #244f88;
  text-decoration: underline;
}

.terms-field {
  border: 0;
  margin: 0;
  padding: 0;
}

.terms-field legend {
  padding: 0;
}

.terms-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  background: #f8fafc;
  padding: 12px;
  font-weight: 400;
  color: #344054;
}

.terms-box p {
  margin: 0;
}

.terms-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.terms-check input {
  width: 16px;
  min-height: 16px;
  height: 16px;
  margin: 0;
}

.dashboard-card,
.management-panel {
  margin-bottom: 18px;
}

.management-feedback {
  margin: 8px 0 10px;
}

.management-feedback:empty {
  display: none;
}

.dashboard-head,
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.dashboard-actions,
.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #d7e0ec;
  border-radius: 8px;
  background: #fff;
  color: #3268b1;
  cursor: pointer;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.icon-button:hover,
.icon-button[aria-pressed="true"] {
  border-color: rgba(47, 179, 68, 0.4);
  background: #e8f7ec;
  color: var(--green-dark);
}

.icon-button:focus-visible {
  outline: 3px solid rgba(50, 104, 177, 0.16);
  outline-offset: 2px;
}

.muted-line {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #eef4ff;
  color: #3268b1;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status-badge.aprovado {
  background: #e8f7ec;
  color: var(--green-dark);
}

.status-badge.pendente {
  background: #fff6df;
  color: #926d00;
}

.status-badge.rejeitado {
  background: #fff1f1;
  color: #b42318;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 22px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  max-height: min(820px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.26);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.user-management-modal {
  width: min(1040px, 100%);
}

.details-modal {
  width: min(780px, 100%);
  grid-template-rows: auto minmax(0, 1fr);
}

.nested-modal {
  z-index: 80;
}

.nested-modal .modal-backdrop {
  background: rgba(15, 23, 42, 0.28);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 22px 14px;
  border-bottom: 1px solid #edf1f6;
}

.modal-head h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.modal-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #344054;
  cursor: pointer;
}

.modal-close-button:hover {
  background: #f3f7fb;
  color: #1f2937;
}

.users-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 22px 12px;
}

.user-stat {
  display: grid;
  gap: 6px;
  min-height: 76px;
  border: 1px solid #dfe6f0;
  border-radius: 8px;
  background: #fbfcff;
  color: #344054;
  cursor: pointer;
  padding: 12px;
  text-align: left;
}

.user-stat span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.user-stat strong {
  font-size: 26px;
  line-height: 1;
}

.user-stat.active {
  border-color: rgba(50, 104, 177, 0.42);
  background: #eef4ff;
  color: #245a9c;
}

.user-stat.pending.active,
.user-stat.pending:hover {
  border-color: #e8d39b;
  background: #fff8e7;
  color: #926d00;
}

.user-stat.approved.active,
.user-stat.approved:hover {
  border-color: rgba(47, 179, 68, 0.4);
  background: #e8f7ec;
  color: var(--green-dark);
}

.user-stat.rejected.active,
.user-stat.rejected:hover {
  border-color: #f0b4b4;
  background: #fff1f1;
  color: #b42318;
}

.modal-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  padding: 0 22px 16px;
}

.modal-toolbar .btn {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 14px;
}

.modal-search {
  display: grid;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  color: #344054;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.modal-search input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  text-transform: none;
  outline: none;
}

.modal-search input:focus {
  border-color: #69a6e9;
  box-shadow: 0 0 0 3px rgba(50, 104, 177, 0.12);
}

.modal-table-wrap {
  margin: 0 22px 22px;
  max-height: min(460px, calc(100vh - 360px));
  overflow: auto;
}

.table-search {
  min-height: 36px;
  width: min(260px, 100%);
  border: 1px solid var(--border);
  border-radius: 0;
  background: #fff;
  color: #1f2937;
  font: inherit;
  padding: 8px 12px;
  outline: none;
}

.records-workflow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin: 4px 0 14px;
  flex-wrap: wrap;
}

.records-summary,
.records-filter,
.records-location-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.records-location-filters {
  flex: 1 1 360px;
  justify-content: center;
}

.records-filter-field {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.records-filter-field span {
  color: #475467;
  font-size: 11px;
  font-weight: 800;
}

.records-filter-field select {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: #1f2937;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 30px 6px 10px;
  outline: none;
}

.records-filter-field select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 179, 68, 0.14);
}

.filter-clear-button {
  align-self: end;
  min-height: 34px;
  border: 1px solid #d6dce7;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 11px;
  cursor: pointer;
}

.filter-clear-button:hover,
.filter-clear-button:focus-visible {
  border-color: var(--green);
  color: var(--green-dark);
}

.filter-clear-button.compact {
  align-self: center;
  min-height: 30px;
}

.table-empty-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  color: #475467;
}

.table-empty-state strong {
  color: #1f2937;
}

.records-summary span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  border: 1px solid #e1e6ef;
  background: #f8fafc;
  color: #344054;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.records-summary strong,
.filter-chip strong {
  font-size: 13px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #344054;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 11px;
  cursor: pointer;
}

.filter-chip.active {
  border-color: var(--green);
  background: #e8f7ec;
  color: var(--green-dark);
}

.filter-chip:focus-visible {
  outline: 3px solid rgba(47, 179, 68, 0.2);
  outline-offset: 2px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e1e6ef;
}

.records-table-wrap {
  max-height: calc(100vh - 258px);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
}

.data-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  background: #fff;
}

.user-requests-table {
  min-width: 1690px;
  table-layout: fixed;
}

.user-requests-table .col-date { width: 110px; }
.user-requests-table .col-name { width: 150px; }
.user-requests-table .col-cpf { width: 104px; }
.user-requests-table .col-email { width: 190px; }
.user-requests-table .col-phone { width: 120px; }
.user-requests-table .col-org { width: 150px; }
.user-requests-table .col-role { width: 115px; }
.user-requests-table .col-sector { width: 110px; }
.user-requests-table .col-regional { width: 125px; }
.user-requests-table .col-city { width: 120px; }
.user-requests-table .col-profile-type { width: 88px; }
.user-requests-table .col-access-profile { width: 150px; }
.user-requests-table .col-admin { width: 94px; }
.user-requests-table .col-invite { width: 64px; }

.admin-requests-table {
  min-width: 1640px;
}

.user-management-table {
  min-width: 800px;
  table-layout: fixed;
}

.user-management-table .user-col-admin { width: 124px; }
.user-management-table .user-col-name { width: 160px; }
.user-management-table .user-col-email { width: 210px; }
.user-management-table .user-col-org { width: 150px; }
.user-management-table .user-col-status { width: 104px; }
.user-management-table .user-col-actions { width: 190px; }

.user-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
  max-width: 100%;
}

.user-cell strong {
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.user-cell span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.user-email-link {
  display: block;
  width: max-content;
  max-width: none;
  min-width: 0;
  overflow: visible;
  color: #245a9c;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: normal;
  text-overflow: clip;
  white-space: nowrap;
  word-break: normal;
  hyphens: none;
}

.user-email-link:hover {
  text-decoration: underline;
}

.user-type-pill {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  background: #eef4ff;
  color: #245a9c;
  font-size: 12px;
  font-weight: 850;
  padding: 4px 9px;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.user-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
}

.action-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  background: #fff;
  color: #344054;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  padding: 6px 9px;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.action-button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.action-button:hover {
  border-color: #b9c7db;
  background: #f6f9fd;
}

.action-button.primary {
  border-color: rgba(47, 179, 68, 0.42);
  background: #e8f7ec;
  color: var(--green-dark);
}

.action-button.secondary {
  border-color: #d7dce5;
  background: #f7f9fc;
  color: #475467;
}

.action-button.danger {
  border-color: #f0b4b4;
  background: #fff1f1;
  color: #b42318;
}

.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.user-management-table .action-button {
  min-height: 30px;
  padding: 5px 8px;
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  overflow: auto;
  padding: 18px 22px 22px;
}

.detail-item {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  background: #fbfcff;
  padding: 11px 12px;
}

.detail-item.full {
  grid-column: 1 / -1;
}

.detail-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.detail-item strong {
  color: #1f2937;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.data-table th,
.data-table td {
  padding: 7px 8px;
  border-bottom: 1px solid #e7ecf4;
  text-align: left;
  vertical-align: top;
  font-size: 12px;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f9fc;
  color: #344054;
  font-weight: 800;
  white-space: nowrap;
}

.user-requests-table th {
  min-height: 38px;
  white-space: normal;
  line-height: 1.12;
  vertical-align: middle;
  font-size: 11px;
}

.user-management-table th,
.user-management-table td {
  white-space: normal;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.data-table td {
  color: #1f2937;
  line-height: 1.3;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.data-table td.copyable-cell {
  overflow: visible;
  text-overflow: clip;
}

.user-requests-table td:nth-child(4),
.user-management-table td:nth-child(3) {
  white-space: nowrap;
  overflow-x: auto;
}

.user-requests-table td {
  vertical-align: middle;
  white-space: normal;
}

.user-requests-table th:last-child,
.user-requests-table td:last-child {
  position: static;
  right: auto;
  z-index: auto;
  box-shadow: none;
}

.user-requests-table th:last-child {
  z-index: 2;
}

.user-requests-table td:last-child {
  background: #fff;
}

.user-requests-table tr.record-sent td:last-child {
  background: #fbfcff;
}

.user-requests-table tr.record-recently-sent td,
.user-requests-table tr.record-recently-sent td:last-child {
  background: #f2fbf4;
}

.user-requests-table tbody tr:hover td {
  background: #f8fbff;
}

.user-requests-table tbody tr:hover td:last-child {
  background: #f8fbff;
}

.record-date {
  color: #475467;
  font-size: 11px;
  font-weight: 750;
  white-space: normal;
}

.admin-marker {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  border-radius: 999px;
  background: #eef4ff;
  color: #245a9c;
  font-size: 10px;
  font-weight: 850;
  padding: 3px 7px;
  text-align: center;
}

.data-table td.copyable-cell {
  position: relative;
  padding-right: 42px;
}

.cell-copy-button {
  position: absolute;
  top: 7px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1px solid #d5dde9;
  border-radius: 6px;
  background: #fff;
  color: #3268b1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 120ms ease, transform 120ms ease, background 120ms ease;
}

.cell-copy-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.data-table td.copyable-cell:hover .cell-copy-button,
.data-table td.copyable-cell:focus-within .cell-copy-button {
  opacity: 1;
  transform: translateY(0);
}

.cell-copy-button:hover,
.cell-copy-button.copied {
  border-color: rgba(47, 179, 68, 0.45);
  background: #e8f7ec;
  color: var(--green-dark);
}

.cell-copy-button:focus-visible {
  opacity: 1;
  outline: 3px solid rgba(50, 104, 177, 0.16);
  outline-offset: 2px;
}

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

.data-table tr.record-sent td {
  background: #fbfcff;
  color: #667085;
}

.data-table tr.record-sent td:not(:last-child) {
  opacity: 0.82;
}

.data-table tr.record-recently-sent td:not(:last-child) {
  opacity: 1;
}

.table-empty {
  color: var(--muted);
  font-weight: 700;
}

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

.inline-actions .btn {
  min-height: 30px;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
}

.invite-control {
  display: grid;
  justify-items: center;
}

.invite-check {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  cursor: pointer;
}

.invite-check input {
  position: absolute;
  inset: 0;
  width: 22px;
  height: 22px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.invite-check span {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1.5px solid #d0d5dd;
  border-radius: 6px;
  background: #fff;
  color: transparent;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.invite-check svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.invite-check input:checked + span {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.invite-check input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(50, 104, 177, 0.16);
}

.invite-check input:disabled + span {
  opacity: 0.6;
}

@media (max-width: 820px) {
  .app-header {
    align-items: center;
    padding: 12px 16px;
  }

  .brand {
    width: auto;
    flex: 1 1 220px;
  }

  .brand img {
    width: 150px;
  }

  .page-shell {
    width: min(100% - 24px, 1220px);
    margin-top: 18px;
  }

  .form-card {
    padding: 16px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-head,
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }

  .panel-actions,
  .dashboard-actions {
    align-items: stretch;
  }

  .table-search {
    width: 100%;
  }

  .records-location-filters {
    justify-content: stretch;
    width: 100%;
  }

  .records-filter-field {
    min-width: 0;
    width: 100%;
  }

  .records-table-wrap {
    max-height: none;
    overflow-x: hidden;
  }

  .user-requests-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
  }

  .user-requests-table colgroup,
  .user-requests-table thead {
    display: none;
  }

  .user-requests-table tbody {
    display: grid;
    gap: 10px;
  }

  .user-requests-table tr {
    display: grid;
    overflow: hidden;
    border: 1px solid #e1e6ef;
    border-radius: 8px;
    background: #fff;
  }

  .user-requests-table td {
    display: grid;
    grid-template-columns: 106px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    padding: 9px 10px;
    border-bottom: 1px solid #eef2f7;
    white-space: normal;
  }

  .user-requests-table td > * {
    min-width: 0;
  }

  .user-requests-table td::before {
    color: #667085;
    content: "";
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .user-requests-table td:nth-child(1)::before { content: "Data"; }
  .user-requests-table td:nth-child(2)::before { content: "Nome"; }
  .user-requests-table td:nth-child(3)::before { content: "CPF"; }
  .user-requests-table td:nth-child(4)::before { content: "E-mail"; }
  .user-requests-table td:nth-child(5)::before { content: "Telefone"; }
  .user-requests-table td:nth-child(6)::before { content: "Órgão"; }
  .user-requests-table td:nth-child(7)::before { content: "Cargo"; }
  .user-requests-table td:nth-child(8)::before { content: "Setor"; }
  .user-requests-table td:nth-child(9)::before { content: "Regional"; }
  .user-requests-table td:nth-child(10)::before { content: "Município"; }
  .user-requests-table td:nth-child(11)::before { content: "Tipo"; }
  .user-requests-table td:nth-child(12)::before { content: "Perfil"; }
  .user-requests-table td:nth-child(13)::before { content: "Adm"; }
  .user-requests-table td:nth-child(14)::before { content: "Convite"; }

  .user-requests-table td:nth-child(4) {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
    white-space: nowrap;
  }

  .user-requests-table td:last-child {
    border-bottom: 0;
  }

  .user-requests-table td.table-empty {
    display: block;
    padding: 14px;
  }

  .user-requests-table td.table-empty::before {
    content: none;
  }

  .user-requests-table .invite-control {
    justify-items: start;
  }

  .user-menu-dropdown {
    right: -4px;
    width: min(300px, calc(100vw - 32px));
  }

  .top-user-name {
    max-width: 104px;
  }

  .modal-layer {
    padding: 10px;
    place-items: stretch;
  }

  .modal-card {
    width: 100%;
    max-height: calc(100vh - 20px);
  }

  .modal-head,
  .users-overview,
  .modal-toolbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .users-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 10px;
  }

  .user-stat {
    min-height: 60px;
    padding: 9px 10px;
  }

  .user-stat span {
    font-size: 10px;
  }

  .user-stat strong {
    font-size: 23px;
  }

  .modal-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .modal-toolbar .btn {
    width: 100%;
    flex: 0 0 auto;
  }

  .modal-table-wrap {
    margin: 0 14px 14px;
    max-height: max(240px, calc(100vh - 360px));
    overflow-x: hidden;
  }

  .user-management-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
  }

  .user-management-table colgroup,
  .user-management-table thead {
    display: none;
  }

  .user-management-table tbody {
    display: grid;
    gap: 10px;
  }

  .user-management-table tr {
    display: grid;
    overflow: hidden;
    border: 1px solid #e1e6ef;
    border-radius: 8px;
    background: #fff;
  }

  .user-management-table td {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    min-width: 0;
    overflow-x: auto;
    padding: 9px 10px;
    border-bottom: 1px solid #eef2f7;
  }

  .user-management-table td > * {
    min-width: 0;
  }

  .user-management-table td::before {
    color: #667085;
    content: "";
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .user-management-table td:nth-child(1)::before { content: "Adm"; }
  .user-management-table td:nth-child(2)::before { content: "Nome"; }
  .user-management-table td:nth-child(3)::before { content: "E-mail"; }
  .user-management-table td:nth-child(4)::before { content: "Órgão"; }
  .user-management-table td:nth-child(5)::before { content: "Status"; }
  .user-management-table td:nth-child(6)::before { content: "Ações"; }

  .user-management-table td:nth-child(3) {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .user-management-table td:nth-child(3) .user-email-link {
    font-size: 11px;
    line-height: 1.25;
  }

  .user-management-table td:last-child {
    border-bottom: 0;
  }

  .user-management-table .user-type-pill {
    justify-self: start;
  }

  .user-management-table .user-row-actions {
    justify-content: flex-start;
  }

  .details-grid {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .profile-options {
    grid-template-columns: 1fr;
  }

  .actions {
    flex-wrap: wrap;
  }

  .btn {
    justify-content: center;
    flex: 1 1 180px;
  }

  .app-footer {
    margin: 18px 0 0;
    padding: 16px 12px;
  }
}
