/* ════════════════════════════════════════════════════════════════════
   Scheda cliente CRM — redesign 2026-11 (intestazione fissa, 5 sezioni)
   Caricato dopo admin-theme.css; usa solo i token di tokens.css.
   ════════════════════════════════════════════════════════════════════ */

.customer-drawer .sh.cx { font-family: var(--font-family); color: var(--text); background: var(--bg); font-variant-numeric: tabular-nums; }
.customer-drawer .sh.cx button { font-family: inherit; }

/* ── Intestazione ─────────────────────────────────────────────────── */
.cx-head { flex: none; background: var(--surface); border-bottom: 1px solid var(--border); }
.cx-head > * { max-width: 1376px; margin-inline: auto; padding-inline: 32px; box-sizing: border-box; }
.cx-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 52px; font-size: var(--text-sm); color: var(--hint); }
.cx-crumb { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cx-crumb b { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: var(--surface2); color: var(--text-2); font-weight: 700; font-size: var(--text-sm); padding: 6px 10px 6px 6px; border-radius: 9px; cursor: pointer; }
.cx-back:hover { background: var(--primary-soft); color: var(--primary-dark); }
.cx-bar-r, .cx-nav { display: flex; align-items: center; gap: 6px; }
.cx-nav span { margin-right: 6px; white-space: nowrap; }
.cx-ib { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); display: grid; place-items: center; cursor: pointer; padding: 0; }
.cx-ib:hover:not(:disabled) { border-color: var(--primary-mid); color: var(--primary-dark); background: var(--primary-soft); }
.cx-ib:disabled { opacity: .4; cursor: default; }
.cx-ib.x { margin-left: 4px; border: 0; background: var(--surface2); }

.cx-id { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding-top: 12px; padding-bottom: 16px; }
.cx-avatar-wrap { position: relative; flex: none; }
.cx-avatar { width: 60px; height: 60px; border-radius: 19px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.cx-online { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 99px; background: var(--green); border: 3px solid var(--surface); }
.cx-id > .cx-avatar-wrap + .cx-id-t { flex: 1 1 420px; }
.cx-id { flex-wrap: wrap; }
.cx-id-t { display: flex; flex-direction: column; gap: 7px; min-width: 0; flex: 1 1 420px; }
.cx-id-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.cx-id-line h1 { margin: 0; font-size: 25px; line-height: 1.1; font-weight: 800; letter-spacing: -.035em; color: var(--text); word-break: break-word; }
.cx-metas { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--text-sm); color: var(--text-2); align-items: center; }
.cx-meta { display: inline-flex; align-items: center; gap: 6px; }
.cx-meta svg { color: var(--hint); flex: none; }
.cx-copy { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.cx-copy:hover { color: var(--primary-dark); }
.cx-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.cx-facts { margin: 0 0 4px; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); padding-inline: 0; border: 1px solid var(--border); border-radius: 14px; background: #FAFAFC; overflow: hidden; }
.cx-facts > div { padding: 11px 16px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cx-facts > div:last-child { border-right: 0; }
.cx-facts dt { font-size: 11px; font-weight: 700; color: var(--hint); text-transform: uppercase; letter-spacing: .05em; }
.cx-facts dd { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-facts dd b { font-size: 17px; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.cx-facts dd span { font-size: var(--text-xs); color: var(--hint); font-weight: 600; }
.cx-meter { display: flex; height: 5px; border-radius: 99px; overflow: hidden; background: var(--surface3); margin-top: 3px; }
.cx-meter i { background: var(--primary); }
.cx-meter i.b { background: var(--accent); }

.cx-head-loading { display: flex; gap: 16px; align-items: center; padding: 14px 0 18px; }
.cx-head-loading span { width: 60px; height: 60px; border-radius: 19px; background: var(--surface2); }
.cx-head-loading div { display: grid; gap: 10px; }
.cx-head-loading i { display: block; height: 14px; width: 260px; border-radius: 6px; background: var(--surface2); }
.cx-head-loading i + i { width: 180px; }

/* Tab principali */
.customer-drawer .cx-head .cx-tabs, .customer-drawer .cx-head #customer-tabs { height: auto; min-height: 0; width: 100%; max-width: 1376px; margin: 8px auto 0; padding: 0 22px; position: static; background: transparent; border: 0; -webkit-mask-image: none; mask-image: none; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.customer-drawer .cx-tabs .tab { height: 48px; padding: 0 14px; gap: 8px; font-size: var(--text-sm); font-weight: 600; color: var(--text-2); border: 0; border-bottom: 2px solid transparent; background: none; white-space: nowrap; display: inline-flex; align-items: center; cursor: pointer; }
.customer-drawer .cx-tabs .tab:hover { color: var(--primary-dark); }
.customer-drawer .cx-tabs .tab.on { color: var(--primary-dark); font-weight: 800; border-bottom-color: var(--primary); }
.customer-drawer .cx-tabs .tab em { font-style: normal; font-size: 11px; font-weight: 800; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 99px; background: var(--surface3); color: var(--text-2); }
.customer-drawer .cx-tabs .tab.on em { background: var(--primary); color: var(--on-primary); }
.customer-drawer .cx-tabs .tab em.alert { background: var(--red); color: #fff; }

/* Sotto-schede */
.cx-subtabs { flex: none; background: var(--bg); padding: 16px 32px 0; }
.cx-subtabs-in { max-width: calc(1376px - 64px); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 6px; }
.cx-pill { height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: var(--text-sm); font-weight: 700; cursor: pointer; }
.cx-pill span { color: var(--hint); font-weight: 600; }
.cx-pill:hover { border-color: var(--border-strong); }
.cx-pill.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.cx-pill.on span { color: rgba(255, 255, 255, .7); }

/* Pannello */
.customer-drawer .sh.cx .pane { padding: 24px 32px 56px; scrollbar-gutter: stable both-edges; }
.customer-drawer .sh.cx .pane > * { width: 100%; max-width: calc(1376px - 64px); margin-inline: auto; box-sizing: border-box; }
.customer-drawer .sh.cx .pane.ms { padding: 16px 32px; }
.cx-page { display: flex; flex-direction: column; gap: 22px; }

/* ── Mattoni ──────────────────────────────────────────────────────── */
.cx-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--surface2); color: var(--text-2); }
.cx-chip svg { flex: none; }
.cx-chip.t-green { background: #E3F5EA; color: #0F7A3D; }
.cx-chip.t-amber { background: #FDF1DC; color: #8A5300; }
.cx-chip.t-red { background: #FDECEE; color: #B4232F; }
.cx-chip.t-violet { background: #EEEBFE; color: #4938C8; }
.cx-chip.t-blue { background: #EAF1FE; color: #1F5BC8; }
.cx-chip.t-teal { background: #E0F4F2; color: #0B6A5F; }
.cx-chip.dot::before { content: ""; width: 6px; height: 6px; border-radius: 99px; background: currentColor; }

.cx-tile { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--surface2); color: var(--text-2); }
.cx-tile.s-lg { width: 40px; height: 40px; border-radius: 12px; }
.cx-tile.t-violet { background: #EEEBFE; color: #4938C8; }
.cx-tile.t-green { background: #E3F5EA; color: #0F7A3D; }
.cx-tile.t-amber { background: #FDF1DC; color: #8A5300; }
.cx-tile.t-red { background: #FDECEE; color: #B4232F; }
.cx-tile.t-blue { background: #EAF1FE; color: #1F5BC8; }
.cx-tile.t-teal { background: #E0F4F2; color: #0B6A5F; }
.cx-tile.t-gray { background: var(--surface2); color: var(--text-2); }

.cx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: var(--text-sm); font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s; }
.cx-btn:hover { border-color: var(--primary-mid); background: var(--primary-soft); color: var(--primary-dark); }
.cx-btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 1px 2px rgba(73, 56, 200, .3); }
.cx-btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--on-primary); }
.cx-btn.dark { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.cx-btn.dark:hover { background: #2B2B36; color: var(--on-ink); }
.cx-btn.danger { color: var(--red); border-color: #F0C2C7; }
.cx-btn.danger:hover { background: var(--red-soft); color: var(--red); border-color: var(--red); }
.cx-btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.cx-btn.danger-solid:hover { background: #B8232F; color: #fff; }
.cx-btn.sm { height: 36px; padding: 0 13px; border-radius: 10px; font-size: var(--text-sm); }
.cx-btn.icon { width: 42px; padding: 0; }
.cx-btn:disabled { opacity: .5; cursor: wait; }
.cx-btn:focus-visible, .cx-pill:focus-visible, .cx-filter:focus-visible, .cx-link:focus-visible, .customer-drawer .cx-tabs .tab:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.cx-link { border: 0; background: none; padding: 0; color: var(--primary-dark); font-weight: 700; font-size: var(--text-sm); cursor: pointer; }
.cx-link:hover { text-decoration: underline; }
.cx-muted { color: var(--hint); font-size: var(--text-xs); }

.cx-more { position: relative; }
.cx-more > summary { list-style: none; }
.cx-more > summary::-webkit-details-marker { display: none; }
.cx-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(22, 22, 29, .14); padding: 6px; display: grid; }
.cx-menu button { display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 10px 12px; border-radius: 8px; font-size: var(--text-sm); font-weight: 600; color: var(--text); cursor: pointer; }
.cx-menu button:hover { background: var(--surface2); }
.cx-menu button.danger { color: var(--red); border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 4px; }

/* Card */
.cx-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 1px 2px rgba(22, 22, 29, .04); min-width: 0; overflow: hidden; }
.cx-card-h { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 18px 22px 12px; }
.cx-card-t { flex: 1 1 140px; min-width: 0; }
.cx-card-t h3 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.cx-card-t p { margin: 2px 0 0; font-size: var(--text-xs); color: var(--hint); }
.cx-card-x { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cx-card-b { padding: 0 22px 18px; display: flex; flex-direction: column; gap: 10px; }
.cx-card-f { padding: 12px 22px; border-top: 1px solid #F2F2F7; }

.cx-kv { margin: 0; }
.cx-kv > div { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-top: 1px solid #F2F2F7; font-size: var(--text-sm); }
.cx-kv > div:first-child { border-top: 0; }
.cx-kv dt { color: var(--hint); flex: none; }
.cx-kv dd { margin: 0; text-align: right; font-weight: 600; color: var(--text); word-break: break-word; min-width: 0; }

.cx-tablewrap { overflow-x: auto; }
.cx-table { width: 100%; min-width: 560px; border-collapse: collapse; }
.cx-table th { text-align: left; padding: 9px 22px; font-size: 11px; font-weight: 800; color: var(--hint); text-transform: uppercase; letter-spacing: .05em; background: #FAFAFC; border-top: 1px solid #F2F2F7; border-bottom: 0; white-space: nowrap; }
.cx-table td { padding: 11px 22px; border-top: 1px solid #F2F2F7; border-bottom: 0; font-size: var(--text-sm); color: var(--text); vertical-align: middle; }
.cx-table tbody tr:hover td { background: #FAFAFE; }
.cx-table .cx-r { text-align: right; }
.cx-table code { font-size: 12px; color: var(--text-2); background: none; }
.cx-up { color: #0F7A3D; }
.cx-down { color: #B4232F; }
.cx-err { display: block; margin-top: 4px; font-size: 11px; color: var(--hint); max-width: 420px; white-space: normal; }
.cx-empty { padding: 22px; text-align: center; color: var(--hint); font-size: var(--text-sm); }
.cx-card-b .cx-empty { padding: 12px 0; }

.cx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cx-filter { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: var(--text-xs); font-weight: 700; cursor: pointer; }
.cx-filter.on { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }

/* Layout */
.cx-section { display: flex; flex-direction: column; gap: 12px; }
.cx-section-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cx-section-h h2 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.cx-section-h span { font-size: var(--text-sm); color: var(--hint); }
.cx-split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.cx-col-main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.cx-col-side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.cx-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 24px; align-items: start; }
.cx-grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 24px; align-items: start; }

/* Da fare adesso */
.cx-todos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.cx-todo { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 1px 2px rgba(22, 22, 29, .04); }
.cx-todo-top { display: flex; gap: 12px; align-items: flex-start; }
.cx-todo-top b { display: block; font-size: 15px; margin-top: 3px; }
.cx-todo-top p { margin: 2px 0 0; font-size: var(--text-sm); color: var(--text-2); line-height: 1.45; }
.cx-todo .cx-btn { align-self: flex-start; margin-top: auto; }
.cx-urg { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.cx-urg.t-red { color: #B4232F; } .cx-urg.t-amber { color: #8A5300; } .cx-urg.t-violet { color: #4938C8; } .cx-urg.t-blue { color: #1F5BC8; }
.cx-calm { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px 18px; }
.cx-calm > div b { display: block; font-size: 14px; }
.cx-calm > div span { font-size: var(--text-sm); color: var(--hint); }
.cx-card-b .cx-calm { border: 0; padding: 4px 0; }

/* Cronologia */
.cx-day { font-size: 11px; font-weight: 800; color: var(--hint); text-transform: uppercase; letter-spacing: .06em; padding: 12px 0 4px; }
.cx-tl { list-style: none; margin: 0; padding: 0; }
.cx-tl li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid #F2F2F7; }
.cx-tl li .cx-tile { width: 32px; height: 32px; border-radius: 9px; }
.cx-tl li > div b { display: block; font-size: var(--text-sm); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-tl li > div span { display: block; font-size: var(--text-xs); color: var(--hint); }
.cx-tl time { font-size: var(--text-xs); color: var(--hint); white-space: nowrap; }

/* Andamento */
.cx-stats { display: flex; flex-wrap: wrap; gap: 20px; font-size: var(--text-xs); color: var(--hint); }
.cx-stats b { display: block; font-size: 17px; color: var(--text); }
.cx-stats em { font-style: normal; font-size: var(--text-xs); color: var(--hint); font-weight: 600; }
.cx-bars { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 12px; align-items: end; height: 170px; padding-top: 8px; background: repeating-linear-gradient(to top, transparent 0, transparent 37px, #F2F2F7 37px, #F2F2F7 38px); background-position: 0 -22px; }
.cx-wk { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.cx-wk span { font-size: 11px; font-weight: 800; color: var(--hint); }
.cx-wk i { display: block; width: 100%; max-width: 40px; min-height: 2px; border-radius: 8px 8px 3px 3px; background: #D9D3FC; }
.cx-wk.now span { color: var(--primary-dark); }
.cx-wk.now i { background: var(--primary); }
.cx-wk small { font-size: 11px; color: var(--hint); white-space: nowrap; }

/* Abbonamento */
.cx-plan { display: flex; justify-content: space-between; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.cx-plan b { display: block; font-size: 19px; letter-spacing: -.02em; }
.cx-plan span { font-size: var(--text-sm); color: var(--text-2); }
.cx-period > div:first-child { display: flex; justify-content: space-between; gap: 8px; font-size: var(--text-xs); color: var(--hint); margin-bottom: 6px; }
.cx-period b { color: var(--text); }
.cx-track { height: 6px; border-radius: 99px; background: var(--surface2); overflow: hidden; }
.cx-track i { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.cx-track i.amber { background: var(--orange); }

/* Note */
.cx-notecard { background: #FFFBF0; border-color: #F3E3B8; }
.cx-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cx-notes li p { margin: 0; font-size: var(--text-sm); line-height: 1.5; white-space: pre-wrap; }
.cx-notes li span { font-size: var(--text-xs); color: var(--hint); }
.cx-note-field { display: grid; gap: 6px; font-size: var(--text-xs); font-weight: 600; color: var(--hint); }
.cx-note-field textarea { width: 100%; box-sizing: border-box; border: 1px solid #E8DDBF; background: var(--surface); border-radius: 10px; padding: 9px 11px; font: var(--text-sm) var(--font-family); color: var(--text); resize: vertical; }
.cx-notecard .cx-btn { align-self: flex-start; }

/* KPI */
.cx-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.cx-kpis > div { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.cx-kpis span { font-size: var(--text-xs); font-weight: 700; color: var(--hint); }
.cx-kpis b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.cx-kpis small { font-size: var(--text-xs); color: var(--text-2); }
.cx-op { padding: 8px 0; border-top: 1px solid #F2F2F7; }
.cx-op:first-child { border-top: 0; }
.cx-op > div { display: flex; justify-content: space-between; gap: 10px; font-size: var(--text-sm); }
.cx-op > div + div { font-size: var(--text-xs); color: var(--hint); margin: 2px 0 6px; }
.cx-op .cx-track { height: 4px; margin: 0; }
.cx-total { font-size: 15px; }

/* Crediti */
.cx-balance { display: flex; flex-wrap: wrap; }
.cx-balance-main { flex: 2 1 460px; border-right: 1px solid #F2F2F7; padding-bottom: 20px; }
.cx-balance-main > :not(header) { margin-inline: 22px; }
.cx-balance-side { flex: 1 1 260px; padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 6px; }
.cx-balance-side h3 { margin: 0 0 6px; font-size: 15px; font-weight: 800; }
.cx-big { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cx-big b { font-size: 40px; line-height: 1; letter-spacing: -.04em; }
.cx-big span { font-size: var(--text-sm); color: var(--hint); font-weight: 600; }
.cx-big-money { font-size: 28px; letter-spacing: -.03em; margin-bottom: 4px; }
.cx-stack { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface2); gap: 2px; margin-bottom: 14px; }
.cx-stack i, .cx-buckets span i { background: var(--primary); }
.cx-stack i.pack, .cx-buckets i.pack { background: var(--accent); }
.cx-stack i.grant, .cx-buckets i.grant { background: #15A050; }
.cx-stack i.ref, .cx-buckets i.ref { background: #F59E0B; }
.cx-buckets { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.cx-buckets > div { display: flex; flex-direction: column; gap: 2px; }
.cx-buckets span { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--hint); }
.cx-buckets span i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.cx-buckets b { font-size: 17px; }
.cx-buckets em { font-style: normal; font-size: var(--text-xs); color: var(--hint); font-weight: 600; }
.cx-buckets small { font-size: 11px; color: var(--hint); }
.cx-banner { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; cursor: pointer; font-size: var(--text-sm); color: var(--text); }
.cx-banner:hover { border-color: var(--primary-mid); }
.cx-banner > span:not(.cx-tile) { flex: 1; }
.cx-banner em { font-style: normal; font-weight: 700; color: var(--primary-dark); }

/* Comunicazioni */
.cx-ticket { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; background: #FAFAFC; display: flex; flex-direction: column; gap: 10px; }
.cx-ticket-h { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.cx-ticket-h b { font-size: 14px; }
.cx-ticket blockquote { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px 12px 12px 4px; padding: 10px 13px; font-size: var(--text-sm); line-height: 1.5; white-space: pre-wrap; }
.cx-ticket blockquote.admin { background: #EEEBFE; border-color: transparent; border-radius: 12px 12px 4px 12px; }
.cx-ticket blockquote span { display: block; font-size: 11px; font-weight: 700; color: var(--hint); margin-bottom: 3px; }
.cx-row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-sublist h4 { margin: 10px 0 2px; font-size: var(--text-sm); font-weight: 800; }
.cx-li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid #F2F2F7; font-size: var(--text-sm); }
.cx-li > span:first-child { font-weight: 600; }
.cx-li2 { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #F2F2F7; font-size: var(--text-sm); }
.cx-li2:first-child { border-top: 0; }
.cx-li2 b { display: block; }
.cx-li2 small { font-size: var(--text-xs); color: var(--hint); }
.cx-switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid #F2F2F7; font-size: var(--text-sm); }
.cx-switch-row:first-child { border-top: 0; }
.cx-switch-row b { display: block; }
.cx-switch-row small { font-size: var(--text-xs); color: var(--hint); }
.cx-switch { flex: none; width: 36px; height: 20px; border-radius: 99px; padding: 2px; box-sizing: border-box; display: flex; justify-content: flex-start; background: var(--border-strong); }
.cx-switch.on { justify-content: flex-end; background: var(--green); }
.cx-switch i { width: 16px; height: 16px; border-radius: 99px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.cx-mini-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cx-mini-stats > div { background: #FAFAFC; border-radius: 12px; padding: 10px; text-align: center; }
.cx-mini-stats span { display: block; font-size: 11px; color: var(--hint); }
.cx-mini-stats b { font-size: 19px; }
.cx-card-b > .cx-btn { align-self: flex-start; }

/* Account */
.cx-danger { border-color: #F3C5CA; }
.cx-danger-h { padding: 16px 22px; background: #FFF7F8; border-bottom: 1px solid #F8DDE0; }
.cx-danger-h h3 { margin: 0; font-size: 15px; font-weight: 800; color: #B4232F; }
.cx-danger-h p { margin: 2px 0 0; font-size: var(--text-xs); color: var(--text-2); }
.cx-danger-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 22px; border-top: 1px solid #F8EDEE; }
.cx-danger-row:first-of-type { border-top: 0; }
.cx-danger-row div { flex: 1 1 360px; }
.cx-danger-row b { display: block; font-size: 14px; }
.cx-danger-row span { font-size: var(--text-sm); color: var(--text-2); }

/* Pannelli esistenti dentro il nuovo contenitore: stesso respiro */
.customer-drawer .sh.cx .pane .cd { border-radius: 18px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-height: 820px) {
  .cx-id { padding-top: 6px; padding-bottom: 12px; }
  .cx-avatar { width: 48px; height: 48px; border-radius: 15px; font-size: 18px; }
  .cx-facts > div { padding: 8px 14px; }
  .cx-facts dd b { font-size: 15px; }
  .customer-drawer .cx-tabs .tab { height: 44px; }
}
@media (max-width: 760px) {
  .cx-head > *, .cx-subtabs { padding-inline: 16px; }
  #customer-head-main .cx-facts { display: flex; overflow-x: auto; }
  .customer-drawer .sh.cx { overflow-y: auto; }
  .customer-drawer .sh.cx .pane:not(.ms) { flex: none; overflow: visible; min-height: auto; }
  .customer-drawer .sh.cx .pane.ms { flex: none; height: calc(100dvh - 140px); }
  .cx-facts > div { flex: 0 0 auto; min-width: 150px; }
  .customer-drawer .sh.cx .pane, .customer-drawer .sh.cx .pane.ms { padding-inline: 16px; }
  .cx-nav span { display: none; }
  .cx-actions { width: 100%; position: relative; }
  .cx-more { position: static; }
  .cx-menu { left: 0; right: 0; min-width: 0; }
  .cx-actions .cx-btn.primary { flex: 1; }
  .cx-id-line h1 { font-size: 21px; }
  .cx-balance-main { border-right: 0; border-bottom: 1px solid #F2F2F7; }
  .cx-mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.cx-more > summary::marker { content: ""; }
.cx-kv dd .cx-link, .cx-li2 .cx-link { height: auto; min-height: 0; line-height: inherit; vertical-align: baseline; }
.cx-more > summary::before, .cx-more > summary::after { content: none !important; display: none !important; }
