/* ══════════════════════════════════════════════════════════════════
   CLIENTES PAGE STYLES
   ══════════════════════════════════════════════════════════════════ */

/* SEARCH INPUT - Light mode */
:root.light-mode input[placeholder="Buscar cliente..."],
:root.light-mode input[placeholder="Buscar organización o cliente..."] {
  background: #ffffff !important;
  border: 1px solid #e0e1e8 !important;
  color: #000000 !important;
}

:root.light-mode input[placeholder="Buscar cliente..."]::placeholder,
:root.light-mode input[placeholder="Buscar organización o cliente..."]::placeholder {
  color: #9ca3af !important;
}

/* GRID */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

/* CARD */
.client-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.client-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.client-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 164, 255, 0.25), transparent);
}

.client-card:hover {
  border-color: rgba(139, 92, 246, 0.4);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.12);
}

/* LIGHT MODE - CARD */
:root.light-mode .client-card {
  background: #ffffff;
  border: 1px solid #e0e1e8;
}

:root.light-mode .client-card::before {
  display: none;
}

:root.light-mode .client-card::after {
  background: none;
}

:root.light-mode .client-card:hover {
  border-color: #7c3aed;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15);
}

/* HEADER */
.client-card-header {
  position: relative;
  z-index: 1;
}

.client-card-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin: 0;
  word-break: break-word;
  line-height: 1.2;
}

:root.light-mode .client-card-name {
  color: #000000;
}

.client-card-company {
  font-size: 10px;
  color: rgba(196, 164, 255, 0.5);
  margin: 2px 0 0 0;
  word-break: break-word;
}

:root.light-mode .client-card-company {
  color: #7a7a9e;
}

/* BODY */
.client-card-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.client-stat {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

:root.light-mode .client-stat {
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.15);
}

.client-stat-label {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: rgba(196, 164, 255, 0.5);
}

:root.light-mode .client-stat-label {
  color: #7a7a9e;
}

.client-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: rgba(167, 139, 250, 0.95);
  font-family: 'DM Serif Display', serif;
  line-height: 1;
}

:root.light-mode .client-stat-value {
  color: #7c3aed;
}

.client-info {
  font-size: 11px;
  color: rgba(196, 164, 255, 0.7);
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

:root.light-mode .client-info {
  color: #7a7a9e;
}

.client-info strong {
  color: rgba(220, 210, 255, 0.85);
  font-weight: 600;
}

:root.light-mode .client-info strong {
  color: #595975;
}

/* FOOTER */
.client-card-footer {
  position: relative;
  z-index: 1;
  margin-top: 4px;
}

.client-card-footer .btn {
  width: 100%;
  padding: 6px 12px;
  font-size: 11px;
}

/* RESPONSIVE */
@media (max-width: 1400px) {
  .clients-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 1024px) {
  .clients-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .client-card {
    padding: 12px;
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .clients-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .client-card {
    padding: 12px;
  }

  .client-card-name {
    font-size: 13px;
  }

  .client-stat-value {
    font-size: 16px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   ORGANIZATION CARDS & PANELS
   ══════════════════════════════════════════════════════════════════ */

.orgs-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 12px;
}

.org-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.org-card:hover {
  border-color: rgba(139, 92, 246, 0.4);
  border-left-color: rgba(139, 92, 246, 0.6);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
}

.org-card-expanded {
  border-color: rgba(139, 92, 246, 0.4);
  border-left-color: rgba(139, 92, 246, 0.8);
  background: rgba(255, 255, 255, 0.06);
}

.org-card-info {
  flex: 1;
}

.org-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 4px 0;
}

:root.light-mode .org-card-name {
  color: #000000;
}

.org-card-description {
  font-size: 12px;
  color: rgba(196, 164, 255, 0.5);
  margin: 0;
}

:root.light-mode .org-card-description {
  color: #7a7a9e;
}

.org-card-count {
  font-size: 12px;
  color: rgba(196, 164, 255, 0.6);
  margin-right: 16px;
  text-align: right;
}

:root.light-mode .org-card-count {
  color: #7a7a9e;
}

.org-card-chevron {
  font-size: 18px;
  color: rgba(196, 164, 255, 0.5);
  transition: transform 0.2s ease;
}

.org-card.expanded .org-card-chevron {
  transform: rotate(90deg);
}

/* ORGANIZATION CLIENTS PANEL */
.org-clients-panel {
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-top: none;
  border-radius: 0 0 10px 10px;
  background: rgba(139, 92, 246, 0.05);
  padding: 12px;
  margin: -1px 0 12px 0;
  display: none;
  animation: slideDown 0.2s ease;
}

.org-clients-panel.show {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.org-clients-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.org-clients-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(196, 164, 255, 0.7);
  margin: 0;
}

:root.light-mode .org-clients-title {
  color: #7a7a9e;
}

.org-clients-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}

.client-row {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  transition: all 0.15s ease;
}

.client-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(139, 92, 246, 0.3);
}

:root.light-mode .client-row {
  background: #f5f5fa;
  border: 1px solid #e0e1e8;
}

:root.light-mode .client-row:hover {
  background: #ffffff;
  border-color: #d4d4e8;
}

.client-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-row-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

:root.light-mode .client-row-name {
  color: #000000;
}

.client-row-details {
  font-size: 11px;
  color: rgba(196, 164, 255, 0.5);
}

:root.light-mode .client-row-details {
  color: #9ca3af;
}

.client-row-responsible {
  font-size: 10px;
  background: rgba(139, 92, 246, 0.2);
  color: rgba(196, 164, 255, 0.8);
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

:root.light-mode .client-row-responsible {
  background: rgba(124, 58, 237, 0.1);
  color: #7c3aed;
}

.client-row-actions {
  display: flex;
  gap: 6px;
}

.client-row-actions .btn {
  padding: 4px 8px;
  font-size: 10px;
  height: auto;
}

/* EMPTY STATE */
.clients-empty {
  text-align: center;
  padding: 24px;
  color: rgba(196, 164, 255, 0.5);
  font-size: 13px;
}

:root.light-mode .clients-empty {
  color: #9ca3af;
}

/* MODAL ASSIGN CLIENT - Light mode */
.client-assign-item {
  transition: all 0.15s ease;
}

:root.light-mode .client-assign-item {
  background: #ffffff !important;
  border: 1px solid #e0e1e8 !important;
}

:root.light-mode .client-assign-item:hover {
  background: #f5f5fa !important;
  border-color: #d4d4e8 !important;
}

.client-assign-item > div:first-child > div:first-child {
  color: #fff;
}

:root.light-mode .client-assign-item > div:first-child > div:first-child {
  color: #000000 !important;
}

.client-assign-item > div:first-child > div:last-child {
  color: rgba(196, 164, 255, 0.5);
}

:root.light-mode .client-assign-item > div:first-child > div:last-child {
  color: #9ca3af !important;
}

/* MODAL HEADER INFO - Light mode */
.modal-content {
  background: #0a0612;
}

:root.light-mode .modal-content {
  background: #ffffff !important;
  border-color: #e0e1e8 !important;
}

:root.light-mode .modal-content h2 {
  color: #000000 !important;
}

:root.light-mode .modal-content button[aria-label="Cerrar"] {
  background: #f0f0f5 !important;
  color: #000000 !important;
}

:root.light-mode .modal-content > div > div[style*="rgba(139,92,246"]  {
  background: rgba(124, 58, 237, 0.08) !important;
  border-color: rgba(124, 58, 237, 0.2) !important;
  color: #7c3aed !important;
}

/* MODAL BUTTONS - Light mode */
:root.light-mode .modal-content .btn-ghost {
  background: #ffffff !important;
  border: 1px solid #d4d4e8 !important;
  color: #000000 !important;
}

:root.light-mode .modal-content .btn-ghost:hover {
  background: #f0f0f5 !important;
  border-color: #7c3aed !important;
  color: #000000 !important;
}

:root.light-mode .modal-content .btn-outline {
  color: #000000 !important;
  border-color: rgba(124, 58, 237, 0.35) !important;
  background: transparent !important;
}

:root.light-mode .modal-content .btn-outline:hover {
  background: rgba(124, 58, 237, 0.08) !important;
  border-color: #7c3aed !important;
  color: #000000 !important;
}
