/* Estilos das telas do grupo "cadastros" (Lojas, Usuários, Planos de contas). Usa os tokens de gp-tema.css
   e herda a base ".cxl" (chips, toolbar, painel, tabela, pills) e ".mm" (formulário em modal). */

/* ── lista ──────────────────────────────────────────────────────────────── */
.cad [hidden] { display: none !important; }
.cad .search { flex: 1 1 260px; min-width: 200px; }
.cad .search input[type=text] { width: 100%; }
.cad .search > svg { fill: none; stroke: var(--faint); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cad .sel { width: auto; flex: none; height: 42px; min-width: 170px; border: 1px solid var(--line); background: var(--campo); color: var(--ink); border-radius: 12px; font: 500 14px "Inter", sans-serif; padding: 0 12px; }
.cad .sel:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.cad .muted { color: var(--faint); }
.cad .mini { font-size: 12.5px; color: var(--muted); }
.cad .ch .dica { flex-basis: 100%; font-size: 13px; color: var(--muted); margin: -4px 0 0; }
.cad .panel .count { margin-left: 10px; }
.cad .cad-pb { padding: 18px 22px; }
.cad .cad-sk { padding: 8px 22px 18px; }
.cad .cad-sk-l { display: flex; gap: 18px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cad .sk { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--line), var(--surface-2), var(--line)); background-size: 200% 100%; animation: cad-sk 1.4s linear infinite; }
@keyframes cad-sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .cad .sk { animation: none; } }

.cad .linkbtn { background: none; border: 0; padding: 0; font: 600 13px "Inter", sans-serif; color: var(--verde-txt); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.cad .linkbtn:focus-visible { outline: none; box-shadow: var(--focus); }
.cad .filtro-ativo button:focus-visible { outline: none; box-shadow: var(--focus); }
.cad .vazio .acao { margin: 0 auto; }
.cad .vazio h4 { margin-top: 10px; }

.cad tr.lin:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.cad tr.lin.off td { color: var(--faint); }
.cad tr.lin.off .dois b { color: var(--muted); font-weight: 500; }
.cad .av-s { width: 36px; height: 36px; border-radius: 50%; background: var(--soft); color: var(--verde-txt); display: grid; place-items: center; font: 700 13px "Inter", sans-serif; flex: none; }
.cad .id-cel { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cad .dois { min-width: 0; }
.cad .dois b { display: block; font-weight: 600; color: var(--ink); }
.cad .dois small { display: block; font-size: 12px; color: var(--faint); }
.cad td.fundo { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cad td.email { max-width: 215px; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.cad td.loja-c { white-space: normal; max-width: 230px; line-height: 1.35; }
.cad .tbl-wrap table th, .cad .tbl-wrap table td { padding-left: 14px; padding-right: 14px; }
.cad .tbl-wrap table th:first-child, .cad .tbl-wrap table td:first-child { padding-left: 22px; }
.cad .tbl-wrap table th:last-child, .cad .tbl-wrap table td:last-child { padding-right: 22px; }
.cad td.so-cel { display: none; }
.cad .acoes { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.cad .acao.perigo { color: var(--danger); }
.cad .acao.perigo:hover { border-color: var(--danger); }
.cad .acao[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.cad .acao[aria-disabled="true"]:hover { border-color: var(--line); }

.cad .tag { display: inline-flex; align-items: center; gap: 5px; font: 600 12px "Inter", sans-serif; padding: 3px 10px; border-radius: 999px; background: var(--st-an-bg); color: var(--st-an); }
.cad .tag.verde { background: var(--soft); color: var(--verde-txt); }
.cad .tag.laranja { background: var(--laranja-bg); color: var(--laranja); }
.cad .tag.auth { background: var(--st-wait-bg); color: var(--st-wait); }
.cad .tag .ic12 { width: 12px; height: 12px; }

/* planos */
.cad td.plano { white-space: normal; min-width: 230px; max-width: 300px; }
.cad td.plano .dois small { margin-top: 2px; line-height: 1.4; }
.cad td.regras { white-space: normal; min-width: 170px; }
.cad td.regras .tag { margin: 0 4px 4px 0; }
.cad td.lim { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cad td.lim.vz { color: var(--faint); font-weight: 400; }
.cad .lims-m { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.cad .lims-m span b { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 600; }
.cad .sw-solo { display: inline-flex; align-items: center; min-height: 40px; gap: 8px; font: 600 12.5px "Inter", sans-serif; color: var(--muted); cursor: pointer; }
.cad .sw-solo input { appearance: none; width: 44px; height: 26px; border-radius: 999px; background: var(--gray-300); position: relative; cursor: pointer; flex: none; border: 0; transition: background-color .15s; margin: 0; }
.cad .sw-solo input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: translate .15s; }
.cad .sw-solo input:checked { background: var(--accent); }
.cad .sw-solo input:checked::after { translate: 18px 0; }
.cad .sw-solo input:focus-visible { outline: none; box-shadow: var(--focus); }

/* aviso (também usado nos modais) */
.cad .aviso, .cadm .aviso { display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.cad .aviso .ic, .cadm .aviso .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface); }
.cad .aviso .ic svg, .cadm .aviso .ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cad .aviso b, .cadm .aviso b { display: block; font: 600 14.5px "Poppins", sans-serif; color: var(--ink); }
.cad .aviso .tx, .cadm .aviso .tx { display: block; font-size: 13px; color: var(--muted); line-height: 1.5; }
.cad .aviso.warn, .cadm .aviso.warn { border-color: var(--b-warn); background: var(--st-wait-bg); }
.cad .aviso.warn .ic, .cadm .aviso.warn .ic { color: var(--st-wait); }
.cad .aviso.bad, .cadm .aviso.bad { border-color: var(--b-danger); background: var(--st-inv-bg); }
.cad .aviso.bad .ic, .cadm .aviso.bad .ic { color: var(--st-inv); }

.cad-3 .chips { }
@container tela (max-width: 760px) {
  .cad-3 .chips { grid-template-columns: repeat(3, 1fr); }
  .cad-3 .chip .p, .cad-5 .chip .p { display: none; }
  .cad-3 .chip { padding: 12px; } .cad-3 .chip .l { font-size: 12px; }
  .cad .search { flex-basis: 100%; }
  .cad .sel { width: 100%; flex: 1 1 100%; }
  .cad .acao, .cad .acao.peq { min-height: 40px; }
  .cad .btn-clear { min-height: 42px; }
  .cad .filtro-ativo button { width: 28px; height: 28px; }
  .cad .tbl-wrap table th, .cad .tbl-wrap table td, .cad .tbl-wrap table td:first-child, .cad .tbl-wrap table td:last-child { padding-left: 0; padding-right: 0; }
  .cad .cad-sk { padding: 8px 16px 14px; }
  .cad td.c-titulo { grid-column: 1; grid-row: 1; min-width: 0; }
  .cad td.c-direita { grid-column: 2; grid-row: 1; justify-self: end; text-align: right; }
  .cad td.c-meio { grid-column: 1 / -1; }
  .cad td.c-fim { grid-column: 1 / -1; text-align: left; margin-top: 4px; }
  .cad td.so-desktop { display: none; }
  .cad td.so-cel { display: block; }
  .cad td.plano, .cad td.regras, .cad td.loja-c, .cad td.email { min-width: 0; max-width: none; }
  .cad .acoes { justify-content: flex-start; flex-wrap: wrap; }
  .cad td.fundo { text-align: left; }
}

/* ── modais (.mm .cadm) ─────────────────────────────────────────────────── */
.modal:has(.cadm) { max-width: 560px; }
.cadm .cad-sub { font-size: 13px; color: var(--muted); margin: -8px 0 0; }
.cadm .sec-t { font: 600 12.5px "Inter", sans-serif; color: var(--faint); margin: 6px 0 -6px; }
.cadm .sec-t:first-of-type { margin-top: 0; }
.cadm .mini { font-size: 12.5px; color: var(--muted); margin-top: -8px; display: block; }
.cadm .cid-uf { display: grid; grid-template-columns: 1fr 92px; gap: 14px; }
.cadm .campo textarea { width: 100%; min-height: 84px; border: 1px solid var(--line); background: var(--campo); color: var(--ink); border-radius: 12px; font: 500 14px "Inter", sans-serif; padding: 10px 14px; resize: vertical; }
.cadm .campo textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.cadm .campo input[readonly] { background: var(--surface-2); color: var(--muted); }
.cadm .campo .lb i { color: var(--danger); font-style: normal; }
.cadm .campo.erro select, .cadm .campo.erro textarea { border-color: var(--danger); }
.cadm .campo[hidden] { display: none; }
.mm.cadm .campo .prefixo { position: relative; }
.mm.cadm .campo .prefixo span { position: absolute; left: 14px; top: 50%; translate: 0 -50%; font: 500 14px "Inter", sans-serif; color: var(--faint); pointer-events: none; }
.mm.cadm .campo .prefixo input { padding-left: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.mm.cadm .campo .pw { position: relative; }
.mm.cadm .campo .pw input { padding-right: 92px; }
.mm.cadm .campo .pw button { position: absolute; right: 6px; top: 50%; translate: 0 -50%; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--verde-txt); font: 600 12.5px "Inter", sans-serif; cursor: pointer; }
.cadm .campo .pw button:focus-visible, .cadm .linkbtn:focus-visible { outline: none; box-shadow: var(--focus); }
.cadm .linkbtn { background: none; border: 0; padding: 0; font: 600 12.5px "Inter", sans-serif; color: var(--verde-txt); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.cadm .seg3.p3 span { height: auto; min-height: 44px; flex-direction: column; gap: 2px; padding: 6px 4px; text-align: center; }
.cadm .limites { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cadm .limites .campo label { font-weight: 500; color: var(--muted); }
.cadm .sw input:disabled { opacity: .65; cursor: not-allowed; }
.cadm .sw input[role=switch] { margin: 0; }
@media (max-width: 520px) { .cadm .limites { grid-template-columns: 1fr 1fr; } .cadm .seg3.p3 span { font-size: 12.5px; } }
