/* Ügyfélportál – Áttekintés (#portal-dashboard), Ügyfelek (#portal-customers) és Ügyfél-adatlap (#portal-customer)
   a Hubban. A portál styles.css-éből átvéve, „pc-” előtaggal; a közös elemek (po-*) a portal-ops.css-ben vannak. */

.pc-page { display: grid; gap: 12px; }
.pc-page .button, .pc-modal .button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.pc-page .button .po-icon, .pc-modal .button .po-icon { width: 15px; height: 15px; }
.pc-page .button:disabled { cursor: not-allowed; }
.pc-toolbar .pc-select { width: auto; min-width: 150px; max-width: 240px; min-height: 36px; }
.pc-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.pc-strong { font-weight: 750; }
.pc-nowrap { white-space: nowrap; }
.pc-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
/* A gomb ikonja és felirata egy sorban marad (keskeny oszlopban se ugorjon a ceruza a felirat fölé). */
.pc-row-actions .button, .pc-order-card-actions .button { display: inline-flex; flex: none; align-items: center; gap: 5px; white-space: nowrap; }
.pc-row-actions .button .po-icon, .pc-order-card-actions .button .po-icon { width: 14px; height: 14px; }
.pc-row-actions.pc-wrap { flex-wrap: wrap; }
.pc-row-actions.pc-start { justify-content: flex-start; }
.pc-empty { margin: 0; }
.pc-empty p { max-width: 430px; margin: 0; font-size: 12px; }
.pc-padded { padding: 18px; }
.pc-hint { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; font-weight: 400; line-height: 1.45; }
.pc-dialog-copy { margin: 0 0 14px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.pc-soft-note { display: flex; align-items: center; gap: 8px; margin: 10px 2px 0; color: var(--muted); font-size: 12px; }

/* --- Logó és profilkép ------------------------------------------------------------ */
.pc-avatar { display: grid; width: 38px; height: 38px; flex: none; place-items: center; border-radius: 11px; background: linear-gradient(135deg, #8fc0d2, var(--blue-dark)); color: #fff; }
.pc-avatar .po-icon { width: 56%; height: 56%; }
.pc-avatar.has-photo { overflow: hidden; padding: 0; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.pc-avatar.has-photo img { display: block; width: 100%; height: 100%; padding: 3px; object-fit: contain; }
.pc-avatar.pc-person.has-photo img { padding: 0; object-fit: cover; }
.pc-avatar.pc-xl { width: 46px; height: 46px; border-radius: 13px; box-shadow: 0 10px 24px rgba(57, 112, 138, .28); }
.pc-avatar.pc-xl.has-photo { box-shadow: 0 0 0 1px var(--line); }
.pc-avatar.pc-small { width: 28px; height: 28px; border-radius: 8px; }

/* --- Áttekintés: rendelések minden ügyféltől --------------------------------------- */
.pc-staff-orders.is-loading { opacity: .55; pointer-events: none; transition: opacity .2s ease; }
.pc-staff-table table { min-width: 860px; }
.pc-tenant-link { color: var(--blue-deep); font-weight: 800; text-decoration: none; }
.pc-tenant-link:hover { text-decoration: underline; }
tr.pc-cancelled td, tr.pc-cancelled strong, tr.pc-cancelled .pc-strong { color: var(--muted); }
.pc-status-stack { display: flex; align-items: center; gap: 9px; }
.pc-package { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 9px; background: #edf1f3; color: #75848b; }
.pc-package .po-icon { width: 19px; height: 19px; }
.pc-package.packing { background: var(--warn-bg); color: var(--warn); }
.pc-package.packed { background: var(--good-bg); color: var(--good); }
.pc-order-cards { display: none; }
.pc-order-card { display: flex; min-width: 0; flex-direction: column; padding: 15px; }
.pc-order-card-head { display: flex; align-items: flex-start; gap: 10px; }
.pc-order-card-head > div { min-width: 0; flex: 1; }
.pc-order-card h3 { margin: 0; font-size: 13px; }
.pc-order-card p { margin: 2px 0 0; color: var(--muted); font-size: 10.5px; }
.pc-order-card-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 13px 0; }
.pc-order-card-meta span, .pc-order-card-meta strong { display: block; }
.pc-order-card-meta span { color: var(--muted); font-size: 8.5px; text-transform: uppercase; }
.pc-order-card-meta strong { margin-top: 2px; font-size: 11px; overflow-wrap: anywhere; }
.pc-order-card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }

/* --- Ablakok: rendelés részletei, ügyfélválasztó, új ügyfél ---------------------------- */
.pc-modal { width: min(680px, calc(100vw - 30px)); }
.pc-modal.po-modal-narrow { width: min(560px, calc(100vw - 30px)); }
.pc-modal.pc-modal-wide { width: min(760px, calc(100vw - 30px)); }
.pc-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin-bottom: 14px; }
.pc-facts > div { display: grid; gap: 2px; min-width: 0; }
.pc-facts .pc-wide { grid-column: 1 / -1; }
.pc-facts span { color: var(--muted); font-size: 9.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.pc-facts b { font-size: 12.5px; font-weight: 650; overflow-wrap: anywhere; }
.pc-facts b small { color: var(--muted); font-size: 11px; font-weight: 600; }
.pc-lines { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.pc-line { display: grid; grid-template-columns: minmax(0, 1fr) 90px 90px 96px; gap: 8px; align-items: center; padding: 7px 12px; border-top: 1px solid var(--line); font-size: 12px; font-variant-numeric: tabular-nums; }
.pc-line > :not(:first-child) { text-align: right; white-space: nowrap; }
.pc-line-head { border-top: 0; background: #f8fafb; color: var(--muted); font-size: 9.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.pc-line-name strong { font-weight: 650; overflow-wrap: anywhere; }
.pc-line.pc-gift { background: #fbf8ef; }
.pc-total { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 12px; }
.pc-total > div { display: grid; justify-items: end; gap: 2px; }
.pc-total strong { color: var(--blue-deep); font-size: 15px; font-variant-numeric: tabular-nums; }
.pc-credentials { display: grid; gap: 6px; margin: 14px 0 0; }
.pc-credentials dt { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .5px; text-transform: uppercase; }
.pc-credentials dd { margin: 0 0 8px; }
.pc-credentials code { display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--canvas); font-size: 12px; word-break: break-all; }
.pc-credentials .pc-credential-code { font-size: 18px; font-weight: 800; letter-spacing: 2px; text-align: center; }

/* --- Ügyfelek ------------------------------------------------------------------------ */
.pc-tenant-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.pc-tenant-card { display: grid; gap: 10px; padding: 13px; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.pc-tenant-card:hover { border-color: #cfe1e8; box-shadow: 0 12px 30px -12px rgba(39, 74, 89, .28); transform: translateY(-1px); }
.pc-tenant-card.inactive { opacity: .7; }
.pc-tenant-main { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.pc-tenant-copy { display: grid; min-width: 0; flex: 1; }
.pc-tenant-copy strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.pc-tenant-copy small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.pc-tenant-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-tenant-stats span { padding: 4px 8px; border-radius: 9px; background: var(--canvas); color: var(--muted); font-size: 11px; }
.pc-tenant-stats b { color: var(--ink); }
.pc-tenant-actions { display: flex; gap: 6px; }
.pc-tenant-actions .button { flex: 1; }

/* --- Ügyfél-adatlap: fejléc és fülek ------------------------------------------------------ */
.pc-detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.pc-back { color: var(--blue-dark); font-size: 12.5px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.pc-back:hover { text-decoration: underline; }
.pc-tabs { display: flex; gap: 4px; width: max-content; max-width: 100%; padding: 4px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; scrollbar-width: none; }
.pc-tabs a { padding: 8px 14px; border-radius: 9px; color: var(--muted); font-size: 12.5px; font-weight: 750; text-decoration: none; white-space: nowrap; transition: background-color .2s ease, color .2s ease; }
.pc-tabs a:hover { background: var(--blue-soft); color: var(--blue-deep); }
.pc-tabs a.active { background: linear-gradient(135deg, var(--blue-dark), var(--blue-deep)); color: #fff; box-shadow: 0 8px 18px rgba(40, 87, 107, .26); }
.pc-customer-tab { display: grid; gap: 12px; animation: pc-rise .35s ease both; }
@keyframes pc-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --- Áttekintés fül ----------------------------------------------------------------------- */
.pc-hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px; overflow: hidden; background: linear-gradient(135deg, #fff 40%, #eef6f9); }
.pc-hero::before { position: absolute; top: -80px; right: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(98, 165, 192, .18), transparent 70%); content: ""; pointer-events: none; }
.pc-hero-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.pc-hero-main h2 { margin: 0; font-size: 18px; }
.pc-hero-main p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.pc-hero-actions { position: relative; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.pc-hero-stats { position: relative; display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 8px; }
.pc-hero-stats div { display: grid; min-width: 110px; padding: 7px 12px; border: 1px solid #dce9ee; border-radius: 12px; background: #fff; }
.pc-hero-stats b { color: var(--blue-deep); font-size: 17px; font-variant-numeric: tabular-nums; }
.pc-hero-stats span { color: var(--muted); font-size: 11px; }
.pc-overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.pc-panel { min-width: 0; }
.pc-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.pc-panel-head h3 { margin: 0; font-size: 13.5px; }
.pc-panel-head p { margin: 1px 0 0; color: var(--muted); font-size: 11px; }
.pc-compact-search { width: 200px; min-width: 0; flex: none; }
.pc-panel-empty { margin: 0; padding: 16px 14px; color: var(--muted); font-size: 12px; }
.pc-panel-foot { margin: 0; padding: 8px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; }
.pc-mini-list { display: grid; }
.pc-mini-row { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 14px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; font: inherit; text-align: left; }
.pc-mini-row:last-child { border-bottom: 0; }
.pc-mini-row:hover:not(.static) { background: var(--blue-soft); }
.pc-mini-row.static { cursor: default; }
.pc-mini-date { flex: none; width: 58px; color: var(--blue-deep); font-size: 11.5px; font-weight: 800; }
.pc-mini-main { display: grid; min-width: 0; flex: 1; }
.pc-mini-main strong { overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.pc-mini-main small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.pc-compact-table th, .pc-compact-table td { padding: 7px 12px; }
.pc-chip-row { display: flex; flex-wrap: wrap; gap: 5px; }
.pc-template-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 8px; background: var(--blue-soft); color: var(--blue-deep); font-size: 11px; white-space: nowrap; }

/* --- Adatok és számlázás fül, új ügyfél űrlap ----------------------------------------------- */
.pc-form { display: grid; gap: 20px; }
.pc-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.pc-form legend { width: 100%; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 800; }
.pc-form fieldset > .pc-hint { margin: 0 0 10px; }
.pc-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.pc-form-grid .pc-full { grid-column: 1 / -1; }
.pc-form input:disabled, .pc-form select:disabled, .pc-form textarea:disabled { background: #f6f8f9; color: var(--muted); cursor: not-allowed; }
.pc-check { display: flex; align-items: flex-start; gap: 9px; color: var(--ink); font-size: 12.5px; font-weight: 550; line-height: 1.45; cursor: pointer; }
.pc-check input { width: 17px; height: 17px; min-height: 0; flex: none; margin: 1px 0 0; padding: 0; accent-color: var(--blue-dark); }

/* --- Árlista fül ------------------------------------------------------------------------------ */
.pc-price-layout { display: grid; gap: 14px; }
.pc-price-import-head h3 { margin: 0; font-size: 15px; }
.pc-price-import-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; margin-top: 12px; }
.pc-price-import-row > label:first-child { flex: 0 1 240px; }
.pc-price-import-row .pc-check { align-items: center; min-height: 38px; }
.pc-price-import-row .pc-check input { margin: 0; }
.pc-price-pricing .pc-price-import-row > label:first-child { flex: 0 1 170px; }
.pc-price-pricing .pc-price-import-row > label:nth-child(2) { flex: 0 1 320px; }
.pc-price-pricing .form-error:empty { display: none; }
.pc-price-toolbar { flex-wrap: wrap; justify-content: flex-start; }
.pc-price-toolbar .po-search { flex: 1 1 260px; }
.pc-price-toolbar .pc-check { align-items: center; white-space: nowrap; }
.pc-price-toolbar .pc-check input { margin: 0; }
.pc-price-help { margin: 0; padding: 12px 18px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.pc-price-help .badge { vertical-align: 1px; }
.pc-price-table { display: grid; max-height: 68vh; overflow: auto; }
.pc-price-row { display: grid; grid-template-columns: minmax(220px, 1fr) 104px 132px 120px 60px; gap: 8px; align-items: center; padding: 8px 17px; border-bottom: 1px solid var(--line); animation: pc-row-in .25s calc(var(--pc-i, 0) * 12ms) ease both; transition: background-color .2s ease; }
@keyframes pc-row-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.pc-price-row input[type=number] { width: 100%; min-height: 34px; padding: 5px 8px; font-variant-numeric: tabular-nums; text-align: right; }
.pc-price-row input[type=number]::placeholder { color: #a5b3b9; font-style: italic; }
.pc-price-row input[type=checkbox] { width: 18px; height: 18px; min-height: 0; justify-self: center; padding: 0; accent-color: var(--blue-dark); }
.pc-price-row.pc-price-head { position: sticky; z-index: 1; top: 0; background: #f7fafb; color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; animation: none; }
.pc-price-head span:nth-child(n+2):nth-child(-n+4) { text-align: right; }
.pc-price-head span:nth-child(5) { text-align: center; }
.pc-price-row.has-override { background: #f1f7fa; }
.pc-price-row.has-override input[data-field=customPriceNet] { border-color: var(--blue); font-weight: 750; }
.pc-price-row.is-hidden { background: #f5f6f7; }
.pc-price-row.is-hidden .pc-price-name strong { color: var(--muted); text-decoration: line-through; }
.pc-price-row.dirty, .pc-price-row.dirty.has-override, .pc-price-row.dirty.is-hidden { background: #fff8e8; }
.pc-price-row.staff-only strong { color: var(--muted); }
.pc-price-name { display: grid; min-width: 0; }
.pc-price-name strong { overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.pc-price-name strong .badge { min-height: 18px; margin-left: 6px; padding: 1px 7px; font-size: 9.5px; vertical-align: 1px; }
.pc-price-name small { color: var(--muted); font-size: 10.5px; }
.pc-price-cell { display: grid; min-width: 0; text-align: right; font-variant-numeric: tabular-nums; }
.pc-price-cell b { font-size: 12.5px; font-weight: 750; }
.pc-price-cell small { overflow: hidden; color: var(--muted); font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.pc-price-cell.muted b { color: var(--muted); font-weight: 600; }

/* --- Integráció fül ---------------------------------------------------------------------------- */
.pc-integration-card { display: grid; gap: 14px; padding: 20px; }
.pc-section-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pc-section-head h3 { margin: 0; font-size: 16px; }
.pc-section-head p { max-width: 62ch; margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.pc-switch { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: 12.5px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.pc-switch input { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--blue-dark); }
.pc-warning { display: flex; align-items: flex-start; gap: 8px; padding: 10px 11px; border: 1px solid #e8c889; border-radius: 8px; background: var(--warn-bg); color: #78500d; font-size: 12px; }
.pc-profile-list { display: grid; grid-template-columns: 160px minmax(0, 1fr); margin: 0; }
.pc-profile-list dt, .pc-profile-list dd { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.pc-profile-list dt { color: var(--muted); }
.pc-profile-list dd { font-weight: 650; }
.pc-profile-list dt:last-of-type, .pc-profile-list dd:last-of-type { border-bottom: 0; }

/* --- Reszponzív ------------------------------------------------------------------------------------ */
@media (max-width: 1100px) {
  .pc-overview-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .pc-toolbar .pc-select { max-width: none; flex: 1 1 140px; }
  .pc-toolbar > .button { flex: 1 1 100%; }
  .pc-toolbar .po-spacer { display: none; }
  .pc-staff-table { display: none; }
  .pc-order-cards { display: grid; gap: 12px; }
  .pc-tenant-grid { grid-template-columns: 1fr; }
  .pc-detail-head > .button { flex: 1 1 100%; }
  .pc-detail-head .po-spacer { display: none; }
  .pc-hero { grid-template-columns: 1fr; }
  .pc-hero-actions { justify-content: stretch; }
  .pc-hero-actions .button { flex: 1; }
  .pc-hero-stats div { flex: 1 1 40%; min-width: 0; }
  .pc-panel-head { flex-wrap: wrap; }
  .pc-compact-search { width: 100%; }
  .pc-form-grid, .pc-facts { grid-template-columns: 1fr; }
  .pc-line { grid-template-columns: minmax(0, 1fr) 64px 80px; }
  .pc-line > :nth-child(3) { display: none; }
  .pc-price-row { grid-template-columns: minmax(0, 1fr) 74px 76px 54px; gap: 6px; padding: 8px 12px; }
  .pc-price-row > :nth-child(2) { display: none; }
  .pc-profile-list { grid-template-columns: 100px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .pc-customer-tab, .pc-price-row { animation: none; }
  .pc-tenant-card:hover { transform: none; }
}
