:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --dark: #1d3557;
  --light: #f4f4f6;
  --shadow: 0 4px 14px rgba(0,0,0,0.09);
  --radius: 14px;
  --transition: all 0.22s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--light);
  color: #333;
  padding-bottom: 60px;
}

/* ── Navbar ── */
.perfil-navbar {
  position: sticky; top: 0; z-index: 100;
  background: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.perfil-navbar-title { font-weight: 700; font-size: 1rem; color: var(--dark); }
.btn-back, .btn-logout {
  background: none; border: none; font-size: 1.1rem;
  cursor: pointer; padding: 6px 10px; border-radius: 50%;
  color: #555; text-decoration: none; transition: var(--transition);
  display: flex; align-items: center;
}
.btn-back:hover { background: #f0f0f0; }
.btn-logout { color: var(--primary); }
.btn-logout:hover { background: #fff0f0; }

/* ── Hero ── */
.perfil-hero {
  background: linear-gradient(135deg, var(--dark) 0%, #457b9d 100%);
  padding: 28px 16px 20px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center; position: relative;
}
.hero-avatar-wrap { position: relative; margin-bottom: 12px; }
.hero-avatar {
  width: 88px; height: 88px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 3px solid rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; color: #fff; overflow: hidden;
}
.hero-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-edit-btn {
  position: absolute; bottom: 0; right: 0;
  background: var(--primary); color: #fff;
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: var(--transition);
}
.avatar-edit-btn:hover { background: var(--primary-dark); }
.hero-name { font-size: 1.3rem; font-weight: 800; color: #fff; margin-bottom: 2px; }
.hero-sub { font-size: 0.85rem; color: rgba(255,255,255,0.7); margin-bottom: 16px; }

.hero-stats {
  background: rgba(255,255,255,0.12);
  border-radius: 12px; padding: 12px 24px;
  display: flex; gap: 20px; align-items: center;
}
.stat-item { display: flex; flex-direction: column; align-items: center; }
.stat-val { font-size: 1.3rem; font-weight: 800; color: #fff; }
.stat-label { font-size: 0.72rem; color: rgba(255,255,255,0.65); }
.stat-divider { width: 1px; height: 32px; background: rgba(255,255,255,0.2); }

/* ── Tabs ── */
.perfil-tabs {
  display: flex; background: #fff;
  border-bottom: 2px solid #eee;
  position: sticky; top: 53px; z-index: 90;
}
.ptab {
  flex: 1; padding: 12px 8px; border: none;
  background: none; font-size: 0.83rem; font-weight: 600;
  color: #aaa; cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: var(--transition);
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.ptab i { font-size: 0.8rem; }
.ptab.active { color: var(--primary); border-bottom-color: var(--primary); }
.ptab:hover:not(.active) { color: #666; }

/* ── Body ── */
.perfil-body { max-width: 680px; margin: 0 auto; padding: 16px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Section card ── */
.section-card {
  background: #fff; border-radius: var(--radius);
  padding: 20px; margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.sc-title {
  font-size: 0.95rem; font-weight: 700; color: var(--dark);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.sc-title i { color: var(--primary); }
.sc-title.danger { color: var(--primary); }

/* ── Campos ── */
.field-group { margin-bottom: 14px; }
.field-group label, .field-label {
  display: block; font-size: 0.8rem; font-weight: 600;
  color: #666; margin-bottom: 5px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pf-input {
  width: 100%; padding: 10px 14px;
  border: 2px solid #eee; border-radius: 10px;
  font-size: 0.9rem; font-family: inherit;
  outline: none; transition: border-color 0.2s;
  background: #fff; color: #333;
}
.pf-input:focus { border-color: var(--primary); }
.pf-input[readonly] { background: #f8f8f8; color: #aaa; cursor: not-allowed; }
.pf-textarea { resize: vertical; min-height: 80px; }
.field-hint { font-size: 0.75rem; color: #bbb; margin-top: 4px; }
.field-hint-inline { font-size: 0.75rem; color: #bbb; font-weight: 400; }

/* Tags inputs */
.tags-inputs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 6px;
}

/* Password */
.input-pw-wrap { position: relative; }
.input-pw-wrap .pf-input { padding-right: 38px; }
.toggle-pw {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%); color: #bbb;
  cursor: pointer; font-size: 0.9rem;
}
.toggle-pw:hover { color: var(--primary); }

/* ── Save bar ── */
.save-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 0 0;
}
.btn-save {
  background: var(--primary); color: #fff;
  border: none; border-radius: 10px;
  padding: 12px 28px; font-size: 0.92rem; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  display: flex; align-items: center; gap: 6px;
}
.btn-save:hover { background: var(--primary-dark); }
.save-msg { font-size: 0.83rem; font-weight: 600; }
.save-msg.ok { color: #2a9d4e; }
.save-msg.err { color: var(--primary); }

/* ── Danger zone ── */
.danger-zone { border: 1.5px solid #fde0e0; }
.btn-danger {
  background: #fff; color: var(--primary);
  border: 2px solid var(--primary); border-radius: 10px;
  padding: 10px 20px; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; transition: var(--transition);
  margin-top: 8px;
}
.btn-danger:hover { background: var(--primary); color: #fff; }

/* ── Reservas ── */
.reserva-card {
  border: 1.5px solid #eee; border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 14px;
}
.reserva-icon {
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff0f0; color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.reserva-info { flex: 1; }
.reserva-name { font-weight: 700; font-size: 0.9rem; color: var(--dark); }
.reserva-detail { font-size: 0.8rem; color: #888; margin-top: 2px; }
.reserva-empty { text-align: center; color: #ccc; padding: 28px 0; font-size: 0.9rem; }
.reserva-empty i { font-size: 2rem; display: block; margin-bottom: 8px; }

/* ── Toast ── */
.toast-confirm {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1d3557; color: #fff;
  padding: 12px 24px; border-radius: 30px;
  font-size: 0.88rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  transition: transform 0.35s cubic-bezier(.32,.72,0,1);
  z-index: 999;
}
.toast-confirm i { color: #4ade80; }
.toast-confirm.show { transform: translateX(-50%) translateY(0); }

/* ── Responsivo ── */
@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; }
  .tags-inputs { grid-template-columns: 1fr; }
  .hero-stats { gap: 14px; padding: 10px 16px; }
}
