/* =========================================================
   WIRTZ HUB · ENTIDADES · CLIENTES
   CSS COMPLETO

   Incluye:
   - Encabezado
   - Métricas
   - Mapa general
   - Leaflet
   - Filtros
   - Forma de pago
   - Tabla redimensionable
   - Lista mobile
   - Modal cliente
   - Modal edición masiva
   - Modal importación CSV
   - Modo claro y oscuro
   - Responsive
   ========================================================= */

/* =========================================================
   PAGE
   ========================================================= */

.clients-page {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;

  width: 100%;
  max-width: 100%;
  min-height: calc(
    100vh -
    var(--topbar-height) -
    44px
  );

  color: var(--text-strong);

  overflow-x: hidden;

  animation: clientsPageIn 0.22s ease both;
}

.clients-page,
.clients-page *,
.client-modal,
.client-modal *,
.clients-map-panel,
.clients-map-panel *,
.clients-map-popup,
.clients-map-popup * {
  box-sizing: border-box;

  font-family:
    "ATF Franklin Gothic",
    "Franklin Gothic Medium",
    "Arial Narrow",
    Arial,
    sans-serif !important;
}

/* =========================================================
   BLOQUES BASE
   ========================================================= */

.clients-head,
.clients-metrics,
.clients-map-panel,
.clients-panel,
.client-modal__card,
.clients-import-result {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: var(--radius-xl);

  background:
    color-mix(
      in srgb,
      var(--panel-solid) 97%,
      transparent
    );

  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.035),
    0 14px 30px rgba(0, 0, 0, 0.035);

  transition:
    background var(--transition),
    border-color var(--transition),
    box-shadow var(--transition);
}

html[data-theme="dark"] .clients-head,
html[data-theme="dark"] .clients-metrics,
html[data-theme="dark"] .clients-map-panel,
html[data-theme="dark"] .clients-panel,
html[data-theme="dark"] .client-modal__card,
html[data-theme="dark"] .clients-import-result {
  border-color: rgba(255, 255, 255, 0.105);

  background: rgba(7, 7, 7, 0.92);

  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.025),
    0 16px 34px rgba(0, 0, 0, 0.34);
}

/* =========================================================
   HEADER
   ========================================================= */

.clients-head {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto;
  align-items: center;
  gap: 12px;

  min-height: 78px;
  padding: 12px;

  overflow: hidden;
}

.clients-brand {
  display: flex;
  align-items: center;
  gap: 10px;

  min-width: 0;
}

.clients-brand__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;

  width: 38px;
  height: 38px;

  border: 1px solid rgba(0, 0, 0, 0.11);
  border-radius: 12px;

  background: rgba(0, 0, 0, 0.035);

  color: var(--text-strong);
}

html[data-theme="dark"] .clients-brand__icon {
  border-color: rgba(255, 255, 255, 0.1);

  background: rgba(255, 255, 255, 0.04);
}

.clients-brand__icon .icon {
  width: 17px;
  height: 17px;

  stroke-width: 2.25;
}

.clients-brand h2 {
  margin: 0;

  color: var(--text-strong);

  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 950;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.clients-brand p {
  max-width: 820px;
  margin: 4px 0 0;

  color: var(--muted);

  font-size: 10px;
  font-weight: 760;
  line-height: 1.42;
}

.clients-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;

  min-width: 0;
}

/* =========================================================
   BUTTONS
   ========================================================= */

.clients-btn,
.client-action,
.client-modal__close,
.clients-map-popup button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  min-height: 34px;
  padding: 7px 11px;

  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 9px;

  background: transparent;

  color: #111111;

  font-size: 9.5px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;

  cursor: pointer;
  outline: none;

  transition:
    background var(--transition),
    border-color var(--transition),
    color var(--transition),
    transform var(--transition),
    opacity var(--transition);
}

.clients-btn:hover,
.client-action:hover,
.client-modal__close:hover,
.clients-map-popup button:hover {
  border-color: rgba(0, 0, 0, 0.24);

  background: rgba(0, 0, 0, 0.055);
}

.clients-btn:active,
.client-action:active,
.client-modal__close:active,
.clients-map-popup button:active {
  transform: translateY(1px);
}

.clients-btn:disabled,
.client-action:disabled,
.client-modal__close:disabled,
.clients-map-popup button:disabled {
  opacity: 0.45;

  cursor: not-allowed;

  transform: none;
}

.clients-btn--dark,
.client-action--dark {
  border-color: rgba(17, 17, 17, 0.24);

  background: rgba(17, 17, 17, 0.92);

  color: #ffffff;
}

.clients-btn--dark:hover,
.client-action--dark:hover {
  border-color: rgba(17, 17, 17, 0.34);

  background: rgba(17, 17, 17, 0.82);
}

html[data-theme="dark"] .clients-btn,
html[data-theme="dark"] .client-action,
html[data-theme="dark"] .client-modal__close,
html[data-theme="dark"] .clients-map-popup button {
  border-color: rgba(255, 255, 255, 0.13);

  background: rgba(255, 255, 255, 0.035);

  color: #ffffff;
}

html[data-theme="dark"] .clients-btn:hover,
html[data-theme="dark"] .client-action:hover,
html[data-theme="dark"] .client-modal__close:hover,
html[data-theme="dark"] .clients-map-popup button:hover {
  border-color: rgba(255, 255, 255, 0.22);

  background: rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .clients-btn--dark,
html[data-theme="dark"] .client-action--dark {
  border-color: rgba(255, 255, 255, 0.24);

  background: rgba(255, 255, 255, 0.9);

  color: #090909;
}

html[data-theme="dark"] .clients-btn--dark:hover,
html[data-theme="dark"] .client-action--dark:hover {
  background: rgba(255, 255, 255, 0.82);
}

.clients-btn .icon,
.client-action .icon,
.client-modal__close .icon,
.clients-map-popup button .icon {
  width: 13px;
  height: 13px;
  min-width: 13px;
  min-height: 13px;

  color: currentColor;
  stroke: currentColor;
  stroke-width: 2.25;
}

/* =========================================================
   MÉTRICAS
   ========================================================= */

.clients-metrics {
  display: grid;
  grid-template-columns:
    repeat(7, minmax(0, 1fr));

  overflow: hidden;
}

.clients-metric {
  display: grid;
  align-content: center;
  gap: 4px;

  min-height: 62px;
  padding: 10px;

  border-right: 1px solid rgba(0, 0, 0, 0.09);
}

.clients-metric:last-child {
  border-right: 0;
}

html[data-theme="dark"] .clients-metric {
  border-right-color: rgba(255, 255, 255, 0.075);
}

.clients-metric span,
.clients-title span,
.client-field label,
.clients-import-hero span,
.clients-import-preview span,
.clients-map-title > div > span,
.clients-map-stat span {
  color: var(--muted);

  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.09em;
  line-height: 1;
  text-transform: uppercase;
}

.clients-metric strong {
  min-width: 0;

  color: var(--text-strong);

  font-size: 16px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.045em;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clients-metric small {
  min-width: 0;

  color: var(--muted-2);

  font-size: 8px;
  font-weight: 820;
  line-height: 1.15;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* =========================================================
   MAPA
   ========================================================= */

.clients-map-panel {
  display: grid;

  min-width: 0;

  overflow: hidden;
}

.clients-map-head {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto;
  align-items: center;
  gap: 12px;

  min-height: 62px;
  padding: 10px 12px;

  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] .clients-map-head {
  border-bottom-color: rgba(255, 255, 255, 0.085);
}

.clients-map-title {
  display: flex;
  align-items: center;
  gap: 10px;

  min-width: 0;
}

.clients-map-title__icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;

  width: 36px;
  height: 36px;

  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 11px;

  background: rgba(0, 0, 0, 0.035);

  color: var(--text-strong);
}

html[data-theme="dark"] .clients-map-title__icon {
  border-color: rgba(255, 255, 255, 0.1);

  background: rgba(255, 255, 255, 0.045);
}

.clients-map-title__icon .icon {
  width: 16px;
  height: 16px;

  stroke-width: 2.2;
}

.clients-map-title > div {
  display: grid;
  gap: 3px;

  min-width: 0;
}

.clients-map-title strong {
  color: var(--text-strong);

  font-size: 14px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.035em;
}

.clients-map-title small {
  color: var(--muted);

  font-size: 8.5px;
  font-weight: 760;
  line-height: 1.3;
}

.clients-map-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.clients-map-stat {
  display: grid;
  align-content: center;
  gap: 3px;

  min-width: 74px;
  min-height: 38px;
  padding: 6px 9px;

  border: 1px solid rgba(0, 0, 0, 0.09);
  border-radius: 9px;

  background: rgba(0, 0, 0, 0.025);
}

html[data-theme="dark"] .clients-map-stat {
  border-color: rgba(255, 255, 255, 0.085);

  background: rgba(255, 255, 255, 0.035);
}

.clients-map-stat strong {
  color: var(--text-strong);

  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

.clients-map-wrap {
  position: relative;

  width: 100%;
  min-width: 0;
  height: 340px;

  overflow: hidden;

  background: #eef2f5;
}

html[data-theme="dark"] .clients-map-wrap {
  background: #0c0c0c;
}

.clients-map {
  position: absolute;
  inset: 0;

  z-index: 1;

  width: 100%;
  height: 100%;

  background: #eef2f5;
}

html[data-theme="dark"] .clients-map {
  background: #0c0c0c;
}

/* =========================================================
   MAPA VACÍO
   ========================================================= */

.clients-map-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 600;

  display: grid;
  justify-items: center;
  gap: 6px;

  width: min(390px, calc(100% - 32px));
  padding: 16px;

  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 14px;

  background: rgba(255, 255, 255, 0.92);

  color: var(--text-strong);

  text-align: center;

  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.08);

  transform: translate(-50%, -50%);

  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
}

.clients-map-empty[hidden] {
  display: none !important;
}

html[data-theme="dark"] .clients-map-empty {
  border-color: rgba(255, 255, 255, 0.12);

  background: rgba(10, 10, 10, 0.92);

  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.34);
}

.clients-map-empty .icon {
  width: 26px;
  height: 26px;

  color: var(--muted);

  stroke-width: 1.8;
}

.clients-map-empty strong {
  color: var(--text-strong);

  font-size: 12px;
  font-weight: 950;
}

.clients-map-empty span {
  color: var(--muted);

  font-size: 9px;
  font-weight: 760;
  line-height: 1.4;
}

/* =========================================================
   LEAFLET
   ========================================================= */

.clients-map .leaflet-container {
  width: 100%;
  height: 100%;

  background: #eef2f5;

  font-family:
    "ATF Franklin Gothic",
    "Franklin Gothic Medium",
    "Arial Narrow",
    Arial,
    sans-serif !important;
}

html[data-theme="dark"] .clients-map .leaflet-container {
  background: #0d0d0d;
}

.clients-map .leaflet-control-zoom {
  overflow: hidden;

  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  border-radius: 10px !important;

  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.08) !important;
}

.clients-map .leaflet-control-zoom a {
  display: grid;
  place-items: center;

  width: 31px !important;
  height: 31px !important;

  border-bottom-color: rgba(0, 0, 0, 0.1) !important;

  background: rgba(255, 255, 255, 0.95) !important;

  color: #111111 !important;

  font-size: 16px !important;
  font-weight: 900 !important;
  line-height: 31px !important;
}

.clients-map .leaflet-control-zoom a:hover {
  background: #f4f4f4 !important;
}

html[data-theme="dark"] .clients-map .leaflet-control-zoom {
  border-color: rgba(255, 255, 255, 0.14) !important;

  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.34) !important;
}

html[data-theme="dark"] .clients-map .leaflet-control-zoom a {
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;

  background: rgba(12, 12, 12, 0.96) !important;

  color: #ffffff !important;
}

.clients-map .leaflet-control-attribution {
  border-top-left-radius: 8px;

  background: rgba(255, 255, 255, 0.82) !important;

  color: #64748b !important;

  font-size: 7px !important;
  font-weight: 700 !important;
}

html[data-theme="dark"] .clients-map .leaflet-control-attribution {
  background: rgba(8, 8, 8, 0.82) !important;

  color: #a1a1aa !important;
}

.clients-map .leaflet-popup-content-wrapper,
.clients-map .leaflet-popup-tip {
  border: 1px solid rgba(0, 0, 0, 0.1);

  background: rgba(255, 255, 255, 0.97);

  color: #111111;

  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.13);
}

.clients-map .leaflet-popup-content-wrapper {
  padding: 0;

  border-radius: 14px;
}

.clients-map .leaflet-popup-content {
  width: auto !important;
  margin: 0 !important;
}

html[data-theme="dark"] .clients-map .leaflet-popup-content-wrapper,
html[data-theme="dark"] .clients-map .leaflet-popup-tip {
  border-color: rgba(255, 255, 255, 0.11);

  background: rgba(10, 10, 10, 0.97);

  color: #ffffff;

  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .clients-map .leaflet-tile-pane {
  filter:
    brightness(0.72)
    contrast(1.1)
    saturate(0.75);
}

/* =========================================================
   MAP POPUP
   ========================================================= */

.clients-map-popup {
  display: grid;

  min-width: 250px;

  color: #111111;
}

html[data-theme="dark"] .clients-map-popup {
  color: #ffffff;
}

.clients-map-popup > header {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 11px 38px 9px 10px;

  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .clients-map-popup > header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.clients-map-popup__avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;

  width: 31px;
  height: 31px;

  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 9px;

  background: rgba(0, 0, 0, 0.04);

  color: #111111;

  font-size: 8.5px;
  font-weight: 950;
}

html[data-theme="dark"] .clients-map-popup__avatar {
  border-color: rgba(255, 255, 255, 0.1);

  background: rgba(255, 255, 255, 0.05);

  color: #ffffff;
}

.clients-map-popup > header > div {
  display: grid;
  gap: 3px;

  min-width: 0;
}

.clients-map-popup > header strong {
  color: inherit;

  font-size: 10.5px;
  font-weight: 950;
  line-height: 1.15;
}

.clients-map-popup > header small {
  color: #64748b;

  font-size: 8px;
  font-weight: 760;
}

html[data-theme="dark"] .clients-map-popup > header small {
  color: #a1a1aa;
}

.clients-map-popup__body {
  display: grid;
  gap: 7px;

  padding: 9px 10px;
}

.clients-map-popup__body p {
  display: grid;
  grid-template-columns:
    14px
    minmax(0, 1fr);
  gap: 6px;
  align-items: start;

  margin: 0;

  color: #475569;

  font-size: 8.5px;
  font-weight: 760;
  line-height: 1.35;
}

html[data-theme="dark"] .clients-map-popup__body p {
  color: #d4d4d8;
}

.clients-map-popup__body .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;

  color: #64748b;

  stroke-width: 2.1;
}

.clients-map-popup > footer {
  padding: 0 10px 10px;
}

.clients-map-popup button {
  width: 100%;
  min-height: 30px;
  padding: 6px 9px;

  border-color: rgba(17, 17, 17, 0.22);

  background: rgba(17, 17, 17, 0.92);

  color: #ffffff;

  font-size: 8.5px;
}

/* =========================================================
   PANEL
   ========================================================= */

.clients-panel {
  display: grid;

  min-width: 0;

  overflow: hidden;
}

.clients-toolbar {
  display: grid;
  grid-template-columns:
    minmax(150px, 0.28fr)
    minmax(0, 1fr);
  gap: 10px;
  align-items: center;

  padding: 10px;

  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] .clients-toolbar {
  border-bottom-color: rgba(255, 255, 255, 0.085);
}

.clients-title {
  display: grid;
  gap: 3px;

  min-width: 0;
}

.clients-title strong {
  color: var(--text-strong);

  font-size: 14px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.04em;
}

.clients-title small {
  color: var(--muted-2);

  font-size: 8px;
  font-weight: 820;
}

.clients-filters {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: nowrap;

  min-width: 0;
  width: 100%;
}

.clients-search {
  position: relative;

  display: flex;
  align-items: center;

  width: min(360px, 100%);
  min-width: 220px;
  flex: 1 1 260px;
}

.clients-search .icon {
  position: absolute;
  left: 9px;

  width: 13px;
  height: 13px;

  color: var(--muted);

  pointer-events: none;
}

.clients-search input {
  padding-left: 29px !important;
}

/* =========================================================
   INPUTS
   ========================================================= */

.clients-filters input,
.clients-filters select,
.client-field input,
.client-field select,
.client-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 7px 9px;

  border: 1px solid rgba(0, 0, 0, 0.13);
  border-radius: 9px;

  background: rgba(255, 255, 255, 0.78);

  color: var(--text-strong);

  font-size: 9.7px;
  font-weight: 820;
  line-height: 1.2;

  outline: none;

  transition:
    border-color var(--transition),
    background var(--transition),
    box-shadow var(--transition);
}

.clients-filters select {
  width: auto;
  min-width: 104px;
  max-width: 160px;
  flex: 0 0 auto;
}

#clientsFormaPago {
  min-width: 140px;
}

.clients-filters input:focus,
.clients-filters select:focus,
.client-field input:focus,
.client-field select:focus,
.client-field textarea:focus {
  border-color: rgba(0, 0, 0, 0.28);

  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.045);
}

.client-field textarea {
  min-height: 82px;

  resize: vertical;

  line-height: 1.42;
}

.client-field select {
  cursor: pointer;
}

html[data-theme="dark"] .clients-filters input,
html[data-theme="dark"] .clients-filters select,
html[data-theme="dark"] .client-field input,
html[data-theme="dark"] .client-field select,
html[data-theme="dark"] .client-field textarea {
  border-color: rgba(255, 255, 255, 0.13);

  background: rgba(255, 255, 255, 0.045);

  color: rgba(255, 255, 255, 0.92);
}

html[data-theme="dark"] .clients-filters input:focus,
html[data-theme="dark"] .clients-filters select:focus,
html[data-theme="dark"] .client-field input:focus,
html[data-theme="dark"] .client-field select:focus,
html[data-theme="dark"] .client-field textarea:focus {
  border-color: rgba(255, 255, 255, 0.26);

  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.055);
}

html[data-theme="dark"] .clients-filters select option,
html[data-theme="dark"] .client-field select option {
  background: #111111;

  color: #ffffff;
}

/* =========================================================
   TABLA
   ========================================================= */

.clients-table-wrap {
  position: relative;

  width: 100%;
  max-width: 100%;
  min-width: 0;

  overflow-x: auto;
  overflow-y: visible;

  overscroll-behavior-x: contain;

  scrollbar-width: thin;

  background:
    color-mix(
      in srgb,
      var(--text-strong) 1.5%,
      transparent
    );
}

.clients-table-wrap::-webkit-scrollbar {
  height: 10px;
}

.clients-table-wrap::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.035);
}

.clients-table-wrap::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;

  background: rgba(0, 0, 0, 0.22);
  background-clip: content-box;
}

.clients-table {
  width: max-content;
  min-width: 100%;

  table-layout: fixed;

  border-collapse: separate;
  border-spacing: 0;

  color: var(--text-strong);
}

.clients-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

.clients-table th,
.clients-table td {
  position: relative;

  height: 44px;
  max-width: 1px;
  padding: 0 9px;

  border-right: 1px solid rgba(0, 0, 0, 0.07);
  border-bottom: 1px solid rgba(0, 0, 0, 0.075);

  vertical-align: middle;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clients-table th:last-child,
.clients-table td:last-child {
  border-right: 0;
}

html[data-theme="dark"] .clients-table th,
html[data-theme="dark"] .clients-table td {
  border-right-color: rgba(255, 255, 255, 0.065);
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

.clients-table th {
  height: 38px;
  padding: 0;

  background:
    color-mix(
      in srgb,
      var(--panel-solid) 98%,
      transparent
    );
}

html[data-theme="dark"] .clients-table th {
  background: rgba(10, 10, 10, 0.96);
}

.clients-table tbody tr {
  background:
    color-mix(
      in srgb,
      var(--panel-solid) 98%,
      transparent
    );

  transition:
    background var(--transition);
}

.clients-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.035);
}

.clients-table tbody tr.is-selected {
  background: rgba(17, 17, 17, 0.055);
}

html[data-theme="dark"] .clients-table tbody tr {
  background: rgba(9, 9, 9, 0.94);
}

html[data-theme="dark"] .clients-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.045);
}

html[data-theme="dark"] .clients-table tbody tr.is-selected {
  background: rgba(255, 255, 255, 0.07);
}

.clients-table td {
  color: var(--text-strong);

  font-size: 9.5px;
  font-weight: 760;
}

.clients-table td strong {
  color: var(--text-strong);

  font-size: 9.8px;
  font-weight: 950;
}

/* =========================================================
   TABLE HEAD
   ========================================================= */

.clients-th {
  user-select: none;
}

.clients-th__sort {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;

  width: 100%;
  height: 38px;
  padding: 0 18px 0 8px;

  border: 0;
  border-radius: 0;

  background: transparent;

  color: var(--muted);

  font-size: 7.8px;
  font-weight: 950;
  letter-spacing: 0.075em;
  line-height: 1;
  text-align: left;
  text-transform: uppercase;

  cursor: pointer;
  outline: none;
}

.clients-th__sort:disabled {
  cursor: default;
}

.clients-th__sort span {
  min-width: 0;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clients-th__sort .icon {
  width: 11px;
  height: 11px;
  min-width: 11px;
  min-height: 11px;

  color: currentColor;
  stroke: currentColor;
  stroke-width: 2.25;

  opacity: 0.72;
}

.clients-th.is-sorted .clients-th__sort {
  color: #111111;

  background: rgba(0, 0, 0, 0.045);
}

html[data-theme="dark"] .clients-th.is-sorted .clients-th__sort {
  color: #ffffff;

  background: rgba(255, 255, 255, 0.06);
}

/* =========================================================
   RESIZE
   ========================================================= */

.clients-th__resize {
  position: absolute;
  top: 0;
  right: -4px;
  z-index: 20;

  width: 9px;
  height: 100%;

  cursor: col-resize;
  touch-action: none;

  background: transparent;
}

.clients-th__resize::before {
  content: "";

  position: absolute;
  top: 8px;
  right: 4px;
  bottom: 8px;

  width: 1px;

  border-radius: 999px;

  background: rgba(0, 0, 0, 0.16);

  transition:
    width var(--transition),
    background var(--transition);
}

.clients-th__resize:hover::before {
  width: 2px;

  background: rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .clients-th__resize::before {
  background: rgba(255, 255, 255, 0.18);
}

html[data-theme="dark"] .clients-th__resize:hover::before {
  background: rgba(255, 255, 255, 0.46);
}

body.is-resizing-clients-column,
body.is-resizing-clients-column * {
  cursor: col-resize !important;

  user-select: none !important;
}

/* =========================================================
   CONTENIDO TABLA
   ========================================================= */

.client-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  max-width: 100%;
  min-width: 0;

  color: var(--text-strong);

  font-size: 9.7px;
  font-weight: 950;
}

.client-name input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 0;

  accent-color: #111111;
}

html[data-theme="dark"] .client-name input[type="checkbox"] {
  accent-color: #ffffff;
}

.client-avatar,
.client-mobile-card__avatar,
.client-modal__avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;

  width: 27px;
  height: 27px;

  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 9px;

  background: rgba(0, 0, 0, 0.045);

  color: var(--text-strong);

  font-size: 8.2px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

html[data-theme="dark"] .client-avatar,
html[data-theme="dark"] .client-mobile-card__avatar,
html[data-theme="dark"] .client-modal__avatar {
  border-color: rgba(255, 255, 255, 0.1);

  background: rgba(255, 255, 255, 0.055);
}

.client-type,
.client-status,
.client-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  max-width: 100%;
  min-height: 22px;
  padding: 4px 8px;

  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 999px;

  background: rgba(0, 0, 0, 0.035);

  color: var(--muted);

  font-size: 8px;
  font-weight: 950;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-status.is-active,
.client-score.is-a {
  border-color:
    color-mix(
      in srgb,
      #16a34a 28%,
      rgba(0, 0, 0, 0.12)
    );

  background:
    color-mix(
      in srgb,
      #16a34a 7%,
      transparent
    );

  color: #16a34a;
}

.client-status.is-review,
.client-score.is-b {
  border-color:
    color-mix(
      in srgb,
      #ca8a04 28%,
      rgba(0, 0, 0, 0.12)
    );

  background:
    color-mix(
      in srgb,
      #ca8a04 7%,
      transparent
    );

  color: #ca8a04;
}

.client-score.is-c {
  border-color:
    color-mix(
      in srgb,
      #dc2626 28%,
      rgba(0, 0, 0, 0.12)
    );

  background:
    color-mix(
      in srgb,
      #dc2626 7%,
      transparent
    );

  color: #dc2626;
}

.client-contact {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  max-width: 100%;
  min-width: 0;

  color: var(--text-strong);

  font-size: 9.2px;
  font-weight: 780;
}

.client-contact .icon {
  width: 12px;
  height: 12px;
  min-width: 12px;

  color: var(--muted);
}

.client-actions {
  display: flex;
  justify-content: center;
  align-items: center;

  width: 100%;
}

.clients-table td:last-child {
  text-align: center;
}

.client-action {
  min-height: 30px;
  height: 30px;
  padding: 0 9px;

  font-size: 8.7px;
}

.clients-table td[colspan] {
  height: 150px;

  text-align: center;
}

.clients-table td[colspan] strong {
  color: var(--muted);

  font-size: 12px;
  font-weight: 900;
}

/* =========================================================
   MOBILE
   ========================================================= */

.clients-mobile-list {
  display: none;
}

.client-mobile-card,
.clients-mobile-empty {
  display: grid;
  gap: 10px;

  padding: 10px;

  border: 1px solid rgba(0, 0, 0, 0.105);
  border-radius: 14px;

  background:
    color-mix(
      in srgb,
      var(--panel-solid) 98%,
      transparent
    );
}

html[data-theme="dark"] .client-mobile-card,
html[data-theme="dark"] .clients-mobile-empty {
  border-color: rgba(255, 255, 255, 0.105);

  background: rgba(9, 9, 9, 0.94);
}

.client-mobile-card.is-selected {
  border-color: rgba(17, 17, 17, 0.24);

  background: rgba(17, 17, 17, 0.05);
}

.client-mobile-card__head,
.client-mobile-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.client-mobile-card__select {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  min-width: 0;

  color: var(--muted);

  font-size: 8.2px;
  font-weight: 950;
}

.client-mobile-card__select input {
  width: 13px;
  height: 13px;
  margin: 0;
}

.client-mobile-card__main {
  display: flex;
  align-items: center;
  gap: 9px;

  min-width: 0;
}

.client-mobile-card__main strong {
  color: var(--text-strong);

  font-size: 13.5px;
  font-weight: 950;
  line-height: 1;
}

.client-mobile-card__main small {
  display: block;

  margin-top: 3px;

  color: var(--muted);

  font-size: 8.7px;
  font-weight: 780;
}

.client-mobile-card__grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.client-mobile-card__grid > div {
  display: grid;
  gap: 3px;

  min-width: 0;
  padding: 8px;

  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;

  background: rgba(0, 0, 0, 0.025);
}

html[data-theme="dark"] .client-mobile-card__grid > div {
  border-color: rgba(255, 255, 255, 0.075);

  background: rgba(255, 255, 255, 0.035);
}

.client-mobile-card__grid span {
  color: var(--muted);

  font-size: 7.4px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.client-mobile-card__grid strong {
  min-width: 0;

  color: var(--text-strong);

  font-size: 9.5px;
  font-weight: 900;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clients-mobile-empty {
  min-height: 140px;

  align-content: center;
  justify-items: center;

  text-align: center;
}

/* =========================================================
   MODAL
   ========================================================= */

.client-modal {
  position: fixed;
  inset: 0;
  z-index: 900;

  display: none;
  place-items: center;

  padding: 14px;

  background: rgba(0, 0, 0, 0.38);

  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.client-modal.is-open {
  display: grid;
}

.client-modal__card {
  position: relative;

  display: grid;
  grid-template-rows:
    auto
    minmax(0, 1fr)
    auto;

  width: min(980px, 100%);
  max-height: min(
    760px,
    calc(100vh - 28px)
  );

  overflow: hidden;

  animation: clientsModalIn 0.2s ease both;
}

.clients-import-card {
  width: min(840px, 100%);
}

.client-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  min-height: 62px;
  padding: 12px;

  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] .client-modal__head {
  border-bottom-color: rgba(255, 255, 255, 0.085);
}

.client-modal__title {
  display: flex;
  align-items: center;
  gap: 10px;

  min-width: 0;
}

.client-modal__title h3 {
  margin: 0;

  color: var(--text-strong);

  font-size: 17px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: -0.04em;
}

.client-modal__title p {
  margin: 4px 0 0;

  color: var(--muted);

  font-size: 9.2px;
  font-weight: 780;
  line-height: 1.3;
}

.client-modal__close {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
}

.client-modal__body {
  min-height: 0;
  max-height: calc(100vh - 178px);

  overflow: auto;

  scrollbar-width: thin;
}

.client-modal__body::-webkit-scrollbar {
  width: 10px;
}

.client-modal__body::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;

  background: rgba(0, 0, 0, 0.2);
  background-clip: content-box;
}

.client-form-grid {
  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));
  gap: 9px;

  padding: 12px;
}

.client-field {
  display: grid;
  align-content: start;
  gap: 5px;

  min-width: 0;
}

.client-field--full {
  grid-column: 1 / -1;
}

.client-field label {
  display: block;
}

.client-field input[type="checkbox"] {
  width: 14px;
  height: 14px;

  accent-color: #111111;
}

html[data-theme="dark"] .client-field input[type="checkbox"] {
  accent-color: #ffffff;
}

#clientFormaPago,
#bulkClientFormaPago {
  font-weight: 900;
}

.client-modal__footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;

  min-height: 56px;
  padding: 11px 12px;

  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] .client-modal__footer {
  border-top-color: rgba(255, 255, 255, 0.085);
}

.client-modal__footer .clients-btn:first-child {
  margin-right: auto;
}

/* =========================================================
   IMPORTACIÓN
   ========================================================= */

.clients-import-hero {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    auto;
  gap: 12px;
  align-items: center;

  padding: 12px;

  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.clients-import-hero strong {
  display: block;

  margin-top: 4px;

  color: var(--text-strong);

  font-size: 14px;
  font-weight: 950;
  line-height: 1.1;
}

.clients-import-hero p {
  max-width: 620px;
  margin: 5px 0 0;

  color: var(--muted);

  font-size: 9.4px;
  font-weight: 760;
  line-height: 1.42;
}

.clients-import-drop {
  display: flex;
  align-items: center;
  gap: 10px;

  margin: 12px;
  padding: 13px;

  border: 1px dashed rgba(0, 0, 0, 0.18);
  border-radius: 14px;

  background: rgba(0, 0, 0, 0.025);

  cursor: pointer;
}

html[data-theme="dark"] .clients-import-drop {
  border-color: rgba(255, 255, 255, 0.16);

  background: rgba(255, 255, 255, 0.035);
}

.clients-import-drop > .icon {
  width: 24px;
  height: 24px;

  color: var(--text-strong);
}

.clients-import-drop strong {
  display: block;

  color: var(--text-strong);

  font-size: 12px;
  font-weight: 950;
}

.clients-import-drop small {
  display: block;

  margin-top: 3px;

  color: var(--muted);

  font-size: 9px;
  font-weight: 780;
}

.clients-import-preview {
  display: grid;
  gap: 6px;

  margin: 0 12px 12px;
}

.clients-import-preview pre {
  max-height: 170px;
  margin: 0;
  padding: 10px;

  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;

  background: rgba(0, 0, 0, 0.035);

  color: var(--text-strong);

  font-size: 9px;
  font-weight: 760;
  line-height: 1.45;

  overflow: auto;

  white-space: pre;
}

.clients-import-result {
  display: grid;
  gap: 8px;

  margin: 0 12px 12px;
  padding: 10px;

  border-radius: 12px;
}

.clients-import-result strong {
  color: var(--text-strong);

  font-size: 12px;
  font-weight: 950;
}

.clients-import-result.is-ok {
  border-color:
    color-mix(
      in srgb,
      #16a34a 28%,
      rgba(0, 0, 0, 0.12)
    );

  background:
    color-mix(
      in srgb,
      #16a34a 6%,
      transparent
    );
}

.clients-import-result.is-error {
  border-color:
    color-mix(
      in srgb,
      #dc2626 28%,
      rgba(0, 0, 0, 0.12)
    );

  background:
    color-mix(
      in srgb,
      #dc2626 6%,
      transparent
    );
}

.clients-import-result__grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.clients-import-result__grid span,
.clients-import-result__grid strong {
  padding: 6px 8px;

  border-radius: 8px;

  background: rgba(255, 255, 255, 0.34);

  font-size: 9px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1380px) {
  .clients-toolbar {
    grid-template-columns: 1fr;

    align-items: start;
  }

  .clients-filters {
    justify-content: flex-start;

    flex-wrap: wrap;
  }
}

@media (max-width: 1280px) {
  .clients-metrics {
    grid-template-columns:
      repeat(4, minmax(0, 1fr));
  }

  .clients-metric:nth-child(4n) {
    border-right: 0;
  }
}

@media (max-width: 980px) {
  .clients-head,
  .clients-map-head {
    grid-template-columns: 1fr;

    align-items: start;
  }

  .clients-actions,
  .clients-map-actions {
    justify-content: flex-start;
  }

  .client-form-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .clients-import-hero {
    grid-template-columns: 1fr;
  }

  .clients-map-wrap {
    height: 320px;
  }
}

@media (max-width: 760px) {
  .clients-page {
    gap: 7px;
  }

  .clients-head,
  .clients-metrics,
  .clients-map-panel,
  .clients-panel,
  .client-modal__card {
    border-radius: 14px;
  }

  .clients-head {
    padding: 10px;
  }

  .clients-brand {
    align-items: flex-start;
  }

  .clients-brand__icon {
    width: 35px;
    height: 35px;

    border-radius: 11px;
  }

  .clients-brand h2 {
    font-size: 22px;
  }

  .clients-brand p {
    display: none;
  }

  .clients-actions {
    display: grid;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    width: 100%;
  }

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

  .clients-metrics {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .clients-metric:nth-child(2n) {
    border-right: 0;
  }

  .clients-map-actions {
    display: grid;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    width: 100%;
  }

  .clients-map-actions .clients-btn {
    grid-column: 1 / -1;

    width: 100%;
  }

  .clients-map-stat {
    width: 100%;
  }

  .clients-map-wrap {
    height: 290px;
  }

  .clients-toolbar {
    padding: 9px;
  }

  .clients-filters {
    display: grid;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));

    width: 100%;
  }

  .clients-search {
    grid-column: 1 / -1;

    width: 100%;
    min-width: 0;
  }

  .clients-filters select,
  .clients-filters .clients-btn,
  #clientsFormaPago {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .clients-table-wrap {
    display: none;
  }

  .clients-mobile-list {
    display: grid;
    gap: 9px;

    padding: 8px;
  }

  .client-modal {
    padding: 8px;
  }

  .client-modal__card {
    max-height: calc(100vh - 16px);
  }

  .client-modal__body {
    max-height: calc(100vh - 134px);
  }

  .client-modal__head {
    min-height: 56px;
    padding: 10px;
  }

  .client-form-grid {
    grid-template-columns: 1fr;
    gap: 8px;

    padding: 10px;
  }

  .client-modal__footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;

    padding: 10px;
  }

  .client-modal__footer .clients-btn:first-child {
    margin-right: 0;
  }

  .client-modal__footer .clients-btn {
    width: 100%;
  }

  .clients-import-result__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .clients-actions,
  .clients-filters,
  .clients-metrics,
  .client-mobile-card__grid,
  .clients-map-actions {
    grid-template-columns: 1fr;
  }

  .clients-map-actions .clients-btn {
    grid-column: auto;
  }

  .clients-map-wrap {
    height: 260px;
  }

  .clients-map-title {
    align-items: flex-start;
  }

  .clients-map-title small {
    display: none;
  }

  .clients-metric {
    border-right: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.085);
  }

  .clients-metric:last-child {
    border-bottom: 0;
  }

  html[data-theme="dark"] .clients-metric {
    border-bottom-color: rgba(255, 255, 255, 0.075);
  }

  .client-mobile-card__head,
  .client-mobile-card__footer {
    align-items: stretch;

    flex-direction: column;
  }

  .client-mobile-card__footer .client-action {
    width: 100%;
  }
}

/* =========================================================
   ANIMACIONES
   ========================================================= */

@keyframes clientsPageIn {
  from {
    opacity: 0;

    transform: translateY(5px);
  }

  to {
    opacity: 1;

    transform: translateY(0);
  }
}

@keyframes clientsModalIn {
  from {
    opacity: 0;

    transform:
      translateY(8px)
      scale(0.985);
  }

  to {
    opacity: 1;

    transform:
      translateY(0)
      scale(1);
  }
}/* =========================================================
   CLIENTES · MISMA ESCALA VISUAL DEL SISTEMA
   Agregar al FINAL de clientes.css

   Igualado con:
   - Topbar
   - Sidebar
   - Footer
   - Dashboard
   ========================================================= */

/* =========================================================
   ESCALA GENERAL
   ========================================================= */

.clients-page {
  gap: 12px !important;
}

/* =========================================================
   ENCABEZADO
   ========================================================= */

.clients-head {
  min-height: 92px !important;

  padding:
    15px
    17px !important;

  gap: 16px !important;
}

.clients-brand {
  gap: 13px !important;
}

.clients-brand__icon {
  width: 46px !important;
  height: 46px !important;
  flex: 0 0 46px !important;

  border-radius: 11px !important;
}

.clients-brand__icon .icon {
  width: 21px !important;
  height: 21px !important;
}

.clients-brand h2 {
  font-size:
    clamp(
      24px,
      2.1vw,
      30px
    ) !important;

  font-weight: 950 !important;
  line-height: 1 !important;
}

.clients-brand p {
  margin-top: 6px !important;

  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 1.45 !important;
}

/* =========================================================
   BOTONES
   ========================================================= */

.clients-btn,
.client-action,
.client-modal__close,
.clients-map-popup button {
  min-height: 36px !important;

  padding:
    0
    12px !important;

  border-radius: 9px !important;

  font-size: 11px !important;
  font-weight: 900 !important;
}

.clients-btn .icon,
.client-action .icon,
.client-modal__close .icon,
.clients-map-popup button .icon {
  width: 15px !important;
  height: 15px !important;

  min-width: 15px !important;
  min-height: 15px !important;
}

/* =========================================================
   MÉTRICAS
   ========================================================= */

.clients-metric {
  min-height: 72px !important;

  padding:
    11px
    12px !important;

  gap: 5px !important;
}

.clients-metric span {
  font-size: 9px !important;
  font-weight: 900 !important;
}

.clients-metric strong {
  font-size: 19px !important;
  font-weight: 950 !important;
}

.clients-metric small {
  font-size: 9.5px !important;
  font-weight: 700 !important;
}

/* =========================================================
   MAPA · CABECERA
   ========================================================= */

.clients-map-head {
  min-height: 70px !important;

  padding:
    12px
    14px !important;
}

.clients-map-title {
  gap: 12px !important;
}

.clients-map-title__icon {
  width: 42px !important;
  height: 42px !important;

  border-radius: 10px !important;
}

.clients-map-title__icon .icon {
  width: 19px !important;
  height: 19px !important;
}

.clients-map-title > div > span {
  font-size: 9px !important;
  font-weight: 900 !important;
}

.clients-map-title strong {
  font-size: 16px !important;
  font-weight: 950 !important;
}

.clients-map-title small {
  font-size: 10px !important;
  font-weight: 650 !important;
}

.clients-map-stat {
  min-width: 84px !important;
  min-height: 44px !important;

  padding:
    7px
    10px !important;
}

.clients-map-stat span {
  font-size: 8.5px !important;
}

.clients-map-stat strong {
  font-size: 14px !important;
}

/* =========================================================
   PANEL Y TOOLBAR
   ========================================================= */

.clients-toolbar {
  grid-template-columns:
    minmax(180px, 0.3fr)
    minmax(0, 1fr) !important;

  gap: 12px !important;

  padding:
    12px !important;
}

.clients-title {
  gap: 4px !important;
}

.clients-title span {
  font-size: 9px !important;
}

.clients-title strong {
  font-size: 16px !important;
  font-weight: 950 !important;
}

.clients-title small {
  font-size: 9.5px !important;
}

/* =========================================================
   FILTROS
   ========================================================= */

.clients-filters {
  gap: 7px !important;
}

.clients-filters input,
.clients-filters select,
.client-field input,
.client-field select,
.client-field textarea {
  min-height: 36px !important;

  padding:
    0
    10px !important;

  border-radius: 9px !important;

  font-size: 10.8px !important;
  font-weight: 800 !important;
}

.clients-search .icon {
  left: 11px !important;

  width: 14px !important;
  height: 14px !important;
}

.clients-search input {
  padding-left: 33px !important;
}

.clients-filters select {
  min-width: 112px !important;
}

#clientsFormaPago {
  min-width: 150px !important;
}

/* =========================================================
   TABLA
   ========================================================= */

.clients-table th {
  height: 42px !important;
}

.clients-table td {
  height: 48px !important;

  padding:
    0
    10px !important;

  font-size: 10.8px !important;
  font-weight: 760 !important;
}

.clients-table td strong {
  font-size: 11px !important;
  font-weight: 950 !important;
}

.clients-th__sort {
  height: 42px !important;

  padding:
    0
    20px
    0
    10px !important;

  font-size: 8.8px !important;
  font-weight: 950 !important;
}

.clients-th__sort .icon {
  width: 13px !important;
  height: 13px !important;

  min-width: 13px !important;
  min-height: 13px !important;
}

/* =========================================================
   CLIENTE EN TABLA
   ========================================================= */

.client-name {
  gap: 8px !important;

  font-size: 11px !important;
}

.client-avatar {
  width: 31px !important;
  height: 31px !important;

  font-size: 9px !important;
}

.client-name input[type="checkbox"] {
  width: 15px !important;
  height: 15px !important;
}

.client-type,
.client-status,
.client-score {
  min-height: 24px !important;

  padding:
    4px
    9px !important;

  font-size: 9px !important;
}

.client-contact {
  gap: 6px !important;

  font-size: 10.5px !important;
}

.client-contact .icon {
  width: 13px !important;
  height: 13px !important;
}

.client-action {
  min-height: 32px !important;
  height: 32px !important;

  padding:
    0
    10px !important;

  font-size: 9.8px !important;
}

/* =========================================================
   MODAL
   ========================================================= */

.client-modal__head {
  min-height: 70px !important;

  padding:
    13px
    14px !important;
}

.client-modal__avatar {
  width: 36px !important;
  height: 36px !important;

  font-size: 10px !important;
}

.client-modal__title {
  gap: 11px !important;
}

.client-modal__title h3 {
  font-size: 19px !important;
}

.client-modal__title p {
  margin-top: 5px !important;

  font-size: 10.5px !important;
}

.client-modal__close {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;

  padding: 0 !important;
}

.client-form-grid {
  gap: 10px !important;

  padding:
    14px !important;
}

.client-field {
  gap: 6px !important;
}

.client-field label {
  font-size: 9px !important;
  font-weight: 900 !important;
}

.client-field textarea {
  min-height: 96px !important;

  padding:
    10px !important;
}

.client-modal__footer {
  min-height: 64px !important;

  padding:
    12px
    14px !important;
}

/* =========================================================
   IMPORTACIÓN
   ========================================================= */

.clients-import-hero {
  padding:
    14px !important;
}

.clients-import-hero span,
.clients-import-preview span {
  font-size: 9px !important;
}

.clients-import-hero strong {
  font-size: 16px !important;
}

.clients-import-hero p {
  font-size: 10.5px !important;
}

.clients-import-drop {
  padding:
    15px !important;
}

.clients-import-drop > .icon {
  width: 27px !important;
  height: 27px !important;
}

.clients-import-drop strong {
  font-size: 13.5px !important;
}

.clients-import-drop small {
  font-size: 10px !important;
}

.clients-import-preview pre {
  padding:
    12px !important;

  font-size: 10px !important;
}

/* =========================================================
   MOBILE CARDS
   ========================================================= */

.client-mobile-card {
  padding:
    12px !important;
}

.client-mobile-card__avatar {
  width: 34px !important;
  height: 34px !important;

  font-size: 9.5px !important;
}

.client-mobile-card__main strong {
  font-size: 15px !important;
}

.client-mobile-card__main small {
  font-size: 10px !important;
}

.client-mobile-card__grid span {
  font-size: 8.5px !important;
}

.client-mobile-card__grid strong {
  font-size: 10.5px !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 980px) {
  .clients-head {
    min-height: 0 !important;
  }

  .clients-brand h2 {
    font-size: 25px !important;
  }

  .clients-brand p {
    font-size: 11px !important;
  }

  .clients-toolbar {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 760px) {
  .clients-page {
    gap: 10px !important;
  }

  .clients-head {
    padding:
      12px !important;
  }

  .clients-brand h2 {
    font-size: 22px !important;
  }

  .clients-brand__icon {
    width: 40px !important;
    height: 40px !important;
    flex-basis: 40px !important;
  }

  .clients-brand__icon .icon {
    width: 18px !important;
    height: 18px !important;
  }

  .clients-actions {
    gap: 7px !important;
  }

  .clients-toolbar {
    padding:
      10px !important;
  }

  .clients-title strong {
    font-size: 15px !important;
  }

  .client-modal__head {
    min-height: 62px !important;

    padding:
      11px !important;
  }

  .client-modal__title h3 {
    font-size: 17px !important;
  }
}/* =========================================================
   CLIENTES · TABLA OCUPANDO TODO EL ANCHO DISPONIBLE
   Agregar al FINAL de clientes.css
   ========================================================= */

/* El panel ocupa todo el ancho real */

.clients-panel {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

/* El contenedor de la tabla usa todo el espacio horizontal */

.clients-table-wrap {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;

  overflow-x: auto !important;
}

/* La tabla deja de quedar limitada por el contenido */

.clients-table {
  width: 100% !important;
  min-width: 100% !important;
  max-width: none !important;

  table-layout: fixed !important;
}

/* Distribución flexible de columnas principales */

.clients-table th[data-column-key="nombre"],
.clients-table td:nth-child(1) {
  width: 18% !important;
  min-width: 220px !important;
}

.clients-table th[data-column-key="tipo"],
.clients-table td:nth-child(2) {
  width: 8% !important;
  min-width: 110px !important;
}

.clients-table th[data-column-key="estado"],
.clients-table td:nth-child(3) {
  width: 8% !important;
  min-width: 105px !important;
}

.clients-table th[data-column-key="ciudad"],
.clients-table td:nth-child(4) {
  width: 10% !important;
  min-width: 130px !important;
}

.clients-table th[data-column-key="provincia"],
.clients-table td:nth-child(5) {
  width: 10% !important;
  min-width: 130px !important;
}

.clients-table th[data-column-key="forma_pago"],
.clients-table td:nth-child(6) {
  width: 10% !important;
  min-width: 140px !important;
}

.clients-table th[data-column-key="email"],
.clients-table td:nth-child(7) {
  width: 16% !important;
  min-width: 190px !important;
}

.clients-table th[data-column-key="vpm"],
.clients-table td:nth-child(8) {
  width: 7% !important;
  min-width: 90px !important;
}

.clients-table th[data-column-key="score"],
.clients-table td:nth-child(9) {
  width: 7% !important;
  min-width: 90px !important;
}

.clients-table th[data-column-key="responsable"],
.clients-table td:nth-child(10) {
  width: 10% !important;
  min-width: 120px !important;
}

.clients-table th[data-column-key="acciones"],
.clients-table td:nth-child(11) {
  width: 10% !important;
  min-width: 130px !important;
}

/* Evitar que el JS deje anchos inline demasiado rígidos */

.clients-table th[data-column-key] {
  max-width: none !important;
}

/* Las celdas pueden aprovechar mejor el ancho */

.clients-table th,
.clients-table td {
  max-width: none !important;
}

/* Mantener texto largo controlado */

.clients-table td,
.clients-th__sort span {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}/* =========================================================
   CLIENTES · BORDES VISIBLES + CUADRÍCULA
   Agregar al FINAL de clientes.css
   ========================================================= */

/* =========================================================
   BORDES PRINCIPALES
   ========================================================= */

.clients-head,
.clients-metrics,
.clients-map-panel,
.clients-panel,
.client-modal__card,
.clients-import-result {
  border:
    1px solid
    rgba(
      15,
      23,
      42,
      0.19
    ) !important;

  box-shadow:
    0 1px 0
    rgba(
      255,
      255,
      255,
      0.85
    ) inset,
    0 5px 16px
    rgba(
      15,
      23,
      42,
      0.055
    ) !important;
}

/* =========================================================
   MÉTRICAS · CUADRÍCULA VISIBLE
   ========================================================= */

.clients-metrics {
  border-collapse: separate !important;
  overflow: hidden !important;
}

.clients-metric {
  border-right:
    1px solid
    rgba(
      15,
      23,
      42,
      0.16
    ) !important;

  border-bottom:
    0 !important;
}

.clients-metric:last-child {
  border-right: 0 !important;
}

.clients-metric:hover {
  background:
    rgba(
      15,
      23,
      42,
      0.04
    ) !important;
}

/* =========================================================
   MAPA · CARDS INTERNAS
   ========================================================= */

.clients-map-head {
  border-bottom:
    1px solid
    rgba(
      15,
      23,
      42,
      0.17
    ) !important;
}

.clients-map-title__icon,
.clients-map-stat,
.clients-map-empty {
  border-color:
    rgba(
      15,
      23,
      42,
      0.18
    ) !important;
}

.clients-map-stat {
  background:
    rgba(
      15,
      23,
      42,
      0.025
    ) !important;
}

.clients-map-stat:hover {
  border-color:
    rgba(
      15,
      23,
      42,
      0.28
    ) !important;

  background:
    rgba(
      15,
      23,
      42,
      0.05
    ) !important;
}

/* =========================================================
   TOOLBAR
   ========================================================= */

.clients-toolbar {
  border-bottom:
    1px solid
    rgba(
      15,
      23,
      42,
      0.17
    ) !important;
}

.clients-search,
.clients-filters input,
.clients-filters select {
  border-color:
    rgba(
      15,
      23,
      42,
      0.18
    ) !important;
}

/* =========================================================
   TABLA · CUADRÍCULA COMPLETA
   ========================================================= */

.clients-table-wrap {
  border-top:
    1px solid
    rgba(
      15,
      23,
      42,
      0.16
    ) !important;
}

.clients-table {
  border-collapse: separate !important;
  border-spacing: 0 !important;

  border:
    1px solid
    rgba(
      15,
      23,
      42,
      0.2
    ) !important;
}

.clients-table th,
.clients-table td {
  border-right:
    1px solid
    rgba(
      15,
      23,
      42,
      0.15
    ) !important;

  border-bottom:
    1px solid
    rgba(
      15,
      23,
      42,
      0.15
    ) !important;
}

.clients-table th:last-child,
.clients-table td:last-child {
  border-right: 0 !important;
}

.clients-table tbody tr:last-child td {
  border-bottom: 0 !important;
}

/* Encabezado más marcado */

.clients-table thead th {
  background:
    color-mix(
      in srgb,
      var(--panel-solid) 92%,
      #eef1f4
    ) !important;

  border-bottom:
    1px solid
    rgba(
      15,
      23,
      42,
      0.22
    ) !important;
}

/* Filas alternadas */

.clients-table tbody tr:nth-child(even) td {
  background:
    rgba(
      15,
      23,
      42,
      0.018
    ) !important;
}

.clients-table tbody tr:hover td {
  background:
    rgba(
      15,
      23,
      42,
      0.05
    ) !important;
}

/* Columna acciones separada */

.clients-table th:last-child,
.clients-table td:last-child {
  border-left:
    1px solid
    rgba(
      15,
      23,
      42,
      0.2
    ) !important;
}

/* =========================================================
   BADGES
   ========================================================= */

.client-type,
.client-status,
.client-score,
.client-avatar {
  border-color:
    rgba(
      15,
      23,
      42,
      0.18
    ) !important;
}

/* =========================================================
   CARDS MOBILE · CUADRÍCULA
   ========================================================= */

.client-mobile-card,
.clients-mobile-empty {
  border:
    1px solid
    rgba(
      15,
      23,
      42,
      0.19
    ) !important;

  box-shadow:
    0 4px 14px
    rgba(
      15,
      23,
      42,
      0.045
    ) !important;
}

.client-mobile-card__grid {
  gap: 0 !important;

  border:
    1px solid
    rgba(
      15,
      23,
      42,
      0.17
    ) !important;

  border-radius: 10px !important;

  overflow: hidden !important;
}

.client-mobile-card__grid > div {
  min-height: 58px !important;

  border: 0 !important;

  border-right:
    1px solid
    rgba(
      15,
      23,
      42,
      0.14
    ) !important;

  border-bottom:
    1px solid
    rgba(
      15,
      23,
      42,
      0.14
    ) !important;

  border-radius: 0 !important;
}

.client-mobile-card__grid > div:nth-child(2n) {
  border-right: 0 !important;
}

.client-mobile-card__grid > div:nth-last-child(-n + 2) {
  border-bottom: 0 !important;
}

/* =========================================================
   MODAL · FORMULARIO CUADRICULADO
   ========================================================= */

.client-form-grid {
  gap: 0 !important;

  margin: 14px !important;
  padding: 0 !important;

  border:
    1px solid
    rgba(
      15,
      23,
      42,
      0.18
    ) !important;

  border-radius: 11px !important;

  overflow: hidden !important;
}

.client-field {
  min-height: 72px !important;

  padding:
    11px
    12px !important;

  border-right:
    1px solid
    rgba(
      15,
      23,
      42,
      0.14
    ) !important;

  border-bottom:
    1px solid
    rgba(
      15,
      23,
      42,
      0.14
    ) !important;
}

.client-field:nth-child(4n) {
  border-right: 0 !important;
}

.client-field:hover,
.client-field:focus-within {
  background:
    rgba(
      15,
      23,
      42,
      0.025
    ) !important;
}

.client-field input,
.client-field select,
.client-field textarea {
  border-color:
    rgba(
      15,
      23,
      42,
      0.17
    ) !important;
}

/* =========================================================
   IMPORTACIÓN
   ========================================================= */

.clients-import-drop,
.clients-import-preview pre {
  border-color:
    rgba(
      15,
      23,
      42,
      0.18
    ) !important;
}

.clients-import-result__grid {
  gap: 0 !important;

  border:
    1px solid
    rgba(
      15,
      23,
      42,
      0.16
    ) !important;

  border-radius: 9px !important;

  overflow: hidden !important;
}

.clients-import-result__grid span,
.clients-import-result__grid strong {
  border-right:
    1px solid
    rgba(
      15,
      23,
      42,
      0.13
    ) !important;

  border-bottom:
    1px solid
    rgba(
      15,
      23,
      42,
      0.13
    ) !important;

  border-radius: 0 !important;
}

/* =========================================================
   HOVER DE BLOQUES
   ========================================================= */

.clients-head:hover,
.clients-map-panel:hover,
.clients-panel:hover,
.client-mobile-card:hover {
  border-color:
    rgba(
      15,
      23,
      42,
      0.29
    ) !important;
}

/* =========================================================
   MODO OSCURO
   ========================================================= */

html[data-theme="dark"] .clients-head,
html[data-theme="dark"] .clients-metrics,
html[data-theme="dark"] .clients-map-panel,
html[data-theme="dark"] .clients-panel,
html[data-theme="dark"] .client-modal__card,
html[data-theme="dark"] .clients-import-result {
  border-color:
    rgba(
      255,
      255,
      255,
      0.2
    ) !important;
}

html[data-theme="dark"] .clients-metric,
html[data-theme="dark"] .clients-map-head,
html[data-theme="dark"] .clients-toolbar,
html[data-theme="dark"] .clients-table th,
html[data-theme="dark"] .clients-table td,
html[data-theme="dark"] .client-field,
html[data-theme="dark"] .client-mobile-card__grid > div {
  border-right-color:
    rgba(
      255,
      255,
      255,
      0.13
    ) !important;

  border-bottom-color:
    rgba(
      255,
      255,
      255,
      0.13
    ) !important;
}

html[data-theme="dark"] .clients-table {
  border-color:
    rgba(
      255,
      255,
      255,
      0.2
    ) !important;
}

html[data-theme="dark"] .clients-table thead th {
  background:
    #111111 !important;

  border-bottom-color:
    rgba(
      255,
      255,
      255,
      0.21
    ) !important;
}

html[data-theme="dark"]
.clients-table
tbody
tr:nth-child(even)
td {
  background:
    rgba(
      255,
      255,
      255,
      0.025
    ) !important;
}

html[data-theme="dark"]
.clients-table
tbody
tr:hover
td {
  background:
    rgba(
      255,
      255,
      255,
      0.06
    ) !important;
}

html[data-theme="dark"] .client-mobile-card,
html[data-theme="dark"] .clients-mobile-empty,
html[data-theme="dark"] .client-mobile-card__grid,
html[data-theme="dark"] .client-form-grid,
html[data-theme="dark"] .clients-map-title__icon,
html[data-theme="dark"] .clients-map-stat {
  border-color:
    rgba(
      255,
      255,
      255,
      0.18
    ) !important;
}

/* =========================================================
   RESPONSIVE DEL FORMULARIO
   ========================================================= */

@media (max-width: 980px) {
  .client-field:nth-child(4n) {
    border-right:
      1px solid
      rgba(
        15,
        23,
        42,
        0.14
      ) !important;
  }

  .client-field:nth-child(2n) {
    border-right: 0 !important;
  }
}

@media (max-width: 760px) {
  .client-form-grid {
    margin: 10px !important;
  }

  .client-field,
  .client-field:nth-child(2n),
  .client-field:nth-child(4n) {
    border-right: 0 !important;
  }

  .client-field:last-child {
    border-bottom: 0 !important;
  }
}

@media (max-width: 480px) {
  .client-mobile-card__grid > div {
    border-right: 0 !important;
  }

  .client-mobile-card__grid > div:nth-last-child(-n + 2) {
    border-bottom:
      1px solid
      rgba(
        15,
        23,
        42,
        0.14
      ) !important;
  }

  .client-mobile-card__grid > div:last-child {
    border-bottom: 0 !important;
  }
}