
:root {
  --pora-blue: #0b3d91;
  --pora-blue-dark: #082b66;
  --ink: #1a1f29;
  --muted: #6b7280;
  --border: #e2e5ea;
  --bg: #f6f7f9;
  --danger: #b3261e;
  --ok: #1e7a34;
  --warn: #a15c00;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; width: 100%; }
label { display: block; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
label input, label select { margin-top: 4px; color: var(--ink); }

.topbar {
  background: var(--pora-blue);
  color: #fff;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.topbar__title { font-weight: 600; }
.topbar__right { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px 16px; }
.topbar__session { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.topbar__session[hidden] { display: none; }

/* Seletor de idioma (visível em todas as telas, inclusive antes do login) */
.lang-switch { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: rgba(255,255,255,0.9); }
.lang-switch__select { width: auto; margin-top: 0; padding: 5px 8px; font-size: 13px; background: #fff; color: var(--ink); border: 1px solid rgba(255,255,255,0.6); }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid #f2a900; outline-offset: 2px; }

.btn { border: none; border-radius: 6px; padding: 9px 14px; font-weight: 600; }
.btn--primary { background: var(--pora-blue); color: #fff; }
.btn--primary:hover { background: var(--pora-blue-dark); }
.btn--small { padding: 6px 10px; font-size: 13px; }
.btn--ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.5); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--secondary { background: #fff; border: 1px solid var(--border); color: var(--ink); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.panel { background: #fff; border-radius: 10px; padding: 24px; margin: 40px auto; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.panel--narrow { max-width: 380px; }
.hint { color: var(--muted); font-size: 13px; margin-top: -8px; margin-bottom: 16px; }
.error { color: var(--danger); font-size: 13px; margin-top: 8px; }

.layout { display: flex; height: calc(100vh - 56px - 45px); }
.list-pane {
  width: 320px;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
}
.list-pane__header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.list-pane__header h2 { font-size: 16px; margin: 0; }
.filter { margin-bottom: 8px; }
.merchant-list { list-style: none; margin: 0; padding: 0; }
.merchant-list li {
  padding: 10px 8px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 4px;
}
.merchant-list li:hover { background: var(--bg); }
.merchant-list li.selected { background: #e8edf9; }
.merchant-list li .name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.merchant-list li .meta { font-size: 12px; color: var(--muted); }

.detail-pane { flex: 1; min-width: 0; overflow-y: auto; padding: 24px 32px; }
.detail-pane .card { overflow-x: auto; }
/* Tabelas largas rolam dentro do próprio bloco (sombra lateral indica que há mais conteúdo) */
.table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%;
  background:
    linear-gradient(to right, #fff 30%, rgba(255,255,255,0)) left center / 24px 100% no-repeat local,
    linear-gradient(to left, #fff 30%, rgba(255,255,255,0)) right center / 24px 100% no-repeat local,
    linear-gradient(to right, rgba(0,0,0,0.18), rgba(0,0,0,0)) left center / 10px 100% no-repeat scroll,
    linear-gradient(to left, rgba(0,0,0,0.18), rgba(0,0,0,0)) right center / 10px 100% no-repeat scroll;
}
.detail-title { margin: 0; overflow-wrap: anywhere; }
.empty-state { color: var(--muted); }
.note { color: var(--muted); font-size: 12px; margin: 2px 0 8px; overflow-wrap: anywhere; }
td .note, th .note { margin: 2px 0 0; }
.note--warn { background: #fff3cd; border: 1px solid #f0d58a; color: #5c4400; border-radius: 6px; padding: 8px 12px; font-size: 13px; }
.note--body { font-size: 14px; color: var(--ink); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge--draft { background: #eee; color: #555; }
.badge--submitted, .badge--under_review { background: #fff3cd; color: var(--warn); }
.badge--pending_issue { background: #fde2c8; color: var(--warn); }
.badge--approved { background: #d9ecff; color: var(--pora-blue); }
.badge--active { background: #d9f2df; color: var(--ok); }
.badge--suspended { background: #ffe3d6; color: #a1470c; }
.badge--rejected, .badge--inactive { background: #f6d6d3; color: var(--danger); }

.card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.card h3 { margin-top: 0; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.field { margin-bottom: 4px; }
.field .k { font-size: 12px; color: var(--muted); }
.field .v { font-size: 14px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
table th, table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
table th { color: var(--muted); font-weight: 600; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.modal { background: #fff; border-radius: 10px; padding: 24px; width: 420px; max-width: 92vw; max-height: 88vh; overflow-y: auto; }
.modal h2 { margin-top: 0; font-size: 16px; }
.modal:focus { outline: none; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

.legal-footer { padding: 8px 16px; font-size: 12px; color: #475569; text-align: center; }
.toast-root {
  position: fixed; bottom: 20px; right: 20px; z-index: 200; max-width: 360px;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 8px; font-size: 14px;
  pointer-events: auto; overflow-wrap: anywhere;
}
.toast--error { background: var(--danger); }
.toast--ok { background: var(--ok); }

.tabs { display: flex; gap: 4px; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--border); height: 45px; align-items: flex-end; overflow-x: auto; }
.tab { background: transparent; border: none; border-bottom: 3px solid transparent; padding: 10px 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--pora-blue); border-bottom-color: var(--pora-blue); }
.tab--active { color: var(--pora-blue); border-bottom-color: var(--pora-blue); }
.tab[hidden] { display: none; }

.page { max-width: 960px; margin: 0 auto; padding: 24px 20px; }
.page .card { overflow-x: auto; }
.page__header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.page__header h2 { margin: 0; font-size: 18px; }
.filter--inline { margin: 0; display: flex; align-items: center; gap: 8px; }
.filter--inline select { width: auto; margin-top: 0; }

.link { background: none; border: none; padding: 0; color: var(--pora-blue); text-decoration: underline; font-size: 13px; cursor: pointer; }
.links { margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.links__sep { margin: 0 6px; }
.notice { background: #e6f4ea; color: var(--ok); border-radius: 6px; padding: 8px 12px; font-size: 13px; }
.muted { color: var(--muted); }

/* Contador nas abas (Aprovações pendentes / Avisos não lidos): número + texto para leitor de tela */
.count { display: inline-block; min-width: 20px; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 16px; }
.count[hidden] { display: none; }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notif { background: #fff; border: 1px solid var(--border); border-left: 5px solid var(--border); border-radius: 8px; padding: 12px 14px; min-width: 0; }
.notif--unread { border-left-color: var(--pora-blue); }
.notif__text { font-size: 14px; overflow-wrap: anywhere; margin-bottom: 4px; }
.notif .row { margin: 8px 0 0; }

/* Aviso de MFA obrigatória (e painel de confirmação da ativação) */
.warn-panel { margin: 0 0 16px; }
#mfa-required-notice {
  background: #fff3cd; border: 1px solid #f0d58a; border-left: 5px solid #f2a900; color: #5c4400;
  border-radius: 6px; padding: 12px 16px; font-size: 14px; line-height: 1.5;
}
#mfa-required-notice[hidden] { display: none; }
#mfa-required-notice strong { display: block; margin-bottom: 2px; color: #3d2d00; }
#mfa-warning { margin-top: 12px; }
.setup { margin-top: 16px; }
.sr-copy { position: fixed; left: -9999px; top: 0; opacity: 0; }
.copy-row { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.link:disabled { color: var(--muted); text-decoration: none; cursor: not-allowed; }
.warn-box { background: #fff3cd; border: 1px solid #f0d58a; color: #5c4400; border-radius: 6px; padding: 12px; font-size: 13px; margin-bottom: 12px; }
.code-block { display: block; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; word-break: break-all; user-select: all; margin: 4px 0 12px; }
.codes { columns: 2; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; padding-left: 18px; }
.check { display: flex; gap: 8px; align-items: center; margin: 12px 0; color: var(--ink); font-size: 14px; }
.check input { width: auto; margin: 0; }
.setup ol { padding-left: 18px; font-size: 13px; color: var(--ink); }

/* Telas estreitas (celular) e textos mais longos (es costuma ser ~20% maior que pt) */
@media (max-width: 760px) {
  /* lista e ficha empilhadas, cada uma com a largura inteira da tela */
  .layout { display: block; height: auto; }
  .list-pane { width: auto; border-right: none; border-bottom: 1px solid var(--border); max-height: 40vh; }
  .detail-pane { width: auto; overflow-y: visible; padding: 16px; }
  .table-scroll table { min-width: 460px; }
  .row { align-items: flex-start; }
}
@media (max-width: 520px) {
  .topbar { padding: 10px 12px; }
  .lang-switch__text {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
  }
  .panel { margin: 16px 12px; padding: 20px 16px; }
  .panel--narrow { max-width: none; }
  .page { padding: 16px 12px; }
  .tabs { padding: 0 8px; }
  .tab { padding: 10px 10px; }
  .modal { padding: 16px; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .codes { columns: 1; }
}

/* ---------------------------------------------------------------
   WAR ROOM 24/7 (somente Owner). Estado nunca depende só da cor:
   cada selo traz símbolo + texto.
   --------------------------------------------------------------- */
.page--wide { max-width: 1240px; }
textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; width: 100%; margin-top: 4px; color: var(--ink); resize: vertical; }
.wr-updated { color: var(--muted); font-size: 12px; }
.wr-error { background: #fde2e0; border: 1px solid #f1b7b2; border-left: 5px solid var(--danger); color: #6b1410; border-radius: 6px; padding: 12px 16px; font-size: 14px; margin: 0 0 16px; }
.wr-error[hidden] { display: none; }
.wr-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; font-size: 14px; }
.wr-strip:empty { display: none; }
.wr-subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 16px; overflow-x: auto; }
.wr-subtabs .tab { min-height: 44px; }
.wr-muted { color: var(--muted); font-size: 13px; }
.wr-warn { color: #5c4400; background: #fff3cd; border: 1px solid #f0d58a; border-radius: 6px; padding: 8px 10px; font-size: 13px; }
.wr-h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin: 8px 0 12px; }

.wr-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.wr-badge--OK { background: #d9f2df; color: #14532a; border-color: #a9d9b6; }
.wr-badge--ATTENTION { background: #fff3cd; color: #6b4300; border-color: #f0d58a; }
.wr-badge--CRITICAL { background: #fde2e0; color: #8f1d17; border-color: #f1b7b2; }
.wr-badge--NOT_MONITORED { background: #eceff3; color: #3b4452; border: 1px dashed #8a93a1; }

.wr-sev { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; }
.wr-sev--CRITICAL { background: #b3261e; color: #fff; }
.wr-sev--HIGH { background: #fde2c8; color: #7a3b00; border: 1px solid #f0b987; }
.wr-sev--MEDIUM { background: #fff3cd; color: #5c4400; border: 1px solid #f0d58a; }
.wr-sev--LOW { background: #d9ecff; color: #0b3d91; border: 1px solid #a9ccf0; }
.wr-sev--INFORMATIONAL { background: #eceff3; color: #3b4452; border: 1px solid #c8ced8; }

.wr-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin-bottom: 4px; }
.wr-card p { margin: 6px 0; font-size: 14px; }
.wr-card--wide { grid-column: 1 / -1; }
.wr-chips, .wr-counts { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 13px; }
.wr-count { padding: 2px 8px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); }
.wr-count--on.wr-count--CRITICAL { border-color: #b3261e; color: #8f1d17; font-weight: 700; }
.wr-count--on.wr-count--HIGH { border-color: #d98a3d; color: #7a3b00; font-weight: 700; }
.wr-count--on { color: var(--ink); }
.wr-count__n { font-weight: 700; }
.wr-decisions { margin: 0; padding-left: 18px; font-size: 14px; }
.wr-decisions li { margin-bottom: 6px; }

.wr-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.wr-area { background: #fff; border: 1px solid var(--border); border-left: 5px solid #8a93a1; border-radius: 8px; padding: 12px 14px; min-width: 0; }
.wr-area--OK { border-left-color: #1e7a34; }
.wr-area--ATTENTION { border-left-color: #d98a00; }
.wr-area--CRITICAL { border-left-color: #b3261e; }
.wr-area--NOT_MONITORED { border-left-style: dashed; background: #fafbfc; }
.wr-area__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.wr-area__head h3 { margin: 0; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.wr-area__meta { color: var(--muted); font-size: 12px; margin: 6px 0; overflow-wrap: anywhere; }
.wr-area__nm { font-size: 13px; background: #eceff3; border-radius: 6px; padding: 8px 10px; margin: 6px 0; overflow-wrap: anywhere; }
.wr-items { margin: 8px 0 0; display: grid; gap: 4px; }
.wr-item { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; border-top: 1px solid #f0f2f5; padding-top: 4px; }
.wr-item dt { color: var(--muted); }
.wr-item dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.wr-item__v { font-weight: 600; }
.wr-item__v--nm { color: #3b4452; font-weight: 600; }
.wr-item__why { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 2px; }
.wr-area__alerts { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; display: grid; gap: 4px; }

.wr-alerts { display: grid; gap: 10px; }
.wr-alert { background: #fff; border: 1px solid var(--border); border-left: 5px solid #8a93a1; border-radius: 8px; padding: 12px 14px; min-width: 0; }
.wr-alert--CRITICAL { border-left-color: #b3261e; }
.wr-alert--HIGH { border-left-color: #d98a3d; }
.wr-alert--MEDIUM { border-left-color: #d9a900; }
.wr-alert--LOW { border-left-color: #3b78c4; }
.wr-alert--resolved { opacity: 0.8; }
.wr-alert__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.wr-alert__head h3 { flex: 1 1 100%; margin: 4px 0 0; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--ink); overflow-wrap: anywhere; }
.wr-status { font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.wr-status--decision { color: #7a3b00; border-color: #f0b987; background: #fff7ee; }
.wr-alert__meta { color: var(--muted); font-size: 12px; margin: 6px 0; overflow-wrap: anywhere; }
.wr-alert__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.wr-alert__detail { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 8px; font-size: 14px; }
.wr-alert__detail[hidden] { display: none; }
.wr-detail { margin: 0; display: grid; gap: 8px; }
.wr-detail dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.wr-detail dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.wr-alert__detail h4, .wr-card h4 { margin: 12px 0 4px; font-size: 13px; }
.wr-evidence { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: 12px; overflow: auto; max-height: 240px; white-space: pre-wrap; overflow-wrap: anywhere; }
.wr-events, .wr-metrics, .wr-nm-list, .wr-findings { margin: 0; padding-left: 18px; font-size: 13px; }
.wr-metrics li, .wr-nm-list li, .wr-findings li, .wr-events li { margin-bottom: 4px; overflow-wrap: anywhere; }
.wr-filters { gap: 8px 16px; }
.wr-filters .filter--inline select { min-height: 36px; }

@media (max-width: 520px) {
  .wr-summary { grid-template-columns: 1fr; }
  .wr-areas { grid-template-columns: 1fr; }
  .wr-item { flex-direction: column; gap: 2px; }
  .wr-item dd { text-align: left; }
  .wr-alert__actions .btn, .wr-filters .btn { min-height: 44px; }
  .wr-subtabs .tab { padding: 10px 12px; }
  #panel-warroom .page__header { flex-direction: column; align-items: flex-start; }
}
/* ---------------------------------------------------------------
   FINANCEIRO (somente leitura). Estado nunca depende só da cor:
   cada selo traz texto. Tabelas rolam dentro de .table-scroll.
   --------------------------------------------------------------- */
.fin-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 4px 12px; align-items: end; margin: 0 0 12px; }
.fin-filters label { margin-bottom: 4px; }
.fin-filters select, .fin-filters input { min-height: 36px; }
.fin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 4px; grid-column: 1 / -1; }
.fin-res { min-height: 24px; }
.fin-res:focus { outline: none; }
.fin-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; margin: 0 0 12px; }
.fin-total { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.fin-total h3 { margin: 0 0 6px; font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.fin-total dl { margin: 0; display: grid; gap: 2px; font-size: 13px; }
.fin-total dl div { display: flex; justify-content: space-between; gap: 8px; }
.fin-total dt { color: var(--muted); }
.fin-total dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.fin-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th.fin-num { text-align: right; }
.fin-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.fin-pager .row { margin: 0; }
.fin-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--border); background: #eceff3; color: #3b4452; white-space: nowrap; }
.fin-badge--ok { background: #d9f2df; color: #14532a; border-color: #a9d9b6; }
.fin-badge--warn { background: #fff3cd; color: #6b4300; border-color: #f0d58a; }
.fin-badge--bad { background: #fde2e0; color: #8f1d17; border-color: #f1b7b2; }
.fin-detail { background: #fff; border: 1px solid var(--border); border-left: 5px solid var(--pora-blue); border-radius: 8px; padding: 14px 16px; margin: 16px 0 0; }
.fin-detail:focus { outline: none; }
.fin-detail h3 { margin: 0 0 8px; font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--ink); }
.fin-detail h4 { margin: 14px 0 6px; font-size: 13px; }
.fin-detail__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.fin-kv { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 16px; font-size: 13px; }
.fin-kv dt { color: var(--muted); font-size: 12px; }
.fin-kv dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.fin-open { margin-top: 6px; display: block; }
.fin-sub-muted { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.fin-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; overflow-wrap: anywhere; }
.fin-loading { color: var(--muted); font-size: 14px; }
.fin-chips { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 13px; }
.fin-chips li { padding: 2px 10px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.fin-chips strong { font-weight: 700; }
#panel-finance table th, #panel-finance table td { vertical-align: top; }
#panel-finance .table-scroll table { min-width: 720px; }

@media (max-width: 520px) {
  .fin-filters { grid-template-columns: 1fr; }
  .fin-totals { grid-template-columns: 1fr; }
  .fin-actions .btn, .fin-pager .btn, .fin-detail .btn { min-height: 44px; }
  .fin-filters select, .fin-filters input { min-height: 44px; }
  #panel-finance .page__header { flex-direction: column; align-items: flex-start; }
  #panel-finance .wr-subtabs .tab { padding: 10px 12px; }
  .fin-pager { flex-direction: column; align-items: stretch; }
}

/* ---------------------------------------------------------------
   OPERAÇÕES DE BENEFÍCIOS. Estado nunca depende só da cor: selo = símbolo + texto.
   --------------------------------------------------------------- */
.bo-error { background: #fde2e0; border: 1px solid #f1b7b2; border-left: 5px solid var(--danger); color: #6b1410; border-radius: 6px; padding: 12px 16px; font-size: 14px; margin: 0 0 16px; }
.bo-error[hidden] { display: none; }
.bo-picker { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; }
.bo-picker .filter { margin: 0; flex: 1 1 220px; min-width: 0; }
.bo-picker .btn { margin-bottom: 0; min-height: 36px; }
.bo-subtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 0 16px; overflow-x: auto; }
.bo-subtabs .tab { min-height: 44px; }
.bo-muted { color: var(--muted); font-size: 13px; }
.bo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 4px; }
.bo-grid .card { margin: 0; }
.bo-kpi { font-size: 24px; font-weight: 700; margin: 4px 0; }
.bo-kpi small { font-size: 13px; font-weight: 400; color: var(--muted); }
.bo-section { margin: 0 0 16px; }
.bo-section h3 { margin: 0 0 8px; }
.bo-section > .bo-muted { margin: 0 0 8px; }
.bo-filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; margin: 0 0 12px; }
.bo-filters .filter { margin: 0; flex: 1 1 180px; min-width: 0; }
.bo-filters .btn { min-height: 36px; }
.bo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.bo-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 0; font-size: 13px; color: var(--muted); }
.bo-pager .row { margin: 0; }
.bo-pending { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.bo-pending li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.bo-detail { border-left: 5px solid var(--pora-blue); }
.bo-detail h3 { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--ink); }
.bo-detail h3:focus { outline: 2px solid #f2a900; outline-offset: 2px; }
.bo-dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px 16px; }
.bo-dl dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
.bo-dl dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.bo-money { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.bo-num, th.bo-num { text-align: right; }
.bo-warn { color: #5c4400; background: #fff3cd; border: 1px solid #f0d58a; border-radius: 6px; padding: 8px 12px; font-size: 13px; margin: 8px 0; }
.bo-info { color: #0b3d91; background: #e8edf9; border: 1px solid #c6d3f0; border-radius: 6px; padding: 8px 12px; font-size: 13px; margin: 8px 0; }
.bo-summary-box { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; margin: 0 0 12px; font-size: 14px; }
.bo-summary-box dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; }
.bo-summary-box dt { color: var(--muted); }
.bo-summary-box dd { margin: 0; overflow-wrap: anywhere; }
.bo-total { font-size: 18px; font-weight: 700; }
.modal textarea { min-height: 80px; }
.bo-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.bo-badge--ok { background: #d9f2df; color: #14532a; border-color: #a9d9b6; }
.bo-badge--warn { background: #fff3cd; color: #6b4300; border-color: #f0d58a; }
.bo-badge--danger { background: #fde2e0; color: #8f1d17; border-color: #f1b7b2; }
.bo-badge--info { background: #e8edf9; color: #0b3d91; border-color: #c6d3f0; }
.bo-badge--neutral { background: #eceff3; color: #3b4452; border: 1px dashed #8a93a1; }
.bo-reasons { margin: 0; padding-left: 16px; font-size: 12px; color: var(--ink); }
.bo-table-actions { display: flex; flex-wrap: wrap; gap: 6px; }
/* O texto .sr-only das colunas de ação é absoluto: sem um bloco de contenção rolável ele escapa do recorte da tabela e
   alarga a página inteira no celular (viewport de layout 690px em vez de 390px). */
#panel-benefitops .table-scroll { position: relative; }

@media (max-width: 520px) {
  .bo-grid { grid-template-columns: 1fr; }
  .bo-subtabs .tab { padding: 10px 12px; }
  .bo-actions .btn, .bo-filters .btn, .bo-table-actions .btn, .bo-pager .btn { min-height: 44px; }
  #panel-benefitops .page__header { flex-direction: column; align-items: flex-start; }
  .bo-summary-box dl { grid-template-columns: 1fr; }
  .bo-summary-box dt { margin-top: 4px; }
}

