/* Client cards + compact table — shared by admin, franchise and reseller. */
.rex-approved .rex-client-list {min-width:0;margin:24px 0}
.rex-approved .rex-client-list [hidden] {display:none!important}
.rex-client-tabs {display:flex;gap:22px;border-bottom:1px solid var(--rex-line);margin-bottom:24px;overflow:auto}
.rex-client-tabs button {font:inherit;font-size:13px;white-space:nowrap;min-height:48px;background:none;border:0;border-bottom:2px solid transparent;color:var(--rex-muted);cursor:pointer}
.rex-client-tabs button[aria-pressed=true] {color:var(--rex-accent);border-bottom-color:var(--rex-accent)}
.rex-client-toolbar {display:flex;gap:12px;justify-content:space-between;margin-bottom:20px;flex-wrap:wrap}
.rex-client-search {display:flex;align-items:center;gap:10px;max-width:100%;min-width:260px;flex:1;border:1px solid var(--rex-line);background:var(--rex-surface);border-radius:8px;padding:0 14px;color:var(--rex-muted)}
.rex-client-search svg {width:18px;height:18px}
.rex-client-search input {width:100%;min-width:0;min-height:44px;border:0;background:none;color:var(--rex-ink);font-size:13px}
.rex-approved .rex-client-all-filters {padding:0 18px;margin-bottom:18px}
.rex-client-all-filters>summary {cursor:pointer;min-height:44px;display:flex;align-items:center;font-size:13px}
.rex-client-all-filters>form {padding:15px 0}
.rex-client-count {font-size:13px;color:var(--rex-muted);margin:12px 0}
.rex-client-table-head {display:none}

.rex-client-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.rex-customer {
  position:relative;background:var(--rex-surface);border:4px solid #22a55a;border-radius:12px;
  padding:0;min-width:0;overflow:hidden;display:flex;flex-direction:column;
  box-shadow:0 0 0 1px rgba(0,0,0,.04);
}
.rex-customer.rex-band-active,
.rex-customer[data-band=active] {border-color:#22a55a}
.rex-customer.rex-band-inactive,
.rex-customer[data-band=inactive],
.rex-customer[data-status=blocked],
.rex-customer[data-status=expired] {border-color:#e04545}
.rex-customer.rex-band-trial,
.rex-customer[data-band=trial],
.rex-customer[data-kind=trial] {border-color:#f28c18}


.rex-customer-kebab {
  display:none;align-items:center;justify-content:center;
  width:36px;height:36px;border:0;border-radius:8px;background:#eef1f5;color:var(--rex-ink);cursor:pointer;flex:none;
}
.rex-customer-kebab svg {width:18px;height:18px}
.rex-customer-table-row {display:none}

.rex-customer-card {display:flex;flex-direction:column;min-width:0}
.rex-customer-idblock {padding:14px 16px 12px;border-bottom:1px dashed var(--rex-line)}
.rex-customer-id {margin:0;color:#2f6fed;font-size:15px;font-weight:700;letter-spacing:.02em}
.rex-customer-brand {margin:4px 0 0;font-size:clamp(1.15rem, 2.6vw, 1.35rem);font-weight:800;letter-spacing:-.02em;color:var(--rex-ink);overflow-wrap:anywhere;line-height:1.2}
.rex-customer-planline {margin:6px 0 0;font-size:13px;font-weight:650;color:#4b5568;overflow-wrap:anywhere}
.rex-customer-email {margin:4px 0 0;font-size:12px;color:var(--rex-muted);overflow-wrap:anywhere}

.rex-customer-dates {padding:12px 16px;border-bottom:1px dashed var(--rex-line);display:grid;gap:10px}
.rex-customer-exp {display:block;font-size:15px;font-weight:750;color:var(--rex-ink)}
.rex-customer-created {display:block;margin-top:2px;font-size:11px;color:var(--rex-muted)}
.rex-customer-pills {display:flex;flex-wrap:wrap;gap:8px}
.rex-pill {
  display:inline-flex;align-items:center;justify-content:center;min-height:30px;padding:0 12px;
  border-radius:999px;font-size:12px;font-weight:750;border:1px solid transparent;
}
.rex-pill-active {color:#1d7a45;background:#e8f7ee;border-color:#9fd4b3}
.rex-pill-blocked {color:#9b2c2c;background:#fde8e8;border-color:#f0b4b4}
.rex-pill-expired {color:#8a5a00;background:#fff4d6;border-color:#ecd08a}
.rex-pill-kind {color:#5b3fa0;background:#f1ebff;border-color:#cbb8f5}

.rex-customer-detail {padding:12px 16px;border-bottom:1px dashed var(--rex-line);font-size:13px;color:#374151}
.rex-customer-detail strong {display:block;font-size:15px;font-weight:750;color:var(--rex-ink);margin-bottom:4px}
.rex-customer-detail p {margin:2px 0}
.rex-customer-wa {color:#128c7e;font-weight:650}
.rex-customer-warning {margin:0;padding:8px 16px;font-size:12px;color:#8a5a00;background:#fff8e8}

.rex-customer-iconbar {
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px 8px;padding:12px 14px 14px;
  border-bottom:1px dashed var(--rex-line);
}
.rex-ico-wrap {display:flex;flex-direction:column;align-items:center;gap:5px;min-width:0}
.rex-ico-label {
  font-size:11px;font-weight:700;line-height:1.15;color:#4b5568;text-align:center;
  overflow-wrap:anywhere;max-width:100%;
}
.rex-ico,.rex-ico-form {margin:0;width:100%}
.rex-ico-form {display:block}
.rex-ico {
  display:inline-flex;align-items:center;justify-content:center;width:100%;min-height:42px;
  border:0;border-radius:10px;cursor:pointer;color:#fff;font-weight:800;text-decoration:none;
}
.rex-ico svg {width:16px;height:16px}
.rex-ico span {font-size:13px;line-height:1}
.rex-ico-playlist {background:#2f6fed}
.rex-ico-m3u {background:#d4a017}
.rex-ico-short {background:#2f9e62}
.rex-ico-copy {background:#3b82f6}
.rex-ico-remind {background:#16a34a}
.rex-ico-sync {background:#0d9488}
.rex-ico-renew {background:#ca8a04}
.rex-ico-more {background:#2563eb}
/* Rede: botões de revenda/franquia mais claros e coloridos */
.rex-network-list-panel .rex-customer-iconbar {grid-template-columns:repeat(4,minmax(0,1fr));gap:12px 10px}
.rex-network-list-panel .rex-ico {
  min-height:48px;border-radius:12px;box-shadow:0 1px 0 rgba(15,23,42,.06);
}
.rex-network-list-panel .rex-ico-manage {background:#2563eb}
.rex-network-list-panel .rex-ico-wallet {background:#ca8a04}
.rex-network-list-panel .rex-ico-users {background:#0d9488}
.rex-network-list-panel .rex-ico-plan {background:#7c3aed}
.rex-network-list-panel .rex-ico-danger,
.rex-network-list-panel .rex-ico-wrap .rex-ico[data-rex-removal-open],
.rex-network-list-panel button.rex-ico[data-rex-removal-open] {background:#dc2626}
.rex-network-list-panel .rex-ico-label {font-size:12px;font-weight:750;color:#334155}
.rex-network-list-panel .rex-t-ico {background:#2563eb}
.rex-network-list-panel .rex-t-ico[data-rex-removal-open],
.rex-network-list-panel button.rex-t-ico[data-rex-removal-open] {background:#dc2626}
html[data-theme="light"] .rex-network-list-panel .rex-ico-label {color:#334155}
html[data-theme="dark"] .rex-network-list-panel .rex-ico-label {color:#c5d0e0}

.rex-customer-actions {display:flex;gap:8px;align-items:stretch;padding:12px 14px;flex-wrap:wrap}
.rex-customer-actions:empty {display:none}
.rex-approved .rex-customer-actions>.btn,
.rex-approved .rex-customer-actions>form {flex:1 1 140px;min-width:0}
.rex-approved .rex-customer-actions>.btn {font-size:13px;padding:9px;justify-content:center}
.rex-approved .rex-customer-actions>form>.btn {width:100%}

.rex-client-pagination {display:flex;gap:12px;justify-content:center;align-items:center;margin:20px 0;font-size:13px}
.rex-client-actions-fallback>summary {min-height:44px;cursor:pointer}
.rex-client-actions-fallback.is-modal {position:fixed;inset:0;background:#02080dc9;z-index:80;padding:24px;display:flex;align-items:center;justify-content:center;margin:0}
.is-modal .rex-client-dialog {background:var(--rex-bg);color:var(--rex-ink);border-radius:18px;width:640px;max-width:calc(100vw - 48px);max-height:calc(100vh - 48px);overflow:auto;box-shadow:0 30px 100px #0006}
.rex-client-dialog>header {display:flex;align-items:flex-start;justify-content:space-between;gap:15px;padding:22px 24px 14px;border-bottom:1px solid var(--rex-line)}
.rex-client-dialog h2 {font-size:1.25rem;font-weight:700;margin:0;overflow-wrap:anywhere;letter-spacing:-0.02em}
.rex-client-dialog>header p {font-size:13px;color:var(--rex-muted);margin:6px 0 0;line-height:1.4}
.rex-client-dialog-body {padding:8px 24px 24px}
.rex-client-dialog .row-actions {gap:10px;align-items:flex-start;flex-wrap:wrap}
.rex-client-dialog .row-actions>form,.rex-client-dialog .row-actions>details {flex-basis:100%;min-width:0}
.rex-client-dialog .extra-client-actions,.rex-client-dialog .admin-client-actions {display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px 0}
.rex-client-dialog .btn {white-space:normal;max-width:100%;overflow-wrap:anywhere}
.rex-client-dialog input,.rex-client-dialog select,.rex-client-dialog textarea {max-width:100%}
.rex-client-dialog .copy-block {white-space:pre-wrap;overflow-wrap:anywhere}
.rex-client-dialog .card-note {font-size:13px;color:var(--rex-muted)}
.rex-client-modal-open {overflow:hidden}

.rex-manage {display:grid;gap:16px}
.rex-manage-section {padding:14px 0 4px;border-top:1px solid var(--rex-line)}
.rex-manage-section:first-child {border-top:0;padding-top:8px}
.rex-manage-title {margin:0 0 10px;font-size:11px;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:var(--rex-muted)}
.rex-manage-note {margin:0 0 12px;font-size:13px;color:var(--rex-muted);line-height:1.45}
.rex-manage-note.is-warn {color:#8a4b00}
.rex-manage-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.rex-manage-stretch {display:contents}
.rex-manage-stretch > .rex-manage-chip,
.rex-manage-stretch > button {width:100%}
.rex-manage-chip {
  display:inline-flex;align-items:center;justify-content:flex-start;gap:8px;
  width:100%;min-height:44px;padding:10px 12px;border-radius:11px;
  border:1px solid var(--rex-line);background:var(--rex-surface);color:var(--rex-ink);
  font:inherit;font-size:13px;font-weight:650;text-align:left;cursor:pointer;text-decoration:none;
}
.rex-manage-chip svg {width:16px;height:16px;flex:none;opacity:.85}
.rex-manage-chip span {overflow-wrap:anywhere}
.rex-manage-chip:hover {border-color:rgba(242,140,24,.45);background:#fff8ef}
.rex-manage-chip.is-accent {background:#fff4e5;border-color:rgba(242,140,24,.35);color:#9a5205}
.rex-manage-chip.is-danger {background:#fdecea;border-color:rgba(232,93,76,.35);color:#8a1f11}
.rex-manage-form {display:grid;gap:12px}
.rex-manage-fields {display:grid;grid-template-columns:1fr 1fr;gap:10px}
.rex-manage-fields label {display:grid;gap:5px;font-size:12px;font-weight:700;color:var(--rex-ink)}
.rex-manage-fields label span em {font-style:normal;font-weight:600;color:var(--rex-muted)}
.rex-manage-fields input,
.rex-manage-fields select {
  width:100%;min-height:44px;border-radius:10px;border:1px solid var(--rex-line);
  background:#fff;color:var(--rex-ink);padding:10px 12px;font:inherit;font-weight:500;
}
.rex-manage-cta {display:flex;flex-wrap:wrap;gap:8px;margin-top:4px}
.rex-manage-primary,
.rex-manage-secondary {
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:46px;padding:0 16px;border-radius:11px;border:0;font:inherit;font-weight:800;cursor:pointer;
}
.rex-manage-primary {background:#f28c18;color:#1a1005;flex:1 1 160px}
.rex-manage-secondary {background:var(--rex-surface);color:var(--rex-ink);border:1px solid var(--rex-line);flex:1 1 160px}
.rex-manage-stack {display:grid;gap:10px;margin-top:10px}
.rex-manage-details {grid-column:1 / -1}
.rex-manage-details > summary {list-style:none}
.rex-manage-details > summary::-webkit-details-marker {display:none}
.rex-manage-details[open] > summary {margin-bottom:10px}
.rex-manage-inline {display:flex;flex-wrap:wrap;gap:8px;align-items:end;grid-column:1 / -1}
.rex-manage-inline label {display:grid;gap:4px;font-size:12px;font-weight:700}
.rex-manage-inline input {min-height:44px;border-radius:10px;border:1px solid var(--rex-line);padding:0 10px;width:96px}
.rex-manage-danger .rex-manage-chip {max-width:280px}
html[data-theme="dark"] .rex-manage-chip:hover {background:#243246}
html[data-theme="dark"] .rex-manage-fields input,
html[data-theme="dark"] .rex-manage-fields select,
html[data-theme="dark"] .rex-manage-inline input {background:#0d1522;color:var(--rex-ink)}
html[data-theme="dark"] .rex-manage-chip.is-accent {background:#3d2a12;color:#ffd19a}

/* Tabela compacta: ações | Nome | Plano | Vencimento | WhatsApp */
.rex-customer-table-tools {display:none}
.rex-client-list[data-view=table] .rex-client-table-head {
  display:grid;grid-template-columns:minmax(118px,auto) minmax(120px,1.5fr) minmax(100px,1.1fr) minmax(110px,1fr) minmax(100px,.9fr);
  gap:10px;align-items:center;padding:10px 14px;margin:0;border:1px solid var(--rex-line);
  border-bottom:0;border-radius:11px 11px 0 0;background:var(--rex-surface-2,#f3f6fa);font-size:11px;font-weight:800;
  letter-spacing:.08em;text-transform:uppercase;color:var(--rex-muted);
}
.rex-client-list[data-view=table] .rex-client-grid {
  grid-template-columns:1fr;gap:0;border:1px solid var(--rex-line);border-radius:0 0 11px 11px;overflow:hidden;
  background:var(--rex-surface);
}
.rex-client-list[data-view=table] .rex-customer {
  border-radius:0;border-style:solid;border-width:0 0 1px 5px;border-color:var(--rex-line);
  display:grid;grid-template-columns:minmax(118px,auto) minmax(120px,1.5fr) minmax(100px,1.1fr) minmax(110px,1fr) minmax(100px,.9fr);
  gap:10px;align-items:center;padding:10px 14px;min-width:0;
  background:var(--rex-surface);color:var(--rex-ink);
}
.rex-client-list[data-view=table] .rex-customer.rex-band-active,
.rex-client-list[data-view=table] .rex-customer[data-band=active] {border-left-color:#22a55a}
.rex-client-list[data-view=table] .rex-customer.rex-band-inactive,
.rex-client-list[data-view=table] .rex-customer[data-band=inactive] {border-left-color:#e04545}
.rex-client-list[data-view=table] .rex-customer.rex-band-trial,
.rex-client-list[data-view=table] .rex-customer[data-band=trial],
.rex-client-list[data-view=table] .rex-customer[data-kind=trial] {border-left-color:#f28c18}
.rex-client-list[data-view=table] .rex-customer:last-child {border-bottom:0}
.rex-client-list[data-view=table] .rex-customer-table-tools {
  display:inline-flex;align-items:center;gap:6px;flex-wrap:nowrap;grid-column:1;min-width:0;
}
.rex-client-list[data-view=table] .rex-customer-kebab {display:inline-flex}
.rex-t-form {margin:0;display:inline-flex}
.rex-t-ico {
  display:inline-flex;align-items:center;justify-content:center;
  width:32px;height:32px;border:0;border-radius:8px;cursor:pointer;flex:none;
  color:#fff;text-decoration:none;padding:0;
}
.rex-t-ico svg {width:15px;height:15px}
.rex-customer-kebab.rex-t-ico {background:#4b5568;color:#fff}
.rex-t-playlist {background:#2f6fed}
.rex-t-sync {background:#0d9488}
.rex-t-renew {background:#ca8a04}
.rex-client-list[data-view=table] .rex-customer-table-row {display:contents}
.rex-client-list[data-view=table] .rex-customer-t-name {
  font-size:14px;font-weight:700;overflow-wrap:anywhere;min-width:0;color:var(--rex-ink);
}
.rex-client-list[data-view=table] .rex-customer-t-plan,
.rex-client-list[data-view=table] .rex-customer-t-exp {
  font-size:13px;color:var(--rex-ink);overflow-wrap:anywhere;min-width:0;opacity:.92;
}
.rex-client-list[data-view=table] .rex-customer-t-wa {
  font-size:13px;color:#128c7e;font-weight:650;overflow-wrap:anywhere;min-width:0;
}
.rex-client-list[data-view=table] .rex-customer-card,
.rex-client-list[data-view=table] .rex-customer-actions {display:none!important}

@media(max-width:1200px){
  .rex-client-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:900px){
  .rex-client-grid{grid-template-columns:1fr}
  .rex-client-list[data-view=table] .rex-client-table-head{display:none}
  .rex-client-list[data-view=table] .rex-customer{
    grid-template-columns:auto 1fr;gap:8px 12px;padding:12px;border-width:0 0 1px 5px;
  }
  .rex-client-list[data-view=table] .rex-customer-table-tools{grid-column:1;align-self:start}
  .rex-client-list[data-view=table] .rex-customer-table-row{display:flex;flex-direction:column;gap:2px;grid-column:2;min-width:0}
  .rex-client-list[data-view=table] .rex-customer-t-plan,
  .rex-client-list[data-view=table] .rex-customer-t-exp,
  .rex-client-list[data-view=table] .rex-customer-t-wa{font-size:12px;color:var(--rex-ink)}
  .rex-client-list[data-view=table] .rex-customer-t-wa{color:#2dd4a8}
}
@media(max-width:650px){
  .rex-client-search{min-width:0;flex-basis:100%}
  .rex-client-toolbar{flex-direction:column;align-items:stretch}
  .rex-customer-iconbar{grid-template-columns:repeat(3,minmax(0,1fr))}
  .rex-manage-grid,.rex-manage-fields {grid-template-columns:1fr}
  .rex-manage-cta {flex-direction:column}
  .rex-manage-primary,.rex-manage-secondary {width:100%}
  .rex-client-actions-fallback.is-modal{padding:12px}
  .is-modal .rex-client-dialog{max-height:calc(100vh - 24px);width:100%}
  .rex-client-dialog>header{padding:20px 18px 16px}
  .rex-client-dialog-body{padding:0 18px 20px}
}
html[data-theme="dark"] .rex-customer {background:#121a26;color:#f1f4f9}
html[data-theme="dark"] .rex-customer.rex-band-active,
html[data-theme="dark"] .rex-customer[data-band=active] {border-color:#2fbf6a}
html[data-theme="dark"] .rex-customer.rex-band-inactive,
html[data-theme="dark"] .rex-customer[data-band=inactive] {border-color:#ef5a5a}
html[data-theme="dark"] .rex-customer.rex-band-trial,
html[data-theme="dark"] .rex-customer[data-band=trial],
html[data-theme="dark"] .rex-customer[data-kind=trial] {border-color:#f5a524}
html[data-theme="dark"] .rex-ico-label {color:#aab4c3}
html[data-theme="dark"] .rex-customer-brand,
html[data-theme="dark"] .rex-customer-exp,
html[data-theme="dark"] .rex-customer-detail strong {color:#f1f4f9}
html[data-theme="dark"] .rex-client-list[data-view=table] .rex-client-grid,
html[data-theme="dark"] .rex-client-list[data-view=table] .rex-customer {background:#121a26;color:#f1f4f9}
html[data-theme="dark"] .rex-client-list[data-view=table] .rex-client-table-head {
  background:#0d1522;border-color:#243246;color:#aab4c3;
}
html[data-theme="dark"] .rex-client-list[data-view=table] .rex-customer-t-name,
html[data-theme="dark"] .rex-client-list[data-view=table] .rex-customer-t-plan,
html[data-theme="dark"] .rex-client-list[data-view=table] .rex-customer-t-exp {color:#f1f4f9}
html[data-theme="dark"] .rex-client-list[data-view=table] .rex-customer-t-wa {color:#5eead4}
html[data-theme="dark"] .rex-customer-kebab {background:#1a2433;color:#e8edf5}
html[data-theme="dark"] .rex-customer-kebab.rex-t-ico {background:#4b5568;color:#fff}

