/* Painel do Gestor — extra screens (Financeiro, Estoque, Pacientes, Site, Configurações) */

/* ===== generic form ===== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; }
.form-grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld__l { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-soft); }
.fld__in {
  font: inherit; font-size: 14px; color: var(--fg);
  padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-sunken); outline: none; width: 100%; transition: border-color .15s, background .15s;
}
.fld__in:focus { border-color: var(--brand); background: var(--bg-elev); }
textarea.fld__in { resize: vertical; min-height: 64px; line-height: 1.5; }

.row-line {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.row-line:last-child { border-bottom: none; }
.row-line__l { color: var(--fg-muted); }
.row-line__v { font-weight: 600; }
.row-line__v.brand { color: var(--brand); }
.row-line__v.good { color: var(--good); }

/* toggle switch */
.tgl { width: 42px; height: 23px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .18s; flex-shrink: 0; }
.tgl::after { content:""; position:absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .18s; }
.tgl.on { background: var(--brand); }
.tgl.on::after { transform: translateX(19px); }

/* status pill */
.spill { font-size: 11.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.spill--on { background: var(--good-soft); color: var(--good); }
.spill--off { background: var(--bg-sunken); color: var(--fg-soft); border: 1px solid var(--border); }
.spill--warn { background: var(--warn-soft); color: var(--warn); }
.spill--danger { background: var(--danger-soft); color: var(--danger); }
.spill--brand { background: var(--brand-soft); color: var(--brand); }
.spill--neutral { background: var(--bg-sunken); color: var(--fg-muted); border: 1px solid var(--border); }

.mini-select {
  font: inherit; font-size: 13px; color: var(--fg); font-weight: 500;
  padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-elev); cursor: pointer;
}
.icon-del { color: var(--fg-soft); padding: 4px; border-radius: 6px; display: grid; place-items: center; }
.icon-del:hover { color: var(--danger); background: var(--danger-soft); }
.icon-del svg { width: 15px; height: 15px; }

/* tiny input (currency) */
.cur-in { display: inline-flex; align-items: center; gap: 6px; }
.cur-in input {
  font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; font-weight: 600; text-align: right;
  width: 92px; padding: 8px 11px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-sunken); outline: none;
}
.cur-in input:focus { border-color: var(--brand); background: var(--bg-elev); }

/* screen action buttons in section heads */
.sec__actions { margin-left: auto; display: flex; gap: 9px; align-items: center; }

/* ===== FINANCEIRO ===== */
.meta-card { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; padding: calc(var(--pad-card) + 4px); }
.meta-card__input { display: flex; align-items: center; gap: 8px; }
.meta-card__input .lbl { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing:.07em; color: var(--fg-soft); display:block; margin-bottom: 6px; }
.meta-card__input .box { display: flex; align-items: center; gap: 8px; }
.meta-card__input input { font: inherit; font-size: 20px; font-weight: 600; width: 110px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-sunken); outline: none; }
.meta-card__mid { font-size: 13.5px; color: var(--fg-muted); }
.meta-card__mid .big { font-size: 15px; color: var(--good); font-weight: 600; }
.meta-card__mid b { color: var(--fg); }
.meta-card__pct { text-align: right; }
.meta-card__pct .n { font-size: 34px; font-weight: 600; letter-spacing: -0.03em; color: var(--brand); }
.meta-card__pct .l { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing:.08em; color: var(--fg-soft); }

/* meta hero (editable target + progress) */
.meta-hero { display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 32px; align-items: center; padding: calc(var(--pad-card) + 8px); }
.meta-hero__eyebrow { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing:.08em; color: var(--fg-soft); display: block; margin-bottom: 10px; }
.meta-hero__value { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.meta-hero__num { font-size: 52px; font-weight: 600; letter-spacing: -0.04em; line-height: 0.95; }
.meta-hero__edit-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--brand); padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elev); }
.meta-hero__edit-btn:hover { border-color: var(--brand); background: var(--brand-softer); }
.meta-hero__edit-btn svg { width: 13px; height: 13px; }
.meta-hero__edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.meta-hero__edit .cur { font-size: 24px; color: var(--fg-muted); font-weight: 500; }
.meta-hero__input { font: inherit; font-size: 38px; font-weight: 600; letter-spacing: -0.03em; width: 200px; max-width: 56vw; padding: 4px 10px; border: none; border-bottom: 2.5px solid var(--brand); background: transparent; outline: none; color: var(--fg); }
.meta-hero__date { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 13px; color: var(--fg-muted); }
.meta-hero__date svg { width: 14px; height: 14px; color: var(--brand); }
.meta-hero__date-in { font: inherit; font-size: 13px; font-weight: 600; color: var(--fg); width: 122px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-sunken); outline: none; }
.meta-hero__date-in:focus { border-color: var(--brand); background: var(--bg-elev); }
.meta-hero__progress { display: flex; flex-direction: column; gap: 9px; }
.meta-hero__prog-top { display: flex; align-items: baseline; justify-content: space-between; font-size: 14px; color: var(--fg-muted); }
.meta-hero__prog-top b { color: var(--good); font-size: 17px; font-weight: 600; }
.meta-hero__pct { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; color: var(--brand); }
.meta-hero__pct.done { color: var(--good); }
.meta-hero__bar { height: 16px; border-radius: 999px; background: var(--bg-sunken); border: 1px solid var(--border); overflow: hidden; position: relative; }
.meta-hero__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), color-mix(in oklch, var(--brand) 70%, var(--good))); transition: width .7s cubic-bezier(.2,.7,.2,1); }
.meta-hero__fill.done { background: linear-gradient(90deg, var(--good), color-mix(in oklch, var(--good) 60%, #000)); }
.meta-hero__prog-foot { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--fg-muted); }
.meta-hero__prog-foot b { color: var(--warn); font-weight: 600; }
.meta-hero__prog-foot .done { color: var(--good); font-weight: 600; }
@media (max-width: 760px) { .meta-hero { grid-template-columns: 1fr; gap: 22px; } .meta-hero__num { font-size: 42px; } }

.fin3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.fin-stat { padding: var(--pad-card); border-left: 3px solid var(--border-strong); }
.fin-stat--good { border-left-color: var(--good); }
.fin-stat--bad { border-left-color: var(--danger); }
.fin-stat--ink { border-left-color: var(--fg); }
.fin-stat__l { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing:.07em; color: var(--fg-soft); }
.fin-stat__v { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; margin: 7px 0 5px; }
.fin-stat__v.good { color: var(--good); } .fin-stat__v.bad { color: var(--danger); }
.fin-stat__foot { font-size: 12.5px; color: var(--fg-muted); display: flex; align-items: center; gap: 6px; }

.launch-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.launch-row:last-of-type { border-bottom: none; }
/* V2.51 — linha que o servidor NÃO conseguiu guardar. Fica marcada até dar
   certo, para o número na tela nunca passar por salvo sem estar. */
.launch-row--erro { background: var(--danger-bg, #FDECEC); box-shadow: inset 3px 0 0 var(--danger, #8B2020); border-radius: 6px; padding-left: 10px; }
/* Receita vinda de consulta realizada: visível, legível, mas não editável. */
.launch-row input:disabled,
.launch-row select:disabled { color: var(--fg-muted, #5D5A52); cursor: not-allowed; opacity: 1; }
.launch-row__body { flex: 1; min-width: 0; }
.launch-row__nm { font-size: 14px; font-weight: 600; }
.launch-row__nm-in { font: inherit; font-size: 14px; font-weight: 600; color: var(--fg); width: 100%; border: 1px solid transparent; border-radius: 7px; padding: 4px 8px; margin: -4px -8px 0; background: transparent; outline: none; transition: border-color .14s, background .14s; }
.launch-row__nm-in:hover { border-color: var(--border); }
.launch-row__nm-in:focus { border-color: var(--brand); background: var(--bg-sunken); }
/* ⚠️ Conserto 2026-08-15 (Teste de Multidão, lente CELULAR) — Regra nº 4.
   Faltava `width`/`min-width`: só `max-width:100%` NÃO tira o tamanho mínimo
   automático que o navegador dá a um item de layout flexível. Como as opções são
   longas ("Atendimento · Telemedicina · Consultórios"), o seletor se recusava a
   encolher (476px) e esticava a linha inteira para ~849px numa tela de 375px.
   Como o app esconde rolagem lateral por regra global, o excesso era CORTADO:
   no iPhone, o campo de valor (x=696) e o botão de apagar (x=802) ficavam
   fisicamente fora da tela — a gestora não via o valor lançado nem conseguia
   corrigir/remover nenhuma linha pelo celular. Medido no DOM, antes e depois. */
.launch-row__cat { font-family: var(--font-mono); font-size: 11px; color: var(--fg-soft); background: transparent; border: 1px solid transparent; border-radius: 6px; padding: 2px 6px; margin-top: 2px; margin-left: -6px; width: 100%; min-width: 0; max-width: 100%; cursor: pointer; }
/* o corpo da linha também precisa poder encolher (mesmo motivo do min-width acima) */
.launch-row__body { min-width: 0; }
.launch-row__cat:hover { border-color: var(--border); color: var(--fg-muted); }
.launch-row__cat:focus { border-color: var(--brand); color: var(--fg); outline: none; }
.launch-row__crumb { font-size: 11.5px; color: var(--fg-soft); font-family: var(--font-mono); margin-top: 2px; }

/* DRE table */
.dre { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.dre__row { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid var(--border); font-size: 14.5px; }
.dre__row:last-child { border-bottom: none; }
.dre__row .op { font-family: var(--font-mono); color: var(--fg-soft); margin-right: 10px; }
.dre__row .val { font-weight: 600; font-variant-numeric: tabular-nums; }
.dre__row .val.neg { color: var(--danger); }
.dre__row .val.pos { color: var(--good); }
.dre__row--sub { background: var(--bg-sunken); font-weight: 600; }
.dre__mrg { font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; color: var(--fg-soft); margin-left: 8px; padding: 2px 8px; border-radius: 999px; background: var(--bg-elev); border: 1px solid var(--border); }
.dre__rate { font: inherit; font-size: 12px; font-weight: 600; width: 46px; text-align: right; padding: 2px 6px; margin: 0 2px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg-elev); color: var(--brand); outline: none; font-variant-numeric: tabular-nums; }
.dre__rate:focus { border-color: var(--brand); background: var(--bg-sunken); }
.dre__row--total { background: var(--fg); color: #fff; font-weight: 600; font-size: 15.5px; }
.dre__row--total .op { color: rgba(255,255,255,0.6); }
html[data-theme="dark"] .dre__row--total { background: var(--brand); }

/* ===== ESTOQUE ===== */
.alert3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.alert-card { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-radius: var(--radius-lg); border: 1px solid var(--border); }
.alert-card .lbl { font-size: 14px; font-weight: 600; }
.alert-card .n { font-size: 26px; font-weight: 600; }
.alert-card--danger { background: var(--danger-soft); border-color: color-mix(in oklch, var(--danger) 22%, #fff); }
.alert-card--danger .lbl, .alert-card--danger .n { color: var(--danger); }
.alert-card--warn { background: var(--warn-soft); border-color: color-mix(in oklch, var(--warn) 22%, #fff); }
.alert-card--warn .lbl, .alert-card--warn .n { color: var(--warn); }
.alert-card--ok .n { color: var(--fg-soft); }

.gtable { width: 100%; border-collapse: collapse; }
.gtable th { text-align: left; font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing:.06em; color: var(--fg-muted); font-weight: 500; padding: 12px 16px; background: var(--bg-sunken); border-bottom: 1px solid var(--border); }
.gtable th.r, .gtable td.r { text-align: right; }
.gtable td.r { white-space: nowrap; }
.gtable td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.gtable tr:last-child td { border-bottom: none; }
.gtable tbody tr { transition: background .12s; }
.gtable tbody tr:hover { background: var(--bg-sunken); }
.gtable .nm { font-weight: 600; }
.gtable .mut { color: var(--fg-muted); }
.gtable .tnum { font-variant-numeric: tabular-nums; }
.gtable .low { color: var(--danger); font-weight: 600; }
/* ⚠️ Conserto 2026-07-31 (Teste de Multidão da tela do gestor, lente de celular).
   ANTES era `overflow: hidden`: no celular as colunas da direita eram CORTADAS e não
   havia como rolar até elas. Na tabela "Regras de repasse aos médicos" (6 colunas), as
   colunas "Procedimento" e "Repasse no mês" sumiam da tela do iPhone — não ficavam
   difíceis de ver, ficavam inalcançáveis.
   AGORA a tabela rola de lado dentro da própria moldura (a página não rola junto). */
.tbl-wrap { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }

/* ===== SITE ===== */
.site-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: var(--gap); align-items: start; }
.kv-line { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.kv-line__k { color: var(--fg-muted); }
.kv-line__v { font-weight: 600; }
.preview {
  background: var(--bg-inverse); border-radius: var(--radius-lg); overflow: hidden; color: #fff;
}
.preview__cap { padding: 22px 20px; text-align: center; background: linear-gradient(160deg, color-mix(in oklch, var(--brand) 40%, var(--bg-inverse)), var(--bg-inverse)); }
.preview__cap h4 { margin: 0; font-size: 18px; font-weight: 600; }
.preview__cap p { margin: 3px 0 0; font-size: 12px; opacity: 0.7; }
.preview__badge { display: inline-block; font-size: 10px; font-weight: 500; background: rgba(255,255,255,0.18); color: #fff; padding: 3px 10px; border-radius: 999px; margin-bottom: 9px; }
.preview__body { background: var(--bg-elev); color: var(--fg); padding: 18px 20px; }
.preview__body h5 { margin: 0 0 3px; font-size: 16px; font-weight: 600; }
.preview__body .sub { font-size: 12.5px; color: var(--fg-muted); margin-bottom: 14px; }
.preview__cta { display: block; width: 100%; text-align: center; padding: 12px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 600; font-size: 14px; }
.preview__docs { display: flex; gap: 8px; margin: 14px 0; }
.preview__docs .av { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 14px; }
.preview__meta { font-size: 12px; color: var(--fg-muted); }
.hint { font-size: 12.5px; color: var(--fg-muted); margin-top: 10px; }
.hint b { color: var(--fg); }

.brand-swatch { width: 52px; height: 30px; border-radius: 8px; border: 1px solid var(--border-strong); cursor: pointer; transition: box-shadow .14s; }
.brand-swatch.sel { box-shadow: 0 0 0 2px var(--bg-elev), 0 0 0 4px var(--fg); }
.brand-pick { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--fg-muted); padding: 6px 11px; border: 1px dashed var(--border-strong); border-radius: 8px; cursor: pointer; position: relative; }
.brand-pick:hover { border-color: var(--brand); color: var(--brand); }
.brand-pick input[type=color] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.brand-pick .dot { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--border-strong); }

/* redes sociais */
.social-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.social-av { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.social-row .fld__in { padding: 8px 11px; font-size: 13px; }
.social-plat { font-size: 11px; color: var(--fg-soft); font-weight: 600; min-width: 70px; }
.preview__social { display: flex; gap: 6px; margin: 12px 0 4px; }
.preview__social-av { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 11px; }

/* saudação Home */
.greeting { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 2px; }
.greeting h2 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.03em; }
.greeting h2 em { font-family: var(--font-display); font-style: italic; font-weight: 400; }
.greeting p { margin: 0; font-size: 14.5px; color: var(--fg-muted); }

/* simulador "e se?" */
.sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 16px 0 18px; }
.sim-control__top { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; margin-bottom: 9px; }
.sim-control__top b { font-weight: 600; }
.sim-control__v { font-weight: 600; color: var(--brand); font-variant-numeric: tabular-nums; font-size: 16px; }
.sim-control input[type=range] { width: 100%; accent-color: var(--brand); height: 6px; cursor: pointer; }
.sim-control__hint { font-size: 11.5px; color: var(--fg-soft); margin-top: 7px; font-family: var(--font-mono); }
.sim-result { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 16px; align-items: center; padding-top: 16px; border-top: 1px solid var(--border); }
.sim-res__l { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-soft); }
.sim-res__v { font-size: 25px; font-weight: 600; letter-spacing: -0.03em; margin-top: 3px; }
.sim-res__d { font-size: 12px; font-weight: 600; margin-top: 3px; }
.sim-res__d.up { color: var(--good); }
@media (max-width: 760px) { .sim-grid { grid-template-columns: 1fr; } .sim-result { grid-template-columns: 1fr 1fr; } }
.photo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.photo-slot {
  aspect-ratio: 4/3; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-sunken);
  display: grid; place-items: center; color: var(--fg-soft); position: relative; overflow: hidden;
  background-image: repeating-linear-gradient(135deg, var(--bg-sunken), var(--bg-sunken) 8px, color-mix(in oklch, var(--border) 50%, var(--bg-sunken)) 8px, color-mix(in oklch, var(--border) 50%, var(--bg-sunken)) 16px);
}
.photo-slot svg { width: 24px; height: 24px; }
.photo-slot--add { background: var(--bg-elev); border-style: dashed; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--fg-muted); gap: 6px; flex-direction: column; }
.photo-slot__star { position: absolute; top: 8px; left: 8px; font-size: 10.5px; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 3px 8px; border-radius: 999px; display: flex; align-items: center; gap: 4px; }

/* ===== CONFIGURAÇÕES ===== */
.doc-team { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.team-card { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.team-card__photo { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 18px; flex-shrink: 0; }
.team-card__body { flex: 1; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.team-card__body .fld__in { padding: 8px 11px; font-size: 13.5px; }

/* work hours table */
.wh { width: 100%; border-collapse: collapse; }
.wh th { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing:.05em; color: var(--fg-muted); font-weight: 500; padding: 8px 6px; text-align: center; }
.wh th:first-child { text-align: left; padding-left: 14px; }
.wh td { padding: 11px 6px; text-align: center; border-top: 1px solid var(--border); font-size: 13.5px; }
.wh td:first-child { text-align: left; padding-left: 14px; font-weight: 600; }
.wh__med { display: flex; align-items: center; gap: 9px; }
.wh__dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.wh .chk { width: 19px; height: 19px; border-radius: 5px; border: 1.5px solid var(--border-strong); display: inline-grid; place-items: center; cursor: pointer; }
.wh .chk.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.wh .chk svg { width: 12px; height: 12px; }
.wh .time { font-family: var(--font-mono); font-size: 12.5px; color: var(--brand); }

/* agent availability grid */
.avail { display: grid; grid-template-columns: 56px repeat(3, 1fr); gap: 6px; }
.avail__h { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing:.06em; color: var(--fg-muted); text-align: center; padding-bottom: 2px; }
.avail__row { font-size: 12.5px; font-weight: 600; color: var(--fg-muted); display: flex; align-items: center; }
.avail__cell { padding: 9px; border-radius: 9px; font-size: 12.5px; font-weight: 500; text-align: center; cursor: pointer; border: 1px solid transparent; transition: all .14s; }
.avail__cell.on { background: var(--good-soft); color: var(--good); border-color: color-mix(in oklch, var(--good) 25%, #fff); }
.avail__cell.off { background: var(--bg-sunken); color: var(--fg-soft); border-color: var(--border); }

/* plano de contas */
.ledger { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; }
.ledger-col__title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.ledger-col__title svg { width: 16px; height: 16px; }
.ledger-col__title.rev { color: var(--good); } .ledger-col__title.exp { color: var(--danger); }
.ledger-col__sub { font-size: 12.5px; color: var(--fg-muted); margin: 2px 0 12px; }
.ledger-group { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing:.06em; font-weight: 600; margin: 16px 0 4px; }
.ledger-group.rev { color: var(--good); } .ledger-group.exp { color: var(--danger); }
.ledger-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 4px 9px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.ledger-item:hover { background: var(--bg-sunken); }
.add-sub { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12.5px; font-weight: 500; color: var(--brand); padding: 6px 12px; border: 1px dashed var(--border-strong); border-radius: 8px; }
.add-sub:hover { background: var(--brand-softer); border-color: var(--brand); }

/* generic config list (centros de custo, convênios) */
.clist__item { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px 12px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.clist__item:last-of-type { border-bottom: none; }

/* repasse + permissões tables reuse .gtable */
.repasse-pct { width: 56px; padding: 6px 8px; font-size: 13px; text-align: right; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-sunken); font-variant-numeric: tabular-nums; outline: none; }
.repasse-pct:focus { border-color: var(--brand); background: var(--bg-elev); }

.integ3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }

/* config internal tabs */
.cfg-nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 0 14px; margin-bottom: 4px; background: color-mix(in oklch, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.cfg-nav__tabs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.cfg-nav__actions { display: flex; gap: 9px; align-items: center; }
.cfg-tab { display: inline-flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--fg-muted); border: 1px solid var(--border); background: var(--bg-elev); white-space: nowrap; transition: all .15s; }
.cfg-tab:hover { border-color: var(--border-strong); color: var(--fg); }
.cfg-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.cfg-tab svg { width: 15px; height: 15px; }
@media (max-width: 760px) { .cfg-nav__actions { width: 100%; } .cfg-nav__actions .btn-brand { flex: 1; } }

/* ===== PROFISSIONAIS (marketplace) ===== */
.docs-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.doc-search {
  flex: 1; min-width: 220px; max-width: 420px;
  display: flex; align-items: center; gap: 9px; padding: 10px 15px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px; color: var(--fg-soft); font-size: 14px;
}
.doc-search svg { width: 16px; height: 16px; }
.doc-search input { border: none; background: none; outline: none; flex: 1; font: inherit; color: var(--fg); }
.spec-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.docs-chip-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.docs-chip-lbl { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing:.07em; color: var(--fg-soft); display: inline-flex; align-items: center; gap: 6px; min-width: 96px; }
.docs-chip-lbl svg { width: 13px; height: 13px; color: var(--brand); }
@media (max-width: 560px) { .docs-chip-lbl { min-width: 0; width: 100%; } }
.spec-chip {
  padding: 8px 15px; border-radius: 999px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--fg-muted); white-space: nowrap;
  transition: all .15s;
}
.spec-chip:hover { border-color: var(--border-strong); color: var(--fg); }
.spec-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.compare-toggle { margin-left: auto; }

.docs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(252px, 1fr)); gap: var(--gap); }
.doc-card {
  position: relative; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px; display: flex; flex-direction: column; gap: 4px; cursor: pointer;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}
.doc-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-3px); }
.doc-card.selected { border-color: var(--brand); box-shadow: 0 0 0 1.5px var(--brand); }
.doc-card__check {
  position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border-radius: 7px;
  border: 1.5px solid var(--border-strong); background: var(--bg-elev); display: grid; place-items: center; color: #fff; z-index: 2;
}
.doc-card__check.on { background: var(--brand); border-color: var(--brand); }
.doc-card__check svg { width: 13px; height: 13px; }
.doc-card__av {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 23px; margin-bottom: 10px;
  background-size: cover; background-position: center;
}
.doc-card__name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.doc-card__spec { font-size: 13px; color: var(--brand); font-weight: 600; }
.doc-card__unit { font-size: 12.5px; color: var(--fg-muted); display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.doc-card__unit svg { width: 12px; height: 12px; }
.doc-card__metrics { display: flex; gap: 6px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.doc-card__tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.doc-tag { font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 999px; background: var(--bg-sunken); border: 1px solid var(--border); color: var(--fg-muted); white-space: nowrap; }
.doc-tag--sched { background: var(--brand-soft); border-color: transparent; color: var(--brand); display: inline-flex; align-items: center; gap: 4px; }
.doc-tag--sched svg { width: 11px; height: 11px; }
.doc-tag--more { color: var(--fg-soft); }
.doc-mini { flex: 1; text-align: center; }
.doc-mini__v { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.doc-mini__l { font-family: var(--font-mono); font-size: 9px; text-transform: uppercase; letter-spacing:.05em; color: var(--fg-soft); margin-top: 1px; }
.doc-card__status { position: absolute; top: 16px; left: 16px; width: 9px; height: 9px; border-radius: 50%; }

.docs-empty { padding: 60px 20px; text-align: center; color: var(--fg-muted); font-size: 15px; }
.doc-card__novo { position: absolute; top: 14px; right: 14px; font-size: 10.5px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 3px 9px; border-radius: 999px; }
.doc-card--add { align-items: center; justify-content: center; text-align: center; border-style: dashed; gap: 6px; }
.doc-card--add:hover { border-color: var(--brand); background: var(--brand-softer); }
.doc-card--add__ic { width: 48px; height: 48px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 8px; }
.doc-card--add__ic svg { width: 22px; height: 22px; }
.doc-card--add .doc-card__unit { color: var(--brand); font-weight: 600; }

/* ranking */
.rank-metrics { margin-left: auto; display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px; }
.rank-metrics button { padding: 6px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--fg-muted); }
.rank-metrics button.on { background: var(--brand); color: #fff; }
.rank-list { display: flex; flex-direction: column; }
.rank-row { display: grid; grid-template-columns: 42px 44px 1fr 150px 88px; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.rank-row:last-child { border-bottom: none; }
.rank-row:hover { background: var(--bg-sunken); }
.rank-pos { font-family: var(--font-mono); font-size: 16px; font-weight: 600; text-align: center; color: var(--fg-soft); display: grid; place-items: center; }
.rank-pos.medal { width: 30px; height: 30px; border-radius: 50%; margin: 0 auto; color: #fff; font-size: 14px; }
.rank-pos.m1 { background: #C9A227; } .rank-pos.m2 { background: #9AA0AE; } .rank-pos.m3 { background: #B97A56; }
.rank-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 16px; }
.rank-id__name { font-size: 14.5px; font-weight: 600; }
.rank-id__meta { font-size: 12px; color: var(--fg-muted); }
.rank-bar { height: 8px; border-radius: 999px; background: var(--bg-sunken); overflow: hidden; }
.rank-bar__fill { height: 100%; border-radius: 999px; transition: width .7s cubic-bezier(.2,.7,.2,1); }
.rank-val { text-align: right; font-size: 17px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
@media (max-width: 680px) {
  .rank-row { grid-template-columns: 34px 38px 1fr 80px; }
  .rank-row .rank-bar-cell { display: none; }
}

/* floating compare bar */
.compare-bar {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120%);
  background: var(--bg-inverse); color: #fff; border-radius: 999px; padding: 10px 12px 10px 18px;
  display: flex; align-items: center; gap: 16px; box-shadow: var(--shadow-lg); z-index: 80;
  transition: transform .3s cubic-bezier(.3,.8,.3,1);
}
.compare-bar.show { transform: translateX(-50%) translateY(0); }
.compare-bar__avs { display: flex; }
.compare-bar__avs .a { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; border: 2px solid var(--bg-inverse); margin-left: -8px; background-size: cover; }
.compare-bar__avs .a:first-child { margin-left: 0; }
.compare-bar__txt { font-size: 13.5px; }
.compare-bar__txt b { font-weight: 600; }
.compare-bar__clear { color: rgba(255,255,255,0.6); font-size: 13px; }
.compare-bar__clear:hover { color: #fff; }
.compare-bar__go { background: var(--brand); color: #fff; font-weight: 600; font-size: 13.5px; padding: 9px 18px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px; }
.compare-bar__go svg { width: 15px; height: 15px; }

/* ===== MODAL (perfil + comparação) ===== */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(10,14,26,0.5); backdrop-filter: blur(3px);
  z-index: 110; display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity .24s;
}
.modal-scrim.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--bg-elev); border-radius: var(--radius-xl); width: 100%; box-shadow: var(--shadow-lg);
  max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
  transform: translateY(12px) scale(.99); transition: transform .26s cubic-bezier(.3,.8,.3,1);
}
.modal-scrim.open .modal { transform: none; }
.modal--profile { max-width: 720px; }
.modal--compare { max-width: 920px; }
.modal__head { display: flex; align-items: flex-start; gap: 16px; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.modal__close { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; background: var(--bg-sunken); display: grid; place-items: center; color: var(--fg-muted); flex-shrink: 0; }
.modal__close:hover { background: var(--border); color: var(--fg); }
.modal__close svg { width: 16px; height: 16px; }
.modal__body { padding: 22px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 20px; }
.modal__foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; }

.profile-id { display: flex; align-items: center; gap: 16px; }
.profile-id__av { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 26px; flex-shrink: 0; background-size: cover; background-position: center; }
.profile-id__name { font-size: 23px; font-weight: 600; letter-spacing: -0.02em; }
.profile-id__meta { font-size: 13.5px; color: var(--fg-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.profile-id__meta .sep { color: var(--border-strong); }
.profile-occ { margin-left: auto; text-align: right; }
.profile-occ__v { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }
.profile-occ__l { font-family: var(--font-mono); font-size: 10px; text-transform: uppercase; letter-spacing:.06em; color: var(--fg-soft); }

.profile-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.profile-kpi { padding: 13px 15px; border-radius: 12px; background: var(--bg-sunken); border: 1px solid var(--border); }
.profile-kpi__v { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }
.profile-kpi__l { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing:.05em; color: var(--fg-soft); margin-top: 2px; }

/* compare table */
.cmp { display: grid; }
.cmp__head { display: grid; }
.cmp-doc { text-align: center; padding: 8px; }
.cmp-doc__av { width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 8px; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 18px; background-size: cover; }
.cmp-doc__name { font-size: 14px; font-weight: 600; }
.cmp-doc__spec { font-size: 11.5px; color: var(--brand); font-weight: 600; }
.cmp-row { display: grid; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.cmp-row__l { font-size: 12.5px; color: var(--fg-muted); font-weight: 500; }
.cmp-cell { text-align: center; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cmp-cell.best { color: var(--good); }
.cmp-cell.worst { color: var(--warn); }
.cmp-cell .tiny { display: block; font-size: 10px; font-weight: 500; color: var(--fg-soft); }

@media (max-width: 760px) {
  .profile-kpis { grid-template-columns: repeat(2, 1fr); }
  .profile-id { flex-wrap: wrap; }
  .profile-occ { margin-left: 0; }
}

@media (max-width: 1180px) {
  .fin3, .alert3, .form-grid--3, .integ3 { grid-template-columns: 1fr; }
  .ledger, .site-grid, .doc-team { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .form-grid { grid-template-columns: 1fr; }
  .meta-card { grid-template-columns: 1fr; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
  .wh { font-size: 12px; }
  .gtable th, .gtable td { padding: 10px 8px; font-size: 12.5px; }
  /* Onda V2.37: grade "dias e horários por médico" (.wh) tem 10 colunas — no celular
     ela cortava/espremia em vez de rolar. Wrapper .wh-wrap ganha scroll lateral só
     nesta largura; a tabela ganha min-width para as colunas não virarem ilegíveis. */
  .wh-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .wh { min-width: 620px; }
}

/* log de lançamentos */
.logfeed { margin-top: 12px; display: flex; flex-direction: column; }
.logfeed__row { display: flex; align-items: center; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.logfeed__row:last-child { border-bottom: none; }
.logfeed__dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.logfeed__dot.r { background: var(--good); }
.logfeed__dot.d { background: var(--danger); }
.logfeed__who { font-weight: 600; white-space: nowrap; }
.logfeed__act { color: var(--fg-muted); }
.logfeed__tag { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.logfeed__tag.r { background: var(--good-soft); color: var(--good); }
.logfeed__tag.d { background: var(--danger-soft); color: var(--danger); }
.logfeed__nm { color: var(--fg); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logfeed__val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.logfeed__when { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-soft); white-space: nowrap; }
@media (max-width: 680px) {
  .logfeed__row { flex-wrap: wrap; gap: 6px 9px; }
  .logfeed__nm { flex-basis: 100%; order: 5; }
  .logfeed__when { order: 6; }
}

/* receita do agente */
.agent-rev { position: relative; padding: var(--pad-card); display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; cursor: pointer; background: linear-gradient(120deg, var(--brand-softer), var(--bg-elev) 60%); border: 1px solid color-mix(in oklch, var(--brand) 22%, var(--border)); transition: border-color .16s, box-shadow .16s, transform .16s; }
.agent-rev:hover { border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.agent-rev__main { display: flex; align-items: center; gap: 16px; }
.agent-rev__ic { width: 50px; height: 50px; border-radius: 14px; background: var(--brand); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-brand); flex-shrink: 0; }
.agent-rev__ic svg { width: 24px; height: 24px; }
.agent-rev__l { font-family: var(--font-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-soft); }
.agent-rev__v { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; margin-top: 3px; }
.agent-rev__pct { font-size: 13px; font-weight: 600; color: var(--brand); background: var(--brand-soft); padding: 3px 10px; border-radius: 999px; vertical-align: middle; margin-left: 8px; }
.agent-rev__stats { display: flex; gap: 30px; }
.agent-rev__sv { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.agent-rev__sl { font-size: 11.5px; color: var(--fg-muted); margin-top: 1px; }
@media (max-width: 680px) {
  .agent-rev { flex-direction: column; align-items: flex-start; }
  .agent-rev__stats { gap: 22px; }
}

/* detecção de rede / filial */
.net-detect { display: flex; gap: 12px; align-items: flex-start; background: var(--brand-soft); border: 1px solid color-mix(in oklch, var(--brand) 30%, #fff); border-radius: 13px; padding: 14px 16px; margin-bottom: 16px; }
.net-detect__ic { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; flex-shrink: 0; }
.net-detect__ic svg { width: 17px; height: 17px; }
.net-detect__txt { font-size: 13.5px; line-height: 1.5; color: var(--fg); }
.netmode { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.netmode__opt { text-align: left; padding: 16px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--bg-elev); cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s; }
.netmode__opt:hover { border-color: var(--border-strong); }
.netmode__opt.on { border-color: var(--brand); background: var(--brand-softer); box-shadow: 0 0 0 1px var(--brand); }
.netmode__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.netmode__ic { width: 34px; height: 34px; border-radius: 10px; background: var(--bg-sunken); color: var(--brand); display: grid; place-items: center; }
.netmode__opt.on .netmode__ic { background: var(--brand); color: #fff; }
.netmode__ic svg { width: 17px; height: 17px; }
.netmode__price { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.netmode__price span { font-size: 11px; font-weight: 500; color: var(--fg-soft); }
.netmode__t { font-size: 15px; font-weight: 600; }
.netmode__d { font-size: 12.5px; color: var(--fg-muted); margin-top: 4px; line-height: 1.45; }
.net-inherit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.net-inherit__l { font-size: 12.5px; color: var(--fg-muted); font-weight: 500; }
@media (max-width: 560px) { .netmode { grid-template-columns: 1fr; } }

/* ===== BASE DE PACIENTES (acesso por perfil · LGPD) ===== */
.pac-access { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 18px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.pac-access .btn-brand { margin-left: auto; }
.pb-seal { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; line-height: 1.4; padding: 7px 13px; border-radius: 999px; }
.pb-seal svg { width: 15px; height: 15px; flex-shrink: 0; }
.pb-seal b { font-weight: 600; }
.pb-seal--med { background: color-mix(in oklab, var(--brand) 10%, transparent); color: var(--brand); }
.pb-seal--admin { background: var(--warn-soft, color-mix(in oklab, var(--warn) 14%, transparent)); color: var(--warn-ink, var(--warn)); }

.modal--patientbase { max-width: 1000px; width: 96vw; height: 88vh; max-height: 88vh; }
.pb-head { align-items: center; gap: 14px; }
.pb-title { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; display: flex; align-items: center; gap: 9px; }
.pb-title svg { width: 18px; height: 18px; color: var(--brand); }
.pb-head .pb-seal { margin-left: 4px; }
.pb-head .modal__close { margin-left: auto; }

.pb-toolbar { display: flex; align-items: center; gap: 14px; padding: 11px 20px; border-bottom: 1px solid var(--border); background: var(--bg); }
.pb-toolbar__txt { font-size: 12.5px; color: var(--fg-muted); font-weight: 500; }
.pb-export { margin-left: auto; position: relative; }
.pb-export__btn { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; padding: 7px 14px; }
.pb-export__btn svg { width: 15px; height: 15px; }
.pb-export__btn svg:last-child { width: 14px; height: 14px; opacity: .6; }
.pb-imp-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--brand); display: inline-block; animation: pbimpspin .7s linear infinite; }
@keyframes pbimpspin { to { transform: rotate(360deg); } }
.pb-export__scrim { position: fixed; inset: 0; z-index: 20; }
.pb-export__menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 21; width: 270px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 7px; }
.pb-export__head { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-soft); padding: 7px 9px 8px; }
.pb-export__opt { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: none; border: none; cursor: pointer; padding: 9px; border-radius: 10px; transition: background .14s; }
.pb-export__opt:hover { background: var(--bg-sunken); }
.pb-export__opt svg { width: 17px; height: 17px; color: var(--brand); flex-shrink: 0; }
.pb-export__opt span { display: flex; flex-direction: column; gap: 1px; }
.pb-export__opt b { font-size: 13.5px; font-weight: 600; }
.pb-export__opt i { font-size: 11.5px; color: var(--fg-muted); font-style: normal; }
.pb-export__sep { height: 1px; background: var(--border); margin: 5px 4px; }
.pb-export__note { display: flex; align-items: flex-start; gap: 8px; font-size: 11.5px; line-height: 1.45; padding: 10px 9px 7px; margin-top: 4px; border-top: 1px solid var(--border); }
.pb-export__note svg { width: 13px; height: 13px; flex-shrink: 0; margin-top: 1px; }
.pb-export__note.is-admin { color: var(--warn); }
.pb-export__note.is-med { color: var(--fg-muted); }
.pb-export__note.is-med svg { color: var(--brand); }

.pb-hero__acts { display: flex; align-items: center; gap: 6px; }
.pb-hero__btn { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: var(--bg); border: 1px solid var(--border); color: var(--fg-muted); cursor: pointer; transition: all .14s; flex-shrink: 0; }
.pb-hero__btn:hover { color: var(--brand); border-color: var(--border-strong); background: var(--bg-elev); }
.pb-hero__btn svg { width: 15px; height: 15px; }

.pb-body { flex: 1; display: grid; grid-template-columns: 296px 1fr; min-height: 0; }
.pb-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.pb-search { display: flex; align-items: center; gap: 9px; padding: 14px 18px; color: var(--fg-soft); }
.pb-search svg { width: 16px; height: 16px; flex-shrink: 0; }
.pb-search input { border: none; background: none; outline: none; font: inherit; font-size: 13.5px; color: var(--fg); width: 100%; }
.pb-list__count { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--fg-soft); padding: 0 18px 8px; }
.pb-list__scroll { overflow-y: auto; padding: 0 10px 10px; display: flex; flex-direction: column; gap: 1px; }
.pb-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; text-align: left; background: none; border: none; cursor: pointer; transition: background .14s; }
.pb-item:hover { background: var(--bg-elev); }
.pb-item.sel { background: var(--bg-elev); box-shadow: inset 0 0 0 1px var(--border), var(--shadow-sm); }
.pb-item__av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 13.5px; flex-shrink: 0; letter-spacing: 0.01em; }
.pb-item__txt { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.pb-item__nm { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-item__sub { font-size: 11.5px; color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pb-dot--good { background: var(--good); }
.pb-dot--soft { background: var(--border-strong); }
.pb-empty { padding: 24px 14px; text-align: center; color: var(--fg-muted); font-size: 13px; }

.pb-detail { display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--bg-elev); }
.pb-hero { display: flex; align-items: center; gap: 16px; padding: 24px 28px 20px; }
.pb-hero__av { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 20px; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.pb-hero__id { flex: 1; min-width: 0; }
.pb-hero__nm { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }
.pb-hero__facts { display: flex; align-items: center; gap: 9px; margin-top: 6px; font-size: 13px; color: var(--fg-muted); flex-wrap: wrap; }
.pb-hero__facts i { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); display: inline-block; }
.pb-chip { font-size: 11px; font-weight: 600; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }
.pb-chip--good { background: color-mix(in oklab, var(--good) 13%, transparent); color: var(--good); }
.pb-chip--brand { background: var(--brand-soft); color: var(--brand); }
.pb-chip--soft { background: var(--bg-sunken); color: var(--fg-muted); }

.pb-tabs { display: flex; gap: 2px; padding: 0 28px; border-bottom: 1px solid var(--border); }
.pb-tab { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; color: var(--fg-muted); background: none; border: none; cursor: pointer; padding: 11px 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .14s; }
.pb-tab svg { width: 15px; height: 15px; }
.pb-tab:hover { color: var(--fg); }
.pb-tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.pb-tab.locked { color: var(--fg-soft); }
.pb-tab.locked.on { color: var(--warn); border-bottom-color: var(--warn); }

.pb-tabbody { padding: 24px 28px 28px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 22px; }
.pb-group__t { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brand); margin-bottom: 4px; }
.pb-group__rows { display: flex; flex-direction: column; }
.pb-row { display: flex; align-items: baseline; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.pb-row:last-child { border-bottom: none; }
.pb-row__l { font-size: 13px; color: var(--fg-muted); width: 168px; flex-shrink: 0; }
.pb-row__v { font-size: 14px; color: var(--fg); font-weight: 500; text-align: right; margin-left: auto; }
.pb-row__v.mono { font-family: var(--font-mono, "Geist Mono", monospace); font-size: 13px; font-weight: 400; letter-spacing: -0.01em; }

.pb-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pb-stat { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 5px; }
.pb-stat__l { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-soft); }
.pb-stat__v { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.pb-stat__v.pos { color: var(--good); }
.pb-stat__v.neg { color: var(--danger); }

.pb-timeline { display: flex; flex-direction: column; }
.pb-tl { display: flex; gap: 14px; padding-bottom: 20px; position: relative; }
.pb-tl::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.pb-tl:last-child { padding-bottom: 0; }
.pb-tl:last-child::before { display: none; }
.pb-tl__dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; margin-top: 2px; z-index: 1; }
.pb-tl__dot.is-next { background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.pb-tl__dot.is-done { background: var(--bg-elev); border: 2px solid var(--border-strong); }
.pb-tl__top { display: flex; align-items: center; gap: 10px; }
.pb-tl__top b { font-size: 14px; font-weight: 600; }
.pb-tl__sub { font-size: 12.5px; color: var(--fg-muted); margin-top: 3px; }

.pb-locked { max-width: 470px; margin: 24px auto; text-align: center; display: flex; flex-direction: column; align-items: center; }
.pb-locked__ic { width: 56px; height: 56px; border-radius: 50%; background: var(--warn-soft, color-mix(in oklab, var(--warn) 13%, transparent)); color: var(--warn); display: grid; place-items: center; margin-bottom: 16px; }
.pb-locked__ic svg { width: 24px; height: 24px; }
.pb-locked__t { font-size: 19px; font-weight: 600; letter-spacing: -0.02em; }
.pb-locked__p { font-size: 13.5px; color: var(--fg-muted); line-height: 1.65; margin: 9px 0 18px; }
.pb-locked__items { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-bottom: 20px; }
.pb-locked__items span { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--fg-muted); }
.pb-locked__items svg { width: 14px; height: 14px; color: var(--danger); flex-shrink: 0; }
.pb-locked__foot { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--fg-soft); padding: 9px 14px; background: var(--bg-sunken); border-radius: 999px; }
.pb-locked__foot svg { width: 14px; height: 14px; flex-shrink: 0; }

.pb-prontuario { display: flex; flex-direction: column; gap: 18px; }
.pb-pr-block h5 { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--brand); margin-bottom: 6px; }
.pb-pr-block h5 svg { width: 14px; height: 14px; }
.pb-pr-block p { font-size: 14px; color: var(--fg); line-height: 1.6; }
.pb-prontuario .pb-locked__foot { align-self: flex-start; margin-top: 2px; }

@media (max-width: 720px) {
  .pb-body { grid-template-columns: 1fr; }
  .pb-list { display: none; }
  .pb-row { gap: 12px; }
  .pb-row__l { width: auto; }
  .pb-stats { grid-template-columns: 1fr; }
}

/* ===== ACESSO DAS SECRETÁRIAS (permissões concedidas pelo gestor) ===== */
.secacc { display: flex; flex-direction: column; gap: 22px; }
.fin-exec { display: flex; align-items: stretch; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 4px; margin-bottom: var(--gap); box-shadow: var(--shadow-sm); }
.conc-tot { display: flex; align-items: stretch; margin-top: 14px; background: var(--bg-sunken); border-radius: var(--radius-lg); padding: 4px; }
.conc-tot__item { flex: 1; display: flex; flex-direction: column; gap: 3px; padding: 12px 16px; }
.conc-tot__l { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-soft); }
.conc-tot__v { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.conc-tot__n { font-size: 11.5px; color: var(--fg-muted); }
.conc-tot__sep { width: 1px; background: var(--border); margin: 10px 0; }
.conc-tbl th.c, .conc-tbl td.c { text-align: center; }
.conc-pill { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.conc-pay { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.conc-pay.is-part { background: var(--brand-soft); color: var(--brand); }
.conc-pay.is-conv { background: color-mix(in oklab, var(--cat-3, #7C5CFF) 14%, transparent); color: var(--cat-3, #7C5CFF); }
@media (max-width: 640px) { .conc-tot { flex-direction: column; } .conc-tot__sep { width: auto; height: 1px; margin: 0 12px; } }
.fin-exec__item { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; min-width: 0; }
.fin-exec__l { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-soft); }
.fin-exec__v { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--fg); }
.fin-exec__v.pos { color: var(--good); }
.fin-exec__v.neg { color: var(--danger); }
.fin-exec__u { font-size: 60%; color: var(--fg-muted); margin-left: 1px; }
.fin-exec__sep { width: 1px; background: var(--border); margin: 12px 0; flex-shrink: 0; }
@media (max-width: 640px) { .fin-exec { flex-direction: column; } .fin-exec__sep { width: auto; height: 1px; margin: 0 12px; } }
.secacc__who { display: flex; gap: 12px; flex-wrap: wrap; }
.secacc__card { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--bg); cursor: pointer; transition: border-color .14s, box-shadow .14s; min-width: 220px; text-align: left; }
.secacc__card:hover { border-color: var(--border-strong); }
.secacc__card.on { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand), var(--shadow-sm); background: var(--bg-elev); }
.secacc__av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 15px; flex-shrink: 0; }
.secacc__id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.secacc__nm { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; }
.secacc__role { font-size: 11.5px; color: var(--fg-muted); }

.secacc__edit { display: flex; flex-direction: column; gap: 20px; }
.secacc__row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.secacc__lbl { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--fg-soft); }
.secacc__presets { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-t--static { cursor: default; }

.secacc__group { display: flex; flex-direction: column; gap: 10px; }
.secacc__pack { display: flex; flex-direction: column; gap: 4px; }
.secacc__packh { font-size: 13px; font-weight: 600; color: var(--fg); padding: 8px 0 2px; border-bottom: 1px solid var(--border); }
.secacc__warn { display: inline-flex; align-items: center; font-family: var(--font-mono, monospace); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--warn); background: color-mix(in oklab, var(--warn) 12%, transparent); padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle; }
.secacc__grouph { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--brand); }
.secacc__funcs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 28px; }
.secacc__func { display: flex; align-items: center; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.secacc__functxt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.secacc__functxt b { font-size: 13.5px; font-weight: 500; }
.secacc__functxt i { font-size: 11.5px; color: var(--fg-muted); font-style: normal; }

.secacc__chips { display: flex; gap: 8px; flex-wrap: wrap; }
.secacc__dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 2px; }

.secacc__foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 6px; }
.secacc__saved { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--good); font-weight: 500; }
.secacc__saved svg { width: 14px; height: 14px; }
.secacc__foot .btn-ghost { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; }
.secacc__foot .btn-ghost svg { width: 15px; height: 15px; }

@media (max-width: 720px) {
  .secacc__funcs { grid-template-columns: 1fr; }
  .secacc__foot .btn-ghost { margin-left: 0; }
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* ══ S6 · LOGS & AUDITORIA — port de gestor-auditoria.css ══════════════════ */
/* ══════════════════════════════════════════════════════════════════════════ */
.aud-kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gap); }
.aud-kpi { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; background: var(--bg-elev); border-left: 3px solid var(--border-strong); }
.aud-kpi--warn    { border-left-color: var(--warn); }
.aud-kpi--brand   { border-left-color: var(--brand); }
.aud-kpi--good    { border-left-color: var(--good); }
.aud-kpi--danger  { border-left-color: var(--danger); }
.aud-kpi--neutral { border-left-color: var(--fg-soft); }
.aud-kpi__ic { width: 32px; height: 32px; border-radius: 9px; background: var(--bg-sunken); color: var(--fg-muted); display: grid; place-items: center; margin-bottom: 10px; }
.aud-kpi__ic svg { width: 16px; height: 16px; }
.aud-kpi--danger .aud-kpi__ic { background: var(--danger-soft); color: var(--danger); }
.aud-kpi__v { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.aud-kpi__l { font-size: 11.5px; color: var(--fg-muted); margin-top: 2px; line-height: 1.3; }

.aud-risks { display: flex; flex-direction: column; gap: 9px; }
.aud-risk { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 12px; border: 1px solid color-mix(in oklch, var(--danger) 22%, var(--border)); background: var(--danger-soft); cursor: pointer; position: relative; transition: box-shadow .14s, transform .14s; }
.aud-risk:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.aud-risk__ic { width: 34px; height: 34px; border-radius: 9px; background: var(--bg-elev,#fff); color: var(--danger); display: grid; place-items: center; flex-shrink: 0; }
.aud-risk__ic svg { width: 17px; height: 17px; }
.aud-risk__body { flex: 1; min-width: 0; }
.aud-risk__t { font-size: 14px; font-weight: 600; color: var(--danger); }
.aud-risk__m { font-size: 12px; color: var(--fg-muted); margin-top: 1px; }
.aud-risk .clk__arrow { position: static; opacity: .5; }

.aud-toolbar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.aud-search { flex: 1; min-width: 220px; max-width: 460px; display: flex; align-items: center; gap: 9px; padding: 10px 15px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px; color: var(--fg-soft); }
.aud-search svg { width: 16px; height: 16px; }
.aud-search input { flex: 1; border: none; background: none; outline: none; font: inherit; font-size: 14px; color: var(--fg); }
.aud-only { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: var(--fg-muted); cursor: pointer; }
.aud-only input { width: 17px; height: 17px; }
.aud-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 10px; }

.aud-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.aud-row { display: flex; align-items: center; gap: 13px; padding: 13px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.aud-row:last-child { border-bottom: none; }
.aud-row:hover { background: var(--bg-sunken); }
.aud-row.risk { background: color-mix(in oklch, var(--danger) 5%, transparent); }
.aud-row.risk:hover { background: var(--danger-soft); }
.aud-row__ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }
.aud-row__ic svg { width: 17px; height: 17px; }
.aud-row__main { flex: 1; min-width: 0; }
.aud-row__top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aud-row__top b { font-size: 14px; font-weight: 600; }
.aud-row__papel { font-size: 11.5px; color: var(--fg-soft); }
.aud-tag { font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; }
.aud-tag svg { width: 11px; height: 11px; }
.aud-tag.sens { background: var(--warn-soft); color: var(--warn); }
.aud-tag.risk { background: var(--danger-soft); color: var(--danger); }
.aud-row__acao { font-size: 13px; color: var(--fg-muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aud-row__alvo { color: var(--fg); }
.aud-row__meta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.aud-row__cat { font-size: 11.5px; color: var(--fg-muted); }
.aud-sev { font-size: 10.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.aud-row__when { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-soft); white-space: nowrap; }

@media (max-width: 1100px) { .aud-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .aud-kpis { grid-template-columns: 1fr 1fr; }
  .aud-row__meta { flex-direction: column; align-items: flex-end; gap: 4px; }
  .aud-row__cat { display: none; }
}
