/* Configurações > Taxas de cartão (js/card-machines.js) */
#cardMachinesRoot { display: grid; gap: 16px; }
.cm-head { display: flex; gap: 14px; align-items: center; }
.cm-head h2 { margin: 0 0 2px; font-size: 22px; }
.cm-head p { margin: 0; color: var(--muted); font-size: 13px; max-width: 78ch; }
.cm-head-icon { width: 52px; height: 52px; flex: none; border-radius: 12px; display: grid; place-items: center; background: #fff7dc; color: #8a5a00; border: 1px solid #f3d79a; }
.cm-head-icon .material-icons-round { font-size: 28px; }

.cm-tabs { display: flex; gap: 8px; border-bottom: 1px solid var(--line); }
.cm-tab { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-bottom: 0; background: transparent; padding: 10px 18px; border-radius: 10px 10px 0 0; font-weight: 700; color: var(--muted); cursor: pointer; }
.cm-tab .material-icons-round { font-size: 18px; }
.cm-tab.active { background: var(--navy, #08243B); color: #fff; }
.cm-tab:not(.active):hover { color: var(--ink); background: #eef3f8; }

.cm-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
.cm-col { min-width: 0; }
.cm-list { display: grid; gap: 10px; background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.cm-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.cm-list-head h3, .cm-card h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.cm-list-head h3 .material-icons-round, .cm-card h3 .material-icons-round { font-size: 20px; color: #8a5a00; }
.cm-list-head .primary-button { display: inline-flex; align-items: center; gap: 4px; }
.cm-list-head .primary-button .material-icons-round { font-size: 18px; }
.cm-note { margin: 0; padding: 8px 10px; background: #fff7dc; border: 1px solid #f3d79a; border-radius: 8px; font-size: 12px; color: #8a5a00; }

.cm-machine { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); cursor: pointer; }
.cm-machine:hover { border-color: var(--gold, #DDB52F); }
.cm-machine.selected { border-color: var(--gold, #DDB52F); background: #fffaea; box-shadow: 0 0 0 1px var(--gold, #DDB52F) inset; }
.cm-machine.off { opacity: .7; }
.cm-machine:focus-visible { outline: 2px solid var(--gold, #DDB52F); outline-offset: 2px; }
.cm-machine-info { min-width: 0; display: grid; }
.cm-machine-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-machine-info small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-default { font-size: 13px; font-weight: 700; color: #c08a00; margin-left: 4px; }
.cm-logo { width: 36px; height: 36px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 16px; flex: none; }
.cm-logo.small { width: 30px; height: 30px; font-size: 14px; }
.cm-pill { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.cm-pill.ok { background: #dcfce7; color: #166534; }
.cm-pill.off { background: #e5e7eb; color: #475467; }
.cm-more { padding: 4px; line-height: 0; }
.cm-more .material-icons-round { font-size: 20px; }

.cm-editor { background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 14px; }
.cm-editor-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cm-editor-head h3 { margin: 0; font-size: 16px; flex: 1; min-width: 160px; }
.cm-auto { display: inline-flex; align-items: center; gap: 10px; text-transform: none; font-size: 13px; font-weight: 600; color: var(--ink); }

.cm-rates { width: 100%; min-width: 0; border-collapse: collapse; } /* tables.css força min-width alto em toda tabela */
.cm-rates th { background: var(--navy, #08243B); color: #fff; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; padding: 10px 12px; text-align: left; white-space: nowrap; }
.cm-rates td { padding: 7px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cm-rates tr.inactive td { opacity: .55; }
.cm-rates tbody tr:nth-child(even) { background: #f7fafc; }
.cm-row-label { font-weight: 700; }
.cm-rate-input { display: inline-flex; align-items: center; gap: 6px; }
.cm-rate-input input { width: 96px; height: 34px; text-align: right; padding: 0 8px; }
.cm-rate-input b { color: var(--muted); }
.cm-status { display: inline-flex; align-items: center; gap: 8px; text-transform: none; font-size: 13px; font-weight: 600; color: var(--ink); }
.cm-actions { white-space: nowrap; }
.cm-actions .icon-button { width: 32px; height: 32px; padding: 0; line-height: 0; }
.cm-actions .material-icons-round { font-size: 18px; }
.cm-rates.compare td.best { background: #dcfce7; color: #166534; font-weight: 800; }
.cm-rates.compare td { text-align: left; }
.cm-rates .muted { color: var(--muted); }

.cm-editor-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.cm-editor-foot select { max-width: 280px; margin-right: auto; height: 38px; }
.cm-dirty { color: #8a5a00; font-size: 12px; font-weight: 700; }
.cm-dirty.hidden { display: none; }
.cm-editor-foot .primary-button { display: inline-flex; align-items: center; gap: 6px; }

/* Interruptor (usado só aqui). Seletor com id para vencer as regras globais de input (largura 100%, borda, altura). */
#cardMachinesRoot input.cm-switch { appearance: none; -webkit-appearance: none; display: inline-block; width: 40px; min-width: 40px; max-width: 40px; height: 22px; min-height: 22px; padding: 0; margin: 0; border-radius: 999px; background: #cbd5e1; position: relative; cursor: pointer; transition: background .15s; flex: none; border: 0; box-shadow: none; }
#cardMachinesRoot input.cm-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
#cardMachinesRoot input.cm-switch:checked { background: #16a34a; }
#cardMachinesRoot input.cm-switch:checked::after { transform: translateX(18px); }
#cardMachinesRoot input.cm-switch:focus-visible { outline: 2px solid var(--gold, #DDB52F); outline-offset: 2px; }

.cm-side { display: grid; gap: 14px; }
.cm-card { background: var(--surface, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 8px; }
.cm-card p { margin: 0; font-size: 13px; color: var(--muted); }
.cm-card.tips { background: #f2faf5; border-color: #cbead6; }
.cm-card.tips ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink); display: grid; gap: 4px; }
.cm-card.wide { padding: 16px; }
.cm-stats { margin: 0; display: grid; gap: 6px; }
.cm-stats div { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.cm-stats dt { color: var(--muted); }
.cm-stats dd { margin: 0; font-weight: 800; }
.cm-compare-hint { margin-bottom: 8px; }

.cm-empty { text-align: center; padding: 48px 16px; background: var(--surface, #fff); border: 1px dashed var(--line); border-radius: 12px; display: grid; gap: 10px; justify-items: center; }
.cm-empty .material-icons-round { font-size: 44px; color: #8a5a00; }
.cm-empty h3 { margin: 0; }
.cm-empty p { margin: 0; max-width: 56ch; color: var(--muted); }
.cm-empty .primary-button { display: inline-flex; align-items: center; gap: 6px; }

.cm-dialog { max-width: 460px; }
.cm-dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.cm-form-error { margin: 0; padding: 8px 10px; background: #fee2e2; color: #991b1b; border-radius: 8px; font-size: 13px; }
.cm-form-error.hidden { display: none; }

@media (max-width: 1500px) {
  .cm-grid { grid-template-columns: 280px minmax(0, 1fr); }
  .cm-side { grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
}
@media (max-width: 760px) {
  .cm-grid { grid-template-columns: 1fr; }
  .cm-head { align-items: flex-start; }
  .cm-editor-foot select { max-width: none; width: 100%; }
}
