body.client-portal-page,
body:has(.client-portal-shell) {
  display: block !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

body.client-portal-page.has-dev-preview,
body:has(.client-portal-shell).has-dev-preview {
  padding-top: 52px !important;
}

.portal-loading {
  margin: 40px auto !important;
}

.portal-entry {
  display: grid;
  gap: 1.2rem;
  margin: auto;
  box-sizing: border-box;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  color: #fff;
  text-decoration: none;
  font: 600 1.15rem Teko, sans-serif;
}

.portal-brand img {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(57, 255, 20, .4);
  border-radius: 50%;
  object-fit: cover;
}

.portal-entry h1 {
  margin: 0;
}

.portal-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  padding: 1rem;
  border: 1px solid rgba(57, 255, 20, .25);
  border-radius: 12px;
}

.portal-choice h2 {
  grid-column: 1/-1;
  margin: 0;
}

.client-portal-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
  box-sizing: border-box;
}

.client-header {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 0 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  text-align: center;
}

.client-header .portal-brand {
  justify-self: start;
}

.client-header h1 {
  margin: .15rem 0 0;
}

.client-header .btn-logout {
  justify-self: end;
  position: static;
  inset: auto;
  transform: none;
}

.client-header .btn-logout:hover {
  transform: translateY(-1px);
}

.client-event-tabs {
  display: flex;
  gap: .5rem;
  margin: 1.25rem 0;
  overflow-x: auto;
}

.client-event-tabs button {
  padding: .7rem 1rem;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(255, 255, 255, .04);
  cursor: pointer;
  white-space: nowrap;
}

.client-event-tabs button.active {
  color: #081008;
  border-color: #39ff14;
  background: #39ff14;
}

.client-event-view {
  display: grid;
  gap: 1rem;
}

.client-hero-card,
.client-section {
  padding: 1.4rem;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 16px;
  background: rgba(10, 20, 22, .8);
}

.client-hero-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  border-color: rgba(57, 255, 20, .3);
}

.client-hero-card h2 {
  margin: .25rem 0;
  font-size: 2rem;
}

.client-event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  color: #aebdb8;
}

.client-event-meta span {
  padding: .3rem .6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
}

.client-payment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .7rem;
  margin-top: 1rem;
}

.client-payment div {
  padding: .8rem;
  border-radius: 10px;
  background: rgba(57, 255, 20, .06);
}

.client-payment strong,
.client-payment span {
  display: block;
}

.client-payment span {
  margin-top: .25rem;
  color: #9dadb8;
  font-size: .75rem;
}

.client-progress {
  min-width: 130px;
  text-align: right;
}

.client-progress strong {
  display: block;
  color: #39ff14;
  font: 600 2rem/1 Teko, sans-serif;
}

.client-questionnaire {
  display: grid;
  gap: .7rem;
}

.client-questionnaire details {
  padding: .85rem;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
}

.client-questionnaire summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
}

.client-questionnaire summary span {
  color: #8cff6b;
  font-size: .75rem;
}

.client-questionnaire form {
  display: grid;
  gap: .7rem;
  padding-top: 1rem;
}

.client-questionnaire textarea {
  width: 100%;
  min-height: 130px;
  padding: .8rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 9px;
  background: rgba(0, 0, 0, .25);
  font: inherit;
}

.client-questionnaire textarea:disabled {
  opacity: .65;
}

.client-section h2 {
  margin: 0;
}

.section-intro {
  margin: .25rem 0 1rem;
  color: #9dadb8;
}

.client-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.portal-lock {
  padding: .35rem .65rem;
  color: #fff;
  border: 1px solid rgba(148, 163, 184, .4);
  border-radius: 999px;
  font-size: .75rem;
  white-space: nowrap;
}

.visible-invite-link {
  display: inline-flex;
  margin-top: .8rem;
}

.form-message .visible-invite-link {
  display: inline;
  margin: 0;
}

.client-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.client-checklist {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .5rem;
}

.client-checklist div {
  padding: .65rem;
  color: #aebdb8;
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.client-checklist div.complete {
  color: #baffae;
}

@media (max-width:720px) {
  .client-header {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .client-header .portal-brand,
  .client-header .btn-logout {
    justify-self: start;
  }

  .client-header .btn-logout {
    width: 100%;
    inset: auto;
    transform: none;
  }

  .client-header .btn-logout:hover {
    transform: translateY(-1px);
  }

  .client-hero-card {
    grid-template-columns: 1fr;
  }

  .client-progress {
    text-align: left;
  }

  .client-payment,
  .client-checklist {
    grid-template-columns: 1fr;
  }

  .client-section-heading {
    display: grid;
  }

  .client-contact {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-choice {
    grid-template-columns: 1fr;
  }
}

.event-contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.event-contact-form label {
  display: grid;
  gap: .35rem;
  color: #dce7e2;
  font-weight: 600;
}

.event-contact-form input,
.event-contact-form select {
  width: 100%;
  padding: .75rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 9px;
  background: rgba(0, 0, 0, .25);
  font: inherit;
}

.event-contact-form .btn-save {
  justify-self: start;
}

@media (max-width:720px) {
  .event-contact-form {
    grid-template-columns: 1fr;
  }

  .event-contact-form .btn-save {
    width: 100%;
  }
}

/* Payment Progress Bar */
.payment-progress-wrapper {
  margin-top: 1.2rem;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(57, 255, 20, 0.2);
  border-radius: 12px;
}

.payment-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.payment-progress-header strong {
  color: #fff;
  font-size: 0.95rem;
}

.payment-progress-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.payment-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #39ff14, #1fb80d);
  border-radius: 999px;
  transition: width 400ms ease;
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.4);
}

.payment-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.payment-stage-badge.deposit-paid {
  background: rgba(57, 255, 20, 0.15);
  color: #39ff14;
  border: 1px solid rgba(57, 255, 20, 0.35);
}

.payment-stage-badge.fully-paid {
  background: rgba(57, 255, 20, 0.25);
  color: #fff;
  border: 1px solid #39ff14;
}

.payment-stage-badge.inquiry {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.28);
}

/* Card-Based Client Hub */
.client-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: 0.5rem;
}

.hub-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(10, 20, 22, 0.82);
  transition: all 180ms ease;
  position: relative;
}

.hub-card:hover {
  border-color: rgba(57, 255, 20, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.hub-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.hub-card-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.hub-card h3 {
  margin: 0.2rem 0;
  font-size: 1.45rem;
  font-family: "Teko", sans-serif;
  letter-spacing: 0.04em;
  color: #fff;
}

.hub-card p {
  margin: 0 0 1rem;
  color: #9dadb8;
  font-size: 0.88rem;
  line-height: 1.5;
  flex: 1;
}

.hub-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: auto;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hub-card.coming-soon {
  opacity: 0.82;
  border-style: dashed;
}

.hub-card.coming-soon:hover {
  border-color: rgba(148, 163, 184, 0.4);
  transform: none;
  box-shadow: none;
}

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(57, 255, 20, 0.1);
  color: #39ff14;
  border: 1px solid rgba(57, 255, 20, 0.25);
}

.status-pill.locked {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.3);
}

/* Client Mashup Video feature (docs/MASHUP-FEATURE-PLAN.md, Phase 4) */
.status-pill.queued {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.3);
}

.status-pill.rendering {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.status-pill.done {
  background: rgba(57, 255, 20, 0.1);
  color: #39ff14;
  border-color: rgba(57, 255, 20, 0.25);
}

.status-pill.failed {
  background: rgba(255, 71, 87, 0.12);
  color: #ff4757;
  border-color: rgba(255, 71, 87, 0.3);
}

.contact-info-summary {
  display: grid;
  gap: 0.4rem;
  margin: 0.6rem 0 1rem;
  font-size: 0.88rem;
  color: #dce7e2;
}

.contact-info-summary div {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-info-summary strong {
  color: #9dadb8;
  font-weight: 500;
  min-width: 90px;
}

.btn-back-hub {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 150ms ease;
  margin-bottom: 1rem;
}

.btn-back-hub:hover {
  border-color: #39ff14;
  color: #39ff14;
  background: rgba(57, 255, 20, 0.08);
  transform: translateX(-2px);
}

.hub-card.full-width {
  grid-column: 1 / -1;
}

@media (max-width: 768px) {
  .client-hub-grid {
    grid-template-columns: 1fr;
  }
}

/* Music Format Selector & Fields */
.music-input-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.music-format-toggle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  padding: 0.35rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.music-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.75rem;
  border-radius: 9px;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
  user-select: none;
  text-align: center;
}

.music-toggle-btn input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.music-toggle-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.music-toggle-btn.active {
  color: #081008;
  background: #39ff14;
  font-weight: 700;
}

.music-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.music-field-group label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #dce7e2;
}

.music-field-group label small {
  font-size: 0.74rem;
  font-weight: 400;
  color: #94a3b8;
}

.music-field-group input[type="url"] {
  width: 100%;
  padding: 0.75rem 0.85rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.25);
  font: inherit;
  font-size: 0.9rem;
}

.music-field-group input[type="url"]:focus {
  border-color: #39ff14;
  outline: 2px solid rgba(57, 255, 20, 0.3);
}

@media (max-width: 640px) {
  .music-format-toggle {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .music-toggle-btn {
    padding: 0.5rem 0.7rem;
    font-size: 0.8rem;
  }
}

/* Document Management */
.doc-item-grid {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}

.doc-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  flex-wrap: wrap;
}

.doc-item-card:hover {
  border-color: rgba(57, 255, 20, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.doc-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 220px;
  flex: 1;
}

.doc-item-info strong {
  color: #fff;
  font-size: 0.95rem;
  word-break: break-word;
}

.doc-item-meta {
  font-size: 0.78rem;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.doc-category-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(57, 255, 20, 0.12);
  border: 1px solid rgba(57, 255, 20, 0.3);
  color: #8cff6b;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
}

.doc-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.doc-upload-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border: 1px dashed rgba(57, 255, 20, 0.35);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
}

.doc-upload-box h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: #fff;
}

.doc-upload-box p {
  margin: 0 0 1rem 0;
  font-size: 0.82rem;
  color: #94a3b8;
}

.doc-upload-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.badge-owner {
  color: #f59e0b;
  font-weight: 600;
}

.badge-manager {
  color: #38bdf8;
  font-weight: 600;
}

.badge-client {
  color: #39ff14;
  font-weight: 600;
}

.badge-partner {
  color: #e879f9;
  font-weight: 600;
}

.badge-planner {
  color: #a78bfa;
  font-weight: 600;
}

.event-type-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  background: rgba(57, 255, 20, 0.1);
  border: 1px solid rgba(57, 255, 20, 0.3);
  border-radius: 999px;
  font-size: 0.8rem;
  color: #fff;
  font-weight: 600;
}

.dev-preview-banner {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 99999 !important;
  background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%) !important;
  border-bottom: 2px solid #818cf8 !important;
  padding: 10px 20px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
  box-sizing: border-box !important;
}

.dev-preview-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: #e2e8f0;
  font-size: 0.85rem;
}

.dev-preview-badge {
  padding: 3px 10px;
  background: rgba(129, 140, 248, 0.2);
  border: 1px solid #818cf8;
  color: #a5b4fc;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-radius: 999px;
}

.btn-exit-preview {
  padding: 5px 14px;
  background: #818cf8;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 150ms ease, transform 150ms ease;
}

.btn-exit-preview:hover {
  background: #a5b4fc;
  transform: translateY(-1px);
}

/* Star Rating & Review Modal */
.star-rating-selector {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0.5rem 0;
}

.star-btn {
  background: transparent;
  border: none;
  font-size: 1.8rem;
  color: #475569;
  cursor: pointer;
  padding: 0 0.15rem;
  transition: transform 0.15s ease, color 0.15s ease;
  line-height: 1;
}

.star-btn.active,
.star-btn.hover {
  color: #facc15;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
}

.star-btn:hover {
  transform: scale(1.2);
}

.review-display-quote {
  padding: 0.85rem 1rem;
  background: rgba(250, 204, 21, 0.05);
  border-left: 3px solid #facc15;
  border-radius: 8px;
  margin: 0.6rem 0;
  color: #f1f5f9;
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.5;
}

.review-meta-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}

/* Digital Contract & E-Signature */
.contract-view-card {
  padding: 1.5rem;
  background: rgba(10, 20, 22, 0.95);
  border: 1px solid rgba(57, 255, 20, 0.3);
  border-radius: 16px;
  display: grid;
  gap: 1.25rem;
}

.contract-header-block {
  border-bottom: 2px solid rgba(57, 255, 20, 0.3);
  padding-bottom: 1rem;
}

.contract-header-block h2 {
  margin: 0.25rem 0;
  font-size: 1.8rem;
  color: #fff;
}

.contract-terms-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 1.25rem;
  max-height: 320px;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #cbd5e1;
  white-space: pre-wrap;
  font-family: inherit;
}

.signature-mode-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.sig-canvas-wrap {
  position: relative;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  display: inline-block;
  border: 2px dashed #94a3b8;
}

#contract-sig-canvas {
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.sig-typed-input {
  font-family: "Brush Script MT", "Caveat", cursive, sans-serif !important;
  font-size: 2rem !important;
  color: #39ff14 !important;
  background: rgba(0, 0, 0, 0.5) !important;
  padding: 0.75rem 1rem !important;
  border-radius: 8px !important;
}

.contract-signed-box {
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.3);
  border-radius: 12px;
  padding: 1.25rem;
  display: grid;
  gap: 0.75rem;
}

.signature-preview-img {
  max-height: 80px;
  background: #fff;
  padding: 6px;
  border-radius: 6px;
  display: inline-block;
}

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }

  .client-header,
  .client-event-tabs,
  .dev-preview-banner,
  .btn-back-hub,
  .btn-print-contract,
  button {
    display: none !important;
  }

  .client-portal-shell,
  .client-section,
  .contract-view-card {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .contract-terms-box {
    max-height: none !important;
    overflow: visible !important;
    color: #000 !important;
    background: transparent !important;
    border: 1px solid #ccc !important;
  }

  .contract-signed-box {
    border: 1px solid #333 !important;
    background: #f9f9f9 !important;
    color: #000 !important;
  }
}