:root {
  --customer-primary: #c32026;
  --customer-primary-dark: #97151b;
  --customer-accent: #f7941d;
  --customer-ink: #1f2937;
  --customer-muted: #6b7280;
  --customer-soft: #f8f9fc;
  --customer-border: #e5e7eb;
  --customer-success: #22c55e;
  --customer-shadow: 0 20px 60px rgba(31, 41, 55, .08);
}

.customer-portal-page,
.auth-premium-page {
  min-height: 100vh;
  background: var(--customer-soft);
  color: var(--customer-ink);
  font-family: "Poppins", "Inter", sans-serif;
}

.customer-shell {
  padding: 42px 20px 68px;
}

.customer-wrap {
  width: min(1280px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.customer-sidebar,
.customer-topbar,
.customer-card,
.customer-table-card,
.auth-premium-card {
  background: #fff;
  border: 1px solid rgba(229, 231, 235, .95);
  border-radius: 18px;
  box-shadow: var(--customer-shadow);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.customer-sidebar:hover,
.customer-card:hover,
.customer-table-card:hover {
  box-shadow: 0 24px 70px rgba(31, 41, 55, .11);
}

.customer-sidebar {
  position: sticky;
  top: 112px;
  padding: 24px;
}

.customer-sidebar__brand {
  display: inline-flex;
  margin-bottom: 22px;
}

.customer-sidebar__brand img {
  width: 148px;
  max-width: 100%;
  border-radius: 12px;
}

.customer-profile-mini {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  padding: 14px;
  border: 1px solid #f0dddd;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff8f2, #fff);
}

.customer-profile-mini span,
.customer-profile-mini img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
}

.customer-profile-mini span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--customer-primary), var(--customer-accent));
}

.customer-profile-mini strong,
.customer-profile-mini small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-profile-mini strong {
  font-size: 14px;
}

.customer-profile-mini small {
  margin-top: 3px;
  color: var(--customer-muted);
  font-size: 12px;
}

.customer-nav {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.customer-nav a,
.customer-logout {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  color: #4b5563;
  font-weight: 700;
  text-decoration: none;
  border-radius: 13px;
  transition: transform .3s ease, color .3s ease, background .3s ease, box-shadow .3s ease;
}

.customer-nav a:hover,
.customer-nav a:focus-visible,
.customer-nav a.is-active,
.customer-logout:hover,
.customer-logout:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, var(--customer-primary), var(--customer-accent));
  box-shadow: 0 14px 28px rgba(195, 32, 38, .18);
  transform: translateY(-2px);
}

.customer-nav i,
.customer-logout i {
  width: 20px;
  text-align: center;
}

.customer-logout {
  margin-top: 18px;
  color: var(--customer-primary);
  border: 1px solid #f3d6d8;
  background: #fff7f7;
}

.customer-main {
  min-width: 0;
  display: grid;
  gap: 24px;
}

.customer-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 26px 30px;
}

.customer-eyebrow {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--customer-accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.customer-topbar h1 {
  margin: 0;
  color: var(--customer-ink);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: 0;
}

.customer-topbar p {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--customer-muted);
  font-size: 15px;
}

.customer-topbar__actions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.customer-icon-link {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--customer-primary);
  text-decoration: none;
  border: 1px solid #f0dddd;
  border-radius: 14px;
  background: #fff8f8;
  transition: transform .3s ease, box-shadow .3s ease, background .3s ease;
}

.customer-icon-link:hover,
.customer-icon-link:focus-visible {
  color: #fff;
  background: var(--customer-primary);
  transform: translateY(-3px);
  box-shadow: 0 16px 30px rgba(195, 32, 38, .18);
}

.customer-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-radius: 14px;
  font-weight: 700;
}

.customer-alert--success {
  color: #166534;
  border: 1px solid #bbf7d0;
  background: #ecfdf5;
}

.customer-alert--error {
  color: #991b1b;
  border: 1px solid #fecaca;
  background: #fef2f2;
}

.customer-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.customer-stat-card {
  position: relative;
  overflow: hidden;
  min-height: 138px;
  padding: 22px;
}

.customer-stat-card::after {
  content: "";
  position: absolute;
  right: -38px;
  bottom: -42px;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: rgba(247, 148, 29, .12);
}

.customer-stat-card span {
  color: var(--customer-muted);
  font-size: 13px;
  font-weight: 700;
}

.customer-stat-card strong {
  display: block;
  margin-top: 12px;
  color: var(--customer-primary);
  font-size: 32px;
  line-height: 1;
  font-weight: 800;
}

.customer-stat-card small {
  display: block;
  margin-top: 10px;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 600;
}

.customer-card,
.customer-table-card {
  padding: 24px;
}

.customer-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.customer-card-head h2 {
  margin: 0;
  color: var(--customer-ink);
  font-size: 22px;
  font-weight: 800;
}

.customer-card-head p {
  margin: 5px 0 0;
  color: var(--customer-muted);
}

.customer-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr);
  gap: 24px;
}

.customer-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.customer-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
}

.customer-table th {
  padding: 13px 14px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: #f9fafb;
  border-bottom: 1px solid var(--customer-border);
}

.customer-table td {
  padding: 16px 14px;
  color: var(--customer-ink);
  font-weight: 600;
  vertical-align: middle;
  border-bottom: 1px solid #f0f1f4;
}

.customer-table tr:hover td {
  background: #fffafa;
}

.customer-status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  color: #374151;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  background: #f3f4f6;
}

.customer-status--paid,
.customer-status--approved,
.customer-status--completed,
.customer-status--delivered {
  color: #166534;
  background: #dcfce7;
}

.customer-status--pending,
.customer-status--processing {
  color: #92400e;
  background: #fef3c7;
}

.customer-status--failed,
.customer-status--expired,
.customer-status--cancelled,
.customer-status--refunded {
  color: #991b1b;
  background: #fee2e2;
}

.customer-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--customer-primary), var(--customer-accent));
  box-shadow: 0 16px 28px rgba(195, 32, 38, .18);
  cursor: pointer;
  transition: transform .3s ease, box-shadow .3s ease, filter .3s ease;
}

.customer-btn:hover,
.customer-btn:focus-visible {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 20px 36px rgba(195, 32, 38, .24);
  filter: saturate(1.05);
}

.customer-btn:disabled,
.customer-btn.is-loading {
  cursor: not-allowed;
  opacity: .68;
  transform: none;
  box-shadow: none;
}

.customer-btn.is-loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: customer-spin .75s linear infinite;
}

@keyframes customer-spin {
  to {
    transform: rotate(360deg);
  }
}

.customer-btn--light {
  color: var(--customer-primary);
  border: 1px solid #f3d6d8;
  background: #fff7f7;
  box-shadow: none;
}

.customer-btn--light:hover,
.customer-btn--light:focus-visible {
  color: #fff;
  background: var(--customer-primary);
}

.customer-btn--full {
  width: 100%;
  min-height: 54px;
}

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

.customer-list li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 13px;
  border: 1px solid #f2e3e3;
  border-radius: 14px;
  background: #fffafa;
}

.customer-list i {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--customer-primary), var(--customer-accent));
}

.customer-list strong,
.customer-list span,
.customer-list small {
  display: block;
}

.customer-list strong {
  color: var(--customer-ink);
  font-size: 14px;
}

.customer-list span {
  color: var(--customer-muted);
  font-size: 13px;
}

.customer-list small {
  margin-top: 3px;
  color: #9ca3af;
  font-size: 12px;
}

.customer-books-grid,
.customer-download-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.customer-book-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid #f1e1e1;
  border-radius: 16px;
  background: #fff;
}

.customer-book-card img {
  width: 72px;
  height: 94px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(31, 41, 55, .12);
}

.customer-book-card strong {
  display: block;
  color: var(--customer-ink);
  font-size: 14px;
  line-height: 1.35;
}

.customer-book-card span {
  display: block;
  margin-top: 5px;
  color: var(--customer-muted);
  font-size: 12px;
}

.customer-book-card .customer-btn {
  min-height: 36px;
  margin-top: 10px;
  padding-inline: 12px;
  font-size: 12px;
}

.customer-filter-form,
.customer-form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.customer-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.customer-field {
  display: grid;
  gap: 8px;
  color: var(--customer-ink);
  font-size: 13px;
  font-weight: 800;
}

.customer-field b {
  color: var(--customer-primary);
}

.customer-field--full {
  grid-column: 1 / -1;
}

.customer-field input,
.customer-field select,
.customer-field textarea {
  width: 100%;
  min-height: 54px;
  padding: 0 15px;
  color: var(--customer-ink);
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--customer-border);
  border-radius: 13px;
  background: #fff;
  outline: none;
  transition: border-color .3s ease, box-shadow .3s ease, background .3s ease;
}

.customer-field textarea {
  min-height: 132px;
  padding: 15px;
  resize: vertical;
}

.customer-field input::placeholder,
.customer-field textarea::placeholder {
  color: #a5adba;
}

.customer-field input:focus,
.customer-field select:focus,
.customer-field textarea:focus {
  border-color: var(--customer-primary);
  box-shadow: 0 0 0 4px rgba(195, 32, 38, .1);
}

.customer-form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}

.customer-empty {
  padding: 42px 24px;
  color: var(--customer-muted);
  text-align: center;
  border: 1px dashed #f0c7c9;
  border-radius: 18px;
  background: #fffafa;
}

.customer-empty i {
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  color: #fff;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--customer-primary), var(--customer-accent));
}

.customer-empty h2,
.customer-empty h3 {
  margin: 0 0 8px;
  color: var(--customer-ink);
  font-weight: 800;
}

.customer-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  gap: 24px;
}

.customer-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.customer-info-item {
  padding: 15px;
  border: 1px solid #f0e1e1;
  border-radius: 14px;
  background: #fffafa;
}

.customer-info-item span,
.customer-info-item small {
  display: block;
  color: var(--customer-muted);
  font-size: 12px;
  font-weight: 700;
}

.customer-info-item strong,
.customer-info-item p {
  margin: 6px 0 0;
  color: var(--customer-ink);
  font-weight: 800;
}

.customer-info-item--full {
  grid-column: 1 / -1;
}

.customer-timeline {
  position: relative;
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.customer-timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
}

.customer-timeline li::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: -16px;
  width: 2px;
  background: #f0dada;
}

.customer-timeline li:last-child::before {
  display: none;
}

.customer-timeline i {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  border-radius: 50%;
  background: #f3f4f6;
}

.customer-timeline li.is-active i {
  color: #fff;
  background: var(--customer-success);
}

.customer-timeline strong,
.customer-timeline span {
  display: block;
}

.customer-timeline strong {
  color: var(--customer-ink);
  font-size: 14px;
}

.customer-timeline span {
  margin-top: 2px;
  color: var(--customer-muted);
  font-size: 12px;
}

.customer-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
}

.customer-pagination a {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--customer-primary);
  font-weight: 800;
  text-decoration: none;
  border: 1px solid #f2d5d7;
  border-radius: 12px;
  background: #fff;
}

.customer-pagination a.is-current,
.customer-pagination a:hover {
  color: #fff;
  background: var(--customer-primary);
}

.auth-premium-page {
  padding: 56px 20px;
}

.auth-premium-shell {
  width: min(1080px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(360px, 520px);
  gap: 34px;
  align-items: center;
}

.auth-premium-copy {
  padding: 42px;
  color: #fff;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--customer-primary), var(--customer-accent));
  box-shadow: 0 24px 60px rgba(195, 32, 38, .22);
}

.auth-premium-copy img {
  width: 170px;
  margin-bottom: 34px;
  border-radius: 14px;
  background: #fff;
}

.auth-premium-copy h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  font-weight: 800;
}

.auth-premium-copy p {
  margin: 16px 0 0;
  color: rgba(255, 255, 255, .9);
  font-size: 16px;
}

.auth-premium-card {
  padding: 34px;
}

.auth-premium-card h2 {
  margin: 0;
  color: var(--customer-ink);
  font-size: 30px;
  font-weight: 800;
}

.auth-premium-card > p {
  margin: 8px 0 24px;
  color: var(--customer-muted);
}

.auth-premium-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  font-weight: 700;
}

.auth-premium-links a {
  color: var(--customer-primary);
  text-decoration: none;
}

.auth-premium-links a:hover {
  color: var(--customer-primary-dark);
}

@media (max-width: 1100px) {
  .customer-wrap {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 22px;
  }

  .customer-stats-grid,
  .customer-books-grid,
  .customer-download-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-dashboard-grid,
  .customer-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .customer-shell {
    padding: 24px 14px 48px;
  }

  .customer-wrap,
  .auth-premium-shell {
    grid-template-columns: 1fr;
  }

  .customer-sidebar {
    position: static;
    padding: 18px;
  }

  .customer-sidebar__brand {
    margin-bottom: 14px;
  }

  .customer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
  }

  .customer-filter-form,
  .customer-form-grid,
  .customer-info-grid {
    grid-template-columns: 1fr;
  }

  .customer-form-actions {
    justify-content: stretch;
  }

  .customer-form-actions .customer-btn {
    width: 100%;
  }

  .auth-premium-copy {
    padding: 30px;
  }
}

@media (max-width: 560px) {
  .customer-stats-grid,
  .customer-books-grid,
  .customer-download-grid,
  .customer-nav {
    grid-template-columns: 1fr;
  }

  .customer-card,
  .customer-table-card,
  .auth-premium-card {
    padding: 20px;
  }

  .customer-topbar h1 {
    font-size: 30px;
  }

  .auth-premium-page {
    padding: 24px 14px;
  }
}
