/* =====================================================================
   panel-amigable.css — MyBroker Panama
   Diseño amigable para los paneles de comprador, vendedor, arrendador
   y arrendatario, tomando el look editorial del index:
   fondo crema #faf9f6, texto #183b3b, acento teal #247564,
   titulares en Instrument Serif y cuerpo en DM Sans.
   Se activa cuando body tiene la clase .panel-friend (ver js/dashboard.js).
   ===================================================================== */

body.panel-friend {
  background: #faf9f6;
  color: #183b3b;
  font-family: 'DM Sans', 'Inter', sans-serif;
}

/* ---------- Barra lateral ---------- */
body.panel-friend .dash-sidebar {
  background: #fffdf9;
  border-right: 1px solid #e4e6dc;
}
body.panel-friend .dash-sidebar__logo {
  border-bottom: 1px solid #e4e6dc;
  padding: 22px 20px;
}
body.panel-friend .dash-sidebar__logo .logo-text {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 1.45rem;
  color: #123d3e;
  letter-spacing: -.01em;
}
body.panel-friend .dash-sidebar__footer { border-top: 1px solid #e4e6dc; }

/* Logo con rol: icono casita + "MyBroker" + rol debajo (p. ej. "Comprador") */
body.panel-friend .dash-sidebar__logo .logo-text {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
body.panel-friend .dash-sidebar__logo .logo-text i { font-size: 1.45rem; color: #123d3e; }
body.panel-friend .dash-sidebar__logo .logo-text > span { display: block; line-height: 1.05; }
.logo-role {
  display: block;
  margin-top: 3px;
  font-family: 'DM Sans', 'Inter', sans-serif;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #247564;
}

body.panel-friend .dash-nav__item {
  border-radius: 12px;
  color: #546e6a;
  font-weight: 500;
  font-size: .87rem;
  margin-bottom: 3px;
}
body.panel-friend .dash-nav__item:hover {
  background: #e3f3ef;
  color: #123d3e;
}
body.panel-friend .dash-nav__item.active {
  background: #123d3e;
  color: #fdfcf8;
  box-shadow: 0 6px 18px rgba(18, 61, 62, .18);
}

/* ---------- Cabecera ---------- */
body.panel-friend .dash-header {
  background: #faf9f6;
  border-bottom: 1px solid #e4e6dc;
  height: 64px;
}
body.panel-friend .dash-header__title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: -.01em;
  color: #123d3e;
}
body.panel-friend .dash-header__user { color: #546e6a; }
body.panel-friend .dash-role-badge {
  font-size: .72rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: capitalize;
  background: rgba(36, 117, 100, .12);
  color: #247564;
  white-space: nowrap;
}

/* ---------- Contenido ---------- */
body.panel-friend .dash-content {
  padding: 28px 32px 56px;
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

/* Tarjeta de bienvenida (solo paneles de cliente) */
.panel-bienvenida {
  background: linear-gradient(135deg, #123d3e 0%, #1c5a4e 100%);
  border-radius: 22px;
  padding: 28px 32px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  color: #fdfcf8;
}
.panel-bienvenida::before {
  content: '';
  position: absolute;
  right: -70px;
  top: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(227, 243, 239, .12);
}
.panel-bienvenida::after {
  content: '';
  position: absolute;
  right: 60px;
  bottom: -110px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(227, 243, 239, .08);
}
.panel-bienvenida h1 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 2rem;
  letter-spacing: -.01em;
  margin: 0 0 6px;
  position: relative;
  z-index: 1;
}
.panel-bienvenida p {
  margin: 0;
  color: rgba(253, 252, 248, .78);
  font-size: .92rem;
  position: relative;
  z-index: 1;
}
body:not(.panel-friend) .panel-bienvenida { display: none; }

/* ---------- Tarjetas de estadísticas ---------- */
body.panel-friend .stat-card {
  background: #fff;
  border: 1px solid #e4e6dc;
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(18, 61, 62, .05);
}
body.panel-friend .stat-card__label { color: #6b8480; font-weight: 500; }
body.panel-friend .stat-card__value {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 1.95rem;
  color: #123d3e;
}
body.panel-friend .stat-card__sub { color: #93a8a3; }

/* ---------- Tarjetas de contenido ---------- */
body.panel-friend .dash-card {
  background: #fff;
  border: 1px solid #e4e6dc;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 1px 3px rgba(18, 61, 62, .05);
}
body.panel-friend .dash-card__title {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 1.18rem;
  color: #123d3e;
  letter-spacing: -.01em;
}
body.panel-friend .dash-card__title i { color: #247564; }

/* ---------- Tablas ---------- */
body.panel-friend .dash-table th {
  background: #f1f5ee;
  color: #5b7370;
  border-radius: 0;
}
body.panel-friend .dash-table th:first-child { border-radius: 10px 0 0 10px; }
body.panel-friend .dash-table th:last-child { border-radius: 0 10px 10px 0; }
body.panel-friend .dash-table td {
  border-bottom: 1px solid #eef0e9;
  color: #2c4a49;
}
body.panel-friend .dash-table tr:hover td { background: #f7f9f4; }

/* ---------- Estados y textos auxiliares ---------- */
body.panel-friend .badge-estado,
body.panel-friend .badge-urgencia { border-radius: 20px; }
body.panel-friend .infoline strong { color: #247564; }
body.panel-friend .empty-state { color: #8fa39f; }

/* ---------- Modales ---------- */
body.panel-friend .modal {
  border-radius: 20px;
  border: 1px solid #e4e6dc;
  background: #fffdf9;
  box-shadow: 0 24px 80px rgba(18, 61, 62, .28);
}
body.panel-friend .modal__header { border-bottom: 1px solid #e4e6dc; }
body.panel-friend .modal__header h3 {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 1.3rem;
  color: #123d3e;
}
body.panel-friend .modal__footer { border-top: 1px solid #e4e6dc; }

/* =====================================================================
   Componentes de contratos y firmas
   ===================================================================== */

.contrato-lista { display: grid; gap: 14px; }

.contrato-card {
  background: #fff;
  border: 1px solid #e4e6dc;
  border-radius: 18px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(18, 61, 62, .05);
}
.contrato-card--destacada {
  border-color: #bfd9cf;
  box-shadow: 0 8px 24px rgba(36, 117, 100, .08);
}
.contrato-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.contrato-card__prop {
  font-family: 'Instrument Serif', Georgia, serif;
  font-weight: 400;
  font-size: 1.2rem;
  color: #123d3e;
  letter-spacing: -.01em;
}
.contrato-card__prop i { color: #247564; margin-right: 8px; font-size: 1rem; }
.contrato-card__datos {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding: 14px 0 12px;
}
.contrato-card__datos + .contrato-card__datos { border-top: 1px dashed #e4e6dc; }
.contrato-card__datos > div { min-width: 110px; }
.contrato-card__datos span {
  display: block;
  font-size: .68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #93a8a3;
  margin-bottom: 3px;
}
.contrato-card__datos strong { font-size: .92rem; font-weight: 600; color: #123d3e; }
.contrato-card__firmas { display: flex; gap: 8px; flex-wrap: wrap; }
.contrato-card__acciones {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e4e6dc;
}

/* Píldoras de firma */
.pill-firma {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .76rem;
  font-weight: 600;
  white-space: nowrap;
}
.pill-firma i { font-size: .9rem; }
.pill-firma.si { background: #e2f3ec; color: #1d7a5c; }
.pill-firma.falta { background: #fdf3e2; color: #b07818; }

/* Badge de estado de contrato */
.badge-festado {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
}
.badge-festado.ok { background: #e2f3ec; color: #1d7a5c; }
.badge-festado.pend { background: #fdf3e2; color: #b07818; }
.badge-festado.mal { background: #fbe5e5; color: #c0392b; }

/* Pasos para firmar (comprador / arrendatario) */
.firma-pasos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0 6px;
}
.firma-pasos .paso {
  background: #f7f9f4;
  border: 1px solid #e4e6dc;
  border-radius: 14px;
  padding: 14px;
}
.firma-pasos .paso.hecho { background: #eef6f2; border-color: #bfd9cf; }
.paso__num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #dbe4da;
  color: #546e6a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.paso.hecho .paso__num { background: #247564; color: #fff; }
.paso__titulo { font-size: .84rem; font-weight: 700; color: #123d3e; margin-bottom: 3px; }
.paso__txt { font-size: .75rem; color: #7d938f; line-height: 1.4; }

/* Grupos del menú lateral (ej. "Buscar", "Mi alquiler") */
.dash-nav__group {
  padding: 16px 14px 6px;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #93a8a3;
}
body.panel-friend .dash-nav__item { padding: 11px 14px; font-size: .9rem; }

/* ---------- Accesos rápidos (botones grandes) ---------- */
.menu-rapido {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.menu-rapido__btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  background: #fff;
  border: 1px solid #e4e6dc;
  border-radius: 16px;
  padding: 16px 18px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(18, 61, 62, .05);
  transition: all .15s ease;
}
.menu-rapido__btn:hover {
  border-color: #bfd9cf;
  background: #f4faf6;
  transform: translateY(-1px);
}
.menu-rapido__btn:active { transform: translateY(0); }
.menu-rapido__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #e3f3ef;
  color: #247564;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}
.menu-rapido__label {
  font-size: .95rem;
  font-weight: 600;
  color: #123d3e;
  line-height: 1.3;
}
.menu-rapido__hint {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  background: #fdf3e2;
  color: #b07818;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ---------- Estadísticas con icono ---------- */
body.panel-friend .stat-card { display: flex; align-items: center; gap: 14px; }
body.panel-friend .stat-card__body { min-width: 0; }
.stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #e3f3ef;
  color: #247564;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

/* ---------- Resumen de contratos (comprador, Inicio) ---------- */
.contrato-resumen {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid #e4e6dc;
  border-radius: 14px;
  background: #fffdf9;
}
.contrato-resumen + .contrato-resumen { margin-top: 10px; }
.contrato-resumen__info strong {
  display: block;
  font-size: .95rem;
  color: #123d3e;
  margin-bottom: 2px;
}
.contrato-resumen__info span { font-size: .8rem; color: #7d938f; }
.contrato-resumen__info a { color: #247564; text-decoration: none; }
.contrato-resumen__info a:hover { text-decoration: underline; }
.contrato-resumen__estado {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* ---------- Flujo de firma accesible (pensado para usuarios de 50+) ---------- */
.modal.firma-modal { max-width: 540px; }
.modal.firma-modal .modal__header h3 {
  font-size: 1.4rem;
  line-height: 1.25;
  padding-right: 8px;
}
.modal.firma-modal .modal__body > p {
  font-size: 1rem;
  line-height: 1.6;
  color: #2c4a49;
}
.firma-resumen {
  display: flex;
  flex-direction: column;
  border: 1px solid #e4e6dc;
  border-radius: 14px;
  overflow: hidden;
  margin: 0 0 14px;
}
.firma-resumen > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 11px 15px;
  font-size: .95rem;
  background: #fffdf9;
}
.firma-resumen > div + div { border-top: 1px solid #eef0e9; }
.firma-resumen span { color: #7d938f; white-space: nowrap; }
.firma-resumen strong { color: #123d3e; text-align: right; }
.firma-check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #eef6f2;
  border: 1px solid #d7e8de;
  border-radius: 14px;
  padding: 15px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1.55;
  color: #2c4a49;
}
.firma-check input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: #247564;
  cursor: pointer;
  flex-shrink: 0;
}
.firma-ayuda {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: .85rem;
  line-height: 1.5;
  color: #6b8480;
  margin: 0 0 14px;
}
.firma-ayuda i { color: #247564; font-size: 1rem; margin-top: 1px; }
.firma-exito-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #e2f3ec;
  color: #1d7a5c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 14px;
}

/* Botón grande para acciones importantes (firmar) */
.btn--lg {
  font-size: 1.05rem;
  padding: 13px 28px;
  border-radius: 14px;
  white-space: nowrap;
}
.btn[disabled] { opacity: .55; cursor: not-allowed; filter: grayscale(.3); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {  body.panel-friend .dash-content { padding: 20px 16px 40px; }
  .panel-bienvenida h1 { font-size: 1.5rem; }
  .firma-pasos { grid-template-columns: 1fr; }
  .contrato-card { padding: 16px; }
  .contrato-card__datos { gap: 16px; }
}
