.clientes-page {
  display: grid;
  gap: 12px;
}

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

.clientes-kpi-btn {
  display: grid;
  gap: 8px;
  padding: 14px;
  text-align: left;
  border: 1px solid #dbe4f0;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}

.clientes-kpi-btn:hover {
  border-color: #b9cef3;
  box-shadow: 0 10px 24px rgba(16, 33, 59, 0.08);
  transform: translateY(-1px);
}

.clientes-kpi-btn.is-active {
  border-color: #0b5bd3;
  box-shadow: 0 0 0 3px rgba(11, 91, 211, 0.12);
}

.clientes-kpi-btn.is-hot {
  background: linear-gradient(180deg, #fff7df 0%, #ffffff 100%);
  border-color: #f2d48c;
}

.clientes-kpi-btn__label {
  color: #4f6382;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.clientes-kpi-btn strong {
  font-size: 28px;
  color: #0c3f91;
  line-height: 1;
}

.clientes-kpi-btn small {
  color: #5e7290;
  font-size: 13px;
  font-weight: 600;
}

.clientes-table-card {
  padding: 0;
  overflow: hidden;
}

.clientes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid #dbe4f0;
}

.clientes-head__search {
  flex: 1 1 auto;
  min-width: 0;
}

.clientes-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 22px;
}

.clientes-searchbar {
  display: grid;
  gap: 8px;
}

.clientes-searchbar__label {
  font-size: 13px;
  color: #314461;
  font-weight: 700;
}

.clientes-searchbar input {
  width: 100%;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  background: #fff;
}

.clientes-searchbar input:focus {
  outline: none;
  border-color: #2463d3;
  box-shadow: 0 0 0 3px rgba(36, 99, 211, 0.12);
}

.clientes-bulkbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: #f8fbff;
  border-bottom: 1px solid #dbe4f0;
}

.clientes-bulkbar__summary {
  display: grid;
  gap: 2px;
}

.clientes-bulkbar__summary small {
  color: #5e7290;
}

.clientes-bulkbar__actions,
.clientes-bulkbar__group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.clientes-bulkbar select {
  min-width: 170px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
}

.clientes-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 290px);
}

.clientes-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1120px;
}

.clientes-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fbff;
  color: #4f6382;
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 10px 12px;
  border-bottom: 1px solid #dbe4f0;
}

.clientes-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2fa;
  vertical-align: middle;
}

.clientes-row {
  cursor: pointer;
  transition: background .16s ease;
}

.clientes-row:hover {
  background: #f7faff;
}

.clientes-row.is-active {
  background: #edf4ff;
}

.clientes-col-check {
  width: 44px;
}

.clientes-col-actions {
  width: 124px;
}

.cliente-main {
  display: grid;
  gap: 3px;
}

.cliente-main strong {
  color: #113f87;
}

.cliente-main small,
.cliente-inline-meta {
  color: #5e7290;
  font-size: 12px;
}

.cliente-last-message,
.cliente-last-update {
  display: grid;
  gap: 2px;
}

.cliente-last-message strong,
.cliente-last-update strong {
  color: #173f7c;
  font-size: 13px;
}

.cliente-last-message small,
.cliente-last-update small {
  color: #5e7290;
  line-height: 1.35;
}

.clientes-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}

.clientes-status--lead {
  background: #fff7df;
  color: #936100;
  border-color: #f2d48c;
}

.clientes-status--prospecto {
  background: #eff5ff;
  color: #2053a6;
  border-color: #cfe0fb;
}

.clientes-status--cliente {
  background: #edf9f1;
  color: #087443;
  border-color: #c6ebd3;
}

.clientes-status--inactivo,
.clientes-status--neutral {
  background: #f5f7fb;
  color: #52657f;
  border-color: #dbe4f0;
}

.clientes-row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.clientes-icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid #dbe4f0;
  background: #fff;
  color: #214777;
  cursor: pointer;
}

.clientes-icon-btn:hover {
  background: #edf4ff;
  border-color: #b9cef3;
}

.clientes-icon-btn svg,
.btn-with-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.clientes-state {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 20px;
}

.clientes-state strong {
  color: #123e81;
  font-size: 16px;
}

.clientes-state span {
  color: #60708a;
  line-height: 1.45;
}

.clientes-loading-cell {
  padding: 0 !important;
  background: #fbfdff;
}

.clientes-loading-cell .app-lottie-loader {
  min-height: 340px;
  padding: 22px;
}

.clientes-loading-cell .app-lottie-loader__anim {
  width: 220px;
  height: 220px;
}

.clientes-loading-cell .app-lottie-loader__copy {
  text-align: center;
}

.clientes-loading-cell .app-lottie-loader__copy strong {
  font-size: 18px;
}

.clientes-loading-cell .app-lottie-loader__copy p {
  font-size: 14px;
}

.clientes-ficha-loading {
  border: 1px solid #dce5f2;
  border-radius: 14px;
  background: #fbfdff;
}

.clientes-ficha-loading .app-lottie-loader {
  min-height: 280px;
  padding: 16px;
}

.clientes-ficha-loading .app-lottie-loader__anim {
  width: 170px;
  height: 170px;
}

.clientes-state--error strong {
  color: #9f2424;
}

.clientes-pagination {
  padding: 12px 14px;
  border-top: 1px solid #dbe4f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.clientes-pagination-actions,
.cliente-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cliente-actions--stack {
  flex-direction: column;
  align-items: stretch;
}

.selected-card,
.sync-provider-card {
  border-color: #dce5f2;
  background: #fbfdff;
  padding: 18px;
}

.sync-options {
  display: grid;
  gap: 10px;
}

.sync-progress {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.sync-progress.is-hidden {
  display: none;
}

.sync-progress-bar {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #e7eefb;
  border: 1px solid #d6e3fb;
}

.sync-progress-bar span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0d5bd7 0%, #4ba3ff 100%);
  animation: sync-progress-slide 1.1s linear infinite;
}

@keyframes sync-progress-slide {
  0% { transform: translateX(-105%); }
  100% { transform: translateX(265%); }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 33, 59, 0.34);
  display: grid;
  place-items: center;
  z-index: 80;
  padding: 12px;
}

.modal-card {
  width: min(560px, 100%);
  max-height: 86vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.modal-card--wide {
  width: min(1080px, 100%);
}

.modal-head {
  padding: 12px 14px;
  border-bottom: 1px solid #dbe4f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.modal-body {
  padding: 14px;
  overflow: auto;
  display: grid;
  gap: 14px;
  align-content: start;
}

.modal-body input,
.modal-body textarea,
.modal-body select {
  width: 100%;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 14px;
}

.cliente-ficha-head {
  align-items: flex-start;
}

.cliente-ficha-head__main,
.cliente-ficha-head__meta,
.cliente-panel__head {
  display: grid;
  gap: 4px;
}

.cliente-ficha-head__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cliente-ficha-grid {
  display: grid;
  grid-template-columns: 1.35fr .9fr;
  gap: 14px;
}

.cliente-ficha-grid > .card.cliente-panel:not(.cliente-panel--full) {
  display: none;
}

.cliente-panel {
  padding: 16px;
  border-color: #dce5f2;
  background: #fbfdff;
}

.cliente-panel--accent {
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%);
}

.cliente-panel--full {
  grid-column: 1 / -1;
}

.cliente-panel--f360 {
  padding: 0;
  border: 0;
  background: transparent;
}

.cliente-panel__head h3,
.selected-card h3 {
  margin: 0;
  color: #0e376f;
  font-size: 18px;
}

.cliente-panel__head small {
  color: #60708a;
}

.cliente-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cliente-whatsapp-block {
  display: grid;
  gap: 12px;
}

.cliente-whatsapp-block strong {
  font-size: 22px;
  color: #113f87;
  word-break: break-word;
}

.cliente-state-pill-wrap {
  display: grid;
  align-content: start;
  gap: 8px;
}

.cliente-meta-list {
  display: grid;
  gap: 10px;
}

.cliente-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cliente-meta-row span {
  color: #60708a;
  font-size: 13px;
}

.cliente-meta-row strong {
  text-align: right;
  color: #173f7c;
}

.cliente-form-footer {
  display: grid;
  gap: 10px;
  position: sticky;
  bottom: 0;
  padding-top: 4px;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 24%);
}

.btn-danger-soft {
  border-color: #f1c1c1;
  color: #9f2424;
  background: #fff6f6;
}

.btn-danger-soft:hover {
  border-color: #e39a9a;
  background: #ffe9e9;
}

@media (max-width: 1120px) {
  .clientes-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clientes-head {
    flex-direction: column;
    align-items: stretch;
  }

  .clientes-head-actions {
    justify-content: flex-start;
  }

  .cliente-ficha-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .clientes-kpis {
    grid-template-columns: 1fr;
  }

  .clientes-field-grid,
  .cliente-meta-row {
    grid-template-columns: 1fr;
  }

  .cliente-meta-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .cliente-ficha-head {
    align-items: stretch;
  }

  .cliente-ficha-head__actions {
    justify-content: flex-start;
  }
}
