/* ─────────────────────────────────────────────────────────────────────
   Auditoria Médica — Portal BI CSC
   Paleta derivada da marca CSC Group (verde-oliva profundo).
   Densidade e vocabulário visual de dashboard analítico.
   ───────────────────────────────────────────────────────────────────── */

:root{
  /* ─── Marca CSC ─── */
  --csc-900:   #2D3A2E;       /* verde profundo da marca */
  --csc-700:   #3B4A3C;       /* verde CSC principal */
  --csc-500:   #5F7560;       /* verde médio */
  --csc-300:   #A9B9AC;       /* verde desbotado */
  --csc-100:   #DDE4DD;       /* verde-tint suave */
  --csc-50:    #EDF1EE;       /* verde-tint muito suave */

  /* ─── Base ─── */
  --ink:       #1F2621;       /* texto principal (quase preto com toque verde) */
  --ink-2:     #6A7470;       /* texto secundário */
  --ink-3:     #98A099;       /* texto terciário / placeholder */
  --paper:     #F4F6F4;       /* fundo app */
  --surface:   #FFFFFF;       /* cards / áreas de dado */
  --surface-2: #F9FAF9;       /* zebra sutil */
  --rule:      #E2E6E2;       /* hairline */
  --rule-soft: #EEF1EE;       /* separação sub */

  /* ─── Accent primário (CSC) ─── */
  --accent:    var(--csc-700);
  --accent-2:  var(--csc-500);
  --accent-soft: var(--csc-100);
  --accent-ink: #FFFFFF;

  /* ─── Accent analítico (BI) ─── */
  --info:      #3B7BA0;       /* azul petróleo — segunda cor de categoria */
  --info-soft: #E2ECF2;

  /* ─── Semânticos BI (vivos, não neon) ─── */
  --crit:      #C13A32;
  --crit-soft: #FBE7E5;
  --warn:      #D08A1F;
  --warn-soft: #FAEEDA;
  --ok:        #3E8057;
  --ok-soft:   #DEEDE3;

  /* ─── Trend indicators ─── */
  --trend-up:   var(--ok);
  --trend-down: var(--crit);

  /* Aliases legados */
  --bg: var(--paper);
  --text: var(--ink);
  --muted: var(--ink-2);
  --border: var(--rule);
  --surface2: var(--surface-2);
  --anchor: var(--accent);
  --anchor-soft: var(--accent-soft);
  --anchor-ink: var(--accent-ink);
  --rail: var(--csc-900);
  --rail-ink: #C5CEC6;
  --rail-active: var(--csc-700);
  --shadow:    0 1px 2px rgba(45,58,46,.04), 0 1px 3px rgba(45,58,46,.06);
  --shadow-sm: 0 1px 2px rgba(45,58,46,.05);
  --shadow-pop:0 12px 32px rgba(45,58,46,.12);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

/* ─── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body{
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.num, [data-num]{ font-variant-numeric: tabular-nums slashed-zero; }

a{ color: var(--accent); text-decoration: none; transition: color .12s; }
a:hover{ color: var(--csc-900); }

button, input, select, textarea { font: inherit; color: inherit; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
select { appearance: none; -webkit-appearance: none; }

:focus-visible{
  outline: 0;
  box-shadow: var(--ring);
  border-radius: 6px;
}

/* Scrollbar */
*{ scrollbar-width: thin; scrollbar-color: var(--rule) transparent; }
*::-webkit-scrollbar{ width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb{ background: var(--csc-300); border-radius: 999px; border: 2px solid var(--paper); }

/* ─── Shell ─────────────────────────────────────────────────────── */
.shell{
  min-height: 100vh;
  background: var(--paper);
  position: relative;
}
.main-col{
  display: flex; flex-direction: column;
  min-width: 0; min-height: 100vh;
  margin-left: 56px;
}

.content{
  flex: 1;
  width: 100%;
  padding: 20px 28px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ─── Rail lateral (fixo 56px, com flyouts) ─────────────────────── */
.rail{
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 56px;
  z-index: 50;
  background: var(--surface);
  border-right: 1px solid var(--rule);
  display: flex; flex-direction: column;
}

.rail-brand{
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: var(--ink);
  height: 56px;
  flex: 0 0 auto;
}
.rail-brand img{ height: 26px; width: auto; }

.rail-nav{
  flex: 1;
  overflow: visible;
  padding: 8px 8px;
  display: flex; flex-direction: column; gap: 4px;
}

/* Item (top-level) — sempre quadrado */
.rail-item{
  display: grid; place-items: center;
  width: 40px; height: 40px;
  color: var(--ink-2);
  text-decoration: none;
  border-radius: 8px;
  transition: background .12s, color .12s;
  position: relative;
  margin: 0 auto;
}
.rail-item:hover{
  background: var(--csc-50);
  color: var(--csc-700);
}
.rail-item.active{
  background: var(--csc-700);
  color: #fff;
}
.rail-item .ic{
  display: grid; place-items: center;
  width: 20px; height: 20px;
  flex: 0 0 auto;
}
.rail-item .badge{
  position: absolute;
  top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: inline-grid; place-items: center;
  font-size: 9px; font-weight: 700;
  color: #fff; background: var(--crit);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  border: 2px solid var(--surface);
}

/* Tooltip no hover do item simples (sem flyout) */
.rail-item[data-tip]::after{
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 10px); top: 50%;
  transform: translateY(-50%);
  background: var(--ink); color: #fff;
  padding: 5px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 500;
  white-space: nowrap;
  opacity: 0; visibility: hidden;
  pointer-events: none;
  transition: opacity .12s;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  z-index: 60;
}
.rail-item[data-tip]:hover::after{ opacity: 1; visibility: visible; }

/* ─── Grupo com flyout lateral ──────────────────────────────────── */
.rail-group{
  position: relative;
  margin: 0 auto;
}
.rail-group > .rail-item{
  /* reutiliza o estilo do item top-level */
}

.rail-flyout{
  position: absolute;
  left: calc(100% + 1px); top: -4px;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  box-shadow: 12px 10px 24px rgba(31,38,33,.12);
  padding: 8px;
  opacity: 0; visibility: hidden;
  transform: translateX(-4px);
  transition: opacity .12s, transform .12s, visibility 0s linear .12s;
  z-index: 55;
}
/* Ponte invisível que evita fechar quando atravessa o gap */
.rail-flyout::before{
  content: "";
  position: absolute;
  left: -12px; top: 0; bottom: 0;
  width: 12px;
}
.rail-group:hover .rail-flyout{
  opacity: 1; visibility: visible;
  transform: translateX(0);
  transition: opacity .12s, transform .12s, visibility 0s;
}

.rail-flyout-head{
  padding: 8px 12px 10px;
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3);
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 6px;
}

.rail-subitem{
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  border-radius: 6px;
  transition: background .12s, color .12s;
  position: relative;
}
.rail-subitem:hover{ background: var(--csc-50); color: var(--csc-700); }
.rail-subitem.active{ background: var(--csc-50); color: var(--csc-700); font-weight: 600; }
.rail-subitem.active::before{
  content: "";
  position: absolute; left: 0; top: 7px; bottom: 7px;
  width: 2px; background: var(--csc-700);
  border-radius: 0 2px 2px 0;
}
.rail-subitem .ic{
  display: grid; place-items: center;
  width: 18px; height: 18px;
  color: currentColor; flex: 0 0 auto;
  opacity: .8;
}
.rail-subitem.active .ic{ opacity: 1; }
.rail-subitem .lb{ flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-subitem .badge{
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-grid; place-items: center;
  font-size: 10px; font-weight: 700;
  color: #fff; background: var(--crit);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

/* ─── User menu no topbar (dropdown) ─────────────────────────────── */
.user-menu{ position: relative; }
.user-menu-trigger{
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.user-menu-trigger:hover{ background: var(--paper); border-color: var(--rule); }
.user-menu-trigger .avatar{
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--csc-700); color: #fff;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700;
  flex: 0 0 auto;
}
.user-menu-trigger .nm{
  font-size: 12px; font-weight: 500; color: var(--ink);
  white-space: nowrap;
}
.user-menu-trigger .chev{
  color: var(--ink-3); transition: transform .12s;
}
.user-menu[data-open="true"] .user-menu-trigger .chev{ transform: rotate(180deg); }

.user-menu-pop{
  position: absolute;
  top: calc(100% + 8px); right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(31,38,33,.14);
  padding: 6px;
  opacity: 0; visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .12s, transform .12s, visibility 0s linear .12s;
  z-index: 60;
}
.user-menu[data-open="true"] .user-menu-pop{
  opacity: 1; visibility: visible;
  transform: translateY(0);
  transition: opacity .12s, transform .12s, visibility 0s;
}
.user-menu-pop .uhead{
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 4px;
}
.user-menu-pop .uhead .nm{ font-size: 13px; font-weight: 600; color: var(--ink); }
.user-menu-pop .uhead .em{ font-size: 11px; color: var(--ink-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.user-menu-pop .uhead .rl{
  display: inline-block; margin-top: 6px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--csc-700); background: var(--csc-50);
  padding: 2px 8px; border-radius: 999px;
}
.user-menu-pop a, .user-menu-pop button{
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0; background: transparent;
  color: var(--ink); font-size: 13px; font-weight: 500;
  text-align: left;
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background .1s, color .1s;
}
.user-menu-pop a:hover, .user-menu-pop button:hover{ background: var(--paper); color: var(--csc-700); }
.user-menu-pop button.danger{ color: var(--crit); }
.user-menu-pop button.danger:hover{ background: var(--crit-soft); color: var(--crit); }
.user-menu-pop svg{ width: 14px; height: 14px; color: currentColor; opacity: .8; }

/* ─── Topbar ────────────────────────────────────────────────────── */
.topbar{
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding: 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 10;
}
.topbar-crumbs{
  display: flex; align-items: center; gap: 6px;
  min-width: 0; flex: 1;
  font-size: 13px; color: var(--ink-2);
}
.topbar-crumbs a{ color: var(--ink-2); text-decoration: none; }
.topbar-crumbs a:hover{ color: var(--csc-700); }
.topbar-crumbs .sep{ color: var(--ink-3); }
.topbar-crumbs .cur{ color: var(--ink); font-weight: 600; }
.topbar-actions{
  display: flex; align-items: center; gap: 8px;
}
.topbar-actions .ibtn{
  position: relative;
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--rule); border-radius: 6px;
  color: var(--ink-2); cursor: pointer; background: var(--surface);
  text-decoration: none;
  transition: color .12s, border-color .12s;
}
.topbar-actions .ibtn:hover{ color: var(--csc-700); border-color: var(--csc-700); }
.topbar-actions .ibtn .dot{
  position: absolute; top: 4px; right: 4px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--crit);
  border: 2px solid var(--surface);
}

/* ─── Page head ─────────────────────────────────────────────────── */
.page-head{
  display: flex; justify-content: space-between; align-items: center;
  gap: 24px; flex-wrap: wrap;
  padding: 4px 0 12px;
}
.page-head h1{
  margin: 0;
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.page-head .lede{
  color: var(--ink-2); font-size: 13px;
  margin-top: 4px;
}
.page-head .actions{
  display: flex; gap: 8px; align-items: center;
}

/* Legados: title-row/.sub/.pills */
.title-row{ display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding: 4px 0 12px; }
.title-row h1{ margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.005em; color: var(--ink); }
.title-row .sub{ color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.pills{ display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill-info{
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 6px; padding: 5px 10px;
}

/* ─── KPIs BI com trend indicator ───────────────────────────────── */
.kpis{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.kpi{
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 14px 16px 16px;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .12s, transform .12s;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.kpi:hover{
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.kpi-top{
  display: flex; justify-content: space-between; align-items: flex-start;
}
.kpi-label{
  font-size: 11px;
  color: var(--ink-2); font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
}
.kpi-value{
  font-size: 28px; font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.kpi-hint{
  font-size: 11px; color: var(--ink-2);
  display: flex; align-items: center; gap: 6px;
  margin-top: auto;
}
.kpi-trend{
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 11px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
  font-variant-numeric: tabular-nums;
}
.kpi-trend.up{   color: var(--ok);   background: var(--ok-soft); }
.kpi-trend.down{ color: var(--crit); background: var(--crit-soft); }
.kpi-trend.flat{ color: var(--ink-2); background: var(--surface-2); }
.kpi-icon{
  width: 24px; height: 24px; border-radius: 6px;
  display: grid; place-items: center;
  color: var(--csc-700); background: var(--csc-50);
}
.kpi-icon.crit{ color: var(--crit); background: var(--crit-soft); }
.kpi-icon.warn{ color: var(--warn); background: var(--warn-soft); }
.kpi-icon.ok{   color: var(--ok);   background: var(--ok-soft); }
.kpi-icon.info{ color: var(--info); background: var(--info-soft); }

/* Sparkline */
.spark{ height: 24px; width: 100%; display: block; margin-top: 6px; }

/* Scoreboard (mantido para compatibilidade) */
.scoreboard{ display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.score{
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  padding: 14px 16px 16px; text-decoration: none; color: var(--ink);
  cursor: pointer; transition: border-color .12s, transform .12s; box-shadow: var(--shadow-sm);
}
.score:hover{ border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow); }
.score-lb{ font-size: 11px; color: var(--ink-2); font-weight: 500; }
.score-val{ font-size: 28px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -0.015em; }
.score-val.is-crit{ color: var(--crit); }
.score-val.is-warn{ color: var(--warn); }
.score-val.is-ok{   color: var(--ok); }
.score-hint{ font-size: 11px; color: var(--ink-2); }

/* ─── Cards BI ──────────────────────────────────────────────────── */
.card, .dcard{
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow-sm);
}
.card h2, .dcard h2{
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  color: var(--ink);
}
.card-head{
  display: flex; justify-content: space-between; align-items: center;
}
.card-head .aside, .card-head span, .card-head a.card-link{
  font-size: 11px; color: var(--ink-2);
}
.card-head a.card-link{ color: var(--accent); font-weight: 500; }
.card-head a.card-link:hover{ color: var(--csc-900); }

.dcard .field{
  display: grid; grid-template-columns: 140px minmax(0,1fr);
  gap: 16px; font-size: 13px;
  border-top: 1px solid var(--rule-soft); padding-top: 8px;
}
.dcard .field .k{ color: var(--ink-2); font-size: 12px; }
.dcard .field .v{ font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.grid2{ display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.grid3{ display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }

/* ─── Section ──────────────────────────────────────────────────── */
.section{ display: flex; flex-direction: column; gap: 10px; }
/* Tabela de ranking compacta — 3 colunas (nome, contagem, %).
   Usada nas "Top N" do analítico sem precisar da pesagem completa do DataTables. */
.tbl-rank{
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.tbl-rank thead tr{
  text-align: left;
  color: var(--ink-2);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--rule-soft);
}
.tbl-rank th{ padding: 8px 10px; font-weight: 600; }
.tbl-rank td{ padding: 7px 10px; }
.tbl-rank tr{ border-bottom: 1px solid var(--rule-soft); }
.tbl-rank .nm{
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tbl-rank .n{
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.tbl-rank .p{
  text-align: right;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.tbl-rank .empty{ padding: 16px; text-align: center; color: var(--ink-2); }

/* Barra horizontal para distribuições (regime, etc.) — rótulo | barra | valor. */
.rank-bar{
  display: grid;
  grid-template-columns: 160px minmax(0,1fr) 92px;
  align-items: center;
  gap: 12px;
}
.rank-bar .lb{
  font-size: 12px; font-weight: 600; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.rank-bar .bar{
  height: 14px; border-radius: 3px; background: var(--rule-soft);
  position: relative; overflow: hidden;
}
.rank-bar .bar > i{
  position: absolute; inset: 0; background: var(--accent); display: block;
}
.rank-bar .val{
  font-variant-numeric: tabular-nums; font-weight: 600;
  text-align: right; font-size: 13px;
}
.rank-bar .val small{ color: var(--ink-2); font-weight: 400; }

/* Sub-section label (sobrinho tipográfico) — all-caps 13px.
   Usado para indicar blocos internos de uma mesma página (ex: "Em curso · agora",
   "Histórico · alta registrada") sem competir com o título principal. */
.section-head.eyebrow h2{
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Pill "em stand-by" — marca espaço reservado para indicadores ainda sem fonte de dado. */
.pill-standby{
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--rule-soft);
  color: var(--ink-2);
  font-weight: 600;
}

/* Display numérico — reaproveita o DNA do .kpi-value (IBM Plex, tabular, 28/600).
   Variante .sm (22px) para números secundários. .crit/.ok para tom semântico. */
.display-num{
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.display-num.sm{ font-size: 22px; }
.display-num.crit{ color: var(--crit); }
.display-num.ok{   color: var(--ok); }
.display-num .unit{
  font-size: 12px; color: var(--ink-2); font-weight: 400;
  letter-spacing: 0; margin-left: 2px;
}

.section-head{
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 8px; border-bottom: 1px solid var(--rule);
}
.section-head h2{ margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.section-head .aside{ font-size: 11px; color: var(--ink-2); }

/* ─── Toolbar BI (filtros globais da página) ────────────────────── */
.toolbar{
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.toolbar .lb{
  font-size: 11px; color: var(--ink-2); font-weight: 500;
  padding-right: 4px;
}
.toolbar select, .toolbar .slicer{
  height: 30px; padding: 0 28px 0 10px;
  border: 1px solid var(--rule); background: var(--paper);
  color: var(--ink); border-radius: 6px;
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236A7470' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.toolbar select:hover, .toolbar .slicer:hover{ border-color: var(--accent); }
.toolbar select:focus{ border-color: var(--accent); outline: 0; }
.toolbar .sep{ width: 1px; height: 20px; background: var(--rule); margin: 0 4px; }
.toolbar .right{ margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* ─── Provider bar (BI) ─────────────────────────────────────────── */
.prov-row{
  display: grid; grid-template-columns: minmax(0,1.3fr) minmax(0,2fr) 48px;
  gap: 12px; align-items: center;
  border: 0; background: transparent; padding: 8px 0;
  cursor: pointer; text-align: left; color: inherit;
  border-top: 1px solid var(--rule-soft);
  text-decoration: none;
  transition: color .12s;
}
.prov-row:first-child{ border-top: 0; }
.prov-row:hover{ color: var(--accent); }
.prov-row .nm{ font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prov-bar{ height: 8px; background: var(--rule-soft); border-radius: 4px; overflow: hidden; display: flex; }
.prov-bar span{ display: block; height: 100%; }
.prov-count{
  font-size: 13px; font-weight: 600; text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.legend{ display: flex; gap: 14px; font-size: 11px; color: var(--ink-2); flex-wrap: wrap; }
.legend span{ display: inline-flex; align-items: center; gap: 5px; }
.legend em{ display: inline-block; width: 8px; height: 8px; border-radius: 2px; font-style: normal; }

/* ─── Histograma / barras ───────────────────────────────────────── */
.histo{
  display: grid; grid-template-columns: repeat(4,1fr); gap: 12px;
  align-items: end; height: 140px; padding-top: 6px;
}
.histo a, .histo button{
  display: flex; flex-direction: column; justify-content: flex-end;
  align-items: stretch; gap: 6px; height: 100%;
  border: 0; background: transparent; padding: 0;
  cursor: pointer; color: inherit; text-decoration: none;
  transition: opacity .12s;
}
.histo a:hover, .histo button:hover{ opacity: .82; }
.histo .cnt{
  font-size: 15px; font-weight: 600; text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.histo .bar{ min-height: 3px; border-radius: 3px 3px 0 0; }
.histo .lb{ font-size: 11px; color: var(--ink-2); text-align: center; }

/* ─── Donut (novo) ───────────────────────────────────────────────── */
.donut-wrap{
  display: flex; align-items: center; gap: 20px;
}
.donut{
  width: 140px; height: 140px; flex: 0 0 auto;
  position: relative;
}
.donut svg{ width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .total{
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.donut .total .n{ font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1; }
.donut .total .l{ font-size: 10px; color: var(--ink-2); margin-top: 2px; letter-spacing: 0.02em; }
.donut-legend{ display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 0; }
.donut-legend .it{
  display: grid; grid-template-columns: 10px 1fr auto auto; gap: 8px;
  align-items: center; font-size: 12px;
}
.donut-legend .it .sw{ width: 10px; height: 10px; border-radius: 2px; }
.donut-legend .it .n{ font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.donut-legend .it .p{ font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 40px; text-align: right; }

/* ─── Sparkline inline ──────────────────────────────────────────── */
.sparkline{ height: 32px; width: 100%; }

/* ─── Top list (compacta BI) ────────────────────────────────────── */
.toplist{ display: flex; flex-direction: column; }
.top-row{
  display: grid; grid-template-columns: minmax(0,1fr) auto auto;
  gap: 12px; align-items: center;
  border: 0; background: transparent; padding: 8px 0;
  cursor: pointer; text-align: left; color: inherit;
  border-top: 1px solid var(--rule-soft);
  text-decoration: none;
}
.top-row:first-child{ border-top: 0; }
.top-row:hover .nm{ color: var(--accent); }
.top-row .nm{ display: block; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .12s; }
.top-row .sub{ display: block; font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

/* ─── Pills (carimbos semânticos) ───────────────────────────────── */
.pill{
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  font-weight: 600; white-space: nowrap;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.pill .dot{ width: 6px; height: 6px; border-radius: 50%; }
.pill.crit{  background: var(--crit-soft);   color: var(--crit); }
.pill.crit .dot{  background: var(--crit); }
.pill.warn{  background: var(--warn-soft);   color: var(--warn); }
.pill.warn .dot{  background: var(--warn); }
.pill.ok{    background: var(--ok-soft);     color: var(--ok); }
.pill.ok .dot{    background: var(--ok); }
.pill.muted{ background: var(--surface-2);   color: var(--ink-2); border: 1px solid var(--rule); }
.pill.muted .dot{ background: var(--ink-2); }
.pill.accent{ background: var(--csc-100);    color: var(--csc-700); }
.pill.accent .dot{ background: var(--csc-700); }
.pill.info{   background: var(--info-soft);  color: var(--info); }
.pill.info .dot{   background: var(--info); }

/* ─── Chips (filtros tipo slicer BI) ────────────────────────────── */
.chips{
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.chip{
  padding: 5px 10px;
  border: 1px solid var(--rule); background: var(--surface);
  color: var(--ink-2); font-weight: 500; cursor: pointer;
  font-size: 12px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px;
  transition: all .12s;
}
.chip:hover{ color: var(--ink); border-color: var(--ink-2); }
.chip.active{ color: var(--surface); background: var(--csc-700); border-color: var(--csc-700); font-weight: 600; }
.chip.crit.active{   background: var(--crit); border-color: var(--crit); }
.chip.warn.active{   background: var(--warn); border-color: var(--warn); color: #fff; }
.chip.ok.active{     background: var(--ok);   border-color: var(--ok); }
.chip.accent.active{ background: var(--csc-700); border-color: var(--csc-700); }
.chip .ct{ font-weight: 600; opacity: .75; font-variant-numeric: tabular-nums; }
.chip.active .ct{ opacity: .85; }
.chip-sep{ width: 1px; height: 18px; background: var(--rule); margin: 0 6px; }
.chip-clear{ color: var(--accent); font-size: 11px; margin-left: 4px; cursor: pointer; }
.chip-clear:hover{ color: var(--csc-900); }

/* ─── Tabela densa BI ───────────────────────────────────────────── */
.tbl-card{
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.tbl-toolbar{
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
  background: var(--surface);
}
.tbl-toolbar .tt{
  font-weight: 600; display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: var(--ink);
}
.tbl-toolbar .tt .ic{ color: var(--accent); display: grid; }
.tbl-toolbar .tt .cnt{ color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.tbl-toolbar .sel{ position: relative; display: inline-grid; }
.tbl-toolbar select{
  border: 1px solid var(--rule); background: var(--paper);
  border-radius: 6px; padding: 6px 26px 6px 10px;
  cursor: pointer; color: var(--ink); font-size: 12px; font-weight: 500;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236A7470' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.tbl-toolbar select:hover{ border-color: var(--accent); }
.tbl-toolbar select:focus{ border-color: var(--accent); outline: 0; }
.tbl-toolbar .btn-csv, .tbl-toolbar .btn-primary{
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--rule); background: var(--surface);
  border-radius: 6px; padding: 6px 12px;
  cursor: pointer; font-size: 12px; font-weight: 500;
  text-decoration: none; color: var(--ink);
  transition: all .12s;
}
.tbl-toolbar .btn-csv:hover{ border-color: var(--accent); color: var(--accent); }
.tbl-toolbar .btn-primary{
  background: var(--csc-700); color: #fff; border-color: var(--csc-700);
}
.tbl-toolbar .btn-primary:hover{
  background: var(--csc-900); border-color: var(--csc-900);
}

.tbl-search{
  display: flex; align-items: center; gap: 6px;
  background: var(--paper);
  border: 1px solid var(--rule); border-radius: 6px;
  padding: 0 10px; height: 30px;
  flex: 0 1 240px; min-width: 140px;
  transition: border-color .12s;
}
.tbl-search:focus-within{ border-color: var(--accent); }
.tbl-search input{ border: 0; outline: 0; background: transparent; width: 100%; font-size: 12px; }
.tbl-search svg{ color: var(--ink-2); flex: 0 0 auto; }

.tbl-scroll{ overflow-x: auto; }

.thead{
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  display: grid;
  position: sticky; top: 0; z-index: 1;
}
.th{
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px;
  border: 0; background: transparent;
  cursor: pointer;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em; text-transform: none;
  color: var(--ink-2); white-space: nowrap;
  text-decoration: none;
  transition: color .12s;
}
.th.active{ color: var(--csc-700); }
.th.right{ justify-content: flex-end; text-align: right; }
.th:hover{ color: var(--ink); }
.th .sort-i{ opacity: .4; display: grid; }
.th.active .sort-i{ opacity: 1; color: var(--csc-700); }

.trow{
  width: 100%;
  display: grid; align-items: center;
  border: 0; border-bottom: 1px solid var(--rule-soft);
  background: var(--surface);
  cursor: pointer; text-align: left;
  font-size: 12px; color: var(--ink);
  text-decoration: none;
  transition: background .1s;
  position: relative;
}
.trow:last-child{ border-bottom: 0; }
.trow.zebra{ background: var(--surface-2); }
.trow:hover{ background: var(--csc-50); }
.trow span{ padding: 9px 12px; }
.trow .right{ text-align: right; font-variant-numeric: tabular-nums; }
.trow .nowrap{ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .muted{ color: var(--ink-2); }
.trow .num{ font-variant-numeric: tabular-nums; }

/* Ações na linha (reveal on hover) */
.trow .row-actions{
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  display: flex; gap: 4px; opacity: 0;
  background: linear-gradient(90deg, transparent, var(--csc-50) 40%);
  padding: 4px 4px 4px 32px;
  pointer-events: none;
  transition: opacity .12s;
}
.trow:hover .row-actions{ opacity: 1; pointer-events: auto; }
.trow .row-actions button, .trow .row-actions a{
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 1px solid var(--rule); background: var(--surface);
  border-radius: 4px; color: var(--ink-2); cursor: pointer;
  transition: color .12s, border-color .12s;
}
.trow .row-actions button:hover, .trow .row-actions a:hover{
  color: var(--accent); border-color: var(--accent);
}

.tbl-foot{
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--rule);
  flex-wrap: wrap;
  background: var(--paper);
}
.tbl-foot .range{ font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tbl-foot .pg{
  min-width: 28px; height: 28px; padding: 0 8px;
  border: 1px solid var(--rule); background: var(--surface);
  color: var(--ink-2); border-radius: 4px;
  cursor: pointer; font-weight: 600; font-size: 11px;
  display: inline-grid; place-items: center;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: all .12s;
}
.tbl-foot .pg:hover{ border-color: var(--accent); color: var(--accent); }
.tbl-foot .pg.active{ background: var(--csc-700); color: #fff; border-color: var(--csc-700); }
.tbl-foot .pg.disabled{ opacity: .35; pointer-events: none; }

/* ─── Avatar ─────────────────────────────────────────────────────── */
.avatar{
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700;
  letter-spacing: -0.02em;
  flex: 0 0 auto;
}
.avatar.crit{  background: var(--crit-soft);  color: var(--crit); }
.avatar.warn{  background: var(--warn-soft);  color: var(--warn); }
.avatar.ok{    background: var(--ok-soft);    color: var(--ok); }
.avatar.muted{ background: var(--surface-2);  color: var(--ink-2); border: 1px solid var(--rule); }
.avatar.accent{background: var(--csc-100);    color: var(--csc-700); }

.cell{ min-width: 0; display: flex; align-items: center; gap: 10px; }
.cell .nm{ display: block; font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .sub{ display: block; font-size: 10px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }

/* LOS bar */
.los-wrap{ display: flex; align-items: center; gap: 8px; }
.los-bar{ flex: 1; height: 4px; background: var(--rule-soft); border-radius: 2px; overflow: hidden; }
.los-bar span{ display: block; height: 100%; }
.los-txt{ font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

/* ─── Empty state ───────────────────────────────────────────────── */
.empty{
  padding: 44px 24px;
  text-align: center;
  color: var(--ink-2);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty .ic{
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--csc-50); color: var(--csc-500);
  display: grid; place-items: center;
}
.empty img.illu{
  width: 140px; height: auto; display: block;
  margin-bottom: 4px;
  opacity: .95;
}
.empty h3{ margin: 0; font-size: 13px; font-weight: 600; color: var(--ink); }
.empty p{ margin: 0; font-size: 12px; max-width: 42ch; }
.empty a{ color: var(--accent); font-weight: 500; }

/* ─── Stats row (resumo acima de listas) ────────────────────────── */
.stats-row{
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.stats-row .stat-card{
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow-sm);
}
.stats-row .stat-card .lb{
  font-size: 11px; color: var(--ink-2); font-weight: 500;
  text-transform: none; letter-spacing: 0;
}
.stats-row .stat-card .vl{
  font-size: 20px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

/* ─── Footer ─────────────────────────────────────────────────────── */
.footer{
  background: var(--surface);
  border-top: 1px solid var(--rule);
  padding: 14px 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 11px; color: var(--ink-3);
}
.footer .powered{
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink-2); font-size: 11px;
  text-decoration: none;
  margin-left: auto;
}
.footer .powered:hover{ color: var(--ink); }
.footer .powered img{ height: 20px; width: auto; display: block; }

/* ─── Botões ─────────────────────────────────────────────────────── */
.btn{
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px;
  border-radius: 6px; cursor: pointer;
  font-weight: 500; font-size: 12px;
  text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule);
  transition: border-color .12s, background .12s, color .12s;
  box-shadow: none;
}
.btn:hover{ border-color: var(--accent); color: var(--accent); }
.btn.primary{
  background: var(--csc-700); color: #fff; border-color: var(--csc-700);
}
.btn.primary:hover{
  background: var(--csc-900); border-color: var(--csc-900); color: #fff;
}
.btn.danger{ color: var(--crit); border-color: color-mix(in srgb, var(--crit) 40%, var(--rule)); }
.btn.danger:hover{ background: var(--crit); color: #fff; border-color: var(--crit); }
.btn.ghost{ background: transparent; border-color: transparent; }
.btn.ghost:hover{ border-color: var(--rule); background: var(--surface); color: var(--ink); }

.btn-back{
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--rule); background: var(--surface);
  border-radius: 6px; padding: 6px 12px;
  cursor: pointer; font-weight: 500; color: var(--ink);
  text-decoration: none; font-size: 12px;
}
.btn-back:hover{ border-color: var(--accent); color: var(--accent); }

/* ─── Detalhe ────────────────────────────────────────────────────── */
.detail-top{
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-bottom: 12px; border-bottom: 1px solid var(--rule);
}
.stats{
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}
.stat{
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: 8px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--shadow-sm);
}
.stat .lb{ display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--ink-2); font-weight: 500; }
.stat .vl{ font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -0.015em; }
.stat .vl .un{ font-size: 12px; font-weight: 400; color: var(--ink-2); }

.dcards{ display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }

.timeline{ display: flex; flex-direction: column; }
.tl-item{ display: grid; grid-template-columns: 22px minmax(0,1fr); gap: 12px; }
.tl-item .dotcol{ display: flex; flex-direction: column; align-items: center; }
.tl-item .dotcol .d{ width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: 0 0 auto; border: 2px solid var(--surface); box-shadow: 0 0 0 1px currentColor; }
.tl-item .dotcol .ln{ width: 1px; flex: 1; background: var(--rule); margin: 4px 0; }
.tl-item .bd{ padding-bottom: 14px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px 12px; }

/* ─── Flash ──────────────────────────────────────────────────────── */
.flash{
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--rule);
  border-left-width: 3px;
  background: var(--surface);
}
.flash.ok{ border-left-color: var(--ok); color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 25%, var(--rule)); border-left-color: var(--ok); }
.flash.err{ border-left-color: var(--crit); color: var(--crit); background: var(--crit-soft); border-color: color-mix(in srgb, var(--crit) 25%, var(--rule)); border-left-color: var(--crit); }

/* ─── Params ─────────────────────────────────────────────────────── */
.params{ display: grid; grid-template-columns: minmax(240px, 280px) 1fr; gap: 16px; align-items: start; }
.params .plist{ background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; display: flex; flex-direction: column; position: sticky; top: 72px; box-shadow: var(--shadow-sm); }
.params .plist-head{ padding: 12px; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 8px; }
.params .pitem{
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border: 0; border-radius: 0; background: transparent;
  cursor: pointer; text-align: left; width: 100%; color: inherit; text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .12s;
}
.params .pitem:hover{ background: var(--paper); }
.params .pitem.active{ background: var(--csc-50); border-left-color: var(--csc-700); }
.params .ptile{ width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; flex: 0 0 auto; background: var(--surface-2); color: var(--ink-2); }
.params .pitem.active .ptile{ background: var(--csc-700); color: #fff; }
.params .pcol{ display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.params .phead{ background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; box-shadow: var(--shadow-sm); }
.params .ptabs{ display: flex; gap: 0; padding: 0 14px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.params .ptab{
  padding: 10px 14px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--ink-2); font-weight: 500; font-size: 12px;
  cursor: pointer; white-space: nowrap; margin-bottom: -1px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.params .ptab:hover{ color: var(--ink); }
.params .ptab.active{ color: var(--csc-700); border-bottom-color: var(--csc-700); font-weight: 600; }
.params .pfield{ display: grid; grid-template-columns: minmax(0,1.4fr) minmax(200px,260px); gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rule-soft); }
.params .pfield .lb{ font-weight: 500; font-size: 12px; display: flex; align-items: center; gap: 8px; }
.params .pfield .hp{ font-size: 11px; color: var(--ink-2); margin-top: 2px; }
.params .pctrl{ display: flex; justify-content: flex-end; }
.params .num-ctl{ display: flex; align-items: center; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; background: var(--paper); }
.params .num-ctl button{ width: 30px; height: 32px; border: 0; background: transparent; cursor: pointer; color: var(--ink-2); font-size: 14px; }
.params .num-ctl input{ width: 56px; height: 32px; border: 0; border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); text-align: center; background: var(--surface); outline: 0; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 12px; }
.params .num-ctl .un{ padding: 0 10px; font-size: 11px; color: var(--ink-2); min-width: 40px; }
.params .toggle{ display: inline-flex; align-items: center; gap: 10px; border: 0; background: transparent; cursor: pointer; padding: 0; color: inherit; }
.params .toggle .tr{ width: 36px; height: 20px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--rule); position: relative; display: block; transition: background .12s, border-color .12s; }
.params .toggle .kn{ position: absolute; top: 1px; left: 1px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15); transition: left .12s; }
.params .toggle.on .tr{ background: var(--csc-700); border-color: var(--csc-700); }
.params .toggle.on .kn{ left: 18px; }
.params select, .params input[type="text"]{ width: 100%; height: 32px; border: 1px solid var(--rule); background: var(--surface); border-radius: 6px; padding: 0 10px; outline: 0; font-size: 12px; color: inherit; }
.params textarea{ width: 100%; border: 1px solid var(--rule); background: var(--surface); border-radius: 6px; padding: 8px 10px; outline: 0; font-size: 12px; resize: vertical; color: inherit; }

/* ─── DataTables — override tema CSC ─────────────────────────────── */
.dt-card{
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  padding: 0;
  overflow: hidden;
}
.dt-card .dt-head{
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.dt-card .dt-head h2{
  margin: 0; font-size: 13px; font-weight: 600; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.dt-card .dt-head .cnt{ color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.dt-card .dt-head .right{ display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Toolbar DataTables (length + search) */
.dt-card .dt-top{
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.dt-card .dt-length{
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--ink-2); font-weight: 500;
}
.dt-card .dt-length select{
  height: 28px; padding: 0 24px 0 8px;
  border: 1px solid var(--rule); background: var(--surface);
  color: var(--ink); border-radius: 4px;
  font-size: 11px; font-weight: 500;
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236A7470' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
}
.dt-card .dt-length select:focus{ border-color: var(--accent); outline: 0; }

.dt-card .dt-search{
  display: inline-flex; align-items: center; gap: 6px;
}
.dt-card .dt-search input{
  height: 28px; padding: 0 10px;
  border: 1px solid var(--rule); background: var(--surface);
  color: var(--ink); border-radius: 4px;
  font-size: 12px; min-width: 200px;
}
.dt-card .dt-search input:focus{ border-color: var(--accent); outline: 0; }

/* Table em si */
table.dt, table.dataTable{
  width: 100% !important;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  color: var(--ink);
  margin: 0 !important;
  table-layout: fixed;  /* respeita larguras definidas */
}
table.dt thead th, table.dataTable thead th{
  background: var(--paper);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-transform: none;
  text-align: left;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  user-select: none;
}
table.dt thead th.text-right, table.dt thead th.dt-right, table.dt thead th[data-right]{ text-align: right; }
table.dt thead th.text-center{ text-align: center; }
table.dt thead th.no-sort{ cursor: default; }
table.dt thead th.dt-orderable-asc:hover,
table.dt thead th.dt-orderable-desc:hover{ color: var(--ink); }
table.dt thead th.dt-ordering-asc, table.dt thead th.dt-ordering-desc{
  color: var(--csc-700);
}

/* Ícone de sort — sobrescrever o default do DT */
table.dt thead th.dt-orderable-asc .dt-column-order,
table.dt thead th.dt-orderable-desc .dt-column-order,
table.dt thead th.dt-ordering-asc .dt-column-order,
table.dt thead th.dt-ordering-desc .dt-column-order{
  position: relative;
  display: inline-block;
  width: 10px; height: 10px;
  margin-left: 4px;
  vertical-align: middle;
}
table.dt thead th.dt-orderable-asc .dt-column-order::before,
table.dt thead th.dt-orderable-desc .dt-column-order::before,
table.dt thead th.dt-ordering-asc .dt-column-order::before,
table.dt thead th.dt-ordering-desc .dt-column-order::before{
  content: "↕";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: 10px; color: var(--ink-3);
  opacity: .6;
}
table.dt thead th.dt-ordering-asc .dt-column-order::before{ content: "↑"; color: var(--csc-700); opacity: 1; }
table.dt thead th.dt-ordering-desc .dt-column-order::before{ content: "↓"; color: var(--csc-700); opacity: 1; }

table.dt tbody td{
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--surface);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
table.dt tbody td.text-right, table.dt tbody td.dt-right, table.dt tbody td[data-right]{
  text-align: right; font-variant-numeric: tabular-nums;
}
table.dt tbody td.text-center{ text-align: center; }
table.dt tbody td.wrap{ white-space: normal; }
table.dt tbody tr:last-child td{ border-bottom: 0; }
table.dt tbody tr{
  cursor: pointer;
  transition: background .1s;
}
table.dt tbody tr:hover td{ background: var(--csc-50); }
table.dt tbody tr.selected td{ background: var(--csc-100); }

/* Cell com avatar + nome + sub */
table.dt .cell-person{
  display: flex; align-items: center; gap: 10px;
}
table.dt .cell-person .ava{
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700;
  flex: 0 0 auto;
}
table.dt .cell-person .meta{ min-width: 0; display: flex; flex-direction: column; }
table.dt .cell-person .meta .nm{
  font-size: 12px; font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
table.dt .cell-person .meta .sub{
  font-size: 10px; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Rodapé DataTables (info + paginação) */
.dt-card .dt-bot{
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px;
  border-top: 1px solid var(--rule);
  background: var(--paper);
  flex-wrap: wrap;
}
.dt-card .dt-info{
  font-size: 11px; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.dt-card .dt-paging{ display: inline-flex; gap: 4px; align-items: center; }
.dt-card .dt-paging .dt-paging-button{
  min-width: 28px; height: 28px; padding: 0 8px;
  display: inline-grid; place-items: center;
  border: 1px solid var(--rule); background: var(--surface);
  color: var(--ink-2); border-radius: 4px;
  font-size: 11px; font-weight: 600;
  cursor: pointer; text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: all .12s;
}
.dt-card .dt-paging .dt-paging-button:hover{ border-color: var(--accent); color: var(--accent); background: var(--surface); }
.dt-card .dt-paging .dt-paging-button.current,
.dt-card .dt-paging .dt-paging-button.current:hover{
  background: var(--csc-700); color: #fff; border-color: var(--csc-700);
}
.dt-card .dt-paging .dt-paging-button.disabled,
.dt-card .dt-paging .dt-paging-button.disabled:hover{
  opacity: .35; pointer-events: none;
  color: var(--ink-2); background: var(--surface); border-color: var(--rule);
}

/* Fixed header do DT — manter visual coerente */
.dtfh-floatingparent table.dt thead th{ background: var(--paper); box-shadow: 0 1px 0 var(--rule); }

/* Responsive child row */
table.dt tr.dtr-expanded td.dtr-control::before,
table.dt tbody td.dtr-control::before{
  background: var(--csc-700); border-color: var(--csc-700);
}

/* Ações compactas dentro da célula */
.row-actions-inline{
  display: inline-flex; gap: 4px; align-items: center;
}
.row-actions-inline a, .row-actions-inline button{
  width: 26px; height: 26px; display: grid; place-items: center;
  border: 1px solid var(--rule); background: var(--surface);
  border-radius: 4px; color: var(--ink-2); cursor: pointer;
  transition: color .12s, border-color .12s;
  text-decoration: none;
}
.row-actions-inline a:hover, .row-actions-inline button:hover{
  color: var(--csc-700); border-color: var(--csc-700);
}
.row-actions-inline .danger:hover{ color: var(--crit); border-color: var(--crit); }

/* Barra de permanência compacta dentro de célula */
.losbar{
  display: inline-flex; align-items: center; gap: 6px;
  min-width: 100px;
}
.losbar .bar{ flex: 1; height: 4px; background: var(--rule-soft); border-radius: 2px; overflow: hidden; display: inline-block; }
.losbar .bar > span{ display: block; height: 100%; }
.losbar .n{ font-size: 12px; font-weight: 600; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

/* ─── Cards de módulo (atalhos ilustrados) ──────────────────────── */
.modules{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.module{
  display: flex; flex-direction: column; align-items: flex-start;
  gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .14s, transform .14s, box-shadow .14s;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.module:hover{
  border-color: var(--csc-500);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.module img{
  width: 48px; height: 48px;
  display: block; flex: 0 0 auto;
}
.module .lb{
  font-size: 13px; font-weight: 600; color: var(--ink);
  line-height: 1.2;
}
.module .hint{
  font-size: 11px; color: var(--ink-2);
  line-height: 1.3;
}
.module .cnt{
  position: absolute; top: 12px; right: 12px;
  font-size: 11px; font-weight: 600;
  color: var(--ink-2);
  background: var(--csc-50);
  padding: 2px 8px; border-radius: 999px;
}

/* ─── Hero profissional (cartão perfil) ──────────────────────────── */
.profile-hero{
  display: flex; align-items: center; gap: 20px;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--csc-50) 0%, var(--surface) 70%);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.profile-hero img{
  width: 160px; height: auto; flex: 0 0 auto;
  display: block;
}
.profile-hero .info{ min-width: 0; flex: 1; }
.profile-hero .info .nm{
  font-size: 18px; font-weight: 600; color: var(--ink);
  line-height: 1.1;
}
.profile-hero .info .role{
  font-size: 12px; color: var(--csc-700); font-weight: 600;
  margin-top: 4px; letter-spacing: 0.01em;
}
.profile-hero .info .meta{
  display: flex; gap: 20px; margin-top: 10px;
  font-size: 12px; color: var(--ink-2);
  flex-wrap: wrap;
}
.profile-hero .info .meta strong{ color: var(--ink); font-weight: 600; }
@media (max-width: 720px){
  .profile-hero{ flex-direction: column; align-items: flex-start; }
  .profile-hero img{ width: 120px; }
}

/* ─── Legados (chrome antigo escondido) ──────────────────────────── */
.header, .conn, .hbtn, .mast, .nav-bar, .status-bar, .mast-sub{ display: none; }

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 960px){
  .rail-flyout{ min-width: 180px; }
  .user-menu-trigger .nm{ display: none; }
  .topbar{ padding: 0 16px; }
  .content{ padding: 16px; }
  .page-head h1, .title-row h1{ font-size: 18px; }
  .params{ grid-template-columns: 1fr; }
  .params .plist{ position: static; }
}

@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}

/* ─── Impressão ─────────────────────────────────────────────────── */
@media print{
  .mast, .nav-bar, .toolbar, .footer, .tbl-toolbar, .tbl-foot{ display: none; }
  body{ background: #fff; color: #000; }
}

/* ─── Filtro global (mês + hospital) ─────────────────────────────── */
.scope-bar{
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px;
  padding: 12px 16px; box-shadow: var(--shadow-sm);
}
.scope-field{ display: flex; flex-direction: column; gap: 4px; min-width: 200px; }
.scope-field.grow{ flex: 1 1 260px; max-width: 420px; }
.scope-field label{
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 500; color: var(--ink-2);
}
.scope-field select{
  font: inherit; font-size: 13px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule); border-radius: 6px;
  padding: 7px 10px; min-height: 34px; width: 100%;
}
.scope-field select:focus{ outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.scope-state{ display: flex; align-items: center; gap: 10px; margin-left: auto; min-height: 34px; flex-wrap: wrap; }
.scope-chips{ display: inline-flex; gap: 6px; flex-wrap: wrap; }
.scope-chips .chip{
  font-size: 11px; font-weight: 600; color: var(--csc-900);
  background: var(--csc-50); border: 1px solid var(--csc-100); border-radius: 999px; padding: 3px 10px;
}
.scope-clear{ display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--crit); text-decoration: none; font-weight: 500; }
.scope-clear:hover{ text-decoration: underline; }
.scope-hint{ font-size: 11px; color: var(--ink-3); }
.scope-note{ margin: -4px 2px 0; font-size: 11px; color: var(--ink-2); }

/* ─── Layouts de painel ───────────────────────────────────────────── */
.grid-wide{ display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.grid3-eq{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1100px){
  .grid-wide, .grid3-eq{ grid-template-columns: minmax(0, 1fr); }
}
.chart-box{ position: relative; width: 100%; height: 260px; }
.chart-box.sm{ height: 220px; }
.chart-box.lg{ height: 320px; }
.chart-sum{ display: flex; gap: 18px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.chart-sum b{ color: var(--ink); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 4px; }
.chart-sum .sw{ display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.legend-inline{ display: flex; gap: 12px; font-size: 11px; color: var(--ink-2); }
.legend-inline i{ display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.card details summary{ cursor: pointer; font-size: 12px; color: var(--accent); font-weight: 500; }
.card details[open] summary{ margin-bottom: 8px; }
.card.standby{ opacity: .6; }
.kpi.standby{ opacity: .55; cursor: default; }
.kpi.standby:hover{ transform: none; border-color: var(--rule); box-shadow: var(--shadow-sm); }
.content > .scope-bar + .section-head, .content > .scope-note + .section-head{ margin-top: 4px; }
@media (max-width: 640px){
  .scope-field, .scope-field.grow{ min-width: 0; flex: 1 1 100%; max-width: none; }
  .scope-state{ margin-left: 0; }
  .chart-box{ height: 220px; }
}

/* ─── Seletor de mês (grade) ──────────────────────────────────────── */
.mpick{ position: relative; display: flex; align-items: stretch; height: 36px; }
.mpick-step{
  width: 32px; border: 1px solid var(--rule); background: var(--surface); color: var(--ink-2);
  font-size: 16px; line-height: 1; cursor: pointer; transition: background .12s, color .12s;
}
.mpick-step:first-of-type{ border-radius: 6px 0 0 6px; border-right: 0; }
.mpick-step:last-of-type{ border-radius: 0 6px 6px 0; border-left: 0; }
.mpick-step:hover:not(:disabled){ background: var(--csc-50); color: var(--csc-900); }
.mpick-step:disabled{ color: var(--ink-3); cursor: default; opacity: .5; }
.mpick-trigger{
  flex: 1; min-width: 160px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--rule); background: var(--surface); padding: 0 12px;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); cursor: pointer;
}
.mpick-trigger:hover, .mpick.open .mpick-trigger{ border-color: var(--accent); }
.mpick.open .mpick-trigger{ box-shadow: 0 0 0 3px var(--csc-50); }
.mpick-caret{ color: var(--ink-3); font-size: 10px; transition: transform .15s; }
.mpick.open .mpick-caret{ transform: rotate(180deg); }
.mpick-pop{
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; width: 300px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(45,58,46,.16), 0 2px 6px rgba(45,58,46,.08);
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
.mpick-pop[hidden]{ display: none; }
.mpick-head{ display: flex; align-items: center; justify-content: space-between; }
.mpick-head strong{ font-size: 14px; font-variant-numeric: tabular-nums; }
.mpick-head button{
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--rule); background: var(--surface);
  cursor: pointer; color: var(--ink-2); font-size: 15px;
}
.mpick-head button:hover:not(:disabled){ border-color: var(--accent); color: var(--accent); }
.mpick-head button:disabled{ opacity: .35; cursor: default; }
.mpick-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mpick-cell{
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px;
  border: 1px solid var(--rule-soft); border-radius: 8px; background: var(--surface-2);
  cursor: pointer; font: inherit; color: var(--ink); transition: background .12s, border-color .12s;
}
.mpick-cell .m{ font-size: 13px; font-weight: 600; }
.mpick-cell .n{ font-size: 10px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mpick-cell:hover:not(:disabled){ border-color: var(--accent); background: var(--csc-50); }
.mpick-cell.is-now{ border-color: var(--csc-300); }
.mpick-cell.is-sel{ background: var(--csc-700); border-color: var(--csc-700); color: #fff; }
.mpick-cell.is-sel .n{ color: var(--csc-100); }
.mpick-cell:disabled{ background: transparent; color: var(--ink-3); cursor: default; border-style: dashed; }
.mpick-foot{ display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--rule-soft); padding-top: 10px; }
.mpick-foot button{
  border: 0; background: none; padding: 4px 2px; font: inherit; font-size: 12px; font-weight: 500;
  color: var(--accent); cursor: pointer;
}
.mpick-foot button:hover:not(:disabled){ text-decoration: underline; }
.mpick-foot button:disabled{ color: var(--ink-3); cursor: default; }

/* ─── Select2 no tema CSC ─────────────────────────────────────────── */
.select2-container--default .select2-selection--single{
  height: 36px; border: 1px solid var(--rule); border-radius: 6px; background: var(--surface);
  display: flex; align-items: center; transition: border-color .12s, box-shadow .12s;
}
.select2-container--default .select2-selection--single:hover{ border-color: var(--accent); }
.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single{
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--csc-50);
}
.select2-container--default .select2-selection--single .select2-selection__rendered{
  color: var(--ink); font-size: 13px; font-weight: 600; line-height: 34px; padding-left: 12px; padding-right: 52px; flex: 1;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder{ color: var(--ink-3); font-weight: 400; }
.select2-container--default .select2-selection--single .select2-selection__arrow{ height: 34px; right: 6px; }
.select2-container--default .select2-selection--single .select2-selection__clear{
  position: absolute; right: 30px; top: 50%; transform: translateY(-50%); margin: 0;
  color: var(--ink-3); font-size: 18px; font-weight: 400; line-height: 1;
}
.select2-container--default .select2-selection--single .select2-selection__clear:hover{ color: var(--crit); }
.select2-dropdown{
  border: 1px solid var(--rule); border-radius: 8px; overflow: hidden;
  box-shadow: 0 12px 32px rgba(45,58,46,.16), 0 2px 6px rgba(45,58,46,.08); z-index: 1100;
}
.select2-container--open .select2-dropdown--below{ margin-top: 4px; border-top: 1px solid var(--rule); border-radius: 8px; }
.select2-container--open .select2-dropdown--above{ margin-top: -4px; border-bottom: 1px solid var(--rule); border-radius: 8px; }
.select2-search--dropdown{ padding: 8px; border-bottom: 1px solid var(--rule-soft); }
.select2-container--default .select2-search--dropdown .select2-search__field{
  border: 1px solid var(--rule); border-radius: 6px; padding: 7px 10px; font: inherit; font-size: 13px; outline: 0;
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus{ border-color: var(--accent); }
.select2-container--default .select2-results > .select2-results__options{ max-height: 300px; }
.select2-results__option{ padding: 8px 12px; font-size: 13px; }
.select2-container--default .select2-results__option--highlighted[aria-selected]{ background: var(--csc-50); color: var(--ink); }
.select2-container--default .select2-results__option[aria-selected=true]{ background: var(--csc-700); color: #fff; }
.select2-container--default .select2-results__option[aria-selected=true] .s2-meta{ color: var(--csc-100); }
.select2-results__message{ color: var(--ink-2); font-size: 12px; }
.s2-opt{ display: flex; flex-direction: column; gap: 1px; }
.s2-name{ font-weight: 500; }
.s2-meta{ font-size: 11px; color: var(--ink-2); }

/* ─── Modal ───────────────────────────────────────────────────────── */
.modal{ position: fixed; inset: 0; z-index: 1000; display: grid; place-items: start center; padding: 12vh 16px 16px; }
.modal[hidden]{ display: none; }
.modal-backdrop{ position: absolute; inset: 0; background: rgba(31,38,33,.45); backdrop-filter: blur(2px); animation: mfade .15s ease-out; }
.modal-card{
  position: relative; width: 100%; max-width: 560px; background: var(--surface);
  border-radius: 12px; border: 1px solid var(--rule);
  box-shadow: 0 24px 60px rgba(31,38,33,.25); animation: mrise .18s ease-out;
}
.modal-head{ display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 20px 6px; }
.modal-head h2{ margin: 0; font-size: 16px; font-weight: 600; }
.modal-head p{ margin: 4px 0 0; font-size: 12px; color: var(--ink-2); }
.modal-x{ border: 0; background: none; color: var(--ink-3); cursor: pointer; padding: 4px; border-radius: 6px; display: grid; }
.modal-x:hover{ background: var(--surface-2); color: var(--ink); }
.modal-body{ padding: 14px 20px 18px; display: flex; flex-direction: column; gap: 6px; }
.modal-label{ font-size: 11px; font-weight: 500; color: var(--ink-2); }
.modal-foot{ display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--rule-soft); background: var(--surface-2); border-radius: 0 0 12px 12px; }
.btn:disabled{ opacity: .5; cursor: not-allowed; }
body.modal-open{ overflow: hidden; }
@keyframes mfade{ from{ opacity: 0; } }
@keyframes mrise{ from{ opacity: 0; transform: translateY(8px) scale(.98); } }

/* ─── Parametrização sem lista lateral ────────────────────────────── */
.params.single{ grid-template-columns: minmax(0, 1fr); }
.pempty{
  background: var(--surface); border: 1px dashed var(--csc-300); border-radius: 12px;
  padding: 48px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
}
.pempty-ico{ width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--csc-50); color: var(--csc-700); }
.pempty h2{ margin: 4px 0 0; font-size: 16px; }
.pempty p{ margin: 0 0 6px; max-width: 440px; font-size: 13px; color: var(--ink-2); }
@media (max-width: 640px){
  .mpick-pop{ width: min(300px, calc(100vw - 48px)); }
  .modal{ padding-top: 8vh; }
}
