/* Console pages (client page, clients list, overview, broadcasts): plain
   cards, one clear purpose per block, status chips in one shared style. */

.cx-back { background: none; border: 0; padding: 0; margin: 0 0 14px; font: inherit; font-size: 0.86rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.cx-back:hover { color: var(--primary); }

.cx-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow-xs); }
.cx-card + .cx-card { margin-top: 18px; }
/* Columns stack with a gap, so a hidden first card never leaves a stray margin. */
.cx-col { display: flex; flex-direction: column; gap: 18px; }
.cx-col > .cx-card + .cx-card { margin-top: 0; }

/* Client page tabs */
.cx-tabs { display: flex; gap: 4px; margin: 0 0 18px; border-bottom: 1px solid var(--border-subtle); overflow-x: auto; scrollbar-width: none; }
.cx-tab { position: relative; padding: 10px 14px; border: 0; background: none; font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.cx-tab:hover { color: var(--text-primary); }
.cx-tab[aria-selected="true"] { color: var(--primary); }
.cx-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }
.cx-tab .cx-tab-dot { display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--amber); vertical-align: middle; }
.cx-narrow { max-width: 680px; }

/* Usage meters */
.cx-meter { margin: 12px 0; }
.cx-meter-top { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 6px; }
.cx-meter-top b { color: var(--text-primary); }
.cx-meter-track { height: 8px; border-radius: 999px; background: var(--bg-surface-elevated); overflow: hidden; }
.cx-meter-fill { height: 100%; border-radius: 999px; background: var(--primary); }
.cx-meter-fill.warn { background: var(--amber); }
.cx-meter-fill.over { background: var(--rose); }

/* "What to do next" */
.cx-next { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; margin-top: 8px; font-size: 0.88rem; }
.cx-next.ok { background: var(--emerald-bg); color: var(--emerald-text); }
.cx-next.warn { background: var(--amber-bg); color: var(--amber-text); }
.cx-next.danger { background: var(--rose-bg); color: var(--rose-text); }
.cx-next.muted { background: var(--bg-surface-elevated); color: var(--text-secondary); }
.cx-next-text { flex: 1; font-weight: 600; }

/* Small number tiles (Home cloud card) */
.cx-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 10px 0 12px; }
.cx-tile { padding: 12px 14px; border-radius: 10px; background: var(--bg-surface-elevated); }
.cx-tile-value { font-size: 1.15rem; font-weight: 800; color: var(--text-primary); }
.cx-tile-label { margin-top: 2px; font-size: 0.76rem; color: var(--text-muted); }
@media (max-width: 900px) { .cx-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

button:disabled, .btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }
.cx-h { margin: 0 0 6px; font-size: 1rem; font-weight: 800; color: var(--text-primary); }
.cx-h4 { margin: 18px 0 8px; font-size: 0.82rem; font-weight: 700; color: var(--text-primary); }
.cx-p { margin: 0 0 14px; font-size: 0.84rem; color: var(--text-secondary); line-height: 1.5; }
.cx-sub { font-size: 0.86rem; color: var(--text-secondary); }
.cx-muted { color: var(--text-muted); font-size: 0.78rem; }
.cx-empty { padding: 10px 0; font-size: 0.85rem; color: var(--text-muted); }
.cx-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 12px; }
.cx-row > .field { flex: 1; min-width: 150px; margin: 0; }

/* Header */
.cx-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.cx-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cx-title { margin: 0; font-size: 1.45rem; font-weight: 800; color: var(--text-primary); }
.cx-head-actions { display: flex; gap: 10px; }

/* Status chips */
.cx-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; border: 1px solid; white-space: nowrap; }
.cx-chip.ok { background: var(--emerald-bg); border-color: var(--emerald-border); color: var(--emerald-text); }
.cx-chip.warn { background: var(--amber-bg); border-color: var(--amber-border); color: var(--amber-text); }
.cx-chip.danger { background: var(--rose-bg); border-color: var(--rose-border); color: var(--rose-text); }
.cx-chip.muted { background: var(--slate-bg); border-color: var(--slate-border); color: var(--slate-text); }
.cx-chip.plan { background: var(--primary-subtle); border-color: var(--primary-border); color: var(--primary-hover); }
.cx-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.cx-dot.ok { background: var(--emerald); }
.cx-dot.off { background: var(--border-strong); }
.cx-dot.warn { background: var(--amber); }

/* Facts strip */
.cx-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.cx-fact { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 14px; padding: 14px 16px; }
.cx-fact-label { font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.cx-fact-value { margin-top: 6px; font-size: 1.12rem; font-weight: 800; color: var(--text-primary); }
.cx-fact-sub { margin-top: 2px; font-size: 0.78rem; color: var(--text-muted); min-height: 1em; }

.cx-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cx-col { min-width: 0; }

.cx-renew-preview { margin: 4px 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--bg-surface-elevated); font-size: 0.84rem; color: var(--text-secondary); }
.cx-renew-preview b { color: var(--text-primary); }
.cx-warn-line { margin-top: 6px; color: var(--amber-text); font-weight: 600; }
.cx-flash { box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.35); transition: box-shadow .3s; }

.cx-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.cx-table th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 700; padding: 6px 8px; border-bottom: 1px solid var(--border-subtle); }
.cx-table td { padding: 8px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.cx-table tr:last-child td { border-bottom: 0; }

.cx-dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 12px; margin: 6px 0 16px; font-size: 0.85rem; }
.cx-dl dt { color: var(--text-muted); }
.cx-dl dd { margin: 0; font-weight: 600; color: var(--text-primary); word-break: break-word; }
.cx-note { font-size: 0.82rem; color: var(--text-secondary); background: var(--bg-surface-elevated); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; line-height: 1.5; }

.cx-details > summary { cursor: pointer; font-size: 0.95rem; font-weight: 800; color: var(--text-primary); }
.cx-check { font-size: 0.85rem; padding: 4px 0; }
.cx-check label { display: flex; gap: 8px; align-items: center; cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-primary); font-size: 0.85rem; }
.cx-change { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px dashed var(--border-subtle); font-size: 0.82rem; }
.cx-change:last-child { border-bottom: 0; }

.cx-danger { border-color: var(--rose-border); }
.cx-danger .cx-h { color: var(--rose-text); }

@media (max-width: 1100px) {
  .cx-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .cx-facts { grid-template-columns: 1fr; }
  .cx-dl { grid-template-columns: 1fr; }
}

/* Clients list */
.cx-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.cx-search { flex: 1; height: 42px; padding: 0 14px; border: 1px solid var(--border-subtle); border-radius: 10px; font: inherit; font-size: 0.9rem; background: var(--bg-surface); }
.cx-search:focus { outline: none; border-color: var(--border-active); box-shadow: var(--border-glow); }
.cx-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cx-filter { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-subtle); background: var(--bg-surface); font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; }
.cx-filter span { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--bg-surface-elevated); font-size: 0.74rem; text-align: center; }
.cx-filter:hover { border-color: var(--border-strong); }
.cx-filter.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.cx-filter.active span { background: rgba(255, 255, 255, 0.22); color: #fff; }
.cx-table-card { padding: 0; overflow-x: auto; }
.cx-list { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 760px; }
.cx-list th { text-align: left; padding: 12px 16px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); border-bottom: 1px solid var(--border-subtle); background: var(--bg-surface-elevated); }
.cx-list td { padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.cx-list tbody tr { cursor: pointer; }
.cx-list tbody tr:hover, .cx-list tbody tr:focus { background: var(--bg-card-hover); outline: none; }
.cx-list tbody tr:last-child td { border-bottom: 0; }
.cx-list .num { text-align: right; font-weight: 700; }
.cx-name { font-weight: 700; color: var(--text-primary); }

/* Overview */
.cx-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.cx-of { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); }
.cx-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.cx-link { background: none; border: 0; padding: 0; font: inherit; font-size: 0.84rem; font-weight: 700; color: var(--primary); cursor: pointer; }
.cx-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border-subtle); }
.cx-item:last-child { border-bottom: 0; }
.cx-item-main { flex: 1; min-width: 0; }
.cx-item-link { cursor: pointer; }
.cx-item-link:hover .cx-name { color: var(--primary); }
.nav-badge { margin-left: auto; min-width: 20px; padding: 1px 7px; border-radius: 999px; background: var(--rose); color: #fff; font-size: 0.72rem; font-weight: 800; text-align: center; }
.cx-req-num { width: 64px; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 8px; font: inherit; font-size: 0.84rem; background: var(--bg-card); color: inherit; }
.cx-req-note { margin-top: 3px; font-style: italic; }
.cx-item-btn { padding: 7px 14px; font-size: 0.82rem; white-space: nowrap; }
.cx-bar { width: 4px; align-self: stretch; border-radius: 4px; background: var(--border-strong); }
.cx-bar.danger { background: var(--rose); }
.cx-bar.warn { background: var(--amber); }
.cx-amount { font-weight: 700; color: var(--text-primary); }
.cx-allgood { padding: 16px; border-radius: 10px; background: var(--emerald-bg); color: var(--emerald-text); font-size: 0.88rem; font-weight: 600; }
.cx-quick { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
@media (max-width: 1100px) { .cx-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cx-stats { grid-template-columns: 1fr; } .cx-toolbar { flex-direction: column; align-items: stretch; } }

/* Broadcasts */
.cx-template { height: 36px; padding: 0 10px; border: 1px solid var(--border-subtle); border-radius: 8px; font: inherit; font-size: 0.82rem; background: var(--bg-surface); color: var(--text-secondary); }
.cx-sticky { position: sticky; top: 16px; }
.cx-link-danger { color: var(--rose-text); }

/* View-only accounts: hide the buttons that create things. The server refuses these anyway. */
body.role-support .btn-topbar-cta, body.role-support #navAddCompany { display: none; }

/* ---- Distributors: roles, sign-up, requests, dialogs ---------------------------------------
   One console for everyone. A distributor sees only the items marked data-for="distributor";
   the Zensia team sees data-for="staff". The server enforces the same split, this only tidies it. */
body.role-distributor [data-for="staff"], body:not(.role-distributor) [data-for="distributor"] { display: none !important; }
body.role-support .owner-only { display: none; }

.login-switch { margin-top: 18px; font-size: 0.84rem; color: var(--text-muted); }
#signupCard .subtitle { margin-bottom: 20px; }

.cx-dialog { border: 0; border-radius: 16px; padding: 24px; width: min(520px, 94vw); box-shadow: var(--shadow-lg); color: var(--text-primary); background: var(--bg-card); }
.cx-dialog::backdrop { background: rgba(15, 23, 42, 0.45); }
.cx-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.cx-dialog .key-box { display: block; text-align: center; margin: 10px 0 14px; }
.cx-linkrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; margin-bottom: 8px; border: 1px solid var(--border-subtle); border-radius: 10px; font-size: 0.85rem; }
.cx-linkrow small { color: var(--text-muted); display: block; word-break: break-all; }

.cx-static tbody tr { cursor: default; }
.cx-static tbody tr:hover { background: transparent; }
.cx-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.cx-req-line { margin-top: 3px; font-size: 0.82rem; color: var(--text-secondary); }
.cx-req-line b { color: var(--text-primary); }
.cx-price-card { padding: 12px 14px; margin-bottom: 10px; border-radius: 10px; background: var(--bg-surface-elevated); }
.cx-price-card .ln { display: flex; justify-content: space-between; gap: 10px; font-size: 0.85rem; padding: 3px 0; color: var(--text-secondary); }
.cx-price-card .ln.total { border-top: 1px dashed var(--border-strong); margin-top: 4px; padding-top: 8px; color: var(--text-primary); }
.cx-price-card .ln.total b { color: var(--primary-hover); font-size: 1rem; }
.cx-sel { box-shadow: inset 3px 0 0 var(--primary); background: var(--primary-subtle); border-radius: 8px; }
#signupCard .row { margin-bottom: 16px; }
#dsList .cx-item { padding-left: 12px; padding-right: 12px; border-radius: 8px; }
.cx-static { min-width: 940px; }
.cx-static td { white-space: nowrap; }
.cx-static .cx-actions { flex-wrap: nowrap; }

/* ---- Visual refresh: calmer cards, sticky page header, dotted status chips, grouped sidebar ---- */
.main-content { padding-top: 0; }
.topbar-header { position: sticky; top: 0; z-index: 15; margin: 0 -36px 24px; padding: 18px 36px;
  background: rgba(248, 250, 252, 0.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border-subtle); }
.page-title { font-size: 1.6rem; }
@media (max-width: 800px) { .topbar-header { margin: 0 -18px 18px; padding: 14px 18px; } }

.cx-card, .cx-fact, .card-modern { border-radius: 16px; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.05); }
.cx-fact-value { font-size: 1.35rem; }
.cx-item { padding: 13px 0; }

.cx-chip::before { content: ""; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: currentColor; flex: none; }

.nav-label { padding: 16px 12px 6px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); }
.nav-item { padding: 10px 12px; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Home: what needs you today */
.cx-todo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.cx-todo-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 16px 18px; text-align: left; min-height: 0;
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 16px; box-shadow: var(--shadow-xs); color: var(--text-primary); }
.cx-todo-card:hover { border-color: var(--primary-border); box-shadow: 0 6px 18px rgba(13, 148, 136, 0.12); transform: translateY(-1px); }
.cx-todo-card.urgent { border-color: var(--amber-border); background: linear-gradient(var(--amber-bg), var(--bg-card)); }
.cx-todo-n { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.cx-todo-t { font-size: 0.9rem; font-weight: 700; }
.cx-todo-d { font-size: 0.78rem; font-weight: 500; color: var(--text-muted); }
@media (max-width: 900px) { .cx-todo { grid-template-columns: 1fr; } }

/* Requests: list on the left, the selected request on the right */
.cx-tabs-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.cx-tabs-pills button { min-height: 0; padding: 6px 14px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg-surface); color: var(--text-secondary); font-size: 0.82rem; }
.cx-tabs-pills button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.rq-split { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .rq-split { grid-template-columns: 1fr; } }
.rq-list { display: flex; flex-direction: column; gap: 10px; }
.rq-item { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; min-height: 0; padding: 13px 15px; text-align: left; font-weight: 500;
  background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 12px; box-shadow: var(--shadow-xs); color: var(--text-primary); }
.rq-item:hover { border-color: var(--border-strong); }
.rq-item.sel { border-color: var(--primary); box-shadow: var(--border-glow); }
.rq-item .top { display: flex; justify-content: space-between; gap: 8px; width: 100%; }
.rq-item b { font-size: 0.92rem; }
.rq-item small, .rq-item span { font-size: 0.8rem; color: var(--text-muted); }
.rq-detail { padding: 0; }
.rq-detail .rq-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 6px; }
.rq-detail .rq-body { padding: 8px 22px 4px; }
.rq-outcome { margin: 14px 22px 0; padding: 14px 16px; border-radius: 12px; background: var(--primary-subtle); border: 1px solid var(--primary-border); }
.rq-outcome b { color: var(--primary-hover); }
.rq-outcome ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-secondary); font-size: 0.84rem; line-height: 1.6; }
.rq-decide { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 18px 22px 22px; }
.rq-empty { text-align: center; padding: 54px 20px; color: var(--text-muted); }
.rq-empty svg { width: 42px; height: 42px; color: var(--emerald); margin-bottom: 8px; }
.rq-empty b { display: block; color: var(--text-primary); font-size: 1.05rem; margin-bottom: 2px; }

/* Toast */
.cx-toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px); z-index: 100; padding: 12px 20px; border-radius: 12px;
  background: #101828; color: #fff; font-size: 0.88rem; font-weight: 600; opacity: 0; pointer-events: none; transition: all .2s ease; box-shadow: var(--shadow-lg); }
.cx-toast.on { opacity: 1; transform: translate(-50%, 0); }

  background: linear-gradient(160deg, #0e7490, #0d9488 55%, #2dd4bf); color: #fff; }
#loginScreen .login-switch { display: none; }

/* Top-bar search */
.gsearch { position: relative; display: flex; align-items: center; width: 340px; max-width: 100%; }
.gsearch input { padding: 9px 40px 9px 14px; border-radius: 999px; background: var(--bg-card); box-shadow: var(--shadow-xs); font-size: 0.86rem; }
.gsearch .kbd-badge { position: absolute; right: 12px; pointer-events: none; }
.gs-results { position: absolute; top: calc(100% + 8px); right: 0; left: 0; min-width: 340px; z-index: 40; padding: 6px; background: var(--bg-card);
  border: 1px solid var(--border-subtle); border-radius: 14px; box-shadow: var(--shadow-lg); }
.gs-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 0; padding: 9px 10px; border-radius: 9px; background: transparent; text-align: left; color: var(--text-primary); font-weight: 500; }
.gs-item:hover, .gs-item.on { background: var(--bg-surface-elevated); }
.gs-text { display: flex; flex-direction: column; min-width: 0; }
.gs-text b { font-size: 0.88rem; }
.gs-text small { font-size: 0.74rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-kind { flex: none; padding: 2px 8px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; background: var(--slate-bg); color: var(--slate-text); }
.gs-kind.distributor { background: var(--primary-subtle); color: var(--primary-hover); }
.gs-none { padding: 12px; font-size: 0.84rem; color: var(--text-muted); }
@media (max-width: 800px) { .gsearch { width: 100%; order: 3; } }
.gsearch input::-webkit-search-cancel-button { display: none; }

a.nav-item { text-decoration: none; }

.rq-item .top b { color: var(--text-primary); }

/* ---- Distributor pricing page ---- */
.pz-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 24px; align-items: center; padding: 18px 24px; border-radius: 18px; color: #fff;
  background: radial-gradient(520px 260px at 0% 0%, rgba(255,255,255,.16), transparent 60%), linear-gradient(135deg, #14b8a6 0%, #0d9488 50%, #0e7490 100%);
  box-shadow: 0 18px 44px rgba(13, 148, 136, 0.28); }
.pz-eyebrow { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.pz-big { display: flex; align-items: baseline; gap: 4px; margin: 4px 0 6px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.pz-big span { font-size: clamp(2.6rem, 5vw, 3.6rem); font-variant-numeric: tabular-nums; }
.pz-big small { font-size: 1.4rem; opacity: .85; }
.pz-hero-text p { margin: 0; max-width: 34ch; font-size: .85rem; line-height: 1.45; opacity: .92; }
.pz-hero-ctl { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); border-radius: 14px; padding: 12px 16px; backdrop-filter: blur(4px); }
.pz-slider { --pct: 20%; -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 8px; background: linear-gradient(90deg, #fff var(--pct), rgba(255,255,255,.28) var(--pct)); outline: none; cursor: pointer; }
.pz-btn:disabled { background: rgba(15,23,42,.45); cursor: default; transform: none; box-shadow: none; }
/* Placeholders shown while a screen waits for its first data: same shapes as the real content. */
.sk { display: block; border-radius: 10px; background: linear-gradient(90deg, #eef2f6 25%, #f7f9fb 40%, #eef2f6 60%); background-size: 300% 100%; animation: sk-shimmer 1.3s ease-in-out infinite; }
.sk-num { width: 64px; height: 30px; }
.sk-sub { width: 120px; height: 12px; margin-top: 4px; }
.sk-row { height: 56px; margin: 8px 0; }
.sk-card { height: 170px; }
.sk-tr td { padding: 4px 12px; }
@keyframes sk-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
.pz-fail { border-color: var(--rose-border); background: var(--rose-bg); color: var(--rose-text); }
.pz-fail b { color: var(--rose-text); }
.pz-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 4px solid #0d9488; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.pz-slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 4px solid #0d9488; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.pz-slider:focus-visible { box-shadow: 0 0 0 4px rgba(255,255,255,.45); }
.pz-scale { display: flex; justify-content: space-between; margin-top: 4px; font-size: .72rem; font-weight: 700; opacity: .8; }
.pz-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pz-chip { min-height: 28px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,.45); background: transparent; color: #fff; font-size: .85rem; font-weight: 700; cursor: pointer; transition: background .15s ease; }
.pz-chip:hover { background: rgba(255,255,255,.2); }
.pz-chip.on { background: #fff; color: #0f766e; border-color: #fff; }
.pz-save { display: flex; gap: 10px; align-items: stretch; }
.pz-num { display: flex; align-items: center; gap: 4px; width: 110px; margin: 0; padding: 0 12px; border-radius: 12px; background: #fff; color: #0f172a; font-weight: 800; text-transform: none; letter-spacing: 0; }
.pz-num input { width: 100%; min-width: 0; padding: 9px 0; border: 0; background: transparent; box-shadow: none; font: inherit; font-size: 1.05rem; color: inherit; outline: none; }
.pz-num span { color: #64748b; }
.pz-btn { flex: 1; min-height: 40px; border: 0; border-radius: 12px; background: #0f172a; color: #fff; font-size: .95rem; font-weight: 800; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.pz-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(15, 23, 42, .35); }
.pz-hint { margin-top: 8px; font-size: .76rem; line-height: 1.4; opacity: .9; }
.pz-hero .result-msg { margin-top: 4px; color: #fff; font-weight: 700; }
.pz-hero .result-msg:empty { display: none; }

.pz-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; margin: 18px 0 10px; }
.pz-section-head h3 { margin: 0; font-size: 1.15rem; letter-spacing: -0.02em; }
.pz-section-head span { font-size: .82rem; color: var(--text-muted); }
.pz-plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pz-warn { grid-column: 1 / -1; padding: 10px 14px; border-radius: 12px; background: #fef2f2; color: #b91c1c; font-size: .86rem; font-weight: 600; }
.pz-plan { position: relative; padding: 14px 18px; border-radius: 16px; background: var(--bg-card); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-xs); transition: transform .15s ease, box-shadow .15s ease; }
.pz-plan:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(13, 148, 136, .14); }
.pz-plan.quad { border-color: var(--primary-border); background: linear-gradient(180deg, var(--primary-subtle), #fff 55%); }
.pz-plan-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.pz-name { font-size: 1.1rem; font-weight: 800; letter-spacing: -0.02em; }
.pz-cams { padding: 4px 10px; border-radius: 999px; background: var(--primary-subtle); border: 1px solid var(--primary-border); color: var(--primary-hover); font-size: .74rem; font-weight: 800; }
.pz-total { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pz-total b { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.pz-total small { color: var(--text-muted); font-weight: 600; }
.pz-total-label { margin-bottom: 2px; font-size: .74rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.pz-bar { display: flex; height: 10px; margin: 8px 0 6px; border-radius: 10px; overflow: hidden; background: var(--bg-surface-elevated); }
.pz-bar i { display: block; height: 100%; transition: width .25s ease; }
.pz-bar .base { background: #94a3b8; }
.pz-bar .gain { background: linear-gradient(90deg, #14b8a6, #059669); }
.pz-rows .ln { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 0; font-size: .86rem; color: var(--text-secondary); }
.pz-rows .ln b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.pz-rows .dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: #94a3b8; }
.pz-rows .gain .dot { background: #059669; }
.pz-rows .gain b { color: #047857; }
.pz-one { margin-top: 8px; padding: 7px 10px; border-radius: 10px; background: var(--bg-surface-elevated); font-size: .78rem; line-height: 1.4; color: var(--text-secondary); }
.pz-one .earn { color: #047857; font-weight: 800; }
.pz-foot { margin-top: 8px; font-size: .8rem; line-height: 1.5; color: var(--text-muted); }
.pz-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.pz-tile { padding: 18px; border-radius: 16px; background: var(--bg-card); border: 1px solid var(--border-subtle); box-shadow: var(--shadow-xs); }
.pz-tile.hot { background: linear-gradient(135deg, #ecfdf5, #fff); border-color: var(--emerald-border); }
.pz-tile span { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.pz-tile b { display: block; margin-top: 6px; font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; }
.pz-tile.hot b { color: #047857; }
.pz-tile small { display: block; margin-top: 2px; color: var(--text-muted); font-size: .8rem; }
.pz-empty { padding: 30px 20px; text-align: center; border: 1.5px dashed var(--border-strong); border-radius: 16px; color: var(--text-secondary); line-height: 1.6; }
.pz-empty b { display: block; margin-bottom: 4px; color: var(--text-primary); }
.pz-table { overflow-x: auto; border-radius: 16px; border: 1px solid var(--border-subtle); background: var(--bg-card); }
.pz-table .cx-table { font-size: .88rem; }
.pz-table .cx-table th, .pz-table .cx-table td { padding: 12px 14px; white-space: nowrap; }
.pz-table .keep { color: #047857; }

@media (max-width: 860px) {
  .pz-hero { grid-template-columns: 1fr; gap: 18px; padding: 22px 18px; border-radius: 18px; }
  .pz-plans, .pz-tiles { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .pz-plan, .pz-btn, .pz-bar i { transition: none; } .pz-plan:hover, .pz-btn:hover { transform: none; } }

/* ---- New client / New licence request: shared polish for the admin and distributor pages ---- */
.issue-license-grid .card-modern { padding: 24px 26px; border-radius: 20px; border: 1px solid var(--border-subtle); box-shadow: 0 10px 30px rgba(13, 148, 136, .07), var(--shadow-xs); }
.issue-license-grid .card-modern-header { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--border-subtle); }
.issue-license-grid .card-modern-header h2 { font-size: 1.15rem; letter-spacing: -0.02em; }
.issue-license-grid .issue-step { width: 30px; height: 30px; font-size: .9rem; background: var(--primary-gradient); box-shadow: 0 6px 14px rgba(13, 148, 136, .3); }
.issue-license-grid .stack { display: grid; gap: 4px; }
.issue-license-grid .field { margin-bottom: 12px; }
.issue-license-grid .field label { font-size: .72rem; letter-spacing: .06em; }
.issue-license-grid .field input, .issue-license-grid .field select, .issue-license-grid .field textarea { border-radius: 12px; padding: 12px 14px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.issue-license-grid .field input:hover, .issue-license-grid .field select:hover, .issue-license-grid .field textarea:hover { border-color: var(--border-strong); }
.issue-license-grid .field input:focus, .issue-license-grid .field select:focus, .issue-license-grid .field textarea:focus { border-color: var(--primary); box-shadow: var(--border-glow); outline: none; }
.issue-license-grid .field-hint { margin-top: 6px; font-size: .78rem; line-height: 1.45; }
.issue-license-grid .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 600px) { .issue-license-grid .row { grid-template-columns: 1fr; gap: 0; } .issue-license-grid .card-modern { padding: 18px 16px; border-radius: 16px; } }

/* Plan cards */
.issue-license-grid .plan-choice { position: relative; gap: 6px; padding: 18px 18px 16px; border-radius: 16px; border-width: 2px; background: linear-gradient(180deg, #fff, var(--bg-surface-elevated)); transition: transform .15s ease, border-color .15s, box-shadow .15s, background .15s; }
.issue-license-grid .plan-choice:hover { transform: translateY(-2px); border-color: var(--primary-light); box-shadow: 0 12px 26px rgba(13, 148, 136, .14); }
.issue-license-grid .plan-choice .pc-name { font-size: 1.3rem; letter-spacing: -0.02em; }
.issue-license-grid .plan-choice .pc-line { padding-bottom: 8px; margin-bottom: 2px; border-bottom: 1px dashed var(--border-strong); width: 100%; }
.issue-license-grid .plan-choice .pc-price { font-size: .86rem; color: var(--text-secondary); }
.issue-license-grid .plan-choice .pc-price:last-of-type { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text-primary); }
.issue-license-grid .plan-choice .pc-price:last-of-type small { font-size: .8rem; }
.issue-license-grid .plan-choice::after { content: ""; position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); background: #fff; transition: all .15s; }
.issue-license-grid .plan-choice[aria-checked="true"] { transform: none; border-color: var(--primary); background: linear-gradient(180deg, var(--primary-subtle), #fff); box-shadow: 0 12px 28px rgba(13, 148, 136, .2); }
.issue-license-grid .plan-choice[aria-checked="true"]::after { border-color: var(--primary); background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E") center / 14px no-repeat; }

/* Extra employees stepper, review box */
.issue-license-grid .emp-stepper-row { gap: 8px; }
.issue-license-grid .emp-btn { border-radius: 12px; }
.issue-license-grid .emp-quick button { border-radius: 999px; }
.issue-license-grid .issue-summary { padding: 6px 16px; border-radius: 14px; background: linear-gradient(180deg, var(--primary-subtle), #fff); border-color: var(--primary-border); }
.issue-license-grid .issue-summary .is-total { margin-top: 4px; padding-top: 12px; border-top: 2px solid var(--primary-border); border-bottom: 0; }
.issue-license-grid .issue-summary .is-total b { font-size: 1.2rem; }
.issue-license-grid .btn-block.btn-primary { min-height: 50px; border-radius: 14px; font-size: 1rem; font-weight: 800; box-shadow: 0 10px 22px rgba(13, 148, 136, .3); }
.issue-license-grid .issue-advanced summary { padding: 4px 0; }
@media (prefers-reduced-motion: reduce) { .issue-license-grid .plan-choice { transition: none; } .issue-license-grid .plan-choice:hover { transform: none; } }

/* Checkboxes and radios are small controls, not full-width text boxes (the global input rule would stretch them) */
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; min-width: 18px; padding: 0; margin: 0; flex: none; border-radius: 5px; accent-color: var(--primary); box-shadow: none; cursor: pointer; }
input[type="radio"] { border-radius: 50%; }
.cx-check label { justify-content: flex-start; margin: 0; }
.cx-check { padding: 0; margin-bottom: 8px; }
.cx-check label { width: 100%; padding: 10px 12px; border: 1px solid var(--border-subtle); border-radius: 12px; background: var(--bg-card); transition: border-color .15s, background .15s; }
.cx-check label:hover { border-color: var(--primary-border); background: var(--primary-subtle); }
.cx-check label:has(input:checked) { border-color: var(--primary-border); background: var(--primary-subtle); font-weight: 600; }

/* Distributor: client names in the list open the client page */
a.cx-rowlink { display: block; color: var(--text-primary); text-decoration: none; }
a.cx-rowlink:hover { color: var(--primary); text-decoration: underline; }
a.btn-secondary.cx-item-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

/* Renewal dialog: month choices */
.pz-chips-light { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.pz-chip-dark { min-height: 40px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--border-strong); background: #fff; color: var(--text-primary); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; transition: all .15s; }
.pz-chip-dark:hover { border-color: var(--primary-light); }
.pz-chip-dark.on { border-color: var(--primary); background: var(--primary-subtle); color: var(--primary-hover); box-shadow: var(--border-glow); }
.cx-item .cx-link { margin-left: 10px; white-space: nowrap; }

/* Distributor client page: history timeline, statement bar */
.pz-timeline { display: grid; gap: 0; }
.pz-ev { display: grid; grid-template-columns: 14px 1fr; gap: 14px; padding: 12px 0; position: relative; }
.pz-ev:not(:last-child)::before { content: ""; position: absolute; left: 6px; top: 30px; bottom: -6px; width: 2px; background: var(--border-subtle); }
.pz-dot { width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 0 4px var(--bg-card); }
.pz-dot.ok { background: #059669; } .pz-dot.warn { background: #d97706; } .pz-dot.danger { background: #dc2626; } .pz-dot.info { background: #0284c7; }
.pz-statement-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.pz-statement-bar select { width: auto; min-width: 190px; }
.cx-tabpanel[hidden] { display: none; }

/* "Approved" on the statement: owed, but Zensia has not recorded a payment yet */
.cx-chip.info { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }

.pz-tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 860px) { .pz-tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Clients list: the "sold by" picker sits beside the search box */
.cx-toolbar { display: flex; gap: 10px; align-items: center; }
.cx-toolbar .cx-search { flex: 1; min-width: 0; }
.cx-seller { width: auto; min-width: 180px; flex: none; }
.cx-seller[hidden] { display: none; }
@media (max-width: 600px) { .cx-toolbar { flex-wrap: wrap; } .cx-seller { width: 100%; } }

/* Distributor Home: the "Get started" checklist */
.pz-start { margin-bottom: 18px; background: linear-gradient(180deg, var(--primary-subtle), #fff 70%); border-color: var(--primary-border); }
.pz-progress { height: 6px; margin: 4px 0 14px; border-radius: 6px; background: var(--bg-surface-elevated); overflow: hidden; }
.pz-progress i { display: block; height: 100%; border-radius: 6px; background: var(--primary-gradient); transition: width .3s ease; }
.pz-steps { display: grid; gap: 8px; }
.pz-step { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--border-subtle); }
.pz-step.next { border-color: var(--primary); box-shadow: var(--border-glow); }
.pz-step.done { opacity: .65; }
.pz-tick { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--bg-surface-elevated); color: var(--text-secondary); font-size: .8rem; font-weight: 800; }
.pz-step.next .pz-tick { background: var(--primary); color: #fff; }
.pz-step.done .pz-tick { background: #059669; color: #fff; }
.pz-step-main b { display: block; font-size: .92rem; }
.pz-step.done .pz-step-main b { text-decoration: line-through; text-decoration-color: var(--border-strong); }
.pz-step-main small { display: block; color: var(--text-muted); font-size: .8rem; line-height: 1.4; }
@media (max-width: 600px) { .pz-step { grid-template-columns: 30px 1fr; } .pz-step .cx-item-btn { grid-column: 2; justify-self: start; } }

.pz-start.low { margin: 18px 0 0; }

/* My clients: one main button and a "..." menu on each row */
.cx-static tbody tr { cursor: pointer; }
.cx-static tbody tr:hover { background: var(--bg-card-hover); }
.cx-dots { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 10px; border: 1px solid var(--border-subtle); background: #fff;
  color: var(--text-secondary); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.cx-dots:hover, .cx-dots[aria-expanded="true"] { border-color: var(--primary-light); color: var(--primary-hover); background: var(--primary-subtle); }
.pz-menu { position: fixed; z-index: 60; min-width: 220px; max-width: 280px; padding: 6px; border-radius: 14px; background: #fff; border: 1px solid var(--border-subtle); box-shadow: 0 16px 40px rgba(15, 23, 42, .18); }
.pz-menu button { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: none; text-align: left; font: inherit; font-size: .88rem; font-weight: 600; color: var(--text-primary); cursor: pointer; }
.pz-menu button:hover:not(:disabled) { background: var(--primary-subtle); color: var(--primary-hover); }
.pz-menu button.off { cursor: not-allowed; color: var(--text-muted); }
.pz-menu button small { display: block; margin-top: 2px; font-size: .74rem; font-weight: 500; line-height: 1.35; }
@media (max-width: 860px) { .cx-static .cx-actions { align-items: center; } }

/* Statement lines open that client's Billing tab */
.pz-table tr.pz-link { cursor: pointer; }
.pz-table tr.pz-link:hover td { background: var(--primary-subtle); }

/* Plan card: what Zensia gets when the licence is sold by a distributor */
.plan-choice .pc-you { margin-top: 4px; padding-top: 6px; border-top: 1px dashed var(--border-strong); width: 100%; font-size: .76rem; font-weight: 700; color: var(--primary-hover); }
.plan-choice .pc-you[hidden] { display: none; }

/* Announcements > Google Drive downloads */
.cx-steps { margin: 0 0 4px; padding-left: 20px; font-size: .86rem; line-height: 1.6; color: var(--text-secondary); }
.cx-steps li { margin-bottom: 4px; }
.cx-linkrows { display: grid; gap: 8px; }

/* Download / Copy link buttons beside a download link */
.cx-linkbtns { display: inline-flex; gap: 6px; flex: none; }
.cx-linkbtns .cx-item-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; white-space: nowrap; }
@media (max-width: 480px) { .cx-linkrow { flex-wrap: wrap; } .cx-linkbtns { width: 100%; } .cx-linkbtns .cx-item-btn { flex: 1; } }

/* Dialog header: title on the left, a close (X) on the right */
.cx-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cx-dialog-head .cx-h { margin: 0 0 8px; }
.cx-dialog-x { flex: none; width: 36px; height: 36px; margin: -6px -8px 0 0; border: 0; border-radius: 10px; background: transparent;
  color: var(--text-secondary); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.cx-dialog-x:hover { background: var(--bg-elevated, rgba(15, 23, 42, 0.06)); color: var(--text-primary); }

/* Emails page: template list on the left, the editor on the right */
.tpl-layout { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: 18px; align-items: start; }
.tpl-list { display: flex; flex-direction: column; gap: 6px; }
.tpl-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border: 1px solid var(--border-subtle);
  border-radius: 10px; background: #fff; font: inherit; font-size: 0.88rem; font-weight: 600; color: var(--text-primary); text-align: left; cursor: pointer; }
.tpl-item:hover { border-color: var(--primary-border); }
.tpl-item.on { border-color: var(--primary); background: var(--primary-subtle); }
.tpl-item small { font-weight: 600; font-size: 0.72rem; color: var(--amber-text); }
.tpl-editor .field { margin-bottom: 12px; }
.tpl-editor textarea { width: 100%; resize: vertical; font: inherit; }
.tpl-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.tpl-fixed { margin: -2px 0 12px; padding: 10px 12px; border: 1px dashed var(--border-subtle); border-radius: 10px; font-size: 0.82rem; color: var(--text-secondary); background: var(--bg-surface-elevated); }
.tpl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tpl-chip { padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border-subtle); background: #fff; font-family: var(--font-mono, monospace); font-size: 0.78rem; cursor: pointer; }
.tpl-chip:hover { border-color: var(--primary); color: var(--primary); }
.tpl-preview { width: 100%; height: 520px; border: 1px solid var(--border-subtle); border-radius: 12px; background: #f4f5f7; }
@media (max-width: 900px) { .tpl-layout { grid-template-columns: 1fr; } }
