/* Digi UI 2026 - camada de design e acessibilidade sobre o CSS legado. */
:root {
  color-scheme: light;
  --background: #f4f7f5;
  --surface: #ffffff;
  --surface-muted: #f2f6f3;
  --surface-strong: #e5ece7;
  --surface-soft: #edf3ef;
  --text: #14211c;
  --text-muted: #485a52;
  --text-soft: #66776f;
  --primary: #123f32;
  --primary-strong: #0b3327;
  --primary-soft: #d5f5e4;
  --primary-soft-2: #aee8cb;
  --accent: #41b77c;
  --accent-strong: #208b5b;
  --border: #ccd8d1;
  --border-strong: #a9bbb1;
  --danger: #b42318;
  --danger-soft: #fee4e2;
  --warning: #8a4b08;
  --warning-soft: #fff3d6;
  --info: #175cd3;
  --info-soft: #eaf2ff;
  --focus: #1677ff;
  --shadow-xs: 0 1px 2px rgba(12, 40, 30, 0.05);
  --shadow-sm: 0 8px 24px rgba(12, 40, 30, 0.07);
  --shadow-md: 0 20px 48px rgba(12, 40, 30, 0.12);
  --shadow-lg: 0 30px 80px rgba(8, 30, 22, 0.2);
  --radius-sm: 0.625rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.125rem;
  --radius-xl: 1.5rem;
  --radius-pill: 999px;
  --container: 1600px;
  --topbar-height: 72px;
  --control-gap: 0.75rem;
  --control-gap-compact: 0.5rem;
  --content-control-gap: 1rem;
}

html {
  min-width: 320px;
  background: var(--background);
  scroll-padding-top: calc(var(--topbar-height) + 1.25rem);
}

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 8% -10%, rgba(65, 183, 124, 0.13), transparent 28rem),
    radial-gradient(circle at 96% 10%, rgba(18, 63, 50, 0.08), transparent 32rem),
    var(--background);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  color: #fff;
  background: var(--primary);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(22, 119, 255, 0.16);
}

:where(button, input, select, textarea):disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 3000;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--primary);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 0.18s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Autenticacao */
.login-shell {
  padding: clamp(1rem, 4vw, 3rem);
}

.login-panel {
  width: min(1120px, 100%);
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(18, 63, 50, 0.12);
  border-radius: 1.75rem;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.login-brand-block {
  min-height: 600px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(7, 43, 32, 0.97), rgba(18, 86, 62, 0.94)),
    var(--primary);
  box-shadow: none;
}

.login-brand-block::after {
  content: "";
  width: min(22rem, 80%);
  aspect-ratio: 1.7;
  margin-top: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 1.5rem;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(255,255,255,.08) 50%, transparent 50.5%),
    linear-gradient(0deg, transparent 49.5%, rgba(255,255,255,.08) 50%, transparent 50.5%),
    radial-gradient(circle at 26% 68%, #6ee7a8 0 0.4rem, transparent 0.45rem),
    radial-gradient(circle at 52% 44%, #b8f4d2 0 0.5rem, transparent 0.55rem),
    radial-gradient(circle at 78% 27%, #fff 0 0.35rem, transparent 0.4rem),
    rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px rgba(255,255,255,.12);
}

.login-brand-block .brand-mark,
.login-brand-block .eyebrow,
.login-brand-block .login-copy {
  color: #fff;
}

.login-brand-block .login-copy {
  color: rgba(255, 255, 255, 0.78);
}

.login-card {
  border: 0;
  border-radius: 0;
  padding: clamp(2rem, 5vw, 4.5rem);
  box-shadow: none;
  backdrop-filter: none;
}

/* Barra superior e navegacao */
.topbar {
  min-height: var(--topbar-height);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(13, 53, 41, 0.97);
  box-shadow: 0 8px 30px rgba(8, 30, 22, 0.16);
}

.topbar-inner,
.page-shell,
.page-footer-inner {
  width: min(calc(100% - 2rem), var(--container));
}

.topbar-brand {
  min-width: 0;
  gap: clamp(1rem, 2.4vw, 2.5rem);
}

.brand-mark img {
  display: block;
  width: auto;
  max-width: 116px;
  height: 38px;
  object-fit: contain;
}

.main-nav {
  gap: 0.25rem;
  flex-wrap: nowrap;
}

.nav-link {
  min-height: 2.75rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.82);
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 650;
  white-space: nowrap;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}

.nav-link:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
  filter: none;
  transform: none;
  box-shadow: none;
}

.nav-link.active {
  color: #123f32;
  border-color: rgba(213, 245, 228, 0.4);
  background: #dff8ea;
}

.nav-link-dropdown::after {
  content: "expand_more";
  font-family: "Material Symbols Outlined";
  font-size: 1.1rem;
  font-weight: 400;
  transition: transform .16s ease;
}

.nav-link-dropdown[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.clients-menu-panel,
.mailing-menu-panel {
  top: calc(100% + 0.65rem);
  min-width: 17rem;
  padding: 0.5rem;
  border: 1px solid #314f45;
  border-radius: var(--radius-md);
  background: #173a2f;
  box-shadow: var(--shadow-lg);
}

.clients-menu-item,
.mailing-menu-item {
  min-height: 2.75rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.625rem;
  font-family: "Inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
}

.clients-menu-item:hover,
.mailing-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
  filter: none;
  transform: none;
  box-shadow: none;
}

.clients-menu-item.active,
.mailing-menu-item.active {
  color: #103b2e;
  background: #dff8ea;
}

.topbar-actions {
  flex: 0 0 auto;
}

.session-chip {
  max-width: 16rem;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.9);
  text-overflow: ellipsis;
}

.icon-circle,
.mobile-menu-btn {
  min-width: 2.75rem;
  min-height: 2.75rem;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: var(--radius-sm);
  color: #fff;
  background: rgba(255,255,255,.08);
}

.profile-menu {
  border-color: var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* Estrutura de pagina */
.page-shell {
  gap: 1.5rem;
  padding-block: clamp(1.25rem, 3vw, 2.5rem) 3rem;
}

.page-hero {
  min-height: 8rem;
  padding: clamp(1.25rem, 2.5vw, 2rem);
  border: 1px solid rgba(18, 63, 50, 0.12);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(120deg, rgba(255,255,255,.98), rgba(240,248,243,.96)),
    var(--surface);
  box-shadow: var(--shadow-sm);
}

.page-hero h1 {
  color: var(--primary-strong);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  letter-spacing: -0.035em;
}

.page-hero > div > p:last-child {
  max-width: 68rem;
  font-size: 1rem;
}

.surface-card,
.login-card,
.modal-panel {
  border: 1px solid var(--border);
  background: rgba(255,255,255,.98);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
}

.surface-card {
  border-radius: var(--radius-lg);
}

.filters-card,
.table-card,
.dashboard-card,
.whatsapp-card,
.seller-context-card,
.mailings-upload-card,
.mailings-status-card,
.mailing-history-card,
.viability-upload-card,
.viability-status-card,
.blacklist-card {
  padding: clamp(1rem, 2vw, 1.5rem);
}

.card-heading,
.table-toolbar,
.mailing-history-header {
  margin-bottom: 1.25rem;
}

.section-heading h2,
.card-heading h2,
.table-toolbar h2,
.table-toolbar h3 {
  color: var(--primary-strong);
  letter-spacing: -0.02em;
}

.section-icon {
  flex: 0 0 auto;
  color: var(--primary);
  background: var(--primary-soft);
}

.eyebrow {
  color: var(--accent-strong);
  font-weight: 800;
  letter-spacing: .11em;
}

/* Formularios */
.field {
  gap: 0.45rem;
}

.field > span,
.history-label,
.goto-page label {
  color: #34483f;
  font-size: 0.85rem;
  font-weight: 700;
}

:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):hover:not(:disabled) {
  border-color: #82998d;
}

:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
  border-color: var(--focus);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(22,119,255,.14);
}

:where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

textarea {
  min-height: 6rem;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #77877f;
  opacity: 1;
}

input[type="checkbox"],
input[type="radio"] {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--primary);
}

.filters-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr));
  gap: 0.85rem 1rem;
}

.filters-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Filtros compactos: um unico card, sem caixas decorativas por campo. */
.filters-card {
  padding: clamp(1rem, 1.5vw, 1.35rem);
  box-shadow: none;
}

.filters-card .card-heading {
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #e4ebe7;
}

.filters-card .section-heading {
  gap: 0.7rem;
}

.filters-card .section-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.7rem;
  font-size: 1.25rem;
}

.filters-card .section-heading h2 {
  font-size: 1.15rem;
  line-height: 1.25;
}

.filters-card .section-heading p {
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.filters-card .filters-grid .field {
  min-width: 0;
  padding: 0;
  gap: 0.35rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.filters-card .filters-grid .field > span {
  color: #52665d;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.065em;
  line-height: 1.2;
  text-transform: uppercase;
}

.filters-card .filters-grid .field input,
.filters-card .filters-grid .field select,
.filters-card .multi-filter-summary {
  min-height: 2.55rem;
  border: 1px solid #c7d2cc;
  border-radius: 0.7rem;
  background: #fff;
  box-shadow: none;
}

.filters-card .filters-grid .field input,
.filters-card .filters-grid .field select {
  padding-block: 0.55rem;
  font-size: 0.9rem;
}

.filters-card .filters-grid .field input:hover,
.filters-card .filters-grid .field select:hover,
.filters-card .multi-filter-summary:hover {
  border-color: #8da197;
  background: #fff;
  transform: none;
  box-shadow: none;
}

.filters-card .filters-grid .field input:focus,
.filters-card .filters-grid .field select:focus,
.filters-card .multi-filter[open] .multi-filter-summary {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(18, 63, 50, 0.1);
}

.filters-card .multi-filter-summary {
  padding: 0.55rem 0.7rem;
}

.filters-card .multi-filter-summary-text {
  font-size: 0.84rem;
  font-weight: 650;
}

.filters-card .multi-filter-summary-count {
  min-width: 1.4rem;
  height: 1.4rem;
  padding-inline: 0.35rem;
  font-size: 0.68rem;
}

.filters-card .multi-select-help {
  display: none;
}

.filters-card .multi-select-meta {
  min-height: 1rem;
  justify-content: flex-end;
}

.filters-card .field-multiselect:not(:has(.multi-filter-summary-count.is-active)) .multi-select-meta {
  display: none;
}

.filters-card .chip-link {
  padding: 0;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-decoration: none;
}

.filters-card .chip-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.filters-card .filters-footer {
  margin-top: 0.25rem;
  padding-top: 1rem;
}

.filters-card .filters-footer .button-row {
  gap: 0.55rem;
}

.filters-card .filters-footer .btn,
.filters-card .toolbar-actions .btn {
  min-height: 2.5rem;
  padding: 0.55rem 0.85rem;
  border-radius: 0.7rem;
  font-size: 0.82rem;
}

.filters-card .toolbar-actions .btn-tertiary {
  border-color: #d7e0db;
  background: #f7faf8;
}

.filters-card .multi-filter-panel {
  padding: 0.6rem;
  border-radius: 0.75rem;
  box-shadow: 0 12px 28px rgba(20, 55, 43, 0.12);
}

@media (max-width: 720px) {
  .filters-card .filters-footer {
    align-items: stretch;
  }

  .filters-card .filters-footer .button-row {
    width: 100%;
  }

  .filters-card .filters-footer .btn {
    flex: 1 1 auto;
  }
}

.selection-summary {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  background: var(--surface-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.multi-filter-summary {
  min-height: 2.75rem;
  border-color: var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
}

.multi-filter-panel {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}

/* Botoes */
.btn,
button {
  min-height: 2.75rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: background .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

button:hover {
  filter: none;
  transform: none;
  box-shadow: none;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary {
  border: 1px solid var(--primary);
  color: #fff;
  background: var(--primary);
  box-shadow: 0 6px 14px rgba(18,63,50,.16);
}

.btn-primary:hover:not(:disabled) {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
  box-shadow: 0 8px 18px rgba(18,63,50,.22);
}

.btn-secondary {
  border: 1px solid var(--border-strong);
  color: var(--primary);
  background: #fff;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.btn-tertiary {
  border: 1px solid transparent;
  color: var(--primary);
  background: var(--surface-soft);
}

.btn-tertiary:hover:not(:disabled) {
  border-color: var(--border);
  background: var(--surface-strong);
}

.btn-danger {
  border: 1px solid var(--danger);
  background: var(--danger);
}

.icon-btn,
.ghost-action,
.icon-circle {
  min-width: 2.75rem;
  min-height: 2.75rem;
}

/* Espacamento consistente entre controles interativos em todas as telas. */
:where(
  .button-row,
  .toolbar-actions,
  .admin-inline-actions,
  .user-form-actions,
  .dashboard-filter-actions,
  .whatsapp-connections-actions,
  .whatsapp-config-actions,
  .whatsapp-sync-actions,
  .modal-actions,
  .actions
) {
  column-gap: var(--control-gap);
  row-gap: var(--control-gap);
}

:where(
  .mailing-history-actions,
  .table-inline-actions,
  .compact-actions,
  .pagination,
  .pagination-controls
) {
  column-gap: var(--control-gap-compact);
  row-gap: var(--control-gap-compact);
}

.actions,
.pagination-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.mailing-history-actions,
.whatsapp-table-footer {
  flex-wrap: wrap;
}

.whatsapp-table-footer {
  gap: var(--control-gap);
}

:where(
  .filters-footer,
  .table-toolbar,
  .table-footer,
  .mailing-status-header,
  .mailing-status-footer,
  .users-cities-footer,
  .whatsapp-list-header,
  .whatsapp-table-footer,
  .whatsapp-connections-header,
  .modal-head
) {
  gap: var(--content-control-gap);
}

.card-heading:has(> button) {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--content-control-gap);
}

:where(.admin-form-card, .admin-table-card) > .button-row {
  margin-block: 1rem;
}

:is(.base-standardization-card, .admin-form-card:has(#baseStandardizationSaveBtn)) {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

:is(.base-standardization-card, .admin-form-card:has(#baseStandardizationSaveBtn)) > .table-toolbar,
:is(.base-standardization-card, .admin-form-card:has(#baseStandardizationSaveBtn)) > .button-row {
  margin-block: 0;
}

.base-standardization-table-wrap {
  margin-top: 0;
}

:where(.button-row, .modal-actions, .toolbar-actions, .pagination-controls) > :where(button, .btn, [role="button"]) {
  margin: 0;
}

/* Tabelas */
.table-wrap,
.table-scroll-wrap,
.mailing-history-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  scrollbar-color: var(--border-strong) transparent;
}

.clients-table,
.admin-data-table,
.mailing-history-table,
.dashboard-table {
  border-collapse: separate;
  border-spacing: 0;
}

.clients-table thead th,
.admin-data-table th,
.mailing-history-table th,
.dashboard-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--border-strong);
  color: #355248;
  background: #edf4f0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: .055em;
}

.clients-table th,
.clients-table td,
.admin-data-table th,
.admin-data-table td,
.mailing-history-table th,
.mailing-history-table td,
.dashboard-table th,
.dashboard-table td {
  padding: 0.8rem 0.75rem;
  border-bottom-color: #e1e9e4;
}

.clients-table tbody tr:nth-child(even),
.admin-data-table tbody tr:nth-child(even),
.mailing-history-table tbody tr:nth-child(even) {
  background: #fbfdfc;
}

.clients-table tbody tr:hover,
.admin-data-table tbody tr:hover,
.mailing-history-table tbody tr:hover {
  background: #eff8f3;
}

/* A grade principal ocupa a tela sem criar rolagem horizontal. */
.table-wrap:has(.clients-directory-table) {
  overflow-x: hidden;
  overflow-y: visible;
}

.clients-directory-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.clients-directory-table th,
.clients-directory-table td {
  box-sizing: border-box;
  padding: 0.72rem 0.5rem;
  word-break: normal;
  overflow-wrap: break-word;
}

.clients-directory-table thead th {
  white-space: normal;
}

.clients-directory-table .col-selection {
  width: 3%;
  padding-inline: 0.35rem;
  text-align: center;
}

.clients-directory-table .col-name {
  width: 10%;
}

.clients-directory-table .col-cpf {
  width: 8%;
  color: #29483f;
  font-size: 0.8rem;
  font-weight: 650;
  overflow-wrap: break-word;
}

.clients-directory-table .col-contact {
  width: 12%;
}

.clients-directory-table .col-status {
  width: 8%;
}

.clients-directory-table .col-value {
  width: 7%;
}

.clients-directory-table th.col-address,
.clients-directory-table td.col-address {
  width: 16.5%;
  min-width: 0;
  max-width: none;
}

.clients-directory-table .col-result,
.clients-directory-table .col-seller {
  width: 8%;
}

.clients-directory-table .col-action {
  width: 13%;
}

.clients-directory-table .col-extraction-purpose {
  width: 8%;
}

.clients-directory-table .cell-actions {
  width: 3%;
  padding-inline: 0.25rem;
  text-align: center;
}

.clients-directory-table .cell-name strong {
  color: var(--primary-strong);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
  word-break: normal;
  overflow-wrap: break-word;
}

.clients-directory-table .contact-value {
  color: #183f33;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: break-word;
}

.clients-directory-table .client-updated-note {
  font-size: 0.68rem;
}

.clients-directory-table .cell-money {
  color: var(--primary-strong);
  font-size: 0.85rem;
  font-weight: 800;
  overflow-wrap: break-word;
}

.clients-directory-table td.col-address {
  color: #29483f;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.5;
}

.address-cell-content {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.address-cell-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 650;
}

.viability.viability-compact {
  width: 1.35rem;
  height: 1.35rem;
}

.viability.viability-compact .material-symbols-outlined {
  font-size: 1.1rem;
}

.clients-directory-table .inline-result,
.clients-directory-table .inline-seller {
  width: 100%;
  min-width: 0;
  border-color: #aebfb6;
  color: #173f33;
  font-weight: 700;
}

.clients-directory-table .action-content {
  width: 100%;
  min-width: 0;
}

.clients-directory-table .action-input {
  min-width: 0;
  border-color: #aebfb6;
  color: #173f33;
  font-weight: 650;
}

.clients-directory-table thead .col-name,
.clients-directory-table thead .col-cpf,
.clients-directory-table thead .col-contact,
.clients-directory-table thead .col-value,
.clients-directory-table thead .col-address,
.clients-directory-table thead .col-result,
.clients-directory-table thead .col-seller,
.clients-directory-table thead .col-action {
  color: var(--primary-strong);
  font-size: 0.75rem;
}

@media (max-width: 1280px) {
  .clients-directory-table th,
  .clients-directory-table td {
    padding-inline: 0.4rem;
    font-size: 0.76rem;
  }

  .clients-directory-table .cell-name strong,
  .clients-directory-table .cell-money {
    font-size: 0.9rem;
  }

  .clients-directory-table .icon-btn,
  .clients-directory-table .ghost-action {
    min-width: 2.2rem;
    width: 2.2rem;
  }

  .extraction-history-open-btn > span:not(.material-symbols-outlined):not(.extraction-history-count) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

@media (max-width: 900px) {
  .table-wrap:has(.clients-directory-table) {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .clients-directory-table,
  .clients-directory-table tbody {
    display: block;
    width: 100%;
  }

  .clients-directory-table thead {
    display: none;
  }

  .clients-directory-table tbody {
    display: grid;
    gap: 0.85rem;
  }

  .clients-directory-table tbody tr {
    display: grid;
    width: 100%;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-sm);
  }

  .clients-directory-table tbody td,
  .clients-directory-table tbody td.col-address {
    position: static;
    display: grid;
    grid-template-columns: minmax(6.5rem, 32%) minmax(0, 1fr);
    align-items: start;
    gap: 0.75rem;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid #e6ece8;
    background: transparent;
    text-align: left;
  }

  .clients-directory-table tbody td::before {
    content: attr(data-label);
    color: #557067;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-transform: uppercase;
  }

  .clients-directory-table tbody td.col-selection,
  .clients-directory-table tbody td.cell-actions {
    display: flex;
    justify-content: flex-end;
    width: auto;
  }

  .clients-directory-table tbody td.col-selection::before,
  .clients-directory-table tbody td.cell-actions::before {
    margin-right: auto;
  }

  .clients-directory-table tbody td:last-child {
    border-bottom: 0;
  }

  .clients-directory-table .action-content {
    align-items: stretch;
  }
}

.table-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.page-btn {
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid var(--border);
  background: #fff;
}

.page-btn.active {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
}

.chip,
.badge {
  border: 1px solid transparent;
  font-weight: 750;
}

.chip.success,
.badge.success {
  border-color: #a8dfc1;
  color: #0f5a39;
  background: #e1f7eb;
}

.chip.warning,
.badge.warning {
  border-color: #f0d18c;
  color: #7a4308;
  background: var(--warning-soft);
}

.chip.danger,
.badge.danger {
  border-color: #f3aaa4;
  color: #8f1710;
  background: var(--danger-soft);
}

.empty-state {
  min-height: 12rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: var(--surface-muted);
}

.col-extraction-purpose {
  width: 12.5rem;
  min-width: 12.5rem;
}

.extraction-history-open-btn {
  width: auto;
  min-height: 2.2rem;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

.extraction-history-open-btn .material-symbols-outlined {
  font-size: 1rem;
}

.extraction-history-count {
  min-width: 1.25rem;
  min-height: 1.25rem;
  display: inline-grid;
  place-items: center;
  padding-inline: 0.35rem;
  border-radius: var(--radius-pill);
  color: #fff;
  background: var(--primary);
  font-size: 0.66rem;
}

.extraction-history-modal-panel {
  width: min(920px, 100%);
}

.extraction-history-modal-table-wrap {
  max-height: min(55dvh, 34rem);
}

.extraction-history-modal-table {
  min-width: 680px;
}

.extraction-history-modal-table th:first-child,
.extraction-history-modal-table td:first-child {
  width: 12rem;
}

.extraction-history-modal-table th:nth-child(2),
.extraction-history-modal-table td:nth-child(2) {
  width: 14rem;
}

.extraction-history-reason {
  color: var(--text);
  font-weight: 650;
  white-space: normal;
}

.extraction-history-modal-actions {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Mensagens e progresso */
.status-banner {
  border-radius: var(--radius-md);
  font-weight: 650;
}

.status-banner.success {
  border-color: #9bd7b8;
  color: #104f35;
  background: #e5f8ed;
}

.status-banner.error {
  border-color: #f1aaa4;
  color: #8a1c14;
  background: #fff0ef;
}

.status-banner.info {
  border-color: #a7c7f8;
  color: #174b9a;
  background: var(--info-soft);
}

.status-modal {
  top: 1rem;
  width: min(calc(100% - 2rem), 34rem);
  max-width: 34rem;
  box-shadow: var(--shadow-lg);
}

.inline-feedback {
  min-height: 1.25rem;
  font-weight: 650;
}

.progress-bar,
.mailing-progress,
.upload-progress-bar {
  background: #dfe9e3;
}

.progress-fill,
.mailing-progress-bar,
.upload-progress-fill {
  background: linear-gradient(90deg, var(--primary), #54c98d);
}

/* Modais */
.modal {
  z-index: 1000;
  display: grid;
  place-items: start center;
  padding: 1.5rem 1rem;
  overflow-y: auto;
}

.modal-backdrop {
  position: fixed;
  background: rgba(8, 24, 18, 0.64);
  backdrop-filter: blur(4px);
}

.modal-panel {
  width: min(760px, 100%);
  max-height: calc(100dvh - 3rem);
  margin: 0;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

.modal-panel-compact {
  width: min(540px, 100%);
}

.modal-head {
  position: sticky;
  top: -1.5rem;
  z-index: 3;
  margin: -1.5rem -1.5rem 1.25rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.98);
}

body.modal-open {
  overflow: hidden;
}

/* Rodape */
.page-footer {
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,.72);
}

.page-footer-inner {
  min-height: 5rem;
}

.footer-links button {
  min-height: 2.75rem;
}

/* Responsividade */
@media (max-width: 1180px) {
  .mobile-menu-btn {
    display: inline-flex;
  }

  .topbar-inner {
    position: relative;
  }

  .topbar-brand {
    width: auto;
    flex: 1 1 auto;
    justify-content: flex-start;
  }

  .mobile-menu-btn {
    margin-left: auto;
  }

  .main-nav {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    display: none;
    max-height: calc(100dvh - var(--topbar-height) - 2rem);
    padding: 0.75rem;
    overflow-y: auto;
    border: 1px solid #345248;
    border-radius: var(--radius-lg);
    background: #123f32;
    box-shadow: var(--shadow-lg);
  }

  .main-nav.mobile-open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav .nav-dropdown,
  .main-nav .nav-link {
    width: 100%;
  }

  .main-nav .nav-link {
    justify-content: space-between;
    text-align: left;
  }

  .clients-menu-panel,
  .mailing-menu-panel {
    position: static;
    width: 100%;
    min-width: 0;
    margin: 0.25rem 0 0.5rem;
    border-color: rgba(255,255,255,.12);
    box-shadow: none;
  }
}

@media (max-width: 960px) {
  .topbar-inner {
    min-height: var(--topbar-height);
    flex-direction: row;
    align-items: center;
    padding-block: 0;
  }

  .topbar-brand {
    width: auto;
    flex: 1 1 auto;
  }

  .topbar-actions {
    width: auto;
    justify-content: flex-end;
  }

  .session-chip {
    display: none;
  }

  .login-brand-block {
    min-height: 360px;
  }

  .login-brand-block::after {
    display: none;
  }
}

@media (max-width: 768px) {
  .topbar-inner,
  .page-shell,
  .page-footer-inner {
    width: min(calc(100% - 1rem), var(--container));
  }

  .page-shell {
    padding-inline: 0;
  }

  .page-hero,
  .surface-card,
  .modal-panel {
    border-radius: var(--radius-md);
  }

  .page-hero {
    min-height: 0;
  }

  .filters-card,
  .table-card,
  .dashboard-card,
  .whatsapp-card,
  .seller-context-card {
    padding: 1rem;
  }

  .table-toolbar,
  .table-footer,
  .filters-footer,
  .page-footer-inner {
    gap: 1rem;
  }

  .button-row,
  .toolbar-actions {
    width: 100%;
  }

  .button-row .btn,
  .toolbar-actions .btn {
    flex: 1 1 auto;
  }

  .modal {
    align-items: end;
    padding: 0;
  }

  .modal-panel,
  .modal-panel-compact {
    width: 100%;
    max-height: 92dvh;
    border-radius: 1.25rem 1.25rem 0 0;
  }

  .modal-actions .btn {
    width: 100%;
  }

  .footer-branding,
  .footer-links {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .brand-mark img {
    max-width: 92px;
    height: 32px;
  }

  .page-hero h1 {
    font-size: 1.65rem;
  }

  .section-heading {
    align-items: center;
  }

  .section-icon {
    width: 2.4rem;
    height: 2.4rem;
  }

  .button-row,
  .toolbar-actions,
  .page-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .button-row .btn,
  .toolbar-actions .btn,
  .page-hero-actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: #81958a;
    --border-strong: #52685d;
    --text-muted: #2d4037;
  }

  .surface-card,
  .page-hero,
  input,
  select,
  textarea,
  .btn {
    border-width: 2px;
  }
}

@media (forced-colors: active) {
  .nav-link.active,
  .page-btn.active,
  .btn-primary,
  .chip,
  .badge {
    forced-color-adjust: none;
  }
}
