.client-modern-body {
    background-color: #f3f4f6;
    font-family: 'Nunito Sans', sans-serif;
}

.client-modern-main {
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
}

/* --- Encabezado --- */
.client-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.client-identity {
    display: flex;
    align-items: center;
    gap: 15px;
}

.client-avatar-l {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #4b5563;
}

.client-name {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.client-meta {
    font-size: 16px;
    color: #6b7280;
    margin: 0;
    letter-spacing: 2px;

}

.client-summary {
    display: flex;
    align-items: center;
    gap: 55px;
}

.summary-item {
    text-align: right;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    display: block;
    text-align: center;
    border-radius: 12px;
}

.summary-value.total-debt { color: #111827; }

.summary-label {
    font-size: 12px;
    color: #6b7280;
    letter-spacing: 0.5px;
}

.client-actions {
    display: flex;
    gap: 10px;
    border-left: 1px solid #e5e7eb;
    padding-left: 25px;
}

.btn-action-primary, .btn-action-secondary, .btn-action-sms, .btn-action-ws {
    padding: 10px 10px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s;
}
.btn-action-ws {
    background-color: #147d1f;
    color: white;
}

.btn-action-primary {
    background-color: #3b82f6;
    color: white;
}
.btn-action-primary:hover { background-color: #2563eb; }

.btn-action-secondary {
    background-color: #e5e7eb;
    color: #374151;
}
.btn-action-secondary:hover { background-color: #d1d5db; }

/* === BOTÓN EDITAR PROMESA === */
.btn-edit-promise {
  background-color: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}
.btn-edit-promise:hover:not(:disabled) {
  background-color: #2563eb;
  transform: translateY(-1px);
}
.btn-edit-promise:disabled {
  background-color: #d1d5db;
  color: #6b7280;
  cursor: not-allowed;
  box-shadow: none;
}

/* --- Contenido Principal --- */
.client-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.main-panel, .sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 15px;
}

/* --- Pestañas --- */
.tabs {
    display: flex;
    border-bottom: 1px solid #d1d5db;
    gap: 110px;
}

.tab-link {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    color: #6b7280;
    border-bottom: 3px solid transparent;
}

.tab-link.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-content { display: none; }
.tab-content.active { display: block; background-color: #fff; padding: 20px; border-radius: 0 0 12px 12px; }

/* --- Timeline --- */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.timeline-item {
    display: flex;
    gap: 15px;
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
}

.timeline-title {
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.timeline-date {
    font-size: 12px;
    color: #6b7280;
    margin-left: 10px;
}

.timeline-description {
     margin-left: 60px; 
     color: #374151;
     font-size: 14px;
     line-height: 1.5;
}

.timeline-user { 
    font-size: 12px; 
    color: #898b8f; 
    margin: 0; 
}

.info-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 15px; 
}

.info-client-container {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
    background-color: #f2f2f2;
    /* border: 1px solid #ccc; */
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    flex-wrap: wrap;
}

.info-client-card {
    width: 45%;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.title-card-client-information {
    color: #374151;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
}

.text-client-information {
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 10px;
}

/* --- Barra Lateral --- */
.card-action, .card-recommendation {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.action-form-modern .form-group {
    margin-bottom: 15px;
}
.action-form-modern label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 5px;
    color: #374151;
}
.action-form-modern input, .action-form-modern select, .action-form-modern textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}
.full-width { width: 100%; }

.card-recommendation p { color: #374151; }
.recommendation-details { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; }
.badge-priority { padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-priority.medium { background-color: #fef3c7; color: #92400e; }

/* ===================== ACCIONES (pestaña) ===================== */

/* Expande un poco las cards dentro de la pestaña y mejora el espaciado */
.acciones-tab .info-client-card {
  background-color: #ffffff;
  border: 1px solid #eef2f7;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(17, 24, 39, 0.04);
}

/* Fila del selector de producto: label + select en línea, alineados y sin desbordes */
.acciones-tab .actions-select-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap; /* si se achica el viewport, baja a dos líneas elegantes */
  margin-top: 6px;
}

.acciones-tab .actions-select-row .phones-others-label {
  min-width: 160px;
  margin: 0;
}

.acciones-tab #actions-loan-select,
.acciones-tab .actions-select-row select {
  width: clamp(260px, 48vw, 560px); /* nunca desborda, crece cómodo */
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 14px;
  color: #111827;
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.acciones-tab .actions-select-row select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

/* Card de botones: grid suave y ancho cómodo */
.acciones-tab .acciones-card {
  display: grid;
  gap: 12px;
}

/* 4 botones en una sola fila en desktop */
.acciones-tab .acciones-button-row {
  display: flex;
  gap: 12px;
  flex-wrap: nowrap;         /* fuerza una línea en anchos normales */
  align-items: stretch;
}

/* Botones: misma altura, padding y aspecto consistente con los existentes */
.acciones-tab .acciones-button-row .btn-action-primary,
.acciones-tab .acciones-button-row .btn-action-secondary,
.acciones-tab .acciones-button-row .btn-action-ws {
  flex: 0 0 auto;            /* no estiran raro */
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 10px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;       /* evita corte de texto */
}

/* Iconos apenas más presentes en esta sección */
.acciones-tab .acciones-button-row i {
  font-size: 14px;
}

/* Texto de ayuda */
.acciones-tab .text-client-information {
  opacity: .8;
  margin-top: 4px;
}

/* Responsivo: si el main se estrecha, pasamos a 2x2 y luego a 1x4 */
@media (max-width: 1100px) {
  .acciones-tab .acciones-button-row {
    flex-wrap: wrap;                 /* permite salto */
  }
  .acciones-tab .acciones-button-row > * {
    flex: 1 1 calc(50% - 12px);      /* dos por fila */
  }
}
@media (max-width: 560px) {
  .acciones-tab .acciones-button-row > * {
    flex: 1 1 100%;                  /* uno por fila en mobile chico */
  }
  .acciones-tab .actions-select-row .phones-others-label {
    min-width: 120px;
  }
  .acciones-tab #actions-loan-select,
  .acciones-tab .actions-select-row select {
    width: 100%;
  }
}
