.portal-router-shell,
.customer-shell {
  width: min(100% - 32px, 1120px);
  margin: 0 auto;
  padding: 28px 0 44px;
}

body.customer-portal-page {
  background: #f6fbf2;
}

.portal-router-shell,
.customer-shell-narrow {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.portal-router-panel,
.customer-panel {
  width: min(100%, 460px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  padding: 28px;
  box-shadow: 0 16px 44px rgba(29, 43, 54, 0.08);
}

.portal-router-logo,
.customer-logo {
  width: 172px;
  margin: 0 0 22px;
}

.portal-router-panel h1,
.customer-panel h1 {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.portal-router-panel p,
.customer-panel p {
  margin: 0;
  color: var(--text-mid);
  line-height: 1.55;
}

.customer-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 34px);
  border-bottom: 1px solid #dfead7;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(67, 112, 52, 0.08);
}

.customer-logo-link img {
  width: 148px;
}

.customer-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.customer-nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  color: #315128;
  font-weight: 700;
  text-decoration: none;
}

.customer-nav a:hover,
.customer-nav a[aria-current="page"] {
  background: #eaf8e2;
  color: #2f7a24;
}

.customer-dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 8px 0 36px;
}

.customer-dashboard-panel {
  position: relative;
  min-width: 0;
  border: 1px solid #dfead7;
  border-radius: 8px;
  background: #ffffff;
  padding: 20px;
  box-shadow: 0 16px 38px rgba(65, 99, 52, 0.08);
}

.customer-dashboard-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--brand-green);
}

.customer-appointments-panel {
  overflow: hidden;
  border-color: #c7e5b8;
  background: #fbfff7;
  box-shadow: 0 20px 48px rgba(72, 132, 47, 0.14);
}

.customer-contact-panel::before {
  background: #4f7f96;
}

.customer-invoices-panel::before {
  background: #d9a441;
}

.customer-questions-panel::before {
  background: #7aa45f;
}

.customer-feedback-panel::before {
  background: #d9765b;
}

.customer-guides-panel::before {
  background: #6099b1;
}

.customer-panel-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.customer-panel-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: #eaf8e2;
  color: #2f7a24;
  font-size: 0.82rem;
  font-weight: 900;
}

.customer-contact-panel .customer-panel-icon,
.customer-guides-panel .customer-panel-icon {
  background: #edf7fb;
  color: #315f73;
}

.customer-invoices-panel .customer-panel-icon {
  background: #fff6dc;
  color: #8a620d;
}

.customer-feedback-panel .customer-panel-icon {
  background: #fff0ea;
  color: #99503d;
}

.customer-dashboard-panel h2 {
  margin: 0;
  color: #263d22;
  font-size: 1.15rem;
  letter-spacing: 0;
}

.customer-dashboard-panel p {
  min-height: 48px;
  margin: 0 0 16px;
  color: #566252;
  line-height: 1.5;
}

.customer-appointments-panel > p {
  min-height: 0;
}

.customer-film-reel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(224px, 1fr);
  gap: 14px;
  overflow-x: auto;
  margin-top: 2px;
  padding: 4px 2px 10px;
  scroll-snap-type: x proximity;
}

.customer-visit-card {
  min-height: 274px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 11px;
  scroll-snap-align: start;
  border: 1px solid #d9e9ce;
  border-top: 5px solid #7ba36a;
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(61, 92, 48, 0.11);
}

.customer-visit-card.is-next {
  border-color: var(--brand-green-dark);
  border-top-color: var(--brand-green-dark);
  background: #f4ffec;
  box-shadow: 0 16px 34px rgba(65, 105, 53, 0.18);
}

.customer-visit-card.is-scheduled {
  border-top-color: #4f7f96;
  background: #f8fcff;
}

.customer-visit-card.is-empty {
  min-height: 150px;
  border-top-color: var(--text-light);
  background: #fbfcfa;
}

.customer-visit-card p {
  min-height: 0;
  margin: 0;
}

.customer-visit-card .customer-visit-label {
  align-self: flex-start;
  border: 1px solid #d7edcd;
  border-radius: 8px;
  background: #edf8e7;
  padding: 5px 8px;
  color: var(--brand-green-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.customer-visit-card.is-scheduled .customer-visit-label {
  border-color: #d5e7ef;
  background: #eef8fc;
  color: #2f6279;
}

.customer-visit-card h3 {
  margin: 0;
  color: #263d22;
  font-size: 1.55rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.customer-visit-meta {
  display: grid;
  gap: 7px;
  margin: 0;
}

.customer-visit-meta div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}

.customer-visit-meta dt {
  color: var(--text-light);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.customer-visit-meta dd {
  min-width: 0;
  margin: 0;
  color: #2f3e2b;
  font-size: 0.92rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.customer-visit-contractors {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.customer-visit-contractors li {
  display: grid;
  gap: 2px;
  border-left: 4px solid #d9a441;
  border-radius: 4px;
  background: #fffaf0;
  padding: 8px 10px;
}

.customer-visit-contractors strong,
.customer-visit-contractors span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.customer-visit-contractors strong {
  color: var(--text-dark);
  font-size: 0.92rem;
}

.customer-visit-contractors span {
  color: var(--text-mid);
  font-size: 0.82rem;
}

.customer-visit-card .customer-visit-summary {
  min-height: 0;
  margin: auto 0 0;
  color: #566252;
  font-size: 0.9rem;
  line-height: 1.42;
}

.customer-panel-status {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border: 1px solid #dfead7;
  border-radius: 8px;
  background: #f8fbf4;
  padding: 7px 10px;
  color: #4e6746;
  font-size: 0.86rem;
  font-weight: 800;
}

.customer-section-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border: 1px solid #c7e5b8;
  border-radius: 8px;
  background: #eaf8e2;
  padding: 8px 12px;
  color: #2f7a24;
  font-size: 0.9rem;
  font-weight: 900;
  text-decoration: none;
}

.customer-section-link:hover,
.customer-section-link:focus-visible {
  background: #dff4d4;
  color: #255f1d;
}

.customer-dashboard-panel .btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.customer-section-page .customer-shell {
  width: min(100% - 32px, 980px);
}

.customer-section-heading {
  display: grid;
  gap: 10px;
  margin: 8px 0 18px;
  border: 1px solid #dfead7;
  border-radius: 8px;
  background: #ffffff;
  padding: 22px;
  box-shadow: 0 16px 38px rgba(65, 99, 52, 0.08);
}

.customer-back-link {
  width: fit-content;
  color: #315128;
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.customer-back-link:hover,
.customer-back-link:focus-visible {
  color: #2f7a24;
  text-decoration: underline;
}

.customer-section-heading h1 {
  margin: 0;
  color: #263d22;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.customer-section-heading p {
  margin: 0;
  color: #566252;
  line-height: 1.5;
}

.customer-section-status {
  width: fit-content;
  border: 1px solid #d7edcd;
  border-radius: 8px;
  background: #edf8e7;
  padding: 7px 10px;
  color: #2f7a24;
  font-size: 0.88rem;
  font-weight: 850;
}

.customer-section-status.is-error {
  border-color: #f2c8b9;
  background: #fff0ea;
  color: #99503d;
}

.customer-section-content {
  display: grid;
  gap: 14px;
  padding-bottom: 40px;
}

.customer-record-list {
  display: grid;
  gap: 14px;
}

.customer-record-list-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.customer-record-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  border: 1px solid #dfead7;
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(65, 99, 52, 0.08);
}

.customer-record-card.is-featured-record {
  border-color: #c7e5b8;
  background: #f4ffec;
  box-shadow: 0 16px 34px rgba(65, 105, 53, 0.15);
}

.customer-record-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.customer-record-header h2 {
  margin: 0;
  color: #263d22;
  font-size: 1.18rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.customer-record-badge {
  flex: 0 0 auto;
  max-width: 48%;
  border: 1px solid #d7edcd;
  border-radius: 8px;
  background: #edf8e7;
  padding: 5px 8px;
  color: #2f7a24;
  font-size: 0.78rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.customer-record-details {
  display: grid;
  gap: 9px;
  margin: 0;
}

.customer-record-details div {
  display: grid;
  grid-template-columns: minmax(96px, 0.34fr) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}

.customer-record-details dt {
  color: var(--text-light);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.customer-record-details dd {
  min-width: 0;
  margin: 0;
  color: #2f3e2b;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.customer-record-card p {
  margin: 0;
  color: #566252;
  line-height: 1.5;
}

.customer-empty-state {
  background: #fbfcfa;
}

.customer-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn-secondary {
  background: #f3f5f6;
  color: var(--text-dark);
}

@media (min-width: 760px) {
  .customer-dashboard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-appointments-panel {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1040px) {
  .customer-dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .customer-film-reel {
    grid-auto-flow: initial;
    grid-auto-columns: initial;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: visible;
  }
}

@media (max-width: 620px) {
  .customer-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .customer-nav {
    width: 100%;
    justify-content: flex-start;
  }

  .customer-section-heading,
  .customer-record-card {
    padding: 16px;
  }

  .customer-record-header {
    flex-direction: column;
  }

  .customer-record-badge {
    max-width: 100%;
  }

  .customer-record-details div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}
