
/*
  AVANZA CONTROL V5.5.2
  Refinamiento visual del módulo Clientes.
*/

#clientsSection {
  width: 100%;
  min-width: 0;
}

/* Encabezado principal */

#clientsSection .client-master-topbar {
  min-height: 92px;
  padding: 20px 22px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  border-bottom: 1px solid #d9e4ed;
  border-radius: 20px 20px 0 0;

  background:
    linear-gradient(
      135deg,
      #ffffff 0%,
      #f2f7fb 100%
    );

  color: #071f3d;
  box-shadow: none;
}

#clientsSection .client-master-topbar > div::before {
  display: block;
  margin-bottom: 6px;

  color: #075fb3;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: .16em;

  content: "GESTIÓN DE CLIENTES";
}

#clientsSection .client-master-topbar h2 {
  margin: 0;
  color: #071f3d;
  font-size: 26px;
  letter-spacing: -.025em;
}

#clientsSection .client-master-topbar p {
  margin: 5px 0 0;
  color: #718398;
  font-size: 12px;
  opacity: 1;
}

#clientsSection .client-master-topbar button {
  min-height: 42px;
  padding: 9px 14px;

  border: 1px solid #cadbe9;
  border-radius: 11px;

  background: #ffffff;
  color: #0756a3;

  font-size: 10px;
  font-weight: 850;
}

#clientsSection .client-master-topbar button:hover {
  border-color: #99c0e0;
  background: #edf6fd;
}

/* Distribución principal */

#clientsSection .client-master-layout {
  padding: 14px;

  grid-template-columns:
    minmax(300px, 340px)
    minmax(0, 1fr);

  gap: 14px;

  background:
    linear-gradient(
      145deg,
      #edf3f8,
      #f7fafc
    );
}

#clientsSection .client-master-sidebar,
#clientsSection .client-master-editor {
  border: 1px solid #d8e3ec;
  border-radius: 17px;

  background: #ffffff;

  box-shadow:
    0 7px 20px
    rgba(7, 31, 61, .05);
}

/* Panel izquierdo */

#clientsSection .client-master-sidebar {
  padding: 14px;
}

#clientsSection .client-master-actions {
  margin-bottom: 11px;

  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, .78fr);

  gap: 8px;
}

#clientsSection .client-master-primary,
#clientsSection .client-master-secondary {
  min-height: 42px;
  padding: 9px 11px;

  border-radius: 10px;

  font-size: 10px;
  font-weight: 850;
}

#clientsSection .client-master-primary {
  border: 1px solid #075fb3;
  background:
    linear-gradient(
      135deg,
      #075fb3,
      #1283d5
    );
  color: #ffffff;

  box-shadow:
    0 7px 15px
    rgba(7, 95, 179, .17);
}

#clientsSection .client-master-secondary {
  border: 1px solid #d5e1eb;
  background: #f8fafc;
  color: #415a72;
}

#clientsSection .client-master-search {
  width: 100%;
  min-height: 44px;
  margin-bottom: 11px;
  padding: 10px 13px;

  border: 1px solid #cbdbe8;
  border-radius: 11px;

  background: #f8fbfd;
  color: #18334d;

  font-size: 11px;
}

#clientsSection .client-master-search:focus {
  border-color: #68a7da;
  outline: 3px solid rgba(18, 131, 213, .10);
  background: #ffffff;
}

#clientsSection .client-master-list {
  display: grid;
  gap: 7px;
}

#clientsSection .client-master-row {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;

  display: block;

  border: 1px solid #e0e8ef;
  border-radius: 12px;

  background: #fbfdff;
  color: #3d5368;

  text-align: left;
  cursor: pointer;

  transition: .16s ease;
}

#clientsSection .client-master-row:hover {
  border-color: #b8d1e5;
  background: #f2f8fd;
  transform: translateX(2px);
}

#clientsSection .client-master-row.active {
  border-color: #8ebce1;
  background:
    linear-gradient(
      135deg,
      #e7f3fd,
      #f5faff
    );

  box-shadow:
    inset 3px 0 0 #075fb3;
}

#clientsSection .client-master-row strong {
  display: block;
  overflow: hidden;

  color: #152f49;
  font-size: 11px;
  font-weight: 850;

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

#clientsSection .client-master-row span,
#clientsSection .client-master-row small {
  display: block;
  margin-top: 4px;
  overflow: hidden;

  color: #718398;
  font-size: 9px;

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

/* Editor */

#clientsSection .client-master-editor {
  padding: 18px;
}

#clientsSection .client-master-heading {
  margin-bottom: 14px;
  padding: 3px 2px 15px;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;

  border-bottom: 1px solid #e6edf3;
}

#clientsSection .client-master-heading h3 {
  margin: 0;
  color: #071f3d;
  font-size: 21px;
  letter-spacing: -.02em;
}

#clientsSection .client-master-heading p {
  margin: 5px 0 0;
  color: #74869a;
  font-size: 10px;
}

#clientsSection .client-master-status {
  min-height: 29px;
  padding: 6px 10px;

  display: inline-flex;
  align-items: center;

  border: 1px solid #cbdbe8;
  border-radius: 999px;

  background: #f3f7fa;
  color: #51677d;

  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

#clientsSection .client-master-status.validated {
  border-color: #a9dfbf;
  background: #e9f8ef;
  color: #08743b;
}

#clientsSection .client-master-status.restricted {
  border-color: #f0bec3;
  background: #fdecee;
  color: #b42332;
}

/* Pestañas */

#clientsSection .client-master-tabs {
  margin-bottom: 15px;
  padding: 5px;

  display: grid;
  grid-template-columns:
    repeat(4, minmax(0, 1fr));

  gap: 6px;

  border: 1px solid #dce6ee;
  border-radius: 13px;

  background: #edf3f8;
}

#clientsSection .client-master-tabs button {
  min-height: 40px;
  padding: 8px 10px;

  border: 1px solid transparent;
  border-radius: 9px;

  background: transparent;
  color: #667b8f;

  font-size: 10px;
  font-weight: 800;
}

#clientsSection .client-master-tabs button:hover {
  background: rgba(255, 255, 255, .72);
}

#clientsSection .client-master-tabs button.active {
  border-color: #bdd6ea;
  background: #ffffff;
  color: #0756a3;

  box-shadow:
    0 4px 11px
    rgba(7, 31, 61, .06);
}

/* Formularios */

#clientsSection .client-master-tab {
  min-width: 0;
}

#clientsSection .client-master-section-title {
  margin: 18px 0 10px;
  padding-bottom: 8px;

  border-bottom: 1px solid #e7edf3;

  color: #193650;
  font-size: 12px;
  font-weight: 900;
}

#clientsSection .client-master-section-title:first-child {
  margin-top: 0;
}

#clientsSection .client-master-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 11px;
}

#clientsSection .client-master-grid label,
#clientsSection .client-reference-card label {
  min-width: 0;

  color: #556b80;
  font-size: 9px;
  font-weight: 800;
}

#clientsSection .client-master-grid label.double,
#clientsSection .client-master-grid label.wide {
  grid-column: 1 / -1;
}

#clientsSection .client-master-grid input,
#clientsSection .client-master-grid select,
#clientsSection .client-master-grid textarea,
#clientsSection .client-reference-card input,
#clientsSection .client-reference-card select,
#clientsSection .client-reference-card textarea {
  width: 100%;
  min-height: 42px;
  margin-top: 5px;
  padding: 9px 11px;

  border: 1px solid #d0dee9;
  border-radius: 10px;

  background: #fbfdff;
  color: #19334d;

  font-size: 11px;
}

#clientsSection .client-master-grid textarea,
#clientsSection .client-reference-card textarea {
  min-height: 80px;
  resize: vertical;
}

#clientsSection input:focus,
#clientsSection select:focus,
#clientsSection textarea:focus {
  border-color: #69a7d8;
  outline: 3px solid rgba(18, 131, 213, .09);
  background: #ffffff;
}

/* Referencias e historial */

#clientsSection .client-reference-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 11px;
}

#clientsSection .client-reference-card {
  padding: 13px;

  border: 1px solid #dce6ee;
  border-radius: 13px;

  background: #f9fbfd;
}

#clientsSection .client-history-row {
  margin-bottom: 8px;
  padding: 12px;

  border: 1px solid #dfe7ee;
  border-radius: 11px;

  background: #fbfdff;
}

/* Estado de preparación */

#clientsSection .client-master-readiness {
  margin: 14px 0;
  padding: 12px 14px;

  border: 1px solid #cfe0ed;
  border-radius: 12px;

  background:
    linear-gradient(
      135deg,
      #eef7fd,
      #f9fcff
    );

  color: #31516c;
}

/* Pie de acciones */

#clientsSection .client-master-footer {
  position: sticky;
  bottom: -18px;
  z-index: 4;

  margin: 18px -18px -18px;
  padding: 12px 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  border-top: 1px solid #dce6ee;

  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(12px);
}

#clientsSection .client-master-footer > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Adaptación */

@media (max-width: 1180px) {
  #clientsSection .client-master-layout {
    grid-template-columns:
      minmax(270px, 310px)
      minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  #clientsSection .client-master-layout {
    grid-template-columns: 1fr;
  }

  #clientsSection .client-master-sidebar,
  #clientsSection .client-master-editor {
    max-height: none;
  }

  #clientsSection .client-master-list {
    max-height: 330px;
    overflow-y: auto;
  }
}

@media (max-width: 620px) {
  #clientsSection .client-master-topbar {
    padding: 17px;
  }

  #clientsSection .client-master-topbar h2 {
    font-size: 23px;
  }

  #clientsSection .client-master-actions,
  #clientsSection .client-master-tabs,
  #clientsSection .client-master-grid,
  #clientsSection .client-reference-grid {
    grid-template-columns: 1fr;
  }

  #clientsSection .client-master-grid label.double,
  #clientsSection .client-master-grid label.wide {
    grid-column: auto;
  }

  #clientsSection .client-master-footer {
    align-items: stretch;
    flex-direction: column;
  }
}
