/* ===== clients.css — Vista "Clientes" (portal) del lado del equipo ===== */

.clients-view { padding: 8px 32px 32px; }
.clients-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

.cl-card {
  background: var(--paper-card); border-radius: var(--radius);
  padding: 0 18px 16px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px;
  overflow: hidden; cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: card-in 300ms ease;
}
.cl-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cl-cover { width: calc(100% + 36px); height: 64px; margin: 0 -18px; background-size: cover; background-position: center; }
.cl-logo-ring { margin-top: -30px; padding: 3px; border-radius: 18px; background: var(--paper-card); box-shadow: var(--shadow-sm); }
.cl-logo {
  width: 58px; height: 58px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #0ea5e9);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 22px;
}
.cl-card h4 { margin: 6px 0 0; font-size: 15px; color: var(--navy-900); }
.cl-mail { font-size: 12px; color: var(--navy-500); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-badges { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.cl-badge {
  font-size: 11px; font-weight: 700; color: var(--navy-500);
  background: var(--paper); border: 1px solid var(--border);
  padding: 3px 9px; border-radius: 999px;
}
.cl-badge.on { color: var(--green); background: var(--green-bg); border-color: transparent; }

/* Tarjeta "+ Nuevo cliente" */
.cl-card-new {
  justify-content: center; gap: 6px; min-height: 178px;
  border: 2px dashed var(--border); background: none; box-shadow: none; padding: 18px;
}
.cl-card-new:hover { border-color: var(--primary); box-shadow: none; }
.cl-card-new b { color: var(--navy-900); font-size: 14.5px; }
.cl-card-new span { font-size: 12px; color: var(--navy-500); }
.cl-new-plus {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800;
}

.cl-skel {
  height: 178px; border-radius: var(--radius);
  background: linear-gradient(100deg, #eceff5 40%, #f6f8fc 50%, #eceff5 60%);
  background-size: 200% 100%; animation: cl-shimmer 1.2s infinite linear;
}
@keyframes cl-shimmer { to { background-position: -200% 0; } }
.cl-empty { grid-column: 1 / -1; text-align: center; color: var(--navy-500); padding: 40px; }

/* ===== Modal de gestión de cliente ===== */
.client-modal { width: min(640px, 94vw); }
.client-modal .modal-scroll { padding: 0; }
.cl-m-cover {
  height: clamp(110px, 22vw, 160px); background-size: cover; background-position: center;
  border-radius: 18px 18px 0 0; position: relative;
}
.cl-m-cover-actions { position: absolute; right: 12px; bottom: 12px; }
.cl-m-cover-actions .btn { background: rgba(255,255,255,0.92); box-shadow: var(--shadow-sm); }
.cl-m-identity { display: flex; align-items: flex-end; gap: 12px; padding: 0 24px; margin-top: -30px; position: relative; }
.cl-m-identity .cl-logo { width: 68px; height: 68px; font-size: 26px; }
.cl-m-logo-actions { padding-bottom: 6px; }
.cl-m-fields { padding: 14px 24px 8px; }
.cl-hint { font-size: 12px; color: var(--navy-500); margin: 4px 0 14px; line-height: 1.5; }

.cl-plan-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.cl-plan-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--paper); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 12px;
}
.cl-plan-ico { font-size: 18px; }
.cl-plan-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cl-plan-info b { font-size: 13px; color: var(--navy-900); }
.cl-plan-info small { font-size: 11.5px; color: var(--navy-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-plan-upload { display: flex; flex-direction: column; gap: 8px; }
.cl-plan-upload input[type="text"] {
  padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--paper-card); color: var(--navy-900); font-size: 13.5px;
}
.cl-plan-upload input[type="file"] { font-size: 12.5px; color: var(--navy-500); }
.cl-plan-upload .btn { align-self: flex-start; }

/* Modo noche */
[data-theme="dark"] .cl-skel { background: linear-gradient(100deg, #1e293b 40%, #263449 50%, #1e293b 60%); background-size: 200% 100%; }
[data-theme="dark"] .cl-m-cover-actions .btn { background: rgba(30,41,59,0.92); color: var(--navy-900); }

/* Sección de canales de clientes en el chat del equipo */
.chat-list-label {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--navy-500); padding: 10px 12px 4px;
}
.chat-client-tag {
  font-size: 9.5px; font-weight: 800; text-transform: uppercase;
  background: var(--green-bg); color: var(--green);
  padding: 1px 7px; border-radius: 999px; margin-left: 6px;
}

/* Móvil */
@media (max-width: 680px) {
  .clients-view { padding: 8px 14px 24px; }
  .clients-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .cl-m-fields { padding: 12px 16px 8px; }
  .cl-m-identity { padding: 0 16px; }
}
