/* Layout: barra lateral em gradiente azul + área de trabalho branca; cada seção do menu é uma tela trocada pelo endereço (#contratos, #prazos…) */
:root {
  --azul: #1E3A8A;
  --azul-vivo: #2F5FE8;
  --dado: #18B98A;
  --papel: #F5F2EA;

  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F3F5FA;
  --ink: #16213F;
  --muted: #5B6378;
  --line: #E2E6EE;
  --accent: #1E3A8A;
  --accent-hover: #2A4BA6;
  /* Cor de todos os botões azuis */
  --botao: #2E5BEA;
  --botao-hover: #2449C8;
  --on-accent: #F5F2EA;
  --link: #1E3A8A;
  --dado-ink: #0E7A5A;
  --dado-soft: #DDF3EA;
  --info-ink: #2448B8;
  --info-soft: #E1E8FB;
  --violet-ink: #6A3FB5;
  --violet-soft: #EEE7FA;
  --warn-ink: #8F5600;
  --warn-soft: #F8E9CC;
  --danger-ink: #A3261D;
  --danger-soft: #F7DEDA;
  --neutral-soft: #EDF0F5;
  --side-bg: linear-gradient(180deg, #2F62EA 0%, #2A51D9 45%, #2141B8 100%);
  --side-solid: #2141B8;
  --side-ink: #F5F2EA;
  --side-muted: #AFBCE3;
  --side-active: rgba(255, 255, 255, 0.16);
  --focus: #2F5FE8;
  --scrim: rgba(14, 22, 48, 0.4);
  --shadow: 0 1px 2px rgba(22, 33, 63, 0.06), 0 6px 20px rgba(22, 33, 63, 0.05);
  --shadow-lg: 0 10px 40px rgba(22, 33, 63, 0.18);

  --f-display: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --f-body: "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-heading: "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
  /* Números, datas e códigos usam a mesma fonte do sistema, com algarismos alinhados */
  --f-mono: "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, -apple-system, sans-serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--f-mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.linkish { background: none; border: 0; padding: 0; color: var(--link); cursor: pointer; font: inherit; text-align: left; }
.linkish:hover { text-decoration: underline; }

/* ---------- Estrutura ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--side-bg); color: var(--side-ink);
  display: flex; flex-direction: column; gap: 28px;
  padding-block: 22px 20px;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: 18px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding-inline: 6px; color: var(--side-ink); }
.brand:hover { text-decoration: none; }
.brand svg { width: 38px; height: 38px; flex: none; border-radius: 9px; }
.brand-name { font-family: var(--f-heading); font-weight: 700; font-size: 21px; line-height: 1; letter-spacing: 0.16em; }
.brand-sub { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--side-muted); margin-top: 5px; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--side-muted); padding: 0 10px 8px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--side-ink); opacity: 0.86; font-weight: 500;
}
.nav a:hover { background: var(--side-active); opacity: 1; text-decoration: none; }
.nav a[aria-current="page"] { background: var(--side-active); opacity: 1; box-shadow: inset 3px 0 0 var(--dado); }
.nav a[aria-current="page"] .icon { color: var(--dado); }
.nav .count { margin-left: auto; font-family: var(--f-mono); font-size: 11.5px; color: var(--side-muted); }
.nav .count.alert { color: var(--side-solid); background: var(--dado); border-radius: 999px; padding: 0 7px; font-weight: 500; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.side-org { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 10px 0; border-top: 1px solid rgba(245, 242, 234, 0.18); min-width: 0; }
.side-org > div:last-child { min-width: 0; overflow-wrap: anywhere; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--dado); color: #0A1028; font-family: var(--f-mono); font-size: 12px; font-weight: 500; flex: none; }
.side-org small { display: block; color: var(--side-muted); font-size: 12px; }

/* ---------- Topo ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner, .page {
  padding-left: max(clamp(16px, 3.2vw, 40px), env(safe-area-inset-left, 0px));
  padding-right: max(clamp(16px, 3.2vw, 40px), env(safe-area-inset-right, 0px));
}
.topbar-inner { display: flex; align-items: center; gap: 12px; padding-block: 12px; max-width: 1360px; margin-inline: auto; }
.menu-btn { display: none; }
.mobile-brand { display: none; }
.search { flex: 1; max-width: 520px; position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input, .field {
  width: 100%; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font: inherit;
}
.search input { padding: 0 56px 0 38px; }
.search input::placeholder, .field::placeholder { color: var(--muted); }
.search input:focus, .field:focus { outline: 2px solid var(--focus); outline-offset: -1px; border-color: transparent; }
.search kbd { position: absolute; right: 10px; font-family: var(--f-mono); font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; background: var(--surface-2); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sample-tag { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--warn-ink); background: var(--warn-soft); padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.icon-btn {
  position: relative; width: 38px; height: 38px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; color: var(--ink);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--dado); box-shadow: 0 0 0 2px var(--surface); }

/* ---------- Página ---------- */
.page { padding-block: 30px 56px; max-width: 1360px; margin-inline: auto; display: flex; flex-direction: column; gap: 26px; }
.page:focus { outline: none; }

.hello, .page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 24px; }
.eyebrow { font-family: var(--f-mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.hello h1, .page-head h1 {
  font-family: var(--f-heading); font-weight: 700;
  font-size: clamp(30px, 4vw, 42px); line-height: 1.05; letter-spacing: -0.02em;
  margin: 6px 0 0; color: var(--ink); text-wrap: balance;
}
.page-head h1 { font-size: clamp(28px, 3.4vw, 36px); }
.page-head p { margin: 8px 0 0; color: var(--muted); max-width: 62ch; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
  font-weight: 500; cursor: pointer; white-space: nowrap; color: var(--ink);
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--botao); border-color: var(--botao); color: #FFFFFF; }
.btn.primary:hover { background: var(--botao-hover); border-color: var(--botao-hover); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 14px; border-radius: var(--r-sm); }
.btn .icon { width: 17px; height: 17px; }

/* Resumo */
.summary {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
}
.stat { padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat-label { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.stat-label .bullet { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.stat-value { font-family: var(--f-mono); font-weight: 700; font-variant-numeric: tabular-nums; font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; }
.stat-value small { font-size: 16px; color: var(--muted); margin-right: 6px; }
.stat-note { font-size: 13px; color: var(--muted); }
.stat-note .up { color: var(--dado-ink); font-weight: 600; }
.stat-note .bad { color: var(--danger-ink); font-weight: 600; }

/* Grades e painéis */
.grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 22px 12px; flex-wrap: wrap; }
.panel-head h2 { font-family: var(--f-heading); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; margin: 0; }
.panel-head .meta { font-size: 13px; color: var(--muted); }
.panel-head a { font-size: 14px; font-weight: 500; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 16px 22px; }
.toolbar.tight { padding-top: 0; }
.toolbar .grow { flex: 1 1 240px; max-width: 380px; position: relative; display: flex; align-items: center; }
.toolbar .grow .icon { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.toolbar .grow .field { padding-left: 36px; height: 36px; }
.select {
  height: 36px; padding: 0 30px 0 12px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; max-width: 100%;
}
.select-label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.spacer { flex: 1; }

/* Pílulas e chips */
.pill {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  font-size: 13px; font-weight: 500; padding: 2px 10px; border-radius: 999px;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.critical { color: var(--danger-ink); background: var(--danger-soft); }
.pill.warn { color: var(--warn-ink); background: var(--warn-soft); }
.pill.ok { color: var(--dado-ink); background: var(--dado-soft); }
.pill.info { color: var(--info-ink); background: var(--info-soft); }
.pill.violet { color: var(--violet-ink); background: var(--violet-soft); }
.pill.neutral { color: var(--muted); background: var(--neutral-soft); }
.tag { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 4px 12px; font-size: 14px; cursor: pointer; color: var(--muted);
}
.chip:hover { color: var(--ink); background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .n { font-family: var(--f-mono); font-size: 11.5px; margin-left: 4px; opacity: 0.75; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab {
  background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px 11px; margin-bottom: -1px;
  font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.tab .n { font-family: var(--f-mono); font-size: 12px; font-weight: 500; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: var(--neutral-soft); color: var(--muted); }
.tab[aria-selected="true"] .n { background: var(--info-soft); color: var(--info-ink); }

/* Prazos */
.deadlines { list-style: none; margin: 0; padding: 0 10px 10px; }
.deadline {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 12px;
}
.deadline + .deadline { border-top: 1px solid var(--line); }
.deadline.is-done .dl-title { color: var(--muted); text-decoration: line-through; }
.date { text-align: center; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 5px 0 6px; background: var(--bg); }
.date b { display: block; font-family: var(--f-mono); font-weight: 700; font-size: 20px; line-height: 1.1; }
.date span { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.date.over { border-color: var(--danger-ink); }
.date.over b { color: var(--danger-ink); }
.dl-body { min-width: 0; }
.dl-title { font-weight: 600; }
.dl-sub { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.mono-ref { color: var(--link); font-size: 14px; font-family: var(--f-mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.dl-side { display: flex; align-items: center; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.group-label { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 14px 22px 4px; display: flex; gap: 8px; border-top: 1px solid var(--line); }
.group-label .n { color: var(--ink); }
.empty { padding: 26px 22px 30px; color: var(--muted); text-align: center; margin: 0; }

/* Calendário */
.cal { padding: 4px 18px 18px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 0 10px; }
.cal-head b { font-family: var(--f-heading); font-weight: 700; font-size: 18px; }
.cal-head .icon-btn { width: 32px; height: 32px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px 0; }
.cal-dow { font-family: var(--f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); text-align: center; padding-bottom: 4px; }
.cal-day {
  min-height: 44px; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent;
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0 5px; cursor: pointer;
  font-family: var(--f-mono); font-size: 13px; font-variant-numeric: tabular-nums;
}
.cal-day:hover { background: var(--surface-2); }
.cal-day.is-out { color: var(--muted); opacity: 0.5; }
.cal-day.is-today { border-color: var(--accent); }
.cal-day.is-sel { background: var(--accent); color: var(--on-accent); }
.cal-dots { display: flex; gap: 3px; height: 6px; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.cal-dots i.critical { background: var(--danger-ink); }
.cal-dots i.warn { background: var(--warn-ink); }
.cal-dots i.ok { background: var(--dado); }
.cal-day.is-sel .cal-dots i { background: var(--on-accent); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 8px; height: 8px; border-radius: 50%; }

/* Ciclo */
.flow { list-style: none; margin: 0; padding: 4px 22px 22px; display: flex; flex-direction: column; }
.flow li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; position: relative; }
.flow li:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 30px; bottom: -10px; width: 2px; background: var(--line); }
.step-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; z-index: 1; }
.step-dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); opacity: 0.5; }
.flow li.final .step-dot { border-color: var(--dado); }
.flow li.final .step-dot::after { background: var(--dado); opacity: 1; }
.flow li.hot .step-dot { border-color: var(--azul-vivo); }
.flow li.hot .step-dot::after { background: var(--azul-vivo); opacity: 1; }
.step-name { font-weight: 500; }
.step-name small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.step-count { font-family: var(--f-mono); font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; }

/* Pendências (início) */
.tasks { list-style: none; margin: 0; padding: 0 10px 10px; }
.task { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 12px; align-items: start; }
.task + .task { border-top: 1px solid var(--line); }
.task-ico { width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; background: var(--info-soft); color: var(--info-ink); }
.task-ico.sign { background: var(--dado-soft); color: var(--dado-ink); }
.task-ico.review { background: var(--warn-soft); color: var(--warn-ink); }
.task-title { font-weight: 600; }
.task-sub { font-size: 14px; color: var(--muted); }

/* Tabela */
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th {
  text-align: left; font-family: var(--f-mono); font-weight: 500; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); padding: 11px 22px; background: var(--surface-2); white-space: nowrap;
}
td { padding: 13px 22px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr.row { cursor: pointer; }
tbody tr.row:hover td { background: var(--surface-2); }
td.num, th.num { text-align: right; }
.c-id { font-family: var(--f-mono); font-weight: 600; font-size: 14.5px; color: var(--link); white-space: nowrap; }
.c-obj { font-weight: 600; }
.c-party { color: var(--muted); font-size: 14px; }
.c-party.mono { font-size: 12.5px; font-weight: 400; }
.c-val { font-family: var(--f-mono); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 14.5px; font-weight: 600; }
.c-val small { color: var(--muted); }
.c-term { font-family: var(--f-mono); font-variant-numeric: tabular-nums; font-size: 14px; white-space: nowrap; color: var(--muted); }
.c-term.soon { color: var(--warn-ink); }
.table-foot { padding: 12px 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Aprovações */
.stack { display: flex; flex-direction: column; gap: 16px; }
.ap-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.ap-top { display: flex; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; align-items: flex-start; }
.ap-top > div { min-width: 0; }
.ap-title { font-size: 18px; font-weight: 600; margin: 4px 0 2px; }
.ap-meta { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.steps { list-style: none; margin: 0; padding: 12px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 0; background: var(--surface-2); border-radius: var(--r-md); }
.steps li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.steps li + li::before { content: ""; width: 26px; height: 1px; background: var(--muted); opacity: 0.4; margin: 0 10px; }
.mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 2px solid var(--line); background: var(--surface); }
.mark .icon { width: 13px; height: 13px; stroke-width: 2.6; }
.steps .ok .mark { background: var(--dado); border-color: var(--dado); color: #FFFFFF; }
.steps .atual .mark { border-color: var(--azul-vivo); }
.steps .atual .mark::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--azul-vivo); }
.steps .devolvido .mark { background: var(--danger-ink); border-color: var(--danger-ink); color: #FFFFFF; }
.steps .espera { color: var(--muted); }
.steps b { font-weight: 600; }
.steps small { color: var(--muted); font-size: 13px; }
.note { border-left: 3px solid var(--danger-ink); background: var(--danger-soft); padding: 10px 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: 14px; }
.note.info { border-left-color: var(--azul-vivo); background: var(--info-soft); }
.ap-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.return-box { display: flex; flex-direction: column; gap: 8px; }
.return-box label { font-weight: 600; font-size: 14px; }
textarea.field { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.field-error { color: var(--danger-ink); font-size: 13px; }

/* Modelos e cláusulas */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 16px; }
.tpl { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.tpl-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tpl h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; }
.tpl p { margin: 0; color: var(--muted); font-size: 14px; }
.tpl dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.tpl dt { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.tpl dd { margin: 2px 0 0; font-family: var(--f-mono); font-size: 15px; font-weight: 600; }
.tpl .updated { font-size: 13px; }
.tpl-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }
.clauses { list-style: none; margin: 0; padding: 0; }
.clause { border-top: 1px solid var(--line); }
.clause summary { list-style: none; cursor: pointer; padding: 14px 22px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: center; }
.clause summary::-webkit-details-marker { display: none; }
.clause summary:hover { background: var(--surface-2); }
.clause-title { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.clause-title .chev { width: 16px; height: 16px; color: var(--muted); transition: transform 0.15s; }
.clause[open] .chev { transform: rotate(90deg); }
.clause-ex { grid-column: 1 / -1; color: var(--muted); font-size: 14px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.clause[open] .clause-ex { display: none; }
.clause-body { padding: 0 22px 18px; display: flex; flex-direction: column; gap: 12px; }
.clause-text { font-size: 15px; line-height: 1.6; max-width: 72ch; margin: 0; padding: 14px 18px; background: var(--surface-2); border-radius: var(--r-md); }
.clause-foot { display: flex; gap: 8px 16px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

/* Gaveta de detalhes */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 30; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); z-index: 31;
  background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px); padding-right: env(safe-area-inset-right, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: slide-in 0.2s ease;
}
@keyframes slide-in { from { transform: translateX(24px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: flex-start; gap: 14px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); }
.drawer-head > div { flex: 1; min-width: 0; }
.drawer-head h2 { font-family: var(--f-heading); font-weight: 700; font-size: 24px; line-height: 1.15; margin: 6px 0 8px; text-wrap: balance; }
.drawer-body { overflow-y: auto; padding: 20px 24px 28px; display: flex; flex-direction: column; gap: 24px; flex: 1; }
.drawer-foot { display: flex; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; margin: 0; }
.kv dt { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.kv dd { margin: 3px 0 0; font-weight: 500; overflow-wrap: anywhere; }
.kv dd.mono { font-size: 15px; }
.kv .wide { grid-column: 1 / -1; }
.section-title { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; font-weight: 500; }
.mini-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); }
.mini-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 10px 14px; flex-wrap: wrap; }
.mini-list li + li { border-top: 1px solid var(--line); }
.mini-list .l { min-width: 0; }
.mini-list .l small { display: block; color: var(--muted); font-size: 13px; }
.copy-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy-line span { user-select: all; }

/* Aviso */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40;
  background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px; font-weight: 500; width: max-content; max-width: calc(100% - 32px);
}
.toast .icon { color: var(--dado); }

/* ---------- Responsivo ---------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .col.side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 880px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); height: 100%; z-index: 20;
    padding-top: max(22px, env(safe-area-inset-top, 0px));
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
    transform: translateX(-102%); transition: transform 0.22s ease;
  }
  .app.nav-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax var(--scrim); }
  .menu-btn { display: grid; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; }
  .mobile-brand svg { width: 30px; height: 30px; border-radius: 7px; }
  .mobile-brand span { font-family: var(--f-heading); font-weight: 700; font-size: 18px; letter-spacing: 0.16em; }
  .search { order: 5; flex-basis: 100%; max-width: none; }
  .topbar-inner { flex-wrap: wrap; }
  .col.side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .sample-tag { display: none; }
  .stat { padding: 14px 16px 16px; }
  .stat-value { font-size: 24px; }
  .panel-head, .toolbar, .group-label { padding-left: 16px; padding-right: 16px; }
  .deadlines, .tasks { padding: 0 4px 6px; }
  .deadline { grid-template-columns: 46px minmax(0, 1fr); gap: 12px; }
  .deadline .dl-side { grid-column: 2; justify-content: flex-start; }
  .flow { padding: 4px 16px 18px; }
  .quick { width: 100%; }
  .quick .btn { flex: 1; justify-content: center; }
  th, td { padding-left: 16px; padding-right: 16px; }
  .ap-card { padding: 16px; }
  .steps li + li::before { width: 14px; margin: 0 6px; }
  .kv { grid-template-columns: minmax(0, 1fr); }
  .drawer-head, .drawer-body, .drawer-foot { padding-left: 16px; padding-right: 16px; }
  .clause summary { padding: 14px 16px; }
  .clause-body { padding: 0 16px 16px; }
  .cal { padding: 4px 10px 14px; }
  .cal-grid { gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
  .drawer { animation: none; }
  .clause-title .chev { transition: none; }
}

/* ---------- Específico da versão em Django ---------- */
.inline-form { display: inline; margin: 0; }
a.chip, a.tab { text-decoration: none; display: inline-flex; align-items: center; }
a.chip:hover, a.tab:hover { text-decoration: none; }
a.cal-day { color: inherit; text-decoration: none; }
.toast.error { background: var(--danger-ink); color: #FFFFFF; }
.toast.error .icon { color: #FFFFFF; }
.detail-page { overflow: hidden; }
.detail-page .drawer-body { overflow: visible; }
.return-box { padding-top: 2px; }
details.devolver > summary { list-style: none; }
details.devolver > summary::-webkit-details-marker { display: none; }
details.devolver[open] > summary { display: none; }
.user-menu { color: var(--side-ink); }
.user-menu a { padding: 0; opacity: 0.8; font-size: 12px; }
.user-menu button { background: none; border: 0; padding: 0; color: var(--side-muted); font-size: 12px; cursor: pointer; text-decoration: underline; }

/* Tela de login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--side-bg); padding-block: 32px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.login-card { width: min(400px, 100%); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 32px 28px; display: flex; flex-direction: column; gap: 18px; }
.login-card .brand { color: var(--ink); padding: 0; }
.login-card .brand-sub { color: var(--muted); }
.login-card h1 { font-family: var(--f-heading); font-weight: 700; font-size: 24px; margin: 6px 0 0; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.login-card .btn { justify-content: center; width: 100%; }
.login-erro { color: var(--danger-ink); background: var(--danger-soft); border-radius: var(--r-sm); padding: 10px 12px; font-size: 14px; margin: 0; }

body { margin: 0; }
img { max-width: 100%; }

/* Início: as duas colunas terminam na mesma altura */
.grid.fill { align-items: stretch; }
.grid.fill .col > .panel:last-child { flex: 1; display: flex; flex-direction: column; }
.grid.fill .col.side > .panel:last-child .flow { flex: 1; }
.grid.fill .col.side > .panel:last-child .flow li { flex: 1; align-items: start; }
.grid.fill .col.side > .panel:last-child .flow li:last-child { flex: 0; }
.panel-foot { margin-top: auto; }

/* ---------- Ficha do contrato ---------- */
.bad { color: var(--danger-ink); }
.tag.bad { color: var(--danger-ink); margin-top: 4px; }
.head-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.detail-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.kv.pad { padding: 4px 22px 22px; }
.kv .texto { font-weight: 400; line-height: 1.55; }
.kv dd .pill { margin: 0 4px 4px 0; }
.calc { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.06em; color: var(--dado-ink); background: var(--dado-soft); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.pad { padding: 4px 22px 22px; }
.stack-sm { display: flex; flex-direction: column; gap: 14px; }
.inset { margin: 0 22px 16px; }
.inset-list { margin: 0 22px 22px; }
.note.warn-note { border-left-color: var(--warn-ink); background: var(--warn-soft); }
table.compact th, table.compact td { padding-top: 9px; padding-bottom: 9px; }
table.compact { min-width: 520px; }

.lifecycle { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; counter-reset: etapa; }
.lifecycle li {
  counter-increment: etapa; flex: 1 1 120px; padding: 8px 12px; border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 600;
}
.lifecycle li::before { content: counter(etapa) " "; font-family: var(--f-mono); font-weight: 500; margin-right: 4px; opacity: 0.7; }
.lifecycle li.atual { background: var(--accent); color: var(--on-accent); }

.acao-pop { position: relative; }
.acao-pop > summary { list-style: none; }
.acao-pop > summary::-webkit-details-marker { display: none; }
.pop-body {
  display: flex; flex-direction: column; gap: 8px; padding: 16px; margin-top: 8px; width: min(340px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg);
}
.acao-pop .pop-body { position: absolute; right: 0; z-index: 10; }
.pop-body label { font-weight: 600; font-size: 14px; }
.pop-body p { margin: 0; font-size: 13px; }
.pop-body textarea.field { min-height: 70px; }
.add-sig { padding: 0 22px 18px; }
.add-sig .pop-body { box-shadow: none; width: 100%; }

.docs { padding: 4px 22px 22px; display: flex; flex-direction: column; gap: 18px; }
.upload { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px dashed var(--line); border-radius: var(--r-md); }
.panel > .upload { margin: 0 22px 22px; }
.upload-linha { display: flex; flex-wrap: wrap; gap: 10px; }
.upload-linha .select { flex: 1 1 220px; }
.upload-linha .field { flex: 1 1 200px; height: 36px; }

/* Envio de arquivo: um botão só; o seletor nativo fica escondido dentro dele */
.arquivo { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.arquivo-btn { position: relative; cursor: pointer; }
.arquivo-btn:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.arquivo-btn[aria-busy="true"] { opacity: 0.7; pointer-events: none; }
.arquivo-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; opacity: 0; }
.arquivo small { font-size: 13px; }
.arquivo-nome { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; font-size: 14px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); padding: 3px 4px 3px 10px; border-radius: 999px; }
.arquivo-nome span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.arquivo-nome button { width: 24px; height: 24px; display: grid; place-items: center; border: 0; background: none; border-radius: 50%; color: var(--muted); cursor: pointer; flex: none; }
.arquivo-nome button:hover { background: var(--danger-soft); color: var(--danger-ink); }
.arquivo-nome .icon { width: 14px; height: 14px; }

.timeline { list-style: none; margin: 0; padding: 0 22px 22px; }
.timeline li { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.tl-when { font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tl-what { font-size: 14px; }
.tl-what small { display: block; color: var(--muted); font-size: 12.5px; }
.tl-diff { color: var(--muted); overflow-wrap: anywhere; }
.tl-diff s { color: var(--danger-ink); }

/* ---------- Formulários ---------- */
.form-sections { display: flex; flex-direction: column; gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; padding: 4px 22px 22px; }
.form-sections > .panel > .form-grid:first-child { padding-top: 22px; }
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo.largo { grid-column: 1 / -1; }
.campo > label { font-weight: 600; font-size: 14px; }
.campo .obrig { color: var(--danger-ink); }
.campo small { font-size: 13px; }
.campo.com-erro .field, .campo.com-erro .select { border-color: var(--danger-ink); }
.campo .select { width: 100%; height: 38px; }
.campo textarea.field { min-height: 96px; }
.inline-fields { display: flex; gap: 8px; }
.inline-fields .field { flex: 1; }
.inline-fields .select { width: auto; height: 38px; }
.check-list > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 6px 16px; }
.check-list label { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; }
.check-list input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

@media (max-width: 1100px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); padding-left: 16px; padding-right: 16px; }
  .timeline { padding-left: 16px; padding-right: 16px; }
  .timeline li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .kv.pad, .pad, .docs { padding-left: 16px; padding-right: 16px; }
  .inset { margin-left: 16px; margin-right: 16px; }
  .inset-list { margin-left: 16px; margin-right: 16px; }
  .acao-pop .pop-body { position: static; }
  .lifecycle li { flex-basis: 45%; }
}

/* Cadastro de parte */
.campo-rotulo { font-weight: 600; font-size: 14px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-md); width: fit-content; max-width: 100%; }
.segmented-opt { position: relative; cursor: pointer; }
.segmented-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented-opt span { display: block; padding: 7px 16px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; color: var(--muted); }
.segmented-opt input:checked + span { background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.segmented-opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.form-grid.tres { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-nota { margin: 0; padding: 0 22px 20px; font-size: 13px; color: var(--muted); }
[data-so-pj][hidden] { display: none !important; }
@media (max-width: 880px) { .form-grid.tres { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .form-nota { padding-left: 16px; padding-right: 16px; } }
.form-link { margin: -8px 0 0; font-size: 14px; font-weight: 500; }

/* Pessoas, grupos e níveis de aprovação */
.pessoa-cel { display: flex; align-items: center; gap: 12px; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.opcoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; padding: 4px 22px 22px; }
.opcao { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; }
.opcao:hover { background: var(--surface-2); }
.opcao input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.opcao:has(input:checked) { border-color: var(--accent); background: var(--info-soft); }
.opcao b { display: block; font-weight: 600; font-size: 14.5px; }
.opcao small { display: block; color: var(--muted); font-size: 13px; }
.pad-x { padding: 0 22px 16px; margin: 0; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; width: fit-content; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 40px; height: 22px; border-radius: 999px; background: var(--line); position: relative; transition: background 0.15s; flex: none; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow); transition: transform 0.15s; }
.switch input:checked + .switch-ui { background: var(--dado); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--focus); outline-offset: 2px; }
.pessoas-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.pessoas-mini li { display: flex; align-items: center; gap: 8px; }
.niveis { list-style: none; margin: 0; padding: 0 22px 22px; display: flex; flex-direction: column; }
.niveis li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; position: relative; }
.niveis li + li { border-top: 1px solid var(--line); }
.nivel-n { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; }
.nivel-topo { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 2px; }
.nivel-corpo { min-width: 0; font-size: 14px; }
.btn.danger-btn { color: var(--danger-ink); }
@media (max-width: 640px) {
  .opcoes { padding-left: 16px; padding-right: 16px; }
  .niveis { padding-left: 16px; padding-right: 16px; }
  .niveis li { grid-template-columns: 34px minmax(0, 1fr); }
  .niveis li .btn { grid-column: 2; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) { .switch-ui, .switch-ui::after { transition: none; } }

/* Início enxuto */
.hello-resumo { margin: 10px 0 0; color: var(--muted); font-size: 16px; }
.hello-resumo b { color: var(--ink); }
.inicio-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
.pendencias { list-style: none; margin: 0; padding: 0 10px 6px; }
.pendencias li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 12px; }
.pendencias li + li { border-top: 1px solid var(--line); }
.pend-corpo { min-width: 0; }
.pend-acao { display: flex; align-items: center; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.vazio { padding: 34px 22px 38px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vazio p { margin: 0; color: var(--muted); max-width: 40ch; }
.vazio-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--dado-soft); color: var(--dado-ink); margin-bottom: 4px; }
.vazio-ico .icon { width: 22px; height: 22px; }
.meus-contratos { list-style: none; margin: 0; padding: 0 10px 10px; }
.meus-contratos li + li { border-top: 1px solid var(--line); }
.meus-contratos a { display: flex; flex-direction: column; gap: 3px; padding: 12px; border-radius: var(--r-sm); color: var(--ink); }
.meus-contratos a:hover { background: var(--surface-2); text-decoration: none; }
.meus-contratos b { font-weight: 600; }
.meus-contratos small { color: var(--muted); font-size: 13px; }
.meus-contratos small.bad { color: var(--warn-ink); font-weight: 600; }
.mc-topo { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
@media (max-width: 1100px) { .inicio-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .pendencias li { grid-template-columns: 32px minmax(0, 1fr); }
  .pend-acao { grid-column: 2; justify-content: flex-start; }
}

/* ---------- Assinatura eletrônica ---------- */
.sig-acoes { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sig-mini { height: 30px; width: auto; max-width: 110px; object-fit: contain; }
.sigs .l small + small { margin-top: 2px; }

.assinatura-pagina { background: var(--bg); }
.assin-topo { background: var(--side-bg); color: var(--side-ink); position: sticky; top: 0; z-index: 5; }
.assin-topo-inner { max-width: 940px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.assin-topo .brand { color: var(--side-ink); padding: 0; }
.assin-topo .brand > span { display: flex; flex-direction: column; }
.assin-topo .brand svg { width: 34px; height: 34px; }
.assin-topo .btn { background: transparent; color: var(--side-ink); border-color: rgba(255,255,255,0.35); }
.assin-main { max-width: 940px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; padding-block: 28px 60px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.assin-cabecalho h1 { font-family: var(--f-heading); font-weight: 700; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; margin: 6px 0 6px; text-wrap: balance; }
.assin-cabecalho p { margin: 0 0 14px; color: var(--muted); font-size: 16px; }
.assin-cabecalho p b { color: var(--ink); }
.assin-quem { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.assin-quem li { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); font-size: 14px; }
.assin-quem li small { display: block; color: var(--muted); font-size: 12.5px; }
.assin-quem li.voce { border-color: var(--accent); }
.assin-quem .mark { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.assin-quem .feito .mark { background: var(--dado); border-color: var(--dado); color: #FFFFFF; }
.assin-quem .mark .icon { width: 12px; height: 12px; stroke-width: 2.6; }
.assin-passos { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.assin-passos li { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 14px; }
.assin-passos li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-size: 13px; }
.assin-passos li.ativo { color: var(--accent); border-color: var(--accent); }
.assin-passos li.ativo span { background: var(--accent); color: var(--on-accent); }
.assin-passos li.feito { color: var(--dado-ink); }
.assin-passos li.feito span { background: var(--dado); color: #FFFFFF; }
.assin-doc { overflow: hidden; }
.assin-doc-barra { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); font-size: 14px; }
.assin-doc-barra span { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.pdf-paginas { background: #E7EAF1; padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 14px; max-height: 78vh; overflow-y: auto; }
.pdf-pagina { max-width: 100%; height: auto; background: #FFFFFF; box-shadow: 0 2px 10px rgba(22, 33, 63, 0.15); }
.pdf-carregando { color: var(--muted); padding: 40px 0; text-align: center; }
.pdf-fim { text-align: center; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 10px; background: #E7EAF1; }
.pdf-paginas + .pdf-fim { margin-top: -1px; }
.assin-form form { display: flex; flex-direction: column; }
.sig-area { position: relative; margin-top: 10px; }
.sig-canvas { display: block; width: 100%; height: 180px; border: 1.5px dashed var(--line); border-radius: var(--r-md); background: #FFFFFF; touch-action: none; cursor: crosshair; }
.sig-canvas.modo-texto { cursor: default; }
.sig-linha { position: absolute; left: 24px; right: 24px; bottom: 44px; height: 1px; background: var(--muted); opacity: 0.35; pointer-events: none; }
.sig-dica { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); pointer-events: none; font-size: 15px; }
.sig-ferramentas { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.aceite { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-size: 14.5px; cursor: pointer; }
.aceite input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.assin-rodape { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 0 22px 8px; }
.assin-rodape p { margin: 0; font-size: 13px; max-width: 56ch; }
.assin-hash, .assin-codigo span { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; font-size: 12px; }
.assin-rodape .btn { height: 46px; padding: 0 22px; font-size: 16px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.pend-msg { padding: 0 22px 20px; margin: 4px 0 0; font-size: 13.5px; }
.assin-feito { padding: 32px 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.assin-feito h2 { margin: 0; font-family: var(--f-heading); font-size: 24px; }
.assin-feito p { margin: 0; max-width: 56ch; }
.sig-grande { max-width: min(320px, 100%); height: auto; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.assin-codigo { font-size: 13px; color: var(--muted); }
@media (max-width: 640px) {
  .pdf-paginas { padding: 8px; max-height: 70vh; }
  .assin-rodape, .pend-msg { padding-left: 16px; padding-right: 16px; }
  .assin-rodape .btn { width: 100%; justify-content: center; }
}

/* ---------- Relatórios: painel de BI ---------- */
:root {
  /* Cores das séries (ordem fixa, validada para daltonismo); "outros" é sempre cinza */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --s-outros: #A3A9B7;
  --grade-linha: #EAEDF3;
  --eixo: #C7CDD9;
}
.btn.perigo { color: var(--danger-ink); }
.btn.perigo:hover { background: var(--danger-soft); border-color: var(--danger-soft); }

.bi-add-wrap { position: relative; }
.bi-tipos {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 25; width: 340px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 14px;
}
.bi-tipos-grade { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bi-tipos-grade button {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px 10px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600;
}
.bi-tipos-grade button .icon { width: 30px; height: 30px; color: var(--accent); stroke-width: 1.5; }
.bi-tipos-grade button:hover, .bi-tipos-grade button:focus-visible { border-color: var(--accent); background: var(--info-soft); outline: none; }

.bi-paineis { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: -8px; }
.bi-paineis .chips { flex: 1; min-width: 0; }
.bi-paineis .chip { text-decoration: none; }
.bi-menu { position: relative; }
.bi-menu summary { list-style: none; cursor: pointer; }
.bi-menu summary::-webkit-details-marker { display: none; }
.bi-menu-pop {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 25; width: 280px; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); padding: 14px;
}
.bi-menu-pop form { display: flex; flex-direction: column; gap: 8px; }
.bi-menu-pop form + form { border-top: 1px solid var(--line); padding-top: 10px; }
.bi-menu-pop label { font-weight: 600; font-size: 14px; }
.bi-menu-pop .field { height: 36px; }

/* Cartões em linhas que quebram: --n é quantos cabem por fileira (indicador pequeno 5, gráfico pequeno 3, médio 2, grande 1) */
.bi-grade { --gap: 16px; display: flex; flex-wrap: wrap; gap: var(--gap); align-items: stretch; }
.bi-card {
  --n: 2; flex: 0 0 calc((100% - (var(--n) - 1) * var(--gap)) / var(--n)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 16px 18px 18px; min-width: 0; position: relative; transition: border-color 0.15s, box-shadow 0.15s, opacity 0.2s;
}
.bi-card.tam-p { --n: 3; }
.bi-card.tipo-numero.tam-p { --n: 5; }
.bi-card.tam-g { --n: 1; }
/* Indicador pequeno: cartão compacto, número se ajusta à largura */
.bi-card.tipo-numero.tam-p { padding: 14px 16px 16px; container-type: inline-size; }
.bi-card.tipo-numero.tam-p .bi-card-head { margin-bottom: 8px; }
.bi-card.tipo-numero.tam-p .bi-card-acoes { position: absolute; top: 8px; right: 8px; margin: 0; background: var(--surface); border-radius: var(--r-sm); }
.bi-card.tipo-numero.tam-p .bi-sub { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bi-card.tipo-numero.tam-p h3 { font-size: 14px; }
.bi-card.tipo-numero.tam-p .bi-sub { font-size: 12px; }
.bi-card.tipo-numero.tam-p .bi-numero b { font-size: clamp(22px, 15cqi, 32px); }
.bi-card.tipo-numero.tam-p .bi-numero span { font-size: 12px; margin-top: 6px; }
@media (hover: hover) {
  .bi-card.tipo-numero.tam-p .bi-card-acoes { opacity: 0; transition: opacity 0.15s; }
  .bi-card.tipo-numero.tam-p:hover .bi-card-acoes, .bi-card.tipo-numero.tam-p:focus-within .bi-card-acoes,
  .bi-card.tipo-numero.tam-p.selecionado .bi-card-acoes { opacity: 1; }
}
.bi-card.editavel { cursor: pointer; }
.bi-card.editavel:hover { border-color: #C9D3EC; }
.bi-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.bi-card.selecionado { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.bi-card.carregando .bi-corpo { opacity: 0.45; }
.bi-card.arrastando { opacity: 0.4; }
.bi-card-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.bi-card-head > div { flex: 1; min-width: 0; }
.bi-card-head h3 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; }
.bi-sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.bi-card-acoes { display: flex; gap: 2px; margin: -4px -6px 0 0; }
.bi-card-acoes button, .bi-card-acoes .bi-grip {
  width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r-sm); color: var(--muted); cursor: pointer;
}
.bi-card-acoes button:hover, .bi-card-acoes button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }
.bi-card-acoes .bi-grip { cursor: grab; }
.bi-card-acoes .icon { width: 16px; height: 16px; }
.bi-corpo { position: relative; min-height: 60px; transition: opacity 0.2s; }
.bi-corpo svg { display: block; width: 100%; overflow: visible; }
.bi-corpo svg text { font-family: var(--f-body); font-size: 12px; fill: var(--muted); }
.bi-corpo svg text.valor { fill: var(--ink); font-weight: 600; }
.bi-corpo svg text.tick { font-variant-numeric: tabular-nums; }
.bi-corpo .grade { stroke: var(--grade-linha); stroke-width: 1; shape-rendering: crispEdges; }
.bi-corpo .base { stroke: var(--eixo); stroke-width: 1; shape-rendering: crispEdges; }
.bi-corpo .alvo { fill: transparent; }
.bi-corpo .grupo { transition: opacity 0.12s; }
.bi-corpo.foco .grupo { opacity: 0.45; }
.bi-corpo.foco .grupo.ativo { opacity: 1; }
.bi-corpo .cruz { stroke: var(--muted); stroke-width: 1; shape-rendering: crispEdges; pointer-events: none; }
.bi-vazio-dados { color: var(--muted); font-size: 14px; padding: 24px 0; text-align: center; }

.bi-numero { padding: 4px 0 2px; }
.bi-numero b { display: block; white-space: nowrap; font-size: clamp(32px, 3.4vw, 42px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.05; color: var(--ink); }
.bi-numero span { display: block; margin-top: 8px; font-size: 13px; color: var(--muted); }

.bi-legenda { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: -2px 0 10px; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.bi-legenda li { display: inline-flex; align-items: center; gap: 6px; }
.bi-legenda i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.bi-legenda.linhas i { height: 2px; width: 14px; border-radius: 1px; }

.bi-rosca { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.bi-rosca svg { width: 180px; flex: none; }
.bi-rosca .bi-legenda { flex-direction: column; flex-wrap: nowrap; gap: 8px; margin: 0; flex: 1; min-width: 180px; font-size: 14px; }
.bi-rosca .bi-legenda li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 8px; align-items: center; cursor: default; }
.bi-rosca .bi-legenda .nome { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bi-rosca .bi-legenda .v { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.bi-rosca .bi-legenda .v small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.bi-rosca .bi-legenda li.ativo .nome { text-decoration: underline; }

.bi-tabela-wrap { overflow-x: auto; max-height: 360px; overflow-y: auto; }
.bi-tabela { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.bi-tabela th, .bi-tabela td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bi-tabela th:first-child, .bi-tabela td:first-child { text-align: left; white-space: normal; }
.bi-tabela thead th { font-size: 12px; font-weight: 600; color: var(--muted); position: sticky; top: 0; background: var(--surface); }
.bi-tabela tfoot td { font-weight: 700; border-bottom: 0; }

.bi-tooltip {
  position: fixed; z-index: 45; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: 9px 12px; font-size: 13px; min-width: 140px; max-width: 280px;
}
.bi-tooltip .t { font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.bi-tooltip .r { display: grid; grid-template-columns: 12px auto minmax(0, 1fr); align-items: center; gap: 8px; }
.bi-tooltip .r i { width: 12px; height: 2px; border-radius: 1px; }
.bi-tooltip .r b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bi-tooltip .r span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bi-vazio { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 44px 24px; }
.bi-vazio h2 { margin: 6px 0 0; font-size: 20px; }
.bi-vazio p { margin: 0; max-width: 48ch; }

/* Painel de configuração (lado direito) */
.bi-config {
  position: fixed; top: 0; right: 0; bottom: 0; width: 380px; z-index: 26; background: var(--surface);
  border-left: 1px solid var(--line); box-shadow: -10px 0 40px rgba(22, 33, 63, 0.08); display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); animation: slide-in 0.2s ease;
}
body.bi-config-aberto .main { padding-right: 380px; }
.bi-config-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.bi-config-head > div { flex: 1; min-width: 0; }
.bi-config-head .section-title { margin: 0; }
.bi-config-head h2 { margin: 4px 0 0; font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; }
.bi-config-body { flex: 1; overflow-y: auto; padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.bi-campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; margin: 0; padding: 0; }
.bi-campo > label, .bi-campo > legend, .bi-filtro > legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 6px; }
.bi-campo > legend { margin-bottom: 8px; }
.bi-campo .select, .bi-campo .field { width: 100%; height: 38px; }
.bi-campo small { font-size: 12.5px; }
.bi-dupla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bi-tipo-opcoes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.bi-tipo-opcoes label { position: relative; cursor: pointer; }
.bi-tipo-opcoes input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.bi-tipo-opcoes span {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px 7px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.bi-tipo-opcoes .icon { width: 22px; height: 22px; stroke-width: 1.5; }
.bi-tipo-opcoes input:checked + span { border-color: var(--accent); color: var(--accent); background: var(--info-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.bi-tipo-opcoes input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.bi-rotulo { font-weight: 600; font-size: 14px; }
.bi-filtros { display: flex; flex-direction: column; gap: 10px; }
.bi-filtro { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); }
.bi-filtro-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 13.5px; }
.bi-filtro-head button { width: 26px; height: 26px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r-sm); color: var(--muted); cursor: pointer; margin: -4px -6px -4px 0; }
.bi-filtro-head button:hover { background: var(--surface); color: var(--danger-ink); }
.bi-filtro-head .icon { width: 15px; height: 15px; }
.bi-filtro small { font-size: 12.5px; }
.bi-filtro .select, .bi-filtro .field { width: 100%; height: 36px; background: var(--surface); }
.bi-filtro .chip-check span { background: var(--surface); }
.bi-filtro .chip-check input:checked + span { background: var(--botao); }
.bi-checks { max-height: 180px; overflow-y: auto; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 4px 0; }
.bi-check { display: flex; align-items: center; gap: 8px; padding: 5px 10px; font-size: 14px; cursor: pointer; }
.bi-check:hover { background: var(--surface-2); }
.bi-check input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; margin: 0; }
.bi-mini { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.bi-sem-filtro { margin: 0; font-size: 13px; }
.bi-add-filtro { color: var(--accent); font-weight: 600; }
.chip-check { position: relative; display: inline-flex; }
.chip-check input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip-check span {
  display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer;
}
.chip-check input:checked + span { background: var(--botao); border-color: var(--botao); color: #FFFFFF; }
.chip-check input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.bi-salvo { margin: 0; font-size: 12.5px; min-height: 1.2em; }
.bi-config-foot { display: flex; gap: 6px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.bi-config-foot .btn.sm { padding: 0 10px; }

@media (max-width: 1280px) {
  .bi-card.tam-p { --n: 2; }
  .bi-card.tipo-numero.tam-p { --n: 3; }
}
@media (max-width: 1700px) {
  body.bi-config-aberto .bi-card.tipo-numero.tam-p { --n: 3; }
  body.bi-config-aberto .bi-card.tam-p { --n: 2; }
  body.bi-config-aberto .bi-card.tam-m { --n: 1; }
}
@media (min-width: 1101px) and (max-width: 1280px) {
  body.bi-config-aberto .bi-card.tipo-numero.tam-p { --n: 2; }
  body.bi-config-aberto .bi-card.tam-p { --n: 1; }
}
@media (max-width: 1100px) {
  body.bi-config-aberto .main { padding-right: 0; }
  .bi-config { width: min(400px, 100%); box-shadow: var(--shadow-lg); }
}
@media (max-width: 760px) {
  .bi-card, .bi-card.tam-p, .bi-card.tam-m, body.bi-config-aberto .bi-card.tam-p { --n: 1; }
  .bi-card.tipo-numero.tam-p, body.bi-config-aberto .bi-card.tipo-numero.tam-p { --n: 2; }
  .bi-grade { --gap: 12px; }
  .bi-config { top: auto; height: min(78vh, 640px); width: 100%; border-left: 0; border-top: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0; }
  .bi-tipos { position: fixed; left: 16px; right: 16px; top: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); width: auto; }
  .bi-menu-pop { right: auto; left: 0; }
}
.bi-paineis .chip { white-space: nowrap; }
@media (max-width: 760px) { .bi-paineis .chips { flex-basis: 100%; } }

/* ---------- Modelos: montagem da minuta ---------- */
.tpl-link { color: inherit; }
.tpl-link:hover { color: var(--accent); }
.montador { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 0; border-top: 1px solid var(--line); }
.montador-col { padding: 18px 22px 22px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.montador-col.biblioteca { background: var(--surface-2); border-left: 1px solid var(--line); border-radius: 0 0 var(--r-lg) 0; }
.montador-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.montador-cab h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.montador-cab .n { font-size: 12px; font-weight: 600; padding: 0 8px; border-radius: 999px; background: var(--info-soft); color: var(--info-ink); }
.montador-erro { margin: 0; padding: 0 22px 10px; }
.montador-fixas { font-size: 13px; color: var(--muted); padding: 8px 12px; border: 1px dashed var(--line); border-radius: var(--r-md); }
.montador-fixas span { font-weight: 600; color: var(--ink); }
.montador-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mont-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.mont-item.arrastando { opacity: 0.4; }
.mont-grip { cursor: grab; color: var(--muted); padding-top: 2px; }
.mont-grip .icon { width: 16px; height: 16px; }
.mont-num { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--info-soft); color: var(--info-ink); font-size: 12.5px; font-weight: 700; }
.mont-info { flex: 1; min-width: 0; }
.mont-titulo { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.mont-titulo b { font-weight: 600; font-size: 14.5px; }
.mont-trecho { margin: 4px 0 0; font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mont-acoes { display: flex; gap: 2px; flex: none; }
.mont-icone { width: 30px; height: 30px; display: grid; place-items: center; border: 0; background: none; border-radius: var(--r-sm); color: var(--muted); cursor: pointer; }
.mont-icone:hover:not([disabled]) { background: var(--surface-2); color: var(--ink); }
.mont-icone[disabled] { opacity: 0.3; cursor: default; }
.mont-icone.cima .icon { transform: rotate(90deg); }
.mont-icone.baixo .icon { transform: rotate(90deg); }
.mont-icone.tirar:hover { color: var(--danger-ink); background: var(--danger-soft); }
.mont-icone .icon { width: 16px; height: 16px; }
.montador-lista.biblio { max-height: 520px; overflow-y: auto; padding-right: 2px; }
.montador-lista.biblio .btn { flex: none; }
.montador-vazio { margin: 0; padding: 16px; text-align: center; color: var(--muted); font-size: 14px; border: 1px dashed var(--line); border-radius: var(--r-md); }
.montador-busca { position: relative; display: block; }
.montador-busca .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.montador-busca .field { width: 100%; height: 38px; padding-left: 34px; background: var(--surface); }
.montador-nova { background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.montador-nova .field, .montador-nova .select { width: 100%; }
.montador-nova textarea.field { min-height: 110px; }
.montador-dupla { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.montador-acoes { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.form-actions .spacer { flex: 1; }

/* Página do modelo */
.minuta-corpo { padding: 0 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.minuta-fixas { font-size: 14px; color: var(--muted); padding: 12px 14px; background: var(--surface-2); border-radius: var(--r-md); }
.minuta-fixas p { margin: 0; }
.minuta-fixas .section-title { margin-bottom: 4px; }
.minuta-objeto { margin-top: 8px !important; color: var(--ink); }
.minuta-lista { margin: 0; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 16px; }
.minuta-lista li::marker { font-weight: 700; color: var(--accent); }
.minuta-titulo { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.minuta-titulo h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
.minuta-lista p { margin: 6px 0 0; font-size: 15px; line-height: 1.6; max-width: 72ch; }

@media (max-width: 1000px) {
  .montador { grid-template-columns: minmax(0, 1fr); }
  .montador-col.biblioteca { border-left: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-lg) var(--r-lg); }
}
@media (max-width: 640px) {
  .montador-col { padding: 14px 16px 16px; }
  .montador-dupla { grid-template-columns: minmax(0, 1fr); }
  .mont-item { flex-wrap: wrap; }
  .montador-lista.biblio .mont-item .btn { margin-left: auto; }
}

/* Pessoas: acesso por link */
.usuario-previa { height: 38px; display: flex; align-items: center; padding: 0 12px; border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--surface-2); color: var(--muted); font-size: 14px; }
.usuario-previa.ok { color: var(--ink); font-weight: 600; border-style: solid; }
.acesso-corpo { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 0 22px 20px; }
.acesso-situacao { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 14px; }
.acesso-alternativa { margin: 0 22px 22px; padding: 14px 16px; border-radius: var(--r-md); background: var(--warn-soft); display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.acesso-alternativa p { margin: 0; }
.acesso-alternativa .mono { overflow-wrap: anywhere; font-size: 13px; }
.login-card .login-link { font-size: 14px; text-align: center; }
.login-card .login-ok { margin: 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--dado-soft); color: var(--dado-ink); font-size: 14px; }
.login-card p.muted { margin: -6px 0 0; font-size: 14px; }
.login-card ul.regras { margin: -6px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.login-form { display: flex; flex-direction: column; gap: 14px; }

/* Número do contrato: gerado pelo sistema, só leitura */
.numero-fixo { height: 38px; display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); color: var(--ink); font-weight: 600; cursor: default; user-select: all; }

/* Âncoras (#financeiro etc.) não ficam escondidas atrás da barra do topo */
.panel[id] { scroll-margin-top: 84px; }

/* Paginação com setas (parcelas) */
.paginacao { align-items: center; }
.paginas { display: flex; align-items: center; gap: 8px; }
.paginas .seta { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--botao); color: #FFFFFF; transition: background 0.15s; }
.paginas a.seta:hover { background: var(--botao-hover); text-decoration: none; }
.paginas .seta[aria-disabled="true"] { background: var(--neutral-soft); color: var(--muted); opacity: 0.6; }
.paginas .seta .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.pagina-n { font-size: 13px; color: var(--muted); min-width: 52px; text-align: center; }

/* Fichas em duas colunas: a última caixa de cada coluna cresce para as duas terminarem na mesma altura */
.detail-grid { align-items: stretch; }
.detail-grid > .col > .panel:last-child { flex: 1; }

/* ---------- Agente de busca ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.agente { width: min(880px, 100%); margin-inline: auto; display: flex; flex-direction: column; gap: 18px; min-height: calc(100vh - 160px); }
.agente-conversa { flex: 1; display: flex; flex-direction: column; gap: 18px; }
.agente-boas-vindas, .agente-msg { display: flex; gap: 12px; align-items: flex-start; }
.agente-boas-vindas p { margin: 4px 0 10px; }
.agente-boas-vindas.compacto .agente-sugestoes { display: none; }
.agente-avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--botao); color: #fff; }
.agente-avatar .icon { width: 18px; height: 18px; }
.agente-eu { justify-content: flex-end; }
.agente-eu-balao { max-width: 75%; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.agente-eu p { margin: 0; background: var(--botao); color: #fff; padding: 10px 14px; border-radius: 16px 16px 4px 16px; overflow-wrap: anywhere; }
.agente-quando { color: var(--muted); font-size: 12px; }
.agente-corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px 16px 16px 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.agente-texto { margin: 0; font-size: 15.5px; line-height: 1.5; }
.agente-esperando .agente-texto { padding-top: 6px; }
.agente-destaques { display: flex; flex-wrap: wrap; gap: 10px; }
.agente-num { flex: 1 1 140px; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); }
.agente-num b { display: block; font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.agente-num span { font-size: 12.5px; color: var(--muted); }
.agente-itens { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); }
.agente-itens li + li { border-top: 1px solid var(--line); }
.agente-item { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 12px; color: inherit; flex-wrap: wrap; }
a.agente-item:hover { background: var(--surface-2); text-decoration: none; }
.agente-item-info { min-width: 0; flex: 1 1 260px; }
.agente-item-info b { display: block; font-weight: 600; font-size: 14.5px; }
a.agente-item:hover .agente-item-info b { color: var(--botao); }
.agente-item-info small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.agente-item-lado { display: flex; align-items: center; gap: 10px; flex: none; }
.agente-valor { font-weight: 600; font-size: 14px; white-space: nowrap; }
.agente-mais, .agente-links { margin: 0; font-size: 13.5px; }
.agente-links { display: flex; gap: 14px; flex-wrap: wrap; }
.agente-entendi { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; }
.tag-entendi { padding: 2px 8px; border-radius: 999px; background: var(--info-soft); color: var(--info-ink); }
.agente-sugestoes .chip { cursor: pointer; font: inherit; font-size: 13.5px; }
.agente-entrada { position: sticky; bottom: 12px; display: flex; gap: 8px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.agente-entrada .field { flex: 1; height: 44px; border: 0; font-size: 15.5px; }
.agente-entrada .field:focus { outline: none; }
.agente-entrada:focus-within { border-color: var(--botao); }
.agente-enviar { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 12px; }
.agente-enviar .icon { width: 20px; height: 20px; stroke-width: 2.2; }
.agente-rodape { margin: -8px 0 0; text-align: center; font-size: 12.5px; }
@media (max-width: 640px) {
  .agente-eu-balao { max-width: 90%; }
  .agente-avatar { display: none; }
}

/* Cidade + UF com sugestões */
.campo-cidade-uf { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 16px 14px; min-width: 0; }
.sugestoes-wrap { position: relative; }
.sugestoes-wrap .field { width: 100%; }
.sugestoes { position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; max-height: 280px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.sugestoes li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 14.5px; }
.sugestoes li small { color: var(--muted); font-weight: 600; font-size: 12px; }
.sugestoes li.ativo, .sugestoes li:hover { background: var(--info-soft); }
.sugestoes li.vazio { color: var(--muted); cursor: default; background: none; }
[data-cidade-ajuda].ok { color: var(--dado-ink); }
[data-cidade-ajuda].bad { color: var(--warn-ink); }
@media (max-width: 640px) { .campo-cidade-uf { grid-template-columns: minmax(0, 1fr) 120px; } }

.campo-cidade-uf { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) 260px; }
@media (max-width: 640px) { .campo-cidade-uf { grid-template-columns: minmax(0, 1fr) 130px; } }

/* Calendário: período com início e fim */
.cal-day.in-range { background: var(--info-soft); border-radius: 0; }
.cal-day.is-sel { background: var(--botao); color: #fff; }
.cal-day.is-inicio { border-radius: var(--r-md) 0 0 var(--r-md); }
.cal-day.is-fim { border-radius: 0 var(--r-md) var(--r-md) 0; }
.cal-instrucao b { color: var(--ink); }
.cal-periodo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.cal-periodo label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.cal-periodo .field { height: 34px; width: 100%; font-size: 13.5px; padding: 0 8px; }
.cal-periodo .btn { height: 34px; }
@media (max-width: 640px) { .cal-periodo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .cal-periodo .btn { grid-column: 1 / -1; } }

/* Agente: arquivos para baixar */
.agente-arquivo { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--botao); border-radius: var(--r-md); background: var(--info-soft); color: var(--ink); }
.agente-arquivo:hover { text-decoration: none; background: #D5DFFA; }
.agente-arquivo > .icon { margin-left: auto; color: var(--botao); width: 20px; height: 20px; }
.agente-arquivo-ic { flex: none; width: 42px; height: 42px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--botao); }
.agente-arquivo-ic.pdf { background: #C2362B; }
.agente-arquivo-ic.xlsx { background: #1D7044; }
.agente-arquivo-ic.csv { background: #4B5563; }
.agente-arquivo-ic.docx { background: #2B579A; }
.agente-arquivo-tx b { display: block; font-size: 15px; }
.agente-arquivo-tx small { color: var(--muted); font-size: 13px; }
.agente-exportar { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; align-items: center; }
.agente-exportar a { font-weight: 600; }

/* ---------- Agente: conversas salvas ---------- */
.agente-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.agente-historico { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 108px); min-width: 0; }
.agente-hist-cab { display: flex; flex-direction: column; gap: 8px; }
.agente-hist-toggle { display: none; }
.agente-hist-toggle .n { font-weight: 600; color: var(--muted); }
.agente-nova { justify-content: center; }
.agente-hist-corpo { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; }
.agente-hist-busca { position: relative; display: block; }
.agente-hist-busca .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.agente-hist-busca .field { width: 100%; height: 38px; padding-left: 34px; background: var(--surface); }
.agente-hist-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.agente-hist-lista a { display: block; padding: 9px 12px; border-radius: var(--r-md); color: var(--ink); }
.agente-hist-lista a:hover { background: var(--surface-2); text-decoration: none; }
.agente-hist-lista a span { display: block; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agente-hist-lista a small { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.agente-hist-lista a.ativa { background: var(--info-soft); }
.agente-hist-lista a.ativa span { color: var(--botao); font-weight: 600; }
.agente-hist-vazio { margin: 4px 12px; font-size: 13px; }
.agente-titulo { overflow-wrap: anywhere; }
.agente .page-head { flex-direction: column; align-items: flex-start; }
.agente-acoes { align-items: flex-start; }
.agente-renomear { position: relative; }
.agente-renomear summary { list-style: none; cursor: pointer; }
.agente-renomear summary::-webkit-details-marker { display: none; }
.agente-renomear-form {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 6; width: min(420px, calc(100vw - 32px));
  display: flex; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg);
}
.agente-renomear-form .field { flex: 1; min-width: 0; }
.agente-renomear-form .btn { flex: none; }
@media (max-width: 1100px) {
  .agente-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .agente-historico { position: static; max-height: none; width: min(880px, 100%); margin-inline: auto; }
  .agente-hist-cab { flex-direction: row; }
  .agente-hist-toggle { display: inline-flex; }
  .agente-nova { margin-left: auto; }
  .agente-hist-corpo { display: none; max-height: 50vh; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); }
  .agente-hist-corpo.aberto { display: flex; }
}

/* Agente: barras nos agrupamentos (por UF, por fornecedor...) */
.agente-barra { display: block; height: 6px; margin-top: 7px; border-radius: 3px; background: var(--surface-2); overflow: hidden; max-width: 360px; }
.agente-barra span { display: block; height: 100%; border-radius: 3px; background: var(--botao); }

/* ---------- Telas de acesso: formulário à esquerda, marca e ilustração no azul à direita ---------- */
.acesso { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: #FFFFFF; }
.acesso-lado {
  display: flex; justify-content: center; align-items: flex-start;
  padding: clamp(40px, 7vh, 72px) max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px));
}
.acesso-caixa { width: min(400px, 100%); }
.acesso-logo { display: block; width: 56px; height: 56px; margin: 0 auto 40px; border-radius: 8px; box-shadow: 0 6px 18px rgba(30, 58, 138, 0.25); }
.acesso-nome-mobile { display: none; }
.acesso-titulo { font-size: 24px; font-weight: 700; margin: 0 0 6px; }
.acesso-texto.acesso-intro { margin: 0 0 16px; }
.acesso-abas { display: flex; gap: 18px; border-bottom: 2px solid var(--line); margin-bottom: 16px; }
.acesso-aba {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -2px; padding: 8px 0;
  font: inherit; font-size: 14.5px; color: var(--ink); cursor: pointer;
}
.acesso-aba:hover { color: var(--botao); }
.acesso-aba[aria-selected="true"] { color: var(--botao); border-bottom-color: var(--botao); font-weight: 600; }
.acesso-cartao { border: 1px solid var(--line); border-radius: 10px; padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 14px; background: #FFFFFF; }
.acesso-form { display: flex; flex-direction: column; gap: 14px; }
.acesso-campo { display: flex; flex-direction: column; gap: 6px; }
.acesso-campo label { font-size: 14px; font-weight: 500; color: var(--ink); }
.acesso-campo .field { height: 42px; width: 100%; }
.acesso-senha { display: flex; }
.acesso-senha .field { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.acesso-olho {
  flex: none; width: 42px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink);
}
.acesso-olho:hover { background: var(--info-soft); color: var(--botao); }
.acesso-olho[aria-pressed="true"] { color: var(--botao); }
.acesso-olho .icon { width: 18px; height: 18px; }
.acesso-botao {
  display: flex; align-items: center; justify-content: center; height: 42px; width: 100%; border: 0; border-radius: 8px; cursor: pointer;
  background: linear-gradient(90deg, #3463EC 0%, #2A51D9 55%, #1F3FB8 100%); color: #FFFFFF; font: inherit; font-weight: 600; font-size: 15px;
  box-shadow: 0 4px 14px rgba(46, 91, 234, 0.3); transition: filter 0.15s, box-shadow 0.15s;
}
.acesso-botao:hover { filter: brightness(1.08); box-shadow: 0 6px 18px rgba(46, 91, 234, 0.38); text-decoration: none; color: #FFFFFF; }
.acesso-link { display: inline-block; margin-top: 18px; font-size: 14px; color: var(--azul); }
.acesso-texto { margin: 0; font-size: 14.5px; line-height: 1.5; }
.acesso-cartao .login-ok { margin: 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--dado-soft); color: var(--dado-ink); font-size: 14px; }
.acesso-cartao ul.regras { margin: 2px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }

.acesso-arte {
  position: relative; overflow: hidden; color: #FFFFFF; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 32px 112px;
  background:
    radial-gradient(circle at 82% 6%, rgba(255, 255, 255, 0.2), transparent 38%),
    radial-gradient(circle at 8% 96%, rgba(24, 185, 138, 0.28), transparent 42%),
    linear-gradient(160deg, #3463EC 0%, #2A51D9 52%, #1F3FB8 100%);
}
.acesso-ilustracao { width: min(500px, 100%); height: auto; overflow: visible; }
.acesso-ilustracao text { font-family: var(--f-body); }
.acesso-ilustracao .arte-rotulo { font-size: 12.5px; fill: #5B6378; }
.acesso-ilustracao .arte-valor { font-size: 17px; font-weight: 700; fill: #16213F; }
.acesso-ilustracao .arte-pill { font-size: 14px; font-weight: 600; fill: #0E7A5A; }
.acesso-marca { display: flex; align-items: baseline; justify-content: center; gap: 18px; margin-top: 36px; }
.acesso-marca-nome { color: #FFFFFF; font-weight: 700; font-size: clamp(44px, 4.8vw, 68px); line-height: 1; letter-spacing: 0.18em; margin-right: -0.18em; }
.acesso-marca .ipso { font-family: var(--f-display); font-style: italic; font-weight: 600; font-size: clamp(48px, 5.4vw, 72px); line-height: 1; }
.acesso-sub { margin: 18px 0 0; font-size: 14px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255, 255, 255, 0.82); }
.acesso-frase { margin: 28px 0 0; font-size: clamp(18px, 1.7vw, 23px); line-height: 1.4; max-width: 28ch; }
.acesso-frase strong { color: #6EE7B7; font-weight: 700; }
.acesso-rodape {
  position: absolute; left: 0; right: 0; bottom: 32px; margin: 0; display: flex; justify-content: center; align-items: baseline; gap: 12px;
  font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255, 255, 255, 0.85);
}
.acesso-rodape .ipso { font-family: var(--f-display); font-style: italic; font-weight: 600; font-size: 26px; letter-spacing: 0; text-transform: none; color: #FFFFFF; }
.acesso-rodape .ipso i { color: #18B98A; font-style: normal; margin: 0 1px; }


@media (max-width: 900px) {
  .acesso { grid-template-columns: minmax(0, 1fr); }
  .acesso-arte { display: none; }
  .acesso-logo { margin-bottom: 12px; }
  .acesso-nome-mobile { display: block; text-align: center; margin: 0 0 28px; font-weight: 700; font-size: 22px; letter-spacing: 0.18em; color: var(--azul); }
}

/* Telas de acesso: avisos e código de verificação */
.acesso-aviso { margin: 0 0 16px; padding: 12px 14px; border-radius: var(--r-md); font-size: 14px; line-height: 1.45; }
.acesso-aviso.ok { background: var(--dado-soft); color: var(--dado-ink); }
.acesso-aviso.erro { background: var(--danger-soft); color: var(--danger-ink); }
.acesso-campo .field.acesso-codigo { height: 56px; font-size: 28px; font-weight: 700; letter-spacing: 0.4em; text-align: center; padding-left: 0.4em; }
.acesso-campo .field.acesso-codigo::placeholder { color: #C9D2EA; }
.acesso-ajuda { font-size: 13px; color: var(--muted); }
.acesso-links { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-top: 18px; }
.acesso-links .acesso-link { margin-top: 0; }
.acesso-link-botao { background: none; border: 0; padding: 0; font: inherit; font-size: 14px; color: var(--azul); cursor: pointer; }
.acesso-link-botao:hover { text-decoration: underline; }

/* ---------- Janela (modal) ---------- */
dialog.modal {
  width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); flex-direction: column; overflow: hidden;
}
dialog.modal[open] { display: flex; }
dialog.modal::backdrop { background: var(--scrim); }
.modal-cab { display: flex; align-items: flex-start; gap: 14px; padding: 20px 24px 14px; border-bottom: 1px solid var(--line); }
.modal-cab > div { flex: 1; min-width: 0; }
.modal-cab h2 { font-family: var(--f-heading); font-weight: 700; font-size: 22px; line-height: 1.2; margin: 6px 0 0; }
.modal-corpo { padding: 18px 24px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-rodape { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-estado { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 14px 16px; border-radius: var(--r-md); font-size: 14.5px; line-height: 1.45; }
.modal-estado .icon { width: 20px; height: 20px; margin-top: 1px; }
.modal-estado p { margin: 4px 0 0; color: var(--ink); }
.modal-estado.ok { background: var(--dado-soft); color: var(--dado-ink); }
.modal-estado.warn { background: var(--warn-soft); color: var(--warn-ink); }
.modal-estado.erro { background: var(--danger-soft); color: var(--danger-ink); }
.modal-form { display: flex; flex-direction: column; gap: 14px; }
.modal-form .kv { margin: 0; }
.modal-campo { display: flex; flex-direction: column; gap: 6px; }
.modal-campo label { font-size: 14px; font-weight: 600; }
.modal-campo textarea.field { width: 100%; height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; box-sizing: border-box; font: inherit; }
.modal-nota { margin: 0; font-size: 13px; }
.modal-pagina { max-width: 600px; margin: 24px auto; overflow: hidden; }
.doc-ultima { display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.doc-ultima .icon { width: 15px; height: 15px; margin-top: 2px; color: var(--botao); }
@media (max-width: 560px) {
  .modal-cab, .modal-corpo, .modal-rodape { padding-left: 16px; padding-right: 16px; }
  .modal-rodape .btn { flex: 1; justify-content: center; }
}
.modal-form .kv { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.config-form { display: flex; flex-direction: column; gap: 8px; }
.config-form label { font-weight: 600; font-size: 14px; }
.config-linha { display: flex; gap: 8px; flex-wrap: wrap; }
.config-linha .field { flex: 1 1 240px; min-width: 0; }
.config-form small { font-size: 13px; line-height: 1.45; }

/* Relatórios: acesso aos painéis por grupo */
.bi-acesso { display: flex; align-items: center; gap: 8px; margin-top: 10px !important; font-size: 14px; color: var(--muted); }
.bi-acesso .icon { width: 16px; height: 16px; color: var(--botao); }
.bi-acesso b { color: var(--ink); font-weight: 600; }
.bi-chip-restrito { width: 13px; height: 13px; margin-left: 6px; vertical-align: -2px; opacity: 0.7; }
.bi-grupos { min-width: 280px; }
.bi-grupos-titulo { margin: 0 0 4px; font-weight: 600; font-size: 14px; }
.bi-grupo { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; }
.bi-grupo:hover { background: var(--surface-2); }
.bi-grupo input { margin-top: 3px; accent-color: var(--botao); }
.bi-grupo span { display: flex; flex-direction: column; font-size: 14px; font-weight: 500; }
.bi-grupo small { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.bi-grupos > small { font-size: 12.5px; line-height: 1.4; }

/* Janela "Quem pode ver" do painel */
.acesso-painel section { display: flex; flex-direction: column; gap: 8px; }
.acesso-painel .section-title { margin: 0; }
.acesso-grupos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.acesso-pessoas-cab { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.acesso-contador { font-size: 13px; font-weight: 600; color: var(--botao); }
.acesso-busca { position: relative; display: block; }
.acesso-busca .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.acesso-busca .field { width: 100%; height: 40px; padding-left: 34px; box-sizing: border-box; }
.acesso-pessoas { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-md); max-height: 260px; overflow-y: auto; }
.acesso-pessoas li + li { border-top: 1px solid var(--line); }
.acesso-pessoa { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; }
.acesso-pessoa:hover { background: var(--surface-2); }
.acesso-pessoa input { accent-color: var(--botao); width: 16px; height: 16px; flex: none; }
.acesso-pessoa:has(input:checked) { background: var(--info-soft); }
.acesso-pessoa.desativada { cursor: default; opacity: 0.65; }
.acesso-avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--azul); font-size: 12px; font-weight: 700; }
.acesso-pessoa-nome { display: flex; flex-direction: column; min-width: 0; font-size: 14px; font-weight: 500; }
.acesso-pessoa-nome small { color: var(--muted); font-weight: 400; font-size: 12.5px; overflow-wrap: anywhere; }
@media (max-width: 560px) { .acesso-grupos { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Cadastro de contrato: tipo com "Novo tipo" e contrapartes com busca ---------- */
.campo-cab { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.campo-cab label { font-weight: 600; font-size: 14px; }
.campo-acao { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; color: var(--botao); text-decoration: none; padding: 2px 4px; margin: -2px -4px; border-radius: var(--r-sm); }
.campo-acao .icon { width: 14px; height: 14px; }
.campo-acao:hover { color: var(--botao-hover); background: var(--info-soft); }
.campo-acao:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tipos-proprios { display: flex; flex-direction: column; gap: 6px; }
.tipos-proprios p { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tipos-proprios .tag { background: var(--surface-2); border-radius: 999px; padding: 3px 10px; text-transform: none; letter-spacing: 0; font-size: 12.5px; color: var(--ink); }
.modal-campo.com-erro .field { border-color: var(--danger-ink); }

.seletor { display: flex; flex-direction: column; gap: 8px; }
.seletor-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.seletor-chips[hidden] { display: none; }
.seletor-chip { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; padding: 3px 4px 3px 12px; border-radius: 999px; background: var(--info-soft); color: var(--accent); font-size: 14px; font-weight: 600; }
.seletor-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seletor-chip button { display: inline-grid; place-items: center; width: 24px; height: 24px; flex: none; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.seletor-chip button:hover { background: rgba(30, 58, 138, 0.12); }
.seletor-chip button:focus-visible { outline: 2px solid var(--focus); }
.seletor-chip .icon { width: 14px; height: 14px; }
.seletor-busca { position: relative; display: flex; align-items: center; }
.seletor-busca > .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.seletor-busca .field { padding-left: 38px; }
.seletor-lista { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.seletor-lista [role=option] { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; font-size: 14.5px; }
.seletor-lista [role=option] small { color: var(--muted); font-size: 12.5px; }
.seletor-lista [role=option]:hover, .seletor-lista [role=option].ativa { background: var(--surface-2); }
.seletor-lista [role=option].ativa { box-shadow: inset 3px 0 0 var(--botao); }
.seletor-vazio { padding: 10px; color: var(--muted); font-size: 14px; }

/* Aprovações: lembrete já enviado */
.ap-lembrete { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--dado-ink); padding: 0 4px; }
.ap-lembrete .icon { width: 16px; height: 16px; }

/* ---------- Pessoas: o que cada função faz e permissões avulsas ---------- */
.funcao-opcao { flex-direction: column; gap: 8px; cursor: default; }
.funcao-opcao > label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.funcao-opcao:hover { background: none; }
.funcao-opcao:has(> label input:checked) { border-color: var(--accent); background: var(--info-soft); }
.funcao-opcao:has(> label input:disabled) > label { cursor: default; }
.funcao-detalhe { margin-left: 27px; font-size: 13px; }
.funcao-detalhe summary { cursor: pointer; color: var(--botao); font-weight: 600; width: fit-content; list-style: none; }
.funcao-detalhe summary::-webkit-details-marker { display: none; }
.funcao-detalhe summary::before { content: "▸ "; }
.funcao-detalhe[open] summary::before { content: "▾ "; }
.funcao-detalhe summary .muted { font-weight: 400; }
.funcao-detalhe ul, .funcao-bloco ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; color: var(--ink); }
.funcoes-lista { gap: 14px; }
.funcao-bloco { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.funcao-bloco:last-child { border-bottom: 0; padding-bottom: 0; }
.funcao-bloco h3 { margin: 0; font-size: 16px; font-weight: 700; }
.funcao-bloco > p { margin: 2px 0 0; font-size: 13.5px; }
.funcao-bloco li { font-size: 14px; }
.permissoes-nota { padding-top: 0; }
.permissoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px 22px; padding: 0 22px 22px; }
.permissoes-area { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.permissoes-area legend { padding: 0; margin-bottom: 4px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.permissao { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: var(--r-md); cursor: pointer; font-size: 14px; }
.permissao:hover { background: var(--surface-2); }
.permissao input { width: 16px; height: 16px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.permissao small { display: block; font-size: 12.5px; color: var(--muted); }
.permissao small:empty { display: none; }
.permissao.pela-funcao { cursor: default; }
.permissao.pela-funcao:hover { background: none; }
.permissao.avulsa { background: var(--violet-soft); }
.permissao.avulsa small { color: var(--violet-ink); font-weight: 600; }
@media (max-width: 640px) { .permissoes { padding-left: 16px; padding-right: 16px; } }

/* Configurações: funções com acesso ao Agente PACTA */
.agente-funcoes { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.agente-funcoes legend { padding: 0; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.config-form .agente-funcoes label { font-weight: 400; }

/* ---------- Funções ---------- */
.funcoes-secao { margin: 8px 0 12px; }
.cards + .funcoes-secao, .panel + .funcoes-secao { margin-top: 28px; }
.funcao-card .funcao-detalhe { margin-left: 0; }
.funcao-card h3 { margin-top: 4px; }
.permissoes-todas { font-size: 13px; font-weight: 600; color: var(--botao); width: fit-content; margin: -2px 0 4px 10px; }
.funcao-pessoas { list-style: none; margin: 0; }
.funcao-pessoas li[hidden] { display: none; }
.funcao-pessoas .opcao { height: 100%; box-sizing: border-box; }
.funcao-pessoas-busca { padding-top: 4px; }
.funcao-pessoas-busca .acesso-busca { max-width: 360px; }
.funcao-excluir { display: flex; justify-content: flex-start; margin-top: -8px; }
.funcao-opcao .pill { margin-left: 6px; vertical-align: 1px; font-size: 11px; }

/* ---------- Importar PDF: revisão das variáveis ---------- */
.importar-destino { padding-top: 4px; }
.revisao-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, 1fr); gap: 20px; align-items: start; }
.revisao-doc { position: sticky; top: 76px; }
.revisao-legenda { display: inline-flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; }
.pdf-texto { max-height: calc(100vh - 190px); overflow-y: auto; padding: 4px 22px 22px; font-size: 14px; line-height: 1.6; color: var(--ink); position: relative; }
.pdf-texto p { margin: 0 0 10px; text-align: justify; }
.pdf-texto p.pdf-cab { font-weight: 700; margin-top: 16px; text-align: left; }
.pdf-var { background: var(--info-soft); color: var(--info-ink); border-radius: 4px; padding: 0 3px; box-shadow: inset 0 -2px 0 var(--botao); cursor: pointer; font-weight: 600; }
.pdf-var.campo { background: var(--violet-soft); color: var(--violet-ink); box-shadow: inset 0 -2px 0 var(--violet-ink); }
.pdf-var.fixo { background: transparent; color: inherit; font-weight: inherit; box-shadow: inset 0 -1px 0 var(--muted); }
.pdf-var.ativo { outline: 2px solid var(--focus); outline-offset: 1px; }
.revisao-legenda .pdf-var { cursor: default; padding: 1px 6px; }
.var-lista { list-style: none; margin: 0; padding: 0 22px 8px; display: flex; flex-direction: column; }
.var-item { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; scroll-margin-top: 90px; }
.var-item:first-child { border-top: 0; }
.var-item.ativo { background: linear-gradient(90deg, var(--info-soft), transparent 70%); margin: 0 -22px; padding-left: 22px; padding-right: 22px; }
.var-topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.var-trecho { border: 0; background: var(--surface-2); border-radius: var(--r-sm); padding: 3px 8px; font: inherit; font-weight: 700; font-size: 14px; color: var(--ink); cursor: pointer; text-align: left; max-width: 100%; overflow-wrap: anywhere; }
.var-trecho:hover { background: var(--info-soft); }
.var-contexto { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
.var-contexto b { color: var(--ink); }
.var-escolha { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.var-escolha .select, .var-nova .select { width: 100%; height: 38px; }
.var-novas { margin: 0 22px 22px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.var-novas summary { cursor: pointer; font-weight: 600; color: var(--botao); }
.var-novas p { font-size: 13px; margin: 8px 0; }
.var-nova { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 6px; margin-top: 8px; }
.var-nova [data-rotulo] { grid-column: 1 / -1; }
.revisao-clausulas .field, .revisao-clausulas .select { width: 100%; }
.revisao-clausulas td { vertical-align: middle; }
.cel-check { width: 40px; }
.cel-check input { width: 17px; height: 17px; accent-color: var(--accent); }
@media (max-width: 1000px) {
  .revisao-grid { grid-template-columns: minmax(0, 1fr); }
  .revisao-doc { position: static; }
  .pdf-texto { max-height: 55vh; }
}
@media (max-width: 640px) {
  .pdf-texto, .var-lista { padding-left: 16px; padding-right: 16px; }
  .var-item.ativo { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .var-novas { margin-left: 16px; margin-right: 16px; }
  .var-nova { grid-template-columns: minmax(0, 1fr); }
}

/* Variáveis nos textos de modelos e cláusulas */
.var-chip { display: inline-block; background: var(--info-soft); color: var(--info-ink); border-radius: 999px; padding: 0 8px; font-size: 0.86em; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.var-chip.campo { background: var(--violet-soft); color: var(--violet-ink); }
.var-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.texto-modelo { font-size: 14.5px; line-height: 1.65; max-width: 80ch; }
.texto-modelo p, .texto-clausula p, .clause-text p { margin: 0 0 10px; }
.texto-modelo p:last-child, .texto-clausula p:last-child, .clause-text p:last-child { margin-bottom: 0; }
.texto-modelo .texto-cab { font-weight: 700; margin-top: 18px; color: var(--accent); }
.texto-clausula .texto-cab, .clause-text .texto-cab { font-weight: 700; }
.campos-modelo { border: 1px solid var(--violet-soft); background: color-mix(in srgb, var(--violet-soft) 35%, transparent); border-radius: var(--r-md); padding: 14px 16px; margin: 0; }
.campos-modelo[hidden] { display: none; }
.campos-modelo legend { font-weight: 700; font-size: 14px; color: var(--violet-ink); padding: 0 6px; }
.campos-modelo > p { margin: 0 0 10px; font-size: 13px; }
.campos-modelo-grade { padding: 0; }
.texto-variaveis { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.55; min-height: 420px; }
.variaveis-ajuda { margin-top: 6px; font-size: 13.5px; }
.variaveis-ajuda summary { cursor: pointer; font-weight: 600; color: var(--botao); width: fit-content; }
.variaveis-ajuda > p { margin: 8px 0; }
.variaveis-ajuda code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; background: var(--surface-2); border-radius: 4px; padding: 1px 5px; color: var(--accent); }
.variaveis-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 8px 22px; }
.variaveis-grade ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.variaveis-grade .section-title { margin: 8px 0 0; }

/* ---------- Ajuda ---------- */
.ajuda-topo { display: grid; gap: 14px; margin-bottom: 20px; }
.ajuda-busca { position: relative; display: flex; align-items: center; max-width: 560px; }
.ajuda-busca .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.ajuda-busca .field { width: 100%; padding-left: 38px; }
.ajuda-assuntos { display: flex; flex-wrap: wrap; gap: 8px; }
.ajuda-assuntos .chip { text-decoration: none; }
.ajuda-grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 16px; align-items: start; }
.ajuda-grade.em-colunas { display: flex; align-items: flex-start; }
.ajuda-coluna { flex: 1 1 0; min-width: 0; display: grid; gap: 16px; }
.ajuda-assunto { scroll-margin-top: 90px; padding-bottom: 8px; }
.ajuda-assunto .panel-head h2 { display: flex; align-items: center; gap: 10px; }
.ajuda-assunto .panel-head h2 .icon { color: var(--accent); }
.ajuda-resumo { margin: -4px 22px 10px; color: var(--muted); font-size: 14px; }
.ajuda-q { border-top: 1px solid var(--line); }
.ajuda-q > summary { list-style: none; cursor: pointer; padding: 13px 22px 13px 46px; position: relative; font-weight: 600; }
.ajuda-q > summary::-webkit-details-marker { display: none; }
.ajuda-q > summary::before {
  content: ""; position: absolute; left: 24px; top: 19px; width: 7px; height: 7px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .15s;
}
.ajuda-q[open] > summary::before { transform: rotate(45deg); top: 17px; }
.ajuda-q > summary:hover { background: var(--surface-2); }
.ajuda-q > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.ajuda-q ol { margin: 0 22px 12px 46px; padding-left: 18px; display: grid; gap: 6px; }
.ajuda-q li { padding-left: 2px; line-height: 1.5; }
.ajuda-q li::marker { color: var(--accent); font-weight: 700; }
.ajuda-dica { margin: 0 22px 16px 46px; padding: 10px 12px; border-radius: var(--r-md); background: var(--info-soft); color: var(--info-ink); font-size: 14px; line-height: 1.5; }
.ajuda-suporte { margin-top: 16px; padding: 18px 22px; }
.ajuda-suporte h2 { font-family: var(--f-heading); font-size: 18px; margin: 0 0 6px; }
.ajuda-suporte p { margin: 0; color: var(--muted); }
@media (max-width: 560px) {
  .ajuda-q > summary { padding: 13px 16px 13px 38px; }
  .ajuda-q > summary::before { left: 17px; }
  .ajuda-q ol, .ajuda-dica { margin-left: 38px; margin-right: 16px; }
  .ajuda-resumo { margin-left: 16px; margin-right: 16px; }
}

/* ---------- Processos ---------- */
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-size: 14px; }
label.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.processos-busca { flex: 1 1 260px; max-width: 360px; }
.fases-tabela .field { width: 100%; min-width: 0; }
.fases-tabela .field.ordem { width: 72px; }
.fases-tabela td { vertical-align: middle; }
.dl-selo { margin-top: 6px; }
.mini-list li > .l { flex: 1 1 200px; }
/* Leitura do PDF do processo */
.leitura-pdf { display: grid; gap: 14px; padding: 4px 22px 22px; }
.leitura-pdf .note { margin: 0; }
.leitura-pdf .campo { padding: 0; }
.partes-lidas .section-title { margin: 0 0 8px; }
.partes-lidas .check { margin-top: 10px; }
.campo.lido .field, .campo.lido .select { border-color: var(--dado-ink); background: var(--dado-soft); }
.campo.faltou .field, .campo.faltou .select { border-color: var(--warn-ink); }
.marca-leitura { font-size: 12.5px; font-weight: 600; }
.marca-leitura.lido { color: var(--dado-ink); }
.marca-leitura.faltou { color: var(--warn-ink); }
/* Busca do processo no tribunal (DataJud) */
.busca-tribunal { display: grid; gap: 10px; padding: 0 22px; }
.busca-tribunal .note { margin: 0; }
.busca-tribunal:has(> :not([hidden])) { padding-bottom: 14px; }
.linha-busca { display: flex; gap: 8px; align-items: center; }
.linha-busca .field { flex: 1 1 auto; min-width: 0; }
.linha-busca .btn { flex: 0 0 auto; white-space: nowrap; }
.tribunal-sync { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 0 22px 12px; }
/* Audiências */
.audiencia-excluir { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: -8px; }
/* Cores do calendário (bolinhas e legenda), em contratos e processos */
.cal-legend i.cal-cor { background: var(--muted); }
.cal-legend i.cal-cor.critical { background: var(--danger-ink); }
.cal-legend i.cal-cor.warn { background: var(--warn-ink); }
.cal-legend i.cal-cor.info, .cal-dots i.info { background: var(--azul-vivo); }
.cal-legend i.cal-cor.ok { background: var(--dado); }
.cal-legend i.cal-cor.off, .cal-dots i.off { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }
.audiencia-pop { width: min(340px, 86vw); display: grid; gap: 14px; }
.audiencia-pop form { display: grid; gap: 6px; }
.audiencia-pop form + form { padding-top: 12px; border-top: 1px solid var(--line); }
.audiencia-pop label { font-weight: 500; font-size: 13px; }
.audiencia-pop .btn { justify-self: start; margin-top: 4px; }
/* Audiência: os botões (editar, realizada, redesignar ou cancelar) ficam embaixo do texto, para não espremê-lo */
.deadline.audiencia { grid-template-columns: 52px minmax(0, 1fr); align-items: start; }
.deadline.audiencia .dl-side { grid-column: 2; justify-content: flex-start; gap: 8px; }
.deadline.audiencia .acao-pop .pop-body { left: 0; right: auto; }
@media (max-width: 560px) { .deadline.audiencia { grid-template-columns: 46px minmax(0, 1fr); } }
/* Botões de ação em gradiente: verde (Realizada) e vermelho (Redesignar ou cancelar) */
.btn.verde, .btn.vermelho { color: #FFFFFF; border-color: transparent; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12); }
.btn.verde { background: linear-gradient(135deg, #1AAE81 0%, #12936C 50%, #0B6B4F 100%); }
.btn.verde:hover { background: linear-gradient(135deg, #159B73 0%, #0F805E 50%, #085A42 100%); border-color: transparent; }
.btn.vermelho { background: linear-gradient(135deg, #E5534B 0%, #C9352C 50%, #A3261D 100%); }
.btn.vermelho:hover, .acao-pop[open] > .btn.vermelho { background: linear-gradient(135deg, #D6453D 0%, #B52C24 50%, #8A1F17 100%); border-color: transparent; }
.btn.verde .icon, .btn.vermelho .icon { color: inherit; }
.btn.verde:focus-visible, .btn.vermelho:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* Controladoria */
.texto-alerta { color: var(--danger-ink); font-weight: 600; }
table.compact th.num, table.compact td.num { text-align: right; }
.distribuir { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.distribuir .select { height: 32px; min-width: 150px; font-size: 13.5px; }
.distribuir .field { height: 32px; width: 140px; font-size: 13.5px; padding: 0 8px; }
.publicacoes { list-style: none; margin: 0; padding: 0 10px 10px; }
.publicacao { padding: 14px 12px; display: grid; gap: 8px; }
.publicacao + .publicacao { border-top: 1px solid var(--line); }
.publicacao.is-done .dl-title { color: var(--muted); }
.pub-topo { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.pub-texto summary { cursor: pointer; color: var(--ink); font-size: 14px; line-height: 1.45; }
.pub-texto .texto { margin-top: 8px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 14px; max-height: 360px; overflow: auto; }
.pub-acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pub-acoes .acao-pop .pop-body { left: 0; right: auto; width: min(380px, 90vw); }
.fin-totais { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.acoes-linha { display: flex; gap: 6px; justify-content: flex-end; }
