/* Ügyfélportál – ügyvezetői nézet. CSP-barát: minden megjelenés osztály. */
.cp { --cp-series: #1f86b5; --cp-ink: var(--ink, #2e3a40); --cp-muted: var(--muted, #6e7d87); --cp-line: var(--line, #e3e9ed); display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; container-type: inline-size; }
.cp [hidden] { display: none !important; }

.cp-tabs { display: flex; gap: 4px; width: max-content; max-width: 100%; padding: 4px; overflow-x: auto; border: 1px solid var(--cp-line); border-radius: 12px; background: #fff; scrollbar-width: none; }
.cp-tab { padding: 8px 15px; border: 0; border-radius: 9px; background: none; color: var(--cp-muted); font: inherit; font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: background-color .2s ease, color .2s ease; }
.cp-tab:hover { background: var(--blue-soft, #eef5f8); color: var(--blue-deep, #28576b); }
.cp-tab.active { background: linear-gradient(135deg, var(--blue-dark, #39708a), var(--blue-deep, #28576b)); color: #fff; box-shadow: 0 6px 16px rgba(40, 87, 107, .22); }
.cp-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; animation: cp-rise .38s cubic-bezier(.2, .8, .2, 1) both; }
.cp-loading, .cp-empty { padding: 28px; color: var(--cp-muted); text-align: center; }
.cp-error { display: grid; gap: 4px; padding: 18px; border: 1px solid #f0c9c7; border-radius: 12px; background: var(--bad-bg, #f9e7e6); color: var(--bad, #b84844); }

.cp-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 24px; border: 1px solid #d7e6ec; border-radius: 16px; background: radial-gradient(circle at 100% 0, rgba(31, 134, 181, .14), transparent 55%), #fff; }
.cp-hero-main { display: grid; gap: 4px; min-width: 0; }
.cp-eyebrow { color: var(--cp-muted); font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.cp-hero-value { color: var(--cp-ink); font-size: 48px; font-weight: 750; line-height: 1.05; letter-spacing: -.5px; }
.cp-hero-note { color: var(--cp-muted); font-size: 13px; }
.cp-portal-link, .cp-ghost { display: inline-flex; align-items: center; min-height: 36px; padding: 7px 13px; border: 1px solid var(--cp-line); border-radius: 9px; background: #fff; color: var(--blue-deep, #28576b); font: inherit; font-size: 12.5px; font-weight: 700; text-decoration: none; cursor: pointer; }
.cp-portal-link:hover, .cp-ghost:hover { border-color: #bcd6e0; background: var(--blue-soft, #eef5f8); }

.cp-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cp-tile { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 15px 16px; border: 1px solid var(--cp-line); border-radius: 13px; background: #fff; animation: cp-rise .4s cubic-bezier(.2, .8, .2, 1) both; transition: transform .2s ease, box-shadow .2s ease; }
.cp-tile:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(39, 74, 89, .1); }
.cp-tile-label { color: var(--cp-muted); font-size: 12px; font-weight: 650; }
.cp-tile-value { color: var(--cp-ink); font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; }
.cp-tile-note { color: var(--cp-muted); font-size: 11.5px; }
.cp-tile.attention { border-color: #c9dfe8; background: linear-gradient(135deg, #fff, var(--blue-soft, #eef5f8)); }
.cp-tile.danger { border-color: #f0c9c7; }
.cp-tile.danger .cp-tile-note { color: var(--bad, #b84844); font-weight: 700; }
.cp-tile.ok .cp-tile-note { color: var(--good, #24764c); }
.cp-tile:nth-child(2) { animation-delay: 40ms; } .cp-tile:nth-child(3) { animation-delay: 80ms; } .cp-tile:nth-child(4) { animation-delay: 120ms; }
.cp-tile:nth-child(5) { animation-delay: 160ms; } .cp-tile:nth-child(6) { animation-delay: 200ms; } .cp-tile:nth-child(7) { animation-delay: 240ms; }

.cp-panels { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 14px; }
.cp-card { border: 1px solid var(--cp-line); border-radius: 14px; background: #fff; overflow: hidden; }
.cp-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px 17px 6px; }
.cp-card-header h3, .cp-section-head h3 { margin: 0; color: var(--cp-ink); font-size: 15px; }
.cp-card-header p, .cp-section-head p { margin: 3px 0 0; color: var(--cp-muted); font-size: 12px; }

.cp-chart-wrap { position: relative; padding: 4px 12px 12px; }
.cp-chart { display: block; width: 100%; height: auto; overflow: visible; }
.cp-grid { stroke: #e8eef1; stroke-width: 1; }
.cp-axis-label { fill: var(--cp-muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.cp-hit { fill: transparent; cursor: pointer; }
.cp-bar { fill: var(--cp-series); transform-box: fill-box; transform-origin: bottom; animation: cp-grow .6s cubic-bezier(.2, .8, .2, 1) both; transition: opacity .15s ease; }
.cp-chart:hover .cp-bar { opacity: .45; }
.cp-chart .cp-bar-group.active .cp-bar, .cp-chart .cp-bar-group:hover .cp-bar { opacity: 1; }
.cp-tooltip { position: absolute; top: 6px; z-index: 2; display: grid; gap: 2px; min-width: 150px; padding: 9px 11px; border: 1px solid var(--cp-line); border-radius: 10px; background: #fff; box-shadow: 0 12px 28px rgba(25, 55, 68, .16); color: var(--cp-ink); font-size: 12px; pointer-events: none; transform: translateX(8px); }
.cp-tooltip.flip { transform: translateX(calc(-100% - 8px)); }
.cp-tooltip strong { font-size: 12.5px; }
.cp-at-0 { left: 0%; } .cp-at-1 { left: 5%; } .cp-at-2 { left: 10%; } .cp-at-3 { left: 15%; } .cp-at-4 { left: 20%; } .cp-at-5 { left: 25%; } .cp-at-6 { left: 30%; }
.cp-at-7 { left: 35%; } .cp-at-8 { left: 40%; } .cp-at-9 { left: 45%; } .cp-at-10 { left: 50%; } .cp-at-11 { left: 55%; } .cp-at-12 { left: 60%; } .cp-at-13 { left: 65%; }
.cp-at-14 { left: 70%; } .cp-at-15 { left: 75%; } .cp-at-16 { left: 80%; } .cp-at-17 { left: 85%; } .cp-at-18 { left: 90%; } .cp-at-19 { left: 95%; } .cp-at-20 { left: 100%; }

.cp-rank { display: grid; gap: 12px; padding: 8px 17px 17px; }
.cp-rank-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; }
.cp-rank-name { overflow: hidden; color: var(--cp-ink); font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.cp-rank-value { color: var(--cp-ink); font-variant-numeric: tabular-nums; font-weight: 700; }
.cp-rank-bar { grid-column: 1 / -1; width: 100%; height: 6px; }
.cp-rank-track { fill: #eef3f5; }
.cp-rank-fill { fill: var(--cp-series); transform-box: fill-box; transform-origin: left; animation: cp-grow-x .7s cubic-bezier(.2, .8, .2, 1) both; }
.cp-rank-meta { color: var(--cp-muted); font-size: 11px; }

.cp-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.cp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-chip { padding: 6px 12px; border: 1px solid var(--cp-line); border-radius: 999px; background: #fff; color: var(--cp-muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: all .18s ease; }
.cp-chip.active { border-color: var(--blue-dark, #39708a); background: var(--blue-dark, #39708a); color: #fff; }

.cp-table-wrap { overflow-x: auto; border: 1px solid var(--cp-line); border-radius: 13px; background: #fff; }
.cp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cp-table th { padding: 10px 13px; border-bottom: 1px solid var(--cp-line); background: #f7fafb; color: var(--cp-muted); font-size: 10.5px; font-weight: 800; letter-spacing: .4px; text-align: left; text-transform: uppercase; white-space: nowrap; }
.cp-table td { padding: 10px 13px; border-bottom: 1px solid #eef2f4; color: var(--cp-ink); vertical-align: top; }
.cp-table tr:last-child td { border-bottom: 0; }
.cp-table td small { display: block; margin-top: 2px; color: var(--cp-muted); font-size: 11px; }
.cp-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-table.compact td { padding: 6px 9px; }
.cp-row { animation: cp-rise .3s ease both; }
.cp-row:hover td { background: #fafcfd; }

.cp-pill { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 9px; border-radius: 12px; font-size: 10.5px; font-weight: 800; white-space: nowrap; }
.cp-pill.good { background: var(--good-bg, #e5f3ea); color: var(--good, #24764c); }
.cp-pill.warn { background: var(--warn-bg, #fcf2dd); color: var(--warn, #9b6812); }
.cp-pill.bad { background: var(--bad-bg, #f9e7e6); color: var(--bad, #b84844); }
.cp-pill.info { background: var(--blue-soft, #eef5f8); color: var(--blue-deep, #28576b); }
.cp-pill.neutral { background: #edf1f3; color: #697a82; }
.cp-text-danger { color: var(--bad, #b84844); font-size: 12px; }

.cp-billing-list { display: grid; gap: 12px; }
.cp-billing-card { display: grid; gap: 12px; padding: 16px 18px; border: 1px solid var(--cp-line); border-left: 4px solid #b9c6cc; border-radius: 13px; background: #fff; animation: cp-rise .35s cubic-bezier(.2, .8, .2, 1) both; transition: box-shadow .2s ease; }
.cp-billing-card:hover { box-shadow: 0 12px 28px rgba(39, 74, 89, .09); }
.cp-billing-card.status-approved { border-left-color: var(--blue, #62a5c0); }
.cp-billing-card.status-issued { border-left-color: #e2b04a; }
.cp-billing-card.status-paid { border-left-color: var(--good, #24764c); }
.cp-billing-card:nth-child(2) { animation-delay: 40ms; } .cp-billing-card:nth-child(3) { animation-delay: 80ms; } .cp-billing-card:nth-child(4) { animation-delay: 120ms; } .cp-billing-card:nth-child(n+5) { animation-delay: 160ms; }
.cp-billing-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cp-period { color: var(--cp-ink); font-weight: 750; }
.cp-figures { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; }
.cp-figures div { display: grid; }
.cp-figures dt { color: var(--cp-muted); font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }
.cp-figures dd { margin: 0; color: var(--cp-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.cp-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-btn { display: inline-flex; align-items: center; min-height: 34px; padding: 6px 12px; border: 1px solid var(--cp-line); border-radius: 9px; background: #fff; color: var(--blue-deep, #28576b); font: inherit; font-size: 12.5px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background-color .18s ease, transform .18s ease; }
.cp-btn:hover { background: var(--blue-soft, #eef5f8); }
.cp-btn:active { transform: scale(.98); }
.cp-btn.primary { border-color: transparent; background: linear-gradient(135deg, var(--blue-dark, #39708a), var(--blue-deep, #28576b)); color: #fff; }
.cp-btn[disabled] { opacity: .55; cursor: progress; }
.cp-detail { padding-top: 10px; border-top: 1px dashed var(--cp-line); animation: cp-rise .3s ease both; }
.cp-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.cp-detail h4 { margin: 0 0 6px; font-size: 13px; }
.cp-detail .cp-table { border: 1px solid var(--cp-line); border-radius: 10px; }
.cp-scroll { max-height: 380px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--cp-line); border-radius: 10px; }
.cp-scroll .cp-table { border: 0; }

@keyframes cp-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes cp-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes cp-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* A tördelés a modul saját szélességéhez igazodik (oldalsávval vagy anélkül). */
@container (min-width: 620px) { .cp-tiles, .cp-sk-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container (min-width: 1080px) { .cp-tiles, .cp-sk-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@container (max-width: 860px) {
  .cp-panels { grid-template-columns: minmax(0, 1fr); }
  .cp-hero-value { font-size: 36px; }
}
@container (max-width: 520px) {
  .cp-tile { padding: 13px 14px; }
  .cp-tile-value { font-size: 19px; }
  .cp-hero { padding: 18px; }
  .cp-hero-value { font-size: 32px; }
  .cp-portal-link, .cp-section-head .cp-ghost { width: 100%; justify-content: center; }
  .cp-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .cp-tab { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .cp-body, .cp-tile, .cp-row, .cp-billing-card, .cp-detail, .cp-bar, .cp-rank-fill { animation: none; }
  .cp-tile:hover { transform: none; }
}

/* Betöltési váz (skeleton) */
.cp-skeleton { display: grid; gap: 12px; }
.cp-sk { border-radius: 14px; background: linear-gradient(100deg, #eef3f5 30%, #f8fafb 50%, #eef3f5 70%); background-size: 300% 100%; animation: cp-shimmer 1.4s ease-in-out infinite; }
.cp-sk-hero { height: 128px; }
.cp-sk-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cp-sk-tile { height: 92px; }
.cp-sk-panel { height: 300px; }
@keyframes cp-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .cp-sk { animation: none; } }

/* Beállítások */
.cp-settings { display: grid; gap: 4px; padding-bottom: 6px; animation: cp-rise .35s cubic-bezier(.2, .8, .2, 1) both; }
.cp-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 8px 17px 4px; }
.cp-field { display: grid; gap: 6px; color: var(--cp-ink); font-size: 12.5px; font-weight: 700; }
.cp-field small { color: var(--cp-muted); font-weight: 500; }
.cp-input-wrap { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--cp-line); border-radius: 10px; background: #fff; transition: border-color .18s ease, box-shadow .18s ease; }
.cp-input-wrap:focus-within { border-color: var(--cp-series); box-shadow: 0 0 0 3px rgba(31, 134, 181, .15); }
.cp-input-wrap input { flex: 1; min-width: 0; min-height: 40px; border: 0; background: none; color: var(--cp-ink); font: inherit; font-size: 16px; font-variant-numeric: tabular-nums; outline: none; }
.cp-input-wrap b { color: var(--cp-muted); font-size: 12px; }
.cp-settings-preview { margin: 4px 17px 0; padding: 10px 12px; border-radius: 10px; background: var(--blue-soft, #eef5f8); color: var(--blue-deep, #28576b); font-size: 12.5px; }
.cp-settings-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 17px; }
.cp-muted { color: var(--cp-muted); font-size: 12px; }
@container (max-width: 620px) { .cp-settings-grid { grid-template-columns: minmax(0, 1fr); } }

/* Csúszókapcsoló (kiszállítási díj be/ki) */
.cp-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.cp-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cp-switch-track { position: relative; width: 46px; height: 26px; flex: 0 0 auto; border-radius: 999px; background: #cfd9de; transition: background-color .22s ease, box-shadow .22s ease; }
.cp-switch-thumb { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(25, 55, 68, .25); transition: transform .26s cubic-bezier(.2, .8, .2, 1.2); }
.cp-switch input:checked + .cp-switch-track { background: var(--good, #24764c); }
.cp-switch input:checked + .cp-switch-track .cp-switch-thumb { transform: translateX(20px); }
.cp-switch input:focus-visible + .cp-switch-track { box-shadow: 0 0 0 3px rgba(31, 134, 181, .3); }
.cp-switch input:disabled + .cp-switch-track { opacity: .55; cursor: not-allowed; }
.cp-switch-label { min-width: 52px; color: var(--cp-ink); font-size: 13px; font-weight: 800; }
.cp-settings.is-off .cp-settings-grid { opacity: .6; transition: opacity .2s ease; }
.cp-settings.is-off .cp-settings-preview { background: #f1f4f6; color: var(--cp-muted); }
@media (prefers-reduced-motion: reduce) { .cp-switch-track, .cp-switch-thumb { transition: none; } }
