/* ERATOOLS V5.4.4 - zunifikowany wygląd i typografia całego Panelu Klienta
   Zakres: /konto oraz wszystkie podstrony klienta.
   Cel: mniejsze nagłówki, jedna czcionka, spójne karty, formularze, tabele, RMA, zgłoszenia i produktowe kafelki.
*/

:root {
  --customer-font: var(--font-main, "Inter", "Segoe UI", Roboto, Arial, sans-serif);
  --customer-radius: 20px;
  --customer-radius-sm: 14px;
  --customer-border: var(--line, rgba(255,255,255,.10));
  --customer-card-bg: color-mix(in srgb, var(--card, #11171b) 78%, transparent);
  --customer-soft-bg: color-mix(in srgb, var(--card-2, #151c21) 72%, transparent);
}

.header-action--account.is-logged {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.header-action--account.is-logged span {
  color: var(--text, #f3f5f7);
  font-weight: 600;
}

.header-action--account.is-logged svg {
  color: currentColor;
}

.header-action--account.is-logged:hover span,
.header-action--account.is-logged:hover svg {
  color: var(--accent, #ffc400);
}

/* Layout bazowy panelu klienta */
.customer-layout {
  width: min(var(--container, 1440px), calc(100% - 72px));
  margin: 30px auto 72px;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  font-family: var(--customer-font);
}

.customer-page .customer-layout {
  margin-top: 30px;
}

.customer-main,
.customer-content {
  display: grid;
  gap: 20px;
  min-width: 0;
  font-family: var(--customer-font);
}

/* Boczne menu */
.customer-sidebar {
  position: sticky;
  top: 96px;
  overflow: hidden;
  border: 1px solid var(--customer-border);
  border-radius: 20px;
  background:
    radial-gradient(circle at 24% 0%, rgba(255,196,0,.12), transparent 33%),
    linear-gradient(180deg, rgba(255,255,255,.050), rgba(255,255,255,.022));
  box-shadow: 0 18px 48px rgba(0,0,0,.20);
}

[data-theme="light"] .customer-sidebar {
  background:
    radial-gradient(circle at 24% 0%, rgba(255,196,0,.18), transparent 33%),
    linear-gradient(180deg, #fff, #f7f8f4);
  box-shadow: 0 16px 38px rgba(18,28,21,.075);
}

.customer-sidebar-head {
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--customer-border);
}

.customer-sidebar-kicker {
  display: block;
  color: var(--accent, #ffc400);
  font-size: .72rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.customer-sidebar-title {
  display: block;
  margin-top: 7px;
  color: var(--text, #f7f9fb);
  font-size: 1.02rem;
  line-height: 1.18;
  font-weight: 900;
}

.customer-sidebar-subtitle {
  display: block;
  margin-top: 5px;
  color: var(--text-soft, #c0c8d2);
  font-size: .80rem;
  line-height: 1.35;
  word-break: break-word;
}

.customer-nav {
  display: grid;
  gap: 3px;
  padding: 10px;
}

.customer-nav-link {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 13px;
  color: var(--text, #f7f9fb);
  text-decoration: none;
  font-size: .88rem;
  line-height: 1.15;
  font-weight: 760;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}

.customer-nav-link:hover {
  color: var(--accent, #ffc400);
  background: rgba(255,196,0,.09);
  transform: translateX(2px);
}

.customer-nav-link.is-active {
  color: #111;
  background: linear-gradient(135deg, var(--accent, #ffc400), #ffdb55);
  box-shadow: 0 12px 24px rgba(255,196,0,.15);
}

.customer-nav-icon {
  width: 24px;
  min-width: 24px;
  height: 24px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.055);
  font-size: .92rem;
}

.customer-nav-link.is-active .customer-nav-icon {
  background: rgba(0,0,0,.14);
}

/* Karty i typografia - główny fix */
.customer-card,
.customer-content > .customer-form,
.customer-card-list,
.customer-page-head {
  border: 1px solid var(--customer-border);
  border-radius: var(--customer-radius);
  background:
    radial-gradient(circle at top left, rgba(255,196,0,.055), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.044), rgba(255,255,255,.020));
  box-shadow: 0 18px 48px rgba(0,0,0,.18);
}

[data-theme="light"] .customer-card,
[data-theme="light"] .customer-content > .customer-form,
[data-theme="light"] .customer-card-list,
[data-theme="light"] .customer-page-head {
  background:
    radial-gradient(circle at top left, rgba(255,196,0,.13), transparent 26%),
    linear-gradient(180deg, #fff, #f8faf5);
  box-shadow: 0 14px 34px rgba(18,28,21,.065);
}

.customer-card {
  padding: 22px;
}

.customer-card.is-hero,
.customer-page-head {
  min-height: auto;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  overflow: hidden;
  position: relative;
}

.customer-card.is-hero::after,
.customer-page-head::after {
  content: "";
  position: absolute;
  right: -72px;
  top: -96px;
  width: 210px;
  height: 210px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,196,0,.18), transparent 66%);
  pointer-events: none;
}

.customer-kicker,
.section-kicker {
  display: block;
  margin-bottom: 7px;
  color: var(--accent, #ffc400);
  font-size: .72rem;
  line-height: 1;
  font-weight: 950;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.customer-card h1,
.customer-page-head h1 {
  margin: 0;
  max-width: 900px;
  color: var(--text, #f7f9fb);
  font-family: var(--customer-font);
  font-size: clamp(1.55rem, 2.15vw, 2.15rem) !important;
  line-height: 1.08 !important;
  letter-spacing: -.025em !important;
  font-weight: 850 !important;
}

.customer-card h2,
.customer-content h2 {
  margin: 0 0 14px;
  color: var(--text, #f7f9fb);
  font-family: var(--customer-font);
  font-size: clamp(1.15rem, 1.45vw, 1.42rem) !important;
  line-height: 1.16 !important;
  letter-spacing: -.018em !important;
  font-weight: 820 !important;
}

.customer-card h3,
.customer-content h3,
.customer-product-title {
  color: var(--text, #f7f9fb);
  font-family: var(--customer-font);
  font-size: 1.02rem !important;
  line-height: 1.25 !important;
  font-weight: 790 !important;
  letter-spacing: -.012em;
}

.customer-lead,
.customer-page-head p,
.customer-card p,
.customer-content p {
  color: var(--text-soft, #c0c8d2);
  font-family: var(--customer-font);
  font-size: .94rem;
  line-height: 1.62;
}

.customer-lead,
.customer-page-head p {
  max-width: 760px;
  margin: 10px 0 0;
}

.customer-card p:first-child {
  margin-top: 0;
}

/* Statystyki i zamówienia */
.customer-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.customer-stat-card {
  min-height: 122px;
  border: 1px solid var(--customer-border);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.046), rgba(255,255,255,.020));
  padding: 18px;
  overflow: hidden;
  position: relative;
}

[data-theme="light"] .customer-stat-card {
  background: #fff;
  box-shadow: 0 12px 26px rgba(18,28,21,.055);
}

.customer-stat-card::after {
  content: "";
  position: absolute;
  right: -44px;
  bottom: -44px;
  width: 124px;
  height: 124px;
  border-radius: 999px;
  background: rgba(255,196,0,.10);
}

.customer-stat-label {
  display: block;
  color: var(--text-soft, #c0c8d2);
  font-size: .74rem;
  line-height: 1;
  font-weight: 900;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.customer-stat-value {
  display: block;
  margin-top: 9px;
  color: var(--accent, #ffc400);
  font-size: clamp(1.65rem, 2.2vw, 2.05rem) !important;
  line-height: 1.04 !important;
  font-weight: 900 !important;
  letter-spacing: -.02em;
}

.customer-stat-card p {
  margin: 10px 0 0;
  max-width: 260px;
  font-size: .86rem;
}

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

.customer-actions,
.customer-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.customer-orders-list,
.customer-card-list {
  display: grid;
  gap: 11px;
}

.customer-card-list {
  padding: 18px;
}

.customer-order-row,
.customer-list-row,
.customer-ticket-card {
  display: grid;
  grid-template-columns: minmax(190px, 1.2fr) repeat(3, minmax(120px, .72fr)) auto;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  border: 1px solid var(--customer-border);
  border-radius: 16px;
  padding: 13px;
  background: rgba(255,255,255,.028);
  color: var(--text, #f7f9fb);
  text-decoration: none;
}

[data-theme="light"] .customer-order-row,
[data-theme="light"] .customer-list-row,
[data-theme="light"] .customer-ticket-card {
  background: #fff;
}

.customer-order-row strong,
.customer-list-row strong,
.customer-ticket-card strong,
.customer-order-row span,
.customer-list-row span,
.customer-ticket-card span,
.customer-order-row small,
.customer-list-row small,
.customer-ticket-card small {
  display: block;
}

.customer-order-row small,
.customer-list-row small,
.customer-ticket-card small {
  margin-bottom: 4px;
  color: var(--text-soft, #c0c8d2);
  font-size: .70rem;
  line-height: 1.1;
  font-weight: 880;
  letter-spacing: .065em;
  text-transform: uppercase;
}

/* Przyciski */
.customer-btn,
.customer-card a.customer-btn,
.customer-order-row .customer-btn,
.customer-v52-actions a,
.customer-v52-actions button,
.customer-rma-orders a,
.btn.primary,
button.btn.primary {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--accent, #ffc400), #ffdb55);
  color: #111 !important;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(255,196,0,.14);
}

.customer-btn.is-secondary,
.customer-card a.customer-btn.is-secondary,
.customer-order-row .customer-btn.is-secondary,
.customer-v52-actions .is-muted,
.customer-v52-actions button.is-muted,
.btn.ghost,
button.btn.ghost {
  background: rgba(255,255,255,.055);
  color: var(--text, #f7f9fb) !important;
  border: 1px solid var(--customer-border);
  box-shadow: none;
}

[data-theme="light"] .customer-btn.is-secondary,
[data-theme="light"] .customer-card a.customer-btn.is-secondary,
[data-theme="light"] .customer-order-row .customer-btn.is-secondary,
[data-theme="light"] .customer-v52-actions .is-muted,
[data-theme="light"] .customer-v52-actions button.is-muted,
[data-theme="light"] .btn.ghost {
  background: #f3f5ef;
  color: #172116 !important;
}

/* Formularze */
.customer-form,
.customer-218-form,
.customer-rma-form {
  display: grid;
  gap: 15px;
}

.customer-content > .customer-form {
  padding: 22px;
}

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

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

.customer-field,
.customer-form label,
.customer-rma-form label {
  display: grid;
  gap: 7px;
  color: var(--text, #f7f9fb);
  font-size: .88rem;
  font-weight: 790;
}

.customer-field input,
.customer-field select,
.customer-field textarea,
.customer-form input,
.customer-form select,
.customer-form textarea,
.customer-rma-form input,
.customer-rma-form select,
.customer-rma-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--customer-border);
  border-radius: 12px;
  background: rgba(255,255,255,.045);
  color: var(--text, #f7f9fb);
  padding: 0 13px;
  font-family: var(--customer-font);
  font-size: .92rem;
  outline: none;
}

[data-theme="light"] .customer-field input,
[data-theme="light"] .customer-field select,
[data-theme="light"] .customer-field textarea,
[data-theme="light"] .customer-form input,
[data-theme="light"] .customer-form select,
[data-theme="light"] .customer-form textarea,
[data-theme="light"] .customer-rma-form input,
[data-theme="light"] .customer-rma-form select,
[data-theme="light"] .customer-rma-form textarea {
  background: #fff;
}

.customer-field textarea,
.customer-form textarea,
.customer-rma-form textarea {
  min-height: 116px;
  padding: 12px 13px;
  resize: vertical;
}

.customer-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.customer-checks {
  display: grid;
  gap: 8px;
}

.customer-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--text-soft, #c0c8d2);
  font-size: .9rem;
}

.form-error,
.customer-alert,
.customer-alert.success,
.customer-alert.is-success,
.customer-alert.is-danger,
.customer-alert.is-error {
  border-radius: 13px;
  padding: 12px 14px;
  font-size: .9rem;
  line-height: 1.45;
}

.form-error {
  color: #ff8a80;
}

.customer-alert.success,
.customer-alert.is-success {
  color: #1f7a34;
  background: rgba(48,176,74,.13);
  border: 1px solid rgba(48,176,74,.22);
}

.customer-alert.is-danger,
.customer-alert.is-error {
  color: #ff8a80;
  background: rgba(240,39,45,.11);
  border: 1px solid rgba(240,39,45,.22);
}

/* Puste stany i boksy informacyjne */
.customer-empty,
.customer-v52-empty {
  border: 1px dashed color-mix(in srgb, var(--customer-border) 75%, var(--accent, #ffc400));
  border-radius: 17px;
  padding: 24px;
  color: var(--text-soft, #c0c8d2);
  text-align: center;
  background: rgba(255,255,255,.025);
}

[data-theme="light"] .customer-empty,
[data-theme="light"] .customer-v52-empty {
  background: #f8faf5;
}

.customer-empty strong {
  display: block;
  margin-bottom: 7px;
  color: var(--text, #f7f9fb);
  font-size: 1rem;
}

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

.customer-info-box {
  border: 1px solid var(--customer-border);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255,255,255,.028);
}

[data-theme="light"] .customer-info-box {
  background: #fff;
  box-shadow: 0 10px 24px rgba(18,28,21,.05);
}

.customer-info-box h3 {
  margin: 0 0 7px;
}

/* Wishlist i produkty */
.customer-product-grid,
.customer-v52-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.customer-product-card,
.customer-v52-card {
  border: 1px solid var(--customer-border);
  border-radius: 18px;
  background: rgba(255,255,255,.028);
  padding: 14px;
  display: grid;
  gap: 12px;
}

[data-theme="light"] .customer-product-card,
[data-theme="light"] .customer-v52-card {
  background: #fff;
}

.customer-product-thumb,
.customer-v52-card img {
  width: 100%;
  height: 154px;
  border-radius: 15px;
  background: rgba(255,255,255,.04);
}

.customer-product-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.customer-product-thumb img,
.customer-v52-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.customer-product-body {
  display: grid;
  gap: 7px;
}

.customer-product-category,
.customer-v52-meta {
  color: var(--text-soft, #c0c8d2);
  font-size: .82rem;
}

.customer-product-title {
  color: var(--text, #f7f9fb);
  text-decoration: none;
}

.customer-product-title:hover,
.customer-v52-card h3 a:hover {
  color: var(--accent, #ffc400);
}

.customer-product-desc {
  color: var(--text-soft, #c0c8d2);
  font-size: .88rem;
  line-height: 1.52;
}

.customer-product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
  margin-top: auto;
}

.customer-price,
.customer-v52-price {
  color: var(--accent, #ffc400);
  font-size: 1.15rem;
  font-weight: 900;
}

.customer-v52-card h3 {
  margin: 0;
}

.customer-v52-card h3 a {
  color: var(--text, #f7f9fb);
  text-decoration: none;
}

.customer-v52-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  font-size: .82rem;
}

.customer-v52-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* RMA */
.customer-rma-orders,
.customer-rma-list,
.customer-rma-items {
  display: grid;
  gap: 11px;
}

.customer-rma-orders article,
.customer-rma-list article,
.customer-rma-items article,
.customer-thread-message {
  border: 1px solid var(--customer-border);
  border-radius: 16px;
  background: rgba(255,255,255,.028);
  padding: 14px;
}

[data-theme="light"] .customer-rma-orders article,
[data-theme="light"] .customer-rma-list article,
[data-theme="light"] .customer-rma-items article,
[data-theme="light"] .customer-thread-message {
  background: #fff;
}

.customer-rma-orders strong,
.customer-rma-list strong {
  display: block;
  color: var(--text, #f7f9fb);
}

.customer-rma-orders span,
.customer-rma-list span,
.customer-rma-list p,
.muted {
  color: var(--text-soft, #c0c8d2);
}

.customer-rma-orders div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.customer-rma-list em {
  display: inline-flex;
  margin-top: 9px;
  border-radius: 999px;
  background: rgba(255,196,0,.12);
  color: var(--accent, #ffc400);
  padding: 5px 10px;
  font-size: .82rem;
  font-style: normal;
  font-weight: 850;
}

.customer-rma-items article {
  display: grid;
  grid-template-columns: minmax(0,1fr) 104px minmax(0,1fr);
  gap: 10px;
  align-items: center;
}

.customer-rma-items label {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Szczegóły zamówienia, dokumenty, powiadomienia */
.customer-summary {
  display: grid;
  gap: 8px;
}

.customer-summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--customer-border);
  padding: 10px 0;
}

.customer-summary-line:last-child {
  border-bottom: 0;
}

.customer-summary-line span {
  color: var(--text-soft, #c0c8d2);
}

.customer-summary-line strong {
  color: var(--text, #f7f9fb);
}

.customer-summary-total strong {
  color: var(--accent, #ffc400);
  font-size: 1.12rem;
}

/* Zgłoszenia legacy v2.18 */
.customer-page {
  font-family: var(--customer-font);
}

.customer-page .customer-layout {
  grid-template-columns: 286px minmax(0, 1fr);
}

.customer-page-head {
  margin: 0;
}

.customer-page-head > div {
  min-width: 0;
}

.customer-page-head .btn {
  position: relative;
  z-index: 1;
  align-self: center;
}

.customer-ticket-card {
  grid-template-columns: minmax(230px, 1.4fr) repeat(3, minmax(110px, .7fr));
}

.customer-thread-message {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.customer-thread-message.is-admin {
  border-color: rgba(255,196,0,.26);
  background: rgba(255,196,0,.065);
}

.customer-thread-message strong {
  color: var(--text, #f7f9fb);
}

.customer-thread-message small {
  color: var(--text-soft, #c0c8d2);
}

.et-auth-success-panel-v54 {
  max-width: 760px;
  display: grid;
  gap: 5px;
  margin-top: 16px;
  border: 1px solid rgba(255,196,0,.32);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255,196,0,.095);
  color: var(--text, #f7f9fb);
}

.et-auth-success-panel-v54 strong {
  color: var(--accent, #ffc400);
}

.et-auth-success-panel-v54 span {
  color: var(--text-soft, #c0c8d2);
}

/* Responsive */
@media (max-width: 1180px) {
  .customer-layout,
  .customer-page .customer-layout {
    width: calc(100% - 34px);
    grid-template-columns: 254px minmax(0, 1fr);
    gap: 18px;
  }

  .customer-order-row,
  .customer-list-row,
  .customer-ticket-card {
    grid-template-columns: 1fr 1fr;
  }

  .customer-order-row .customer-btn {
    grid-column: 1 / -1;
  }

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

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

@media (max-width: 900px) {
  .customer-layout,
  .customer-page .customer-layout {
    width: calc(100% - 28px);
    grid-template-columns: 1fr;
    margin-top: 22px;
  }

  .customer-sidebar {
    position: static;
  }

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

  .customer-stats-grid,
  .customer-info-grid,
  .customer-product-grid,
  .customer-v52-grid,
  .customer-form-grid,
  .customer-form-grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .customer-card.is-hero,
  .customer-page-head,
  .customer-section-head {
    display: grid;
  }

  .customer-actions,
  .customer-inline-actions {
    justify-content: flex-start;
  }

  .customer-rma-items article {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .customer-layout,
  .customer-page .customer-layout {
    width: calc(100% - 22px);
  }

  .customer-card,
  .customer-card.is-hero,
  .customer-page-head,
  .customer-content > .customer-form,
  .customer-card-list {
    padding: 17px;
    border-radius: 18px;
  }

  .customer-nav {
    grid-template-columns: 1fr;
  }

  .customer-order-row,
  .customer-list-row,
  .customer-ticket-card {
    grid-template-columns: 1fr;
  }

  .customer-card h1,
  .customer-page-head h1 {
    font-size: 1.46rem !important;
  }

  .customer-card h2,
  .customer-content h2 {
    font-size: 1.12rem !important;
  }
}
