/* Painel administrativo - complementos do design system */
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 360px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
/* Filtro e tabela no mesmo bloco nao podem colar */
section > .toolbar { margin-bottom: 16px; }
section > .card-title { margin: 0 0 14px; }

/* Titulo solto dentro do card (sem card-head) colava na tabela */
.card > .card-title { margin: 0 0 16px; }
.card > .card-title + .table,
.card > .card-title + .table-wrap { margin-top: 0; }
.card > p:last-child,
.card > .hint:last-child { margin-bottom: 0; }

/* Wrapper da Operacao e forms com varios cards: o gap do content-body nao entra aqui */
#opsLive,
.content-body > form:not(.toolbar) {
  display: flex;
  flex-direction: column;
  gap: 26px;
}
.toolbar .input, .toolbar .select { width: auto; min-width: 160px; min-height: 40px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs a { padding: 8px 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--panel-2); color: var(--muted); font-weight: 700; font-size: 13px; }
.tabs a.is-on { background: var(--accent); color: #000; border-color: var(--accent); }
.tabs a .count { margin-left: 6px; opacity: 0.8; }

/* switch on/off dos mercados */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: rgba(255, 255, 255, 0.15); border: 1px solid var(--line); transition: background 0.15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(20px); background: #000; }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-dim); }

.market-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.row-actions { display: flex; align-items: center; gap: 10px; }
.odd-cap { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.odd-cap .input { width: 96px; min-height: 34px; text-align: right; }
.pick-box { flex: 1 0 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; padding: 4px 0 6px; }
.band-box { flex: 1 0 100%; display: grid; gap: 8px; min-width: 0; padding: 4px 0 10px; }
.band-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.band-line .input { width: 120px; min-height: 34px; }
.band-line span { overflow-wrap: anywhere; }
.pick-box .pick { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; background: var(--panel-2); }
.pick-box .pick.is-off { color: var(--muted); }
.pick-box .switch { width: 38px; height: 22px; }
.pick-box .switch i::after { width: 14px; height: 14px; }
.pick-box .switch input:checked + i::after { transform: translateX(16px); }
.market-row:last-child { border-bottom: 0; }
.market-row strong { display: block; }
.market-row.is-off strong { color: var(--muted); }
.group-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.group-head h3 { font-size: 18px; }

.inline-form { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form .input { min-height: 34px; width: 160px; }

.wd-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: max-content;
}
.wd-actions form {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.wd-actions .input {
  width: 160px;
  min-width: 160px;
  max-width: 160px;
  flex: none;
}
.wd-actions .btn { flex: none; white-space: nowrap; }
.wd-roll, .wd-pix { white-space: nowrap; word-break: normal; }

.aff-link { display: inline-flex; align-items: center; gap: 8px; }
.aff-link .icon-btn { width: 32px; height: 32px; flex: none; }
.aff-cell { width: 1%; white-space: nowrap; vertical-align: middle; }
.aff-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: max-content;
}
.aff-actions form,
.aff-actions .inline-form,
.aff-actions .aff-pw,
.aff-actions .aff-del {
  margin: 0;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  width: auto;
  flex: none;
}
.aff-actions .inline-form input[name="pct"],
.aff-actions .inline-form input[name="show_pct"] {
  width: 4.5em;
  min-width: 4.5em;
  max-width: 4.5em;
  flex: none;
}
.aff-actions .inline-form input[name="code"] {
  width: 10em;
  min-width: 10em;
  max-width: 10em;
  flex: none;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.aff-actions .select,
.aff-actions .select.input {
  width: auto;
  min-width: 7.5em;
  min-height: 34px;
  flex: none;
}
.aff-actions .btn {
  flex: none;
  width: auto;
  white-space: nowrap;
}
.pager { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pager a { padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 700; font-size: 13px; }
.pager a.is-on { background: var(--accent); color: #000; border-color: var(--accent); }
.kpi.warn strong { color: var(--warn); }
.month-cash { margin-bottom: 18px; padding: 18px; border-radius: 16px; border: 1px solid var(--line-strong); background: linear-gradient(180deg, rgba(31, 214, 85, 0.1), transparent 72%); }
.month-cash-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.month-cash-head h2 { font-size: 22px; text-transform: uppercase; }
.month-cash-head p { margin: 0; color: var(--muted); font-size: 13px; }
.secret { font: 700 20px var(--font-display); letter-spacing: 0.12em; word-break: break-all; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--accent-dim); }

.break { overflow-wrap: anywhere; }
.log-list { list-style: none; margin: 0; padding: 0; min-width: 0; }
.log-list li { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 12px 0; border-bottom: 1px solid var(--line); }
.log-list li:first-child { padding-top: 0; }
.log-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.log-action { font-weight: 700; overflow-wrap: anywhere; }
.log-meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

[hidden] { display: none !important; }
