/* =========================================================
   ENCORE — Provider Portal Styles (Portal de Proveedores)
   ========================================================= */

.portal-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: calc(var(--navbar-height, 72px) + 4rem) 1.5rem 5rem;
}

/* ── Page Header ─────────────────────────────────────────── */
.portal-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .portal-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.portal-header__title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-terracotta, #B96852);
  line-height: 1.1;
}

.portal-header__subtitle {
  font-size: 0.95rem;
  color: var(--color-text-secondary);
  margin-top: 0.25rem;
}

/* ── KPI Cards ───────────────────────────────────────────── */
.portal-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.portal-kpi-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--color-cream-dark);
  box-shadow: 0 4px 16px rgba(11, 42, 51, 0.04);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.portal-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(11, 42, 51, 0.08);
}

.portal-kpi-card__val {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 400;
  color: var(--color-dark);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.portal-kpi-card__label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.portal-kpi-card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--color-cream-light);
  color: var(--color-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.portal-kpi-card__icon--gold {
  background: rgba(169, 213, 203, 0.22);
  color: var(--color-dark);
}

.portal-kpi-card__icon--success {
  background: #EAF5ED;
  color: #2D7A4D;
}

/* ── Section Cards & Tabs ────────────────────────────────── */
.portal-section-card {
  background: #fff;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-cream-dark);
  box-shadow: 0 4px 20px rgba(11, 42, 51, 0.04);
  padding: 2rem;
  margin-bottom: 2.5rem;
}

.portal-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--color-cream-dark);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.portal-tab-btn {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.portal-tab-btn:hover {
  background: var(--color-cream-light);
  color: var(--color-dark);
}

.portal-tab-btn.active {
  background: var(--color-dark);
  color: var(--color-ivory);
}

/* ── Requests List ───────────────────────────────────────── */
.requests-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.request-card {
  border: 1px solid var(--color-cream-dark);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  background: #fff;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.request-card:hover {
  border-color: var(--color-mint, #A9D5CB);
  box-shadow: 0 6px 20px rgba(11, 42, 51, 0.06);
}

.request-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.request-card__client-name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--color-dark);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.request-card__date {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-badge--pending {
  background: #FFF7ED;
  color: #C2410C;
  border: 1px solid #FFEDD5;
}

.status-badge--sent {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #DBEAFE;
}

.status-badge--accepted {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #D1FAE5;
}

.request-card__meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  background: var(--color-cream-light);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
}

.meta-item__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  margin-bottom: 0.2rem;
}

.meta-item__value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-dark);
}

.request-card__notes {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--color-text-secondary);
  background: #FAFAF8;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--color-mint, #A9D5CB);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.request-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(0,0,0,0.05);
}

/* ── Modal Styles ────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 42, 51, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  transform: translateY(20px);
  transition: transform 0.25s ease;
  padding: 2.25rem;
}

.modal-overlay.open .modal-box {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-cream-dark);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-terracotta, #B96852);
}

.modal-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem;
}

/* ── Profile Editor Components ───────────────────────────── */
.profile-cover-editor {
  position: relative;
  height: 260px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  margin-bottom: 3.5rem;
  border: 1px solid var(--color-cream-dark);
}

.profile-cover-editor__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11,42,51,0.2) 0%, rgba(11,42,51,0.6) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 1.5rem;
}

.profile-avatar-wrapper {
  position: absolute;
  bottom: -35px;
  left: 2rem;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.profile-avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Gallery Grid */
.gallery-grid-editor {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.gallery-slot {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-cream-light);
  border: 1px solid var(--color-cream-dark);
  group: true;
}

.gallery-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.gallery-slot:hover img {
  transform: scale(1.04);
}

.gallery-slot__delete {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(11, 42, 51, 0.8);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.gallery-slot:hover .gallery-slot__delete {
  opacity: 1;
}

.gallery-slot__delete:hover {
  background: #e53e3e;
}

.gallery-add-slot {
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
  border: 2px dashed rgba(169, 213, 203, 0.7);
  background: rgba(169, 213, 203, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  color: var(--color-dark);
  transition: all 0.2s ease;
  text-decoration: none;
}

.gallery-add-slot:hover {
  background: rgba(169, 213, 203, 0.18);
  border-color: var(--color-mint, #A9D5CB);
  transform: translateY(-2px);
}

/* Package Item Cards */
.package-editor-card {
  border: 1px solid var(--color-cream-dark);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  background: #FAFAF9;
  position: relative;
}

/* Toast */
.portal-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--color-dark);
  color: var(--color-ivory);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  border-left: 4px solid var(--color-mint, #A9D5CB);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  pointer-events: none;
}

.portal-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
