/* Directorio de clientes: vista de tabla en escritorio y tarjetas compactas en móvil. */
.clientes-view { width: 100%; }
.clientes-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
.clientes-directory-card,
.clientes-insight-card {
  min-width: 0;
  overflow: visible;
  border: 1px solid #e7edf5;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(32, 56, 100, .055);
}
.clientes-directory-card { overflow: hidden; }
.clientes-directory-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 19px;
}
.clientes-heading-copy { display: flex; align-items: center; gap: 14px; min-width: 0; }
.clientes-heading-icon,
.clientes-insight-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
}
.clientes-heading-icon { width: 54px; height: 54px; color: #07875f; background: #e7fbf2; }
.clientes-heading-icon svg { width: 25px; height: 25px; }
.clientes-heading-copy h2 { margin: 0; color: #101a36; font-size: clamp(20px, 1.7vw, 27px); font-weight: 850; line-height: 1.12; letter-spacing: -.045em; }
.clientes-heading-copy p { margin: 5px 0 0; color: #77859d; font-size: 13px; font-weight: 500; }
.clientes-new-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 0 19px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #08b77a, #079668);
  box-shadow: 0 9px 20px rgba(8, 183, 122, .2);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.clientes-new-button:hover { background: linear-gradient(135deg, #079d6a, #057b57); box-shadow: 0 11px 24px rgba(8, 150, 101, .25); }
.clientes-new-button svg { width: 18px; height: 18px; }
.clientes-toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 1.35fr) repeat(3, minmax(130px, .65fr));
  gap: 10px;
  padding: 0 22px 17px;
}
.clientes-search-field,
.clientes-filter-field {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 43px;
  align-items: center;
  border: 1px solid #e2e8f1;
  border-radius: 11px;
  background: #fff;
  color: #78869d;
}
.clientes-search-field { gap: 9px; padding: 0 12px; }
.clientes-search-field > svg { width: 17px; height: 17px; flex: 0 0 auto; color: #8694a8; }
.clientes-search-field input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0 !important;
  outline: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: #172441;
  font: inherit;
  font-size: 12px;
}
.clientes-search-field input::placeholder { color: #94a0b3; }
.clientes-filter-field select {
  width: 100%;
  min-width: 0;
  height: 100%;
  appearance: none;
  padding: 0 32px 0 12px;
  border: 0 !important;
  outline: 0;
  border-radius: inherit;
  background: transparent !important;
  box-shadow: none !important;
  color: #56647d;
  font-family: inherit;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}
.clientes-filter-field > svg { position: absolute; right: 10px; width: 14px; height: 14px; pointer-events: none; color: #66758e; }
.clientes-table-scroll { width: 100%; overflow-x: auto; border-top: 1px solid #edf0f5; }
.clientes-table { min-width: 800px; }
.clientes-table-head,
.clientes-card-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.22fr) minmax(145px, 1.08fr) minmax(145px, 1.12fr) minmax(82px, .62fr) minmax(110px, .86fr) 92px;
  align-items: center;
  column-gap: 12px;
}
.clientes-table-head {
  min-height: 43px;
  padding: 0 18px;
  background: #f7f9fc;
  color: #78859b;
  font-size: 10px;
  font-weight: 800;
}
.clientes-table-head span:last-child { text-align: center; }
.clientes-table-body { display: flex; flex-direction: column; background: #fff; }
.clientes-card-row {
  min-height: 68px;
  padding: 10px 18px;
  border-bottom: 1px solid #edf0f5;
  background: #fff;
  color: #172441;
  transition: background-color .16s ease;
}
body:has(#view-dashboard) #clientes-grid .clientes-card-row {
  display: grid !important;
  grid-template-columns: minmax(160px, 1.22fr) minmax(145px, 1.08fr) minmax(145px, 1.12fr) minmax(82px, .62fr) minmax(110px, .86fr) 92px;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border: 0;
  border-bottom: 1px solid #edf0f5;
  border-radius: 0;
  box-shadow: none;
}
.clientes-card-row:last-child { border-bottom: 0; }
.clientes-card-row:hover { background: #fbfdfd; }
.clientes-client-cell,
.clientes-contact-cell,
.clientes-interaction-cell,
.clientes-tags-cell,
.clientes-actions-cell { display: flex; min-width: 0; align-items: center; }
.clientes-client-cell { gap: 11px; }
.clientes-client-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  font-size: 17px;
  font-weight: 800;
}
.clientes-client-avatar.tone-0 { background: #e2faef; color: #08a66f; }
.clientes-client-avatar.tone-1 { background: #f1e5ff; color: #8b42df; }
.clientes-client-avatar.tone-2 { background: #ffe4ee; color: #e24d8c; }
.clientes-client-avatar.tone-3 { background: #e3f0ff; color: #2673e7; }
.clientes-client-avatar.tone-4 { background: #fff0db; color: #dd8a16; }
.clientes-client-copy,
.clientes-contact-copy,
.clientes-interaction-copy { display: flex; min-width: 0; flex-direction: column; }
.clientes-client-copy strong { overflow: hidden; color: #16213b; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.clientes-client-copy small,
.clientes-contact-copy small,
.clientes-interaction-copy small { overflow: hidden; margin-top: 3px; color: #8290a6; font-size: 10px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.clientes-contact-cell { gap: 8px; }
.clientes-contact-icon,
.clientes-interaction-icon { width: 16px; height: 16px; flex: 0 0 auto; color: #08a975; }
.clientes-contact-copy strong { overflow: hidden; color: #33425d; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.clientes-interaction-cell { gap: 8px; }
.clientes-interaction-icon { color: #3180eb; }
.clientes-interaction-copy strong { overflow: hidden; color: #53617a; font-size: 10px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.clientes-status-cell { display: flex; min-width: 0; }
.clientes-status-chip,
.clientes-tag-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  padding: 5px 9px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.clientes-status-chip { background: #e9fbf3; color: #079568; }
.clientes-status-chip.is-inactive { background: #f1f3f7; color: #75839b; }
.clientes-status-chip.is-prospect { background: #eff6ff; color: #2971d7; }
.clientes-status-chip i { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.clientes-tags-cell { gap: 5px; overflow: hidden; }
.clientes-tag-chip { background: #e9fbf3; color: #079568; }
.clientes-tag-chip.tone-blue { background: #edf5ff; color: #2875db; }
.clientes-tag-chip.tone-amber { background: #fff5e3; color: #d98a0c; }
.clientes-tag-chip.tone-violet { background: #f4ecff; color: #8344d7; }
.clientes-tag-chip.tone-rose { background: #fff0f3; color: #d64d78; }
.clientes-actions-cell { justify-content: flex-end; gap: 5px; }
.clientes-action-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.clientes-action-button svg { width: 17px; height: 17px; }
.clientes-action-button.is-chat { background: #edf5ff; color: #2d7ee8; }
.clientes-action-button.is-message { background: #e8fbf2; color: #08a269; }
.clientes-action-button:hover { filter: brightness(.96); transform: translateY(-1px); }
.cliente-row-menu { position: relative; flex: 0 0 auto; }
.cliente-row-menu summary { display: grid; width: 30px; height: 34px; place-items: center; border-radius: 9px; color: #7c8aa0; cursor: pointer; list-style: none; }
.cliente-row-menu summary::-webkit-details-marker { display: none; }
.cliente-row-menu summary svg { width: 18px; height: 18px; }
.cliente-row-menu[open] summary { background: #f2f5f9; }
.cliente-row-menu-popover { position: absolute; z-index: 30; top: calc(100% + 5px); right: 0; width: 140px; padding: 5px; border: 1px solid #e7edf5; border-radius: 12px; background: #fff; box-shadow: 0 12px 30px rgba(24, 39, 71, .14); }
.cliente-row-menu-popover button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 9px 8px; border: 0; border-radius: 8px; background: transparent; color: #53617a; font-size: 11px; font-weight: 700; text-align: left; cursor: pointer; }
.cliente-row-menu-popover button:hover { background: #f5f7fa; }
.cliente-row-menu-popover button.is-danger { color: #dc5067; }
.cliente-row-menu-popover svg { width: 14px; height: 14px; }
.clientes-empty { grid-column: 1 / -1; display: flex; min-height: 260px; align-items: center; justify-content: center; flex-direction: column; padding: 28px; color: #8b98ac; text-align: center; }
.clientes-empty-icon { display: grid; width: 54px; height: 54px; margin-bottom: 12px; place-items: center; border-radius: 50%; background: #f0fbf6; color: #08a875; }
.clientes-empty-icon svg { width: 24px; height: 24px; }
.clientes-empty strong { color: #33425d; font-size: 14px; }
.clientes-empty span { max-width: 360px; margin-top: 5px; font-size: 11px; line-height: 1.5; }

.clientes-insights { display: grid; gap: 14px; }
.clientes-insight-card { overflow: hidden; padding: 17px; }
.clientes-insight-title { display: flex; min-width: 0; align-items: center; gap: 9px; }
.clientes-insight-title h3 { overflow: hidden; margin: 0; color: #17223c; font-size: 13px; font-weight: 850; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.clientes-insight-title-spread { justify-content: space-between; gap: 8px; }
.clientes-insight-title-spread > .clientes-insight-title { min-width: 0; }
.clientes-insight-title-spread > a { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; color: #2874df; font-size: 9px; font-weight: 750; text-decoration: none; }
.clientes-insight-title-spread > a svg { width: 12px; height: 12px; }
.clientes-insight-icon { width: 33px; height: 33px; }
.clientes-insight-icon svg { width: 17px; height: 17px; }
.clientes-insight-icon.is-green { background: #e8fbf2; color: #08a875; }
.clientes-insight-icon.is-slate { background: #f0f3f8; color: #61718c; }
.clientes-insight-icon.is-mint { background: #e8fbf2; color: #16a97b; }
.clientes-summary-card { position: relative; isolation: isolate; }
.clientes-summary-total { position: relative; z-index: 1; display: flex; flex-direction: column; margin: 12px 0 13px 44px; }
.clientes-summary-total strong { color: #16213b; font-size: 32px; font-weight: 850; line-height: 1; letter-spacing: -.05em; }
.clientes-summary-total span { margin-top: 4px; color: #7b89a0; font-size: 10px; }
.clientes-summary-wave { position: absolute; z-index: -1; top: 32px; right: -12px; width: 68%; height: 70px; opacity: .62; background: linear-gradient(160deg, transparent 0 17%, #dbf8ea 18% 47%, #c8f4e0 48% 70%, transparent 71%); clip-path: polygon(0 70%, 25% 47%, 42% 55%, 63% 17%, 77% 24%, 100% 0, 100% 100%, 0 100%); }
.clientes-summary-stats { position: relative; z-index: 1; display: grid; gap: 0; margin: 0; }
.clientes-summary-stats > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; border-top: 1px solid #f0f2f6; }
.clientes-summary-stats dt { display: flex; align-items: center; gap: 8px; color: #77859d; font-size: 10px; }
.clientes-summary-stats dd { margin: 0; color: #283650; font-size: 11px; font-weight: 800; }
.clientes-status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #08b77a; }
.clientes-status-dot.is-inactive { background: #8592a8; }
.clientes-status-dot.is-new { background: #2874e7; }
.clientes-recent-list { display: grid; gap: 0; margin-top: 10px; }
.clientes-recent-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 47px; border-top: 1px solid #f0f2f6; color: inherit; text-decoration: none; }
.clientes-recent-avatar { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; background: #e7fbf2; color: #079b69; font-size: 12px; font-weight: 800; }
.clientes-recent-avatar.tone-1 { background: #f2e8ff; color: #8847d8; }
.clientes-recent-avatar.tone-2 { background: #fff0df; color: #d98b1b; }
.clientes-recent-avatar.tone-3 { background: #e9f2ff; color: #3678db; }
.clientes-recent-copy { display: flex; min-width: 0; flex-direction: column; }
.clientes-recent-copy strong { overflow: hidden; color: #283650; font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.clientes-recent-copy small { overflow: hidden; margin-top: 3px; color: #8390a4; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.clientes-recent-time { color: #7e8ba0; font-size: 9px; white-space: nowrap; }
.clientes-insight-empty { margin: 12px 0 3px; color: #8b97aa; font-size: 10px; }
.clientes-popular-tags { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 13px; }
.clientes-popular-tag { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-width: 0; padding: 6px 8px; border: 0; border-radius: 10px; background: #ecfbf4; color: #089668; font-size: 9px; font-weight: 750; cursor: pointer; }
.clientes-popular-tag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clientes-popular-tag strong { display: grid; width: 19px; height: 19px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: rgba(255,255,255,.72); color: #43516c; font-size: 9px; }
.clientes-popular-tag.tone-blue { background: #edf5ff; color: #2875db; }
.clientes-popular-tag.tone-amber { background: #fff5e3; color: #d98a0c; }
.clientes-popular-tag.tone-violet { background: #f4ecff; color: #8344d7; }
.clientes-popular-tag.tone-rose { background: #fff0f3; color: #d64d78; }

@media (min-width: 1440px) {
  .clientes-layout { grid-template-columns: minmax(0, 1fr) 306px; gap: 16px; }
}

@media (max-width: 1100px) and (min-width: 768px) {
  .clientes-toolbar { grid-template-columns: minmax(200px, 1.5fr) repeat(2, minmax(135px, .8fr)); }
  .clientes-filter-tag { grid-column: 3; }
}

@media (max-width: 767px) {
  body:has(#view-dashboard) #view-clientes { gap: 0; }
  .clientes-layout { gap: 13px; }
  .clientes-directory-card { border-radius: 19px; }
  .clientes-directory-heading { align-items: flex-start; flex-direction: column; gap: 13px; padding: 17px 15px 13px; }
  .clientes-heading-copy { gap: 10px; }
  .clientes-heading-icon { width: 43px; height: 43px; }
  .clientes-heading-icon svg { width: 21px; height: 21px; }
  .clientes-heading-copy h2 { font-size: 20px; }
  .clientes-heading-copy p { max-width: 290px; font-size: 11px; line-height: 1.45; }
  .clientes-new-button { width: 100%; min-height: 44px; border-radius: 12px; }
  .clientes-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 13px 13px; }
  .clientes-search-field { grid-column: 1 / -1; min-height: 43px; }
  .clientes-filter-field { min-height: 40px; }
  .clientes-filter-field select { padding-left: 9px; font-size: 10px; }
  .clientes-table-scroll { overflow: visible; }
  .clientes-table { min-width: 0; }
  .clientes-table-head { display: none; }
  body:has(#view-dashboard) #clientes-grid,
  #clientes-grid.clientes-table-body { display: flex !important; flex-direction: column; gap: 9px; padding: 10px; background: #f7f9fc; }
  body:has(#view-dashboard) #clientes-grid .clientes-card-row,
  #clientes-grid .clientes-card-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "client actions" "contact actions" "interaction interaction" "status tags";
    gap: 7px 10px;
    min-height: 0;
    padding: 13px;
    border: 1px solid #e7edf5;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 4px 13px rgba(32, 56, 100, .045);
  }
  body:has(#view-dashboard) #view-clientes .clientes-card-row .clientes-action-button { min-height: 32px; }
  .clientes-client-cell { grid-area: client; }
  .clientes-client-avatar { width: 37px; height: 37px; font-size: 15px; }
  .clientes-contact-cell { grid-area: contact; padding-left: 48px; }
  .clientes-interaction-cell { grid-area: interaction; padding: 7px 0 2px; border-top: 1px solid #f0f2f6; }
  .clientes-status-cell { grid-area: status; align-items: center; }
  .clientes-tags-cell { grid-area: tags; justify-content: flex-end; }
  .clientes-actions-cell { grid-area: actions; align-self: start; }
  .clientes-client-copy strong { font-size: 12px; }
  .clientes-client-copy small,
  .clientes-contact-copy small,
  .clientes-interaction-copy small { font-size: 9px; }
  .clientes-contact-copy strong { font-size: 10px; }
  .clientes-interaction-copy strong { font-size: 10px; }
  .clientes-action-button { width: 32px; height: 32px; }
  .clientes-insights { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .clientes-insight-card { padding: 15px; border-radius: 18px; }
  .clientes-summary-total strong { font-size: 29px; }
  .clientes-recent-item { min-height: 45px; }
}
