/* Painel da Conelo · Assinaturas (P7). Usa os tokens de .pc (panel.css) e as peças pcm- (commercial.css);
   prefixo pcs-. Sem style= no HTML (CSP de produção); tabelas viram cartões no celular. */

.pcs-page .pcs-card + .pcs-card, .pcs-page .pcs-card + .pc-card { margin-top: 18px; }
.pcs-page .pc-banner { margin-top: -6px; }

/* ——— Números */
.pcs-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pcs-kpis .pc-kpi { min-height: 136px; }
.pcs-kpi-skel { gap: 18px; box-shadow: none; }
.pcs-skel-value { width: 56%; height: 40px; border-radius: 10px; }
.pc .pcs-kpi[data-tone="warn"] .pc-kpi-value { color: var(--pc-warn); }

/* ——— Situações */
.pcm-pill[data-tone="warn"] { background: var(--pc-warn-soft); color: var(--pc-warn); }
.pcm-pill[data-tone="warn"] i { background: var(--pc-warn-dot); }
.pcm-pill[data-tone="neutral"] { background: var(--pc-sunken); color: var(--pc-ink-2); }
.pcs-label { display: none; }
.pcs-wrap { display: block; color: var(--pc-ink-2); font-size: 13px; overflow-wrap: anywhere; }

/* ——— Empresas */
.pcs-table { min-width: 1080px; table-layout: fixed; }
.pcs-table th:nth-child(1) { width: 19%; }
.pcs-table th:nth-child(2) { width: 15%; }
.pcs-table th:nth-child(3) { width: 14%; }
.pcs-table th:nth-child(4) { width: 10%; }
.pcs-table th:nth-child(5) { width: 13%; }
.pcs-table th:nth-child(6) { width: 8%; }
.pcs-table th:nth-child(7) { width: 10%; }
.pcs-table th:nth-child(8) { width: 11%; }
/* panel.css esconde o 5º título das tabelas até 1040px (lista de clientes); aqui as colunas seguem alinhadas. */
.pcs-table thead th:nth-child(5), .pcs-coupon-table thead th:nth-child(5) { display: table-cell; }
.pcs-table .pc-cell-main, .pcs-table .pc-cell-sub, .pcs-coupon-table .pc-cell-main, .pcs-coupon-table .pc-cell-sub { white-space: normal; overflow-wrap: anywhere; }
.pcs-td-state .pc-cell-sub { margin-top: 5px; }
.pcs-table s { color: var(--pc-ink-3); text-decoration-thickness: 1px; }
.pcs-table tr[data-state="canceled"] .pcs-td-company .pc-cell-main { color: var(--pc-ink-3); }

/* ——— Conferência necessária */
.pcs-card[data-tone="warn"] { border-color: #ecd9ae; }
.pcs-card[data-tone="warn"] > .pc-card-head { background: linear-gradient(180deg, var(--cn-surface-muted), var(--cn-surface)); border-radius: var(--pc-r-lg) var(--pc-r-lg) 0 0; }
.pcs-card .pc-card-head h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pcs-card .pc-card-head > div { display: grid; gap: 4px; max-width: 76ch; }
.pcs-recon-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 12px 14px; padding: 14px 22px; }
.pcs-recon-item + .pcs-recon-item { border-top: 1px solid var(--pc-line-soft); }
.pcs-recon-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--pc-warn-soft); color: var(--pc-warn); }
.pcs-recon-main { display: grid; gap: 3px; min-width: 0; }
.pcs-recon-main .pc-small { overflow-wrap: anywhere; }
.pcs-recon-details { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 12.5px; }
.pcs-recon-details > div { display: flex; gap: 5px; min-width: 0; }
.pcs-recon-details dt { color: var(--pc-ink-3); }
.pcs-recon-details dt::after { content: ":"; }
.pcs-recon-details dd { color: var(--pc-ink); font-weight: 500; overflow-wrap: anywhere; }
.pcs-recon-action { align-self: center; }
.pcs-ok { display: flex; align-items: center; gap: 10px; padding: 16px 22px; color: var(--pc-ok); font-size: 14px; font-weight: 500; }
.pcs-ok .pc-ic { width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: var(--pc-ok-soft); }
.pcs-foot { padding: 0 22px 16px; }

/* ——— Pedidos de retenção */
.pcs-retention > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 22px; }
.pcs-retention > li + li { border-top: 1px solid var(--pc-line-soft); }
.pcs-retention-main { display: grid; gap: 2px; min-width: 0; }
.pcs-retention time { white-space: nowrap; }

/* ——— Seções com ação no título */
.pcs-section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 16px; }
.pcs-section-head > div { display: grid; gap: 4px; flex: 1 1 360px; min-width: 0; }

/* ——— Planos e preços (pacote × faixa) */
.pcs-plan-table { min-width: 780px; table-layout: fixed; }
.pcs-plan-table thead th:first-child { width: 170px; }
.pcs-plan-table td, .pcs-plan-table th[scope="row"] { vertical-align: top; }
.pcs-plan-table .pc-tr:hover { background: transparent; }
.pcs-plan-pack { padding: 18px 16px; border-bottom: 1px solid var(--pc-line-soft); font: 500 17px/1.2 var(--pc-f-display); letter-spacing: -0.02em; color: var(--pc-pinho); }
.pcs-plan-table tbody tr:last-child th, .pcs-plan-table tbody tr:last-child td { border-bottom: 0; }
.pcs-plan { display: grid; justify-items: start; gap: 7px; }
.pcs-plan-price { display: flex; align-items: baseline; gap: 3px; }
.pcs-plan-price strong { font-size: 22px; font-weight: 500; letter-spacing: -0.03em; color: var(--pc-pinho); }
.pcs-plan-price span { color: var(--pc-ink-3); font-size: 12.5px; }
.pcs-plan-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.pcs-plan-table td[data-status="archived"] .pcs-plan-price strong { color: var(--pc-ink-3); }
.pcs-plan-empty { color: var(--pc-ink-3); }

/* ——— Cupons */
.pcs-coupon-table { min-width: 900px; table-layout: fixed; }
.pcs-coupon-table th:nth-child(1) { width: 17%; }
.pcs-coupon-table th:nth-child(2) { width: 16%; }
.pcs-coupon-table th:nth-child(3) { width: 14%; }
.pcs-coupon-table th:nth-child(4) { width: 11%; }
.pcs-coupon-table th:nth-child(5) { width: 20%; }
.pcs-coupon-table th:nth-child(6) { width: 11%; }
.pcs-coupon-table th:nth-child(7) { width: 11%; }
.pcs-coupon-table .pc-tr[data-status="archived"] .pc-cell-main { color: var(--pc-ink-3); }

/* ——— Régua e retenção */
.pcs-settings { display: grid; gap: 14px; }
.pcs-settings .pc-dl > div { grid-template-columns: 160px minmax(0, 1fr); }
.pcs-settings dd::first-letter { text-transform: uppercase; }
.pcs-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--pc-info-soft); color: var(--pc-info); font-size: 13.5px; }
.pcs-note .pc-ic { width: 18px; height: 18px; margin-top: 1px; }
.pcs-note.is-ok { background: var(--pc-ok-soft); color: var(--pc-ok); }

/* ——— Diálogos */
.pcs-fieldset { display: grid; gap: 12px; padding: 16px; border: 1px solid var(--pc-line); border-radius: 14px; background: var(--cn-surface); }
/* Legenda flutuante: fica dentro da caixa (sem o recorte na borda) e vira o primeiro item da grade. */
.pcs-fieldset legend { float: left; width: 100%; color: var(--pc-ink-3); font: 500 10.5px/1.2 var(--pc-f-mono); letter-spacing: 0.1em; text-transform: uppercase; }
.pcs-fieldset .pc-hint { margin-top: 0; }
.pcs-checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pcs-check { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; cursor: pointer; }
.pcs-check input { width: 18px; height: 18px; accent-color: var(--pc-pinho); flex: none; }
.pcs-check input:disabled + span { color: var(--pc-ink-3); }
.pcs-check:has(input:disabled) { cursor: not-allowed; }
.pcs-dialog-meta { color: var(--pc-ink-2); overflow-wrap: anywhere; }
.pcs-history-part { display: grid; gap: 10px; }
.pcs-history-part + .pcs-history-part { margin-top: 18px; }
.pcs-h3 { font: 600 14px/1.3 var(--pc-f-body); color: var(--pc-ink); }
.pcs-timeline { overflow: hidden; border: 1px solid var(--pc-line); border-radius: 14px; }
.pcs-tl-item { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 14px; padding: 12px 14px; }
.pcs-tl-item + .pcs-tl-item { border-top: 1px solid var(--pc-line-soft); }
.pcs-tl-item[data-actor="provider"] .pcs-tl-time { color: var(--pc-info); }
.pcs-tl-time { padding-top: 2px; color: var(--pc-ink-3); font: 400 11.5px/1.5 var(--pc-f-mono); }
.pcs-tl-body { display: grid; gap: 2px; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.pcs-tl-detail { color: var(--pc-ink-2); font-size: 13px; }
.pcs-tl-who { color: var(--pc-ink-3); font-size: 12px; }
.pcs-notices { overflow: hidden; border: 1px solid var(--pc-line); border-radius: 14px; }
.pcs-notices > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.pcs-notices > li + li { border-top: 1px solid var(--pc-line-soft); }
.pcs-notice-main { display: grid; gap: 2px; min-width: 0; }
.pcs-history-retry { margin-top: 12px; }
[data-sub-history] .pc-banner { margin-bottom: 14px; }

/* ——— Responsivo */
@media (max-width: 900px) {
  .pcs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .pcs-kpis .pc-kpi { min-height: 118px; }
  .pcs-kpis .pc-kpi.is-hero { grid-column: 1 / -1; }
  .pcs-kpis .pc-kpi-value { font-size: 34px; }
  .pcs-label { display: block; margin-bottom: 2px; color: var(--pc-ink-3); font: 500 10px/1.3 var(--pc-f-mono); letter-spacing: 0.08em; text-transform: uppercase; }
  .pcs-recon-item { grid-template-columns: auto minmax(0, 1fr); padding: 14px 16px; }
  .pcs-recon-action { grid-column: 1 / -1; width: 100%; }
  .pcs-ok { padding: 14px 16px; }
  .pcs-foot { padding: 0 16px 14px; }
  .pcs-retention > li { flex-wrap: wrap; padding: 12px 16px; }
  .pcs-section-head .pc-btn { width: 100%; }
  .pcs-settings .pc-dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .pcs-tl-item { grid-template-columns: minmax(0, 1fr); }
  .pcs-notices > li { flex-wrap: wrap; }
  .pcs-check { min-height: 44px; }

  /* Tabelas viram cartões no celular. */
  .pcs-scroll:has(table) { overflow: visible; }
  .pcs-table, .pcs-coupon-table, .pcs-plan-table { min-width: 0; table-layout: auto; }
  .pcs-table thead, .pcs-coupon-table thead, .pcs-plan-table thead { display: none; }
  .pcs-table, .pcs-table tbody, .pcs-coupon-table, .pcs-coupon-table tbody, .pcs-plan-table, .pcs-plan-table tbody { display: block; }
  .pcs-table .pc-tr, .pcs-coupon-table .pc-tr { display: grid; gap: 10px 12px; padding: 14px 16px; border-bottom: 1px solid var(--pc-line-soft); }
  .pcs-table .pc-tr:last-child, .pcs-coupon-table .pc-tr:last-child { border-bottom: 0; }
  .pcs-table .pc-tr td, .pcs-coupon-table .pc-tr td { display: block; min-width: 0; padding: 0; border: 0; width: auto; }
  .pcs-table .pc-tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "company state" "plan price" "next method" "late late" "actions actions"; }
  .pcs-table td:nth-child(1) { grid-area: company; }
  .pcs-table td:nth-child(2) { grid-area: plan; }
  .pcs-table td:nth-child(3) { grid-area: state; justify-self: end; text-align: right; }
  .pcs-table td:nth-child(4) { grid-area: price; text-align: right !important; }
  .pcs-table td:nth-child(5) { grid-area: next; }
  .pcs-table td:nth-child(6) { grid-area: method; text-align: right; }
  .pcs-table td:nth-child(7) { grid-area: late; }
  .pcs-table td:nth-child(7).is-empty { display: none; }
  .pcs-table td:nth-child(8) { grid-area: actions; text-align: left !important; }
  .pcs-table td:nth-child(8) .pc-btn { width: 100%; }
  .pcs-coupon-table .pc-tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "code state" "discount validity" "uses plans" "actions actions"; }
  .pcs-coupon-table td:nth-child(1) { grid-area: code; }
  .pcs-coupon-table td:nth-child(2) { grid-area: discount; }
  .pcs-coupon-table td:nth-child(3) { grid-area: validity; }
  .pcs-coupon-table td:nth-child(4) { grid-area: uses; }
  .pcs-coupon-table td:nth-child(5) { grid-area: plans; }
  .pcs-coupon-table td:nth-child(6) { grid-area: state; justify-self: end; }
  .pcs-coupon-table td:nth-child(7) { grid-area: actions; text-align: left !important; }
  .pcs-coupon-table td:nth-child(7):empty { display: none; }
  .pcs-coupon-table td:nth-child(7) .pc-btn { width: 100%; }
  .pcs-plan-table .pc-tr { display: grid; grid-template-columns: minmax(0, 1fr); border-bottom: 1px solid var(--pc-line); }
  .pcs-plan-table .pc-tr:last-child { border-bottom: 0; }
  .pcs-plan-table .pc-tr > * { display: block; padding: 12px 16px; border: 0; }
  .pcs-plan-pack { padding: 16px 16px 4px !important; }
  .pcs-plan-table .pc-tr > td + td { border-top: 1px solid var(--pc-line-soft); }
  .pcs-plan .pc-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .pcs-kpis .pc-kpi { transition: none !important; }
}
