/* SIGAP · identidade visual própria (ver DESIGN.md na raiz do projeto) */

:root {
  --bulma-primary-h: 206deg; --bulma-primary-s: 64%; --bulma-primary-l: 33%;
  --bulma-link-h: 206deg; --bulma-link-s: 64%; --bulma-link-l: 33%;
  --bulma-info-h: 206deg; --bulma-info-s: 64%; --bulma-info-l: 40%;
  --bulma-success-h: 152deg; --bulma-success-s: 60%; --bulma-success-l: 32%;
  --bulma-warning-h: 40deg; --bulma-warning-s: 87%; --bulma-warning-l: 56%;
  --bulma-danger-h: 4deg; --bulma-danger-s: 70%; --bulma-danger-l: 42%;
  --bulma-family-primary: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bulma-radius: 8px; --bulma-radius-small: 6px; --bulma-radius-medium: 10px; --bulma-radius-large: 12px;
  --bulma-body-color: #2b3a4a; --bulma-text-strong: #13263b; --bulma-scheme-main: #fff;
  --bulma-border: #dde4ec; --bulma-border-weak: #e9eef4;

  /* Identidade SIGAP: azul institucional + dourado */
  --sg-canvas: #f2f5f9; --sg-surface: #ffffff; --sg-ink: #13263b;
  --sg-primary: #1f5c8b; --sg-primary-dark: #174668; --sg-tint: #e7eff6;
  --sg-signal: #c9a14a; --sg-line: #dde4ec; --sg-line-in: #e9eef4;
  --sg-muted: #5c6e81; --sg-faint: #95a5b6;
  --sg-up: #12805c; --sg-down: #b42318;
  --sg-ok-bg: #e3f3ea; --sg-ok-fg: #12633f;
  --sg-warn-bg: #fdf3dc; --sg-warn-fg: #7a5300;
  --sg-navy: #10283f; --sg-navy-2: #1b3a58; --sg-navy-text: #c3d0de; --sg-navy-icon: #8299b1;
  --sg-display: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --sg-sidebar: 276px; --sg-sidebar-mini: 72px; --sg-topbar: 68px;
}

html { background: var(--sg-canvas); }
body { color: var(--bulma-body-color); -webkit-font-smoothing: antialiased; font-size: 15px; background: var(--sg-canvas); }
[x-cloak] { display: none !important; }
a { color: var(--sg-primary); }
a:hover { color: var(--sg-primary-dark); }
:focus-visible { outline: 2px solid var(--sg-primary); outline-offset: 2px; }
.title, h1, h2, h3 { font-family: var(--sg-display); letter-spacing: -.015em; color: var(--sg-ink); }
.card, .box { background: var(--sg-surface); box-shadow: none; border: 1px solid var(--sg-line); border-radius: 12px; color: inherit; padding: 1.3rem 1.4rem; }
.box:not(:last-child) { margin-bottom: 1.25rem; }
.button { font-weight: 600; border-radius: 8px; }
.button.is-primary { background: var(--sg-primary); color: #fff; }
.button.is-primary:hover, .button.is-primary:focus { background: var(--sg-primary-dark); color: #fff; }
.button.is-primary.is-light { background: var(--sg-tint); color: var(--sg-primary-dark); }
.button.is-primary.is-light:hover { background: #d5e8e1; color: var(--sg-primary-dark); }
.button.is-danger.is-light { background: #fbe9e7; color: var(--sg-down); }
.button.is-danger.is-light:hover { background: #f7dad6; color: var(--sg-down); }
.button.is-danger.is-outlined { border-color: #f1c4bf; color: var(--sg-down); background: #fff; }
.button.is-danger.is-outlined:hover { background: #fbe9e7; color: var(--sg-down); }
.tabular, .num { font-variant-numeric: tabular-nums; }
code, .mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: .86em; }
code { background: var(--sg-canvas); color: var(--sg-ink); padding: .1em .35em; border-radius: 5px; }
.text-muted { color: var(--sg-muted); }
.text-small { font-size: .82rem; }
.break { overflow-wrap: anywhere; }

/* ------------------------------ Campos ------------------------------ */
.input, .textarea, .select select { box-shadow: none; border-color: #ccd7d2; border-radius: 8px; }
.input:focus, .textarea:focus, .select select:focus,
.input:focus-visible, .textarea:focus-visible, .select select:focus-visible {
  border-color: var(--sg-primary); box-shadow: 0 0 0 3px rgba(31, 92, 139, .18); outline: none;
}
.input.is-danger, .textarea.is-danger, .select.is-danger select { border-color: var(--sg-down); }
.label { font-weight: 600; font-size: .88rem; color: var(--sg-ink); }
.help { font-size: .78rem; color: var(--sg-muted); }
.help.is-danger { color: var(--sg-down); font-weight: 500; }
.checkbox input, .radio input { accent-color: var(--sg-primary); }
.checkbox { display: inline-flex; gap: .5rem; align-items: flex-start; line-height: 1.4; }
.checkbox input { margin-top: .2rem; }
.select, .select select { width: 100%; }
.select:not(.is-multiple):not(.is-loading)::after { border-color: var(--sg-muted); }
.sg-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem 1.1rem; }
.sg-form-grid .field { margin-bottom: 0; }
.sg-form-grid .is-wide { grid-column: 1 / -1; }
.sg-form-grid .is-span2 { grid-column: span 2; }
.sg-form-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: 1.25rem; }

/* ------------------------------ Estrutura ------------------------------ */
.sg-app { min-height: 100vh; }
.sg-sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sg-sidebar); z-index: 40;
  background: var(--sg-surface); border-right: 1px solid var(--sg-line);
  display: flex; flex-direction: column; transition: width .2s, transform .2s;
}
.sg-brand { display: flex; align-items: center; gap: .6rem; height: var(--sg-topbar); padding: 0 1.15rem; flex: none; color: var(--sg-ink); }
.sg-brand:hover { color: var(--sg-ink); }
.sg-brand svg { flex: none; }
.sg-brand-name { font-family: var(--sg-display); font-weight: 650; font-size: 1.2rem; letter-spacing: -.02em; white-space: nowrap; }
.sg-brand-sub { display: block; font-family: var(--bulma-family-primary); font-size: .74rem; font-weight: 500; color: var(--sg-signal); letter-spacing: 0; margin-top: -.15rem; }
.sg-menu { flex: 1; overflow-y: auto; padding: .4rem .75rem 1rem; }
.sg-menu-group { font-size: .76rem; font-weight: 600; color: var(--sg-faint); margin: 1.1rem 0 .35rem .6rem; white-space: nowrap; }
.sg-menu-item {
  position: relative; display: flex; align-items: center; gap: .7rem; height: 40px; padding: 0 .7rem;
  border-radius: 9px; color: var(--sg-muted); font-size: .93rem; font-weight: 550; white-space: nowrap;
  transition: background .12s, color .12s; border: 0; background: none; width: 100%; cursor: pointer; text-align: left;
  font-family: inherit;
}
.sg-menu-item i { width: 20px; text-align: center; color: var(--sg-faint); flex: none; transition: color .12s; }
.sg-menu-item:hover { background: var(--sg-canvas); color: var(--sg-ink); }
.sg-menu-item:hover i { color: var(--sg-ink); }
.sg-menu-item.is-active { background: var(--sg-tint); color: var(--sg-ink); font-weight: 650; }
.sg-menu-item.is-active i { color: var(--sg-primary); }
.sg-menu-item.is-active::before { content: ''; position: absolute; left: -.75rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sg-primary); }
.sg-sidebar-foot { border-top: 1px solid var(--sg-line); padding: .6rem .75rem .75rem; flex: none; }
.sg-user { display: flex; align-items: center; gap: .65rem; padding: .55rem .3rem 0; }
.sg-user-info { min-width: 0; flex: 1; }
.sg-user-name { font-weight: 600; color: var(--sg-ink); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-user-role { font-size: .76rem; color: var(--sg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-user-role a { color: var(--sg-muted); text-decoration: underline; text-underline-offset: 2px; }
.sg-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sg-ink); color: #fff; display: grid; place-items: center; font-size: .74rem; font-weight: 650; flex: none; }
.sg-icon-btn { width: 34px; height: 34px; border-radius: 8px; border: 0; background: none; color: var(--sg-muted); display: inline-grid; place-items: center; cursor: pointer; transition: background .12s, color .12s; }
.sg-icon-btn:hover { background: var(--sg-canvas); color: var(--sg-ink); }

.sg-main { margin-left: var(--sg-sidebar); min-width: 0; transition: margin-left .2s; }
.sg-topbar {
  position: sticky; top: 0; z-index: 30; height: var(--sg-topbar);
  display: flex; align-items: center; gap: 1rem; padding: 0 2.25rem;
  background: rgba(242, 245, 249, .9); backdrop-filter: saturate(1.3) blur(10px); -webkit-backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--sg-line);
}
.sg-topbar-title { min-width: 0; flex: 1; }
.sg-crumbs { font-size: .8rem; color: var(--sg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-crumbs a { color: var(--sg-muted); }
.sg-crumbs a:hover { color: var(--sg-ink); }
.sg-crumbs .sep { margin: 0 .35rem; color: var(--sg-faint); }
.sg-page-title { font-family: var(--sg-display); font-size: 1.4rem; font-weight: 650; letter-spacing: -.02em; color: var(--sg-ink); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-topbar-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sg-burger { display: none; }
.sg-content { padding: 1.75rem 2.25rem 3rem; max-width: 1480px; }
.sg-backdrop { position: fixed; inset: 0; background: rgba(16, 40, 63, .35); z-index: 35; }
.sg-footer { color: var(--sg-muted); font-size: .76rem; margin-top: 2rem; }

/* Menu recolhido (a partir de 1024px) */
@media (min-width: 1024px) {
  .sb-collapsed .sg-sidebar { width: var(--sg-sidebar-mini); }
  .sb-collapsed .sg-main { margin-left: var(--sg-sidebar-mini); }
  .sb-collapsed .sg-brand { padding: 0 1.1rem; justify-content: center; }
  .sb-collapsed .sg-brand-name, .sb-collapsed .sg-menu-item span, .sb-collapsed .sg-user-info, .sb-collapsed .sg-user form, .sb-collapsed .sg-user > a.sg-icon-btn { display: none; }
  .sb-collapsed .sg-menu { overflow: visible; }
  .sb-collapsed .sg-menu-group { font-size: 0; height: 1px; background: var(--sg-line); margin: .7rem .4rem; }
  .sb-collapsed .sg-menu-item { justify-content: center; padding: 0; }
  .sb-collapsed .sg-user { justify-content: center; padding-left: 0; padding-right: 0; }
  .sb-collapsed .sg-collapse i { transform: rotate(180deg); }
  .sb-collapsed .sg-menu-item[data-tip]:hover::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
    background: var(--sg-ink); color: #fff; font-size: .8rem; font-weight: 550; padding: .35rem .6rem; border-radius: 7px; white-space: nowrap; z-index: 60;
  }
}

/* Menu lateral azul-marinho (igual em todas as telas) */
.sg-sidebar { background: var(--sg-navy); border-right-color: var(--sg-navy); }
.sg-sidebar .sg-brand, .sg-sidebar .sg-brand:hover { color: #fff; }
.sg-sidebar .sg-brand-sub { color: var(--sg-signal); }
.sg-sidebar .sg-menu-group { color: var(--sg-navy-icon); }
.sg-sidebar .sg-menu-item { color: var(--sg-navy-text); }
.sg-sidebar .sg-menu-item i { color: var(--sg-navy-icon); }
.sg-sidebar .sg-menu-item:hover, .sg-sidebar .sg-menu-item.is-active { background: var(--sg-navy-2); color: #fff; }
.sg-sidebar .sg-menu-item:hover i { color: #fff; }
.sg-sidebar .sg-menu-item.is-active i { color: var(--sg-signal); }
.sg-sidebar .sg-menu-item.is-active::before { background: var(--sg-signal); }
.sg-sidebar .sg-sidebar-foot { border-top-color: var(--sg-navy-2); }
.sg-sidebar .sg-user-name { color: #fff; }
.sg-sidebar .sg-user-role, .sg-sidebar .sg-user-role a { color: var(--sg-navy-text); }
.sg-sidebar .sg-avatar { background: var(--sg-navy-2); }
.sg-sidebar .sg-icon-btn { color: var(--sg-navy-text); }
.sg-sidebar .sg-icon-btn:hover { background: var(--sg-navy-2); color: #fff; }
.sb-collapsed .sg-sidebar .sg-menu-group { background: var(--sg-navy-2); }

/* Abas */
.sg-tabs { display: flex; gap: .25rem; padding: 0 2.25rem; background: var(--sg-surface); border-bottom: 1px solid var(--sg-line); overflow-x: auto; }
.sg-tabs a { display: inline-flex; align-items: center; gap: .5rem; padding: .85rem .6rem; color: var(--sg-muted); font-weight: 550; font-size: .9rem; border-bottom: 2px solid transparent; white-space: nowrap; }
.sg-tabs a i { color: var(--sg-faint); }
.sg-tabs a:hover { color: var(--sg-ink); }
.sg-tabs a.is-active { color: var(--sg-ink); border-bottom-color: var(--sg-primary); }
.sg-tabs a.is-active i { color: var(--sg-primary); }

/* ------------------------------ Caixas ------------------------------ */
.box-title { font-family: var(--sg-display); font-size: 1.02rem; font-weight: 600; letter-spacing: -.01em; color: var(--sg-ink); margin-bottom: .9rem; display: flex; align-items: baseline; gap: .75rem; }
.box-title .right { margin-left: auto; font-family: var(--bulma-family-primary); font-size: .82rem; font-weight: 550; letter-spacing: 0; }
.box-title .count { font-family: var(--bulma-family-primary); font-size: .82rem; font-weight: 500; color: var(--sg-muted); letter-spacing: 0; }
.section-title { font-family: var(--sg-display); font-size: 1.2rem; font-weight: 650; letter-spacing: -.015em; color: var(--sg-ink); margin: 0 0 .85rem; }
.sg-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 1.25rem; margin-bottom: 1.25rem; }
.sg-grid-2 > .box { margin-bottom: 0; }
.sg-split { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 1fr); gap: 1.25rem; align-items: start; }
.sg-split > div > .box:last-child { margin-bottom: 0; }

/* Faixa de indicadores */
.sg-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; background: var(--sg-surface); border: 1px solid var(--sg-line); border-radius: 12px; overflow: hidden; margin-bottom: 1.25rem; }
.sg-kpi { padding: 1.05rem 1.25rem 1.1rem; box-shadow: inset -1px 0 0 var(--sg-line), inset 0 -1px 0 var(--sg-line); color: inherit; display: block; min-width: 0; }
a.sg-kpi:hover { background: #f7faf9; color: inherit; }
.sg-kpi-label { font-size: .82rem; font-weight: 550; color: var(--sg-muted); }
.sg-kpi-value { font-family: var(--sg-display); font-size: 2rem; font-weight: 600; letter-spacing: -.02em; color: var(--sg-ink); line-height: 1.15; margin-top: .3rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-kpi-value.is-money { font-size: 1.55rem; }
.sg-kpi-note { font-size: .78rem; color: var(--sg-muted); margin-top: .25rem; }

/* Barras (funil) */
.sg-bars { display: grid; gap: .5rem; }
.sg-bar-row { display: grid; grid-template-columns: minmax(90px, 150px) minmax(0, 1fr); gap: .75rem; align-items: center; font-size: .88rem; }
.sg-bar-row .lbl { color: var(--bulma-body-color); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-bar-track { background: var(--sg-canvas); border-radius: 5px; height: 26px; display: flex; align-items: center; overflow: hidden; }
.sg-bar-fill { background: var(--sg-primary); height: 100%; border-radius: 5px; min-width: 3px; display: flex; align-items: center; justify-content: flex-end; flex: none; }
.sg-bar-val { font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; padding: 0 .55rem; color: var(--sg-ink); }
.sg-bar-fill .sg-bar-val { color: #fff; }
.sg-mini-bar { height: 6px; border-radius: 999px; background: var(--sg-canvas); overflow: hidden; min-width: 60px; margin-top: .3rem; }
.sg-mini-bar span { display: block; height: 100%; background: var(--sg-primary); border-radius: 999px; }

/* ------------------------------ Tabelas ------------------------------ */
.table-wrap { overflow-x: auto; border: 1px solid var(--sg-line); border-radius: 10px; }
.box > .table-wrap:last-child { margin-bottom: 0; }
.table { font-size: .9rem; color: var(--bulma-body-color); background: transparent; }
.table thead th { font-size: .78rem; font-weight: 600; color: var(--sg-muted); border-bottom: 1px solid var(--sg-line); border-width: 0 0 1px; white-space: nowrap; background: #fafbfb; }
.table td, .table th { border-color: var(--sg-line-in); vertical-align: top; padding: .62rem .75rem; }
.table tbody tr:last-child td { border-bottom: 0; }
.table.is-hoverable tbody tr:not(.is-selected):hover { background: #f7faf9; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table td .sub { display: block; color: var(--sg-muted); font-size: .8rem; margin-top: .1rem; }
.table td strong { color: var(--sg-ink); font-weight: 600; }
.table tr.sg-row-link { cursor: pointer; }
.bar-cell { position: relative; }
.bar-cell .bar-bg { position: absolute; inset: 6px auto 6px 0; background: var(--sg-tint); border-radius: 4px; z-index: 0; }
.bar-cell span { position: relative; z-index: 1; }

/* Tags */
.sg-tag { display: inline-flex; align-items: center; gap: .35rem; border-radius: 6px; padding: .18rem .55rem; font-size: .78rem; font-weight: 600; white-space: nowrap; background: var(--sg-canvas); color: var(--sg-muted); line-height: 1.5; }
.sg-tag.is-ok { background: var(--sg-ok-bg); color: var(--sg-ok-fg); }
.sg-tag.is-warn { background: var(--sg-warn-bg); color: var(--sg-warn-fg); }
.sg-tag.is-bad { background: #fbe9e7; color: var(--sg-down); }
.sg-tag.is-info { background: var(--sg-tint); color: var(--sg-primary-dark); }
.sg-tag.is-neutral { background: var(--sg-canvas); color: var(--sg-muted); }

/* Filtros ativos */
.sg-chips { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-top: .9rem; }
.sg-chip { display: inline-flex; align-items: center; gap: .45rem; background: var(--sg-ink); color: #fff; border-radius: 999px; padding: .22rem .4rem .22rem .75rem; font-size: .8rem; font-weight: 550; }
.sg-chip a { color: #fff; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .68rem; background: rgba(255,255,255,.14); }
.sg-chip a:hover { background: rgba(255,255,255,.28); color: #fff; }
.sg-chips .clear { font-size: .8rem; color: var(--sg-muted); margin-left: .25rem; }

/* Avisos */
.sg-alert { display: flex; gap: .7rem; align-items: flex-start; border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1.25rem; border: 1px solid var(--sg-line); background: var(--sg-surface); font-size: .9rem; }
.sg-alert > i { margin-top: .2rem; flex: none; }
.sg-alert ul { margin: .3rem 0 0 1.1rem; list-style: disc; }
.sg-alert.is-danger { background: #fef3f2; border-color: #f1c4bf; color: #7a1a12; }
.sg-alert.is-danger > i { color: var(--sg-down); }
.sg-alert.is-warning { background: var(--sg-warn-bg); border-color: #f0dca8; color: var(--sg-warn-fg); }
.sg-alert.is-success { background: var(--sg-ok-bg); border-color: #bcd9c8; color: var(--sg-ok-fg); }
.sg-alert.is-info { background: var(--sg-surface); color: var(--bulma-body-color); }
.sg-alert.is-info > i { color: var(--sg-muted); }
.sg-alert.is-ink { background: var(--sg-ink); border-color: var(--sg-ink); color: #fff; }
.sg-alert.is-ink > i { color: var(--sg-signal); }
.sg-alert.is-ink .mono { background: var(--sg-navy-2); color: #fff; padding: .1rem .45rem; border-radius: 5px; font-size: 1rem; }
.sg-alert.is-large { font-size: 1rem; }

/* Toasts */
.sg-toasts { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 80; display: grid; gap: .5rem; max-width: min(420px, calc(100vw - 2.5rem)); }
.sg-toast { display: flex; gap: .7rem; align-items: flex-start; background: var(--sg-ink); color: #fff; border-radius: 10px; padding: .85rem 1rem; font-size: .9rem; box-shadow: 0 14px 40px -10px rgba(16, 40, 63, .35); }
.sg-toast > i { color: var(--sg-signal); margin-top: .2rem; }
.sg-toast button { margin-left: auto; background: none; border: 0; color: var(--sg-navy-text); cursor: pointer; padding: 0 .1rem; }
.sg-toast button:hover { color: #fff; }

/* Estado vazio */
.sg-empty { text-align: center; padding: 2.5rem 1rem; }
.sg-empty-icon { width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--sg-primary); color: var(--sg-primary); display: grid; place-items: center; margin: 0 auto 1rem; font-size: 1.15rem; }
.sg-empty h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: .35rem; }
.sg-empty p { color: var(--sg-muted); max-width: 440px; margin: 0 auto 1rem; }

/* Linha do tempo */
.sg-timeline { list-style: none; margin: 0; padding: 0; }
.sg-timeline li { display: flex; gap: .75rem; padding-bottom: 1rem; position: relative; }
.sg-timeline li::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--sg-line); }
.sg-timeline li:last-child { padding-bottom: 0; }
.sg-timeline li:last-child::before { display: none; }
.sg-dot { width: 28px; height: 28px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: .68rem; background: var(--sg-surface); border: 2px solid var(--sg-primary); color: var(--sg-primary); }
.sg-dot.is-current { background: var(--sg-primary); color: #fff; }
.sg-dot.is-bad { border-color: var(--sg-down); color: var(--sg-down); }
.sg-timeline .what { font-weight: 600; color: var(--sg-ink); font-size: .9rem; }
.sg-timeline .meta { font-size: .78rem; color: var(--sg-muted); }
.sg-timeline .detail { font-size: .84rem; color: var(--bulma-body-color); margin-top: .15rem; overflow-wrap: anywhere; }

/* Pares rótulo/valor */
.sg-kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: .5rem 1rem; font-size: .9rem; margin: 0; }
.sg-kv dt { color: var(--sg-muted); }
.sg-kv dd { color: var(--sg-ink); margin: 0; overflow-wrap: anywhere; }

/* Ícone em quadradinho */
.sg-ico { width: 28px; height: 28px; border-radius: 7px; display: inline-grid; place-items: center; background: var(--sg-canvas); border: 1px solid var(--sg-line); color: var(--sg-muted); font-size: .78rem; flex: none; }

/* Lista de módulos */
.sg-modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.sg-module { display: flex; gap: .8rem; align-items: center; border: 1px solid var(--sg-line); border-radius: 10px; padding: .8rem .9rem; color: inherit; background: var(--sg-surface); transition: border-color .12s; }
a.sg-module:hover { border-color: #b9c8c2; color: inherit; }
.sg-module strong { display: block; color: var(--sg-ink); font-weight: 600; font-size: .92rem; }
.sg-module small { color: var(--sg-muted); font-size: .78rem; }
.sg-module.is-planned { background: transparent; border-style: dashed; }

/* Bloco de código / hash */
.sg-code { background: var(--sg-navy); color: #dbe6f1; border-radius: 10px; padding: .7rem .9rem; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; overflow-wrap: anywhere; }

/* Prévia de PDF */
.sg-pdf { border: 1px solid var(--sg-line); border-radius: 12px; overflow: hidden; background: #e6ebe9; }
.sg-pdf iframe { display: block; width: 100%; height: 860px; border: 0; }

/* Imagem de assinatura */
.sg-signature { height: 42px; max-width: 180px; object-fit: contain; background: #fff; border: 1px solid var(--sg-line); border-radius: 6px; padding: 2px 6px; }

/* Paginação */
.pagination { margin-top: 1rem; font-size: .88rem; }
.pagination-link.is-current { background: var(--sg-ink); border-color: var(--sg-ink); color: #fff; }
.pagination-link, .pagination-previous, .pagination-next { border-color: var(--sg-line); }

/* Matriz de permissões */
.sg-perm { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .6rem 1.25rem; }
.sg-perm .checkbox { font-size: .9rem; color: var(--sg-ink); }
.sg-perm .checkbox small { display: block; color: var(--sg-muted); font-size: .76rem; }

/* ------------------------------ Entrada ------------------------------ */
.sg-auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--sg-surface); }
.sg-auth-side { background: var(--sg-navy); color: #fff; padding: 2.5rem clamp(2rem, 5vw, 4.5rem); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.sg-auth-side .sg-brand { padding: 0; height: auto; color: #fff; }
.sg-auth-side .sg-brand-sub { color: var(--sg-signal); }
.sg-auth-side h1 { color: #fff; font-size: clamp(2rem, 3.4vw, 2.8rem); font-weight: 600; line-height: 1.08; letter-spacing: -.03em; margin: auto 0 1.4rem; text-wrap: balance; max-width: 15em; }
.sg-auth-side ul { list-style: none; margin: 0 0 auto; padding: 0; display: grid; gap: .65rem; font-size: 1.02rem; color: var(--sg-navy-text); max-width: 30em; }
.sg-auth-side li { display: flex; gap: .7rem; align-items: baseline; }
.sg-auth-side li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--sg-signal); flex: none; transform: translateY(-2px); }
.sg-auth-art { position: absolute; right: -60px; bottom: -60px; opacity: .14; pointer-events: none; }
.sg-auth-form { display: grid; place-items: center; padding: 2rem 1.25rem; }
.sg-auth-form > div { width: 100%; max-width: 400px; }
.sg-auth-form h2 { font-size: 1.7rem; font-weight: 650; letter-spacing: -.025em; margin-bottom: .3rem; }

/* Página pública de validação */
.sg-public { min-height: 100vh; background: var(--sg-canvas); }
.sg-public-bar { height: var(--sg-topbar); display: flex; align-items: center; padding: 0 clamp(1rem, 4vw, 2.25rem); background: var(--sg-surface); border-bottom: 1px solid var(--sg-line); }
.sg-public-main { max-width: 680px; margin: 0 auto; padding: 2rem 1rem 3rem; }
.sg-public-main h1 { font-size: clamp(1.6rem, 3.6vw, 2.1rem); font-weight: 600; letter-spacing: -.03em; text-wrap: balance; margin-bottom: .4rem; }
.sg-result { display: flex; gap: .9rem; align-items: center; border-radius: 12px; padding: 1rem 1.15rem; margin-bottom: 1.25rem; border: 1px solid var(--sg-line); background: var(--sg-surface); }
.sg-result .sg-empty-icon { margin: 0; flex: none; }
.sg-result strong { display: block; font-family: var(--sg-display); font-size: 1.15rem; font-weight: 650; letter-spacing: -.015em; color: var(--sg-ink); }
.sg-result.is-ok { border-color: #bcd9c8; background: #f4fbf7; }
.sg-result.is-ok .sg-empty-icon { border-color: var(--sg-up); color: var(--sg-up); }
.sg-result.is-bad { border-color: #f1c4bf; background: #fef3f2; }
.sg-result.is-bad .sg-empty-icon { border-color: var(--sg-down); color: var(--sg-down); }
.sg-code-input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.25rem; letter-spacing: .12em; text-align: center; text-transform: uppercase; }

/* ------------------------------ Responsivo ------------------------------ */
.sg-only-mobile, .button.sg-only-mobile { display: none !important; }
@media (max-width: 1023px) {
  .sg-sidebar { transform: translateX(-100%); box-shadow: 0 16px 40px -12px rgba(16, 40, 63, .25); }
  .sg-sidebar.is-open { transform: none; }
  .sg-main { margin-left: 0; }
  .sg-burger { display: inline-grid; }
  .sg-collapse { display: none !important; }
  .sg-topbar { padding: 0 1rem; }
  .sg-content { padding: 1.25rem 1rem 2.5rem; }
  .sg-tabs { padding: 0 1rem; }
  .sg-split { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sg-auth { grid-template-columns: 1fr; }
  .sg-auth-side { display: none; }
}
@media (max-width: 640px) {
  .sg-only-mobile, .button.sg-only-mobile { display: flex !important; }
  .sg-filtros { margin-top: 1rem; }
  .sg-topbar { height: auto; min-height: var(--sg-topbar); flex-wrap: wrap; padding-top: .6rem; padding-bottom: .6rem; }
  .sg-topbar-actions { width: 100%; justify-content: flex-start; }
  .sg-page-title { font-size: 1.2rem; white-space: normal; }
  .sg-grid-2 { grid-template-columns: 1fr; }
  .sg-form-grid .is-span2 { grid-column: auto; }
  .sg-kv { grid-template-columns: 1fr; gap: .1rem; }
  .sg-kv dd { margin-bottom: .55rem; }
  .sg-kpis { grid-template-columns: 1fr 1fr; }
  .sg-kpi-value { font-size: 1.55rem; }
  .sg-kpis:has(.is-money) { grid-template-columns: 1fr; }
  .sg-kpi-value.is-money { font-size: 1.35rem; }
  .sg-pdf iframe { height: 520px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  .sg-sidebar, .sg-topbar, .sg-toasts, .no-print { display: none !important; }
  .sg-main { margin: 0; }
}

/* ------------------------------ Pessoas ------------------------------ */
.sg-avatar.is-photo { object-fit: cover; background: var(--sg-canvas); padding: 0; }
.sg-person { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.sg-person-head { display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap; }
.sg-person-name { font-size: 1.35rem; font-weight: 650; letter-spacing: -.02em; margin: 0 0 .15rem; color: var(--sg-ink); }
.sg-person-contact { margin-left: auto; display: grid; gap: .3rem; font-size: .88rem; }
.sg-person-contact a { color: var(--bulma-body-color); }
.sg-person-contact a:hover { color: var(--sg-primary); }
.sg-person-contact i { width: 18px; color: var(--sg-muted); }
.sg-tags { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .55rem; }
.sg-dot.is-muted { border-color: var(--sg-line); color: var(--sg-faint); }
.sg-vinculo { position: relative; border: 1px solid var(--sg-line); border-radius: 10px; padding: 1rem 3rem 1rem 1rem; margin-bottom: .75rem; background: #fbfcfe; }
.sg-vinculo-del { position: absolute; top: .6rem; right: .6rem; }
.sg-vinculo-del:hover { color: var(--sg-down); background: #fbe9e7; }

/* Busca de pessoa */
.sg-pessoa-campo { position: relative; }
.sg-pessoa-lista { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--sg-line); border-radius: 10px; box-shadow: 0 16px 40px -12px rgba(16, 40, 63, .25); max-height: 320px; overflow-y: auto; padding: .3rem; }
.sg-pessoa-item { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .5rem .65rem; border-radius: 7px; cursor: pointer; font: inherit; }
.sg-pessoa-item strong { display: block; color: var(--sg-ink); font-weight: 600; font-size: .9rem; }
.sg-pessoa-item span { display: block; color: var(--sg-muted); font-size: .78rem; }
.sg-pessoa-item:hover, .sg-pessoa-item.is-active { background: var(--sg-tint); }
.sg-pessoa-vazio { padding: .6rem .65rem; color: var(--sg-muted); font-size: .85rem; }
.sg-pessoa-escolhida { display: flex; align-items: center; gap: .75rem; border: 1px solid var(--sg-line); border-radius: 10px; padding: .65rem .8rem; background: #fbfcfe; flex-wrap: wrap; }
.sg-pessoa-escolhida strong { color: var(--sg-ink); }
@media (max-width: 640px) {
  .sg-person-contact { margin-left: 0; width: 100%; }
  .sg-vinculo { padding-right: 1rem; padding-top: 2.6rem; }
}


/* Nome do gabinete longo no topo do menu */
.sg-brand-name { min-width: 0; overflow: hidden; }
.sg-brand-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
.sg-auth-side .sg-brand-sub, .sg-public-bar .sg-brand-sub { max-width: none; white-space: normal; }

/* Contador no menu (ex.: chamados aguardando) */
.sg-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--sg-signal); color: #fff; font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }
@media (min-width: 1024px) {
  .sb-collapsed .sg-badge { position: absolute; top: 4px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px; font-size: .62rem; }
}
.sg-ajuda { color: var(--sg-muted); font-size: 1.05rem; }

/* Conversa dos chamados de suporte */
.sg-conversa { display: flex; flex-direction: column; gap: 1rem; }
.sg-msg { display: flex; gap: .75rem; align-items: flex-start; }
.sg-msg .sg-avatar { margin-top: .15rem; }
.sg-msg-corpo { flex: 1; min-width: 0; border: 1px solid var(--sg-line); border-radius: 12px; padding: .8rem 1rem; background: var(--sg-surface); }
.sg-msg-topo { display: flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: baseline; font-size: .82rem; color: var(--sg-muted); margin-bottom: .35rem; }
.sg-msg-topo strong { color: var(--sg-ink); font-size: .88rem; }
.sg-msg-texto { white-space: pre-wrap; word-wrap: break-word; font-size: .93rem; color: var(--sg-ink); }
.sg-msg-anexo { display: inline-flex; align-items: center; gap: .45rem; margin-top: .6rem; padding: .35rem .65rem; border: 1px solid var(--sg-line); border-radius: 8px; font-size: .84rem; background: var(--sg-canvas); }
.sg-msg.is-plataforma .sg-msg-corpo { background: var(--sg-tint); border-color: #cddfec; }
.sg-msg.is-plataforma .sg-avatar { background: var(--sg-primary); }
.sg-msg.is-interna .sg-msg-corpo { background: var(--sg-warn-bg); border-color: #f0dca8; border-style: dashed; }
.sg-msg.is-interna .sg-avatar { background: var(--sg-signal); }
.sg-tag.is-urgente { background: #fbe9e7; color: var(--sg-down); }
.sg-form-grid.sg-grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 640px) { .sg-form-grid.sg-grid-2-1 { grid-template-columns: 1fr; } }

/* Item do menu para trocar de ambiente (root que participa de um gabinete) */
.sg-troca { font-weight: 600; }
.sg-menu-item > span { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Gráficos (MAPP e outros módulos) ----------
   Cores validadas (CVD/contraste): situação = verde / azul / âmbar / cinza;
   execução = pago (azul) e saldo (passo claro do mesmo azul). */
:root {
  --sg-c-pago: #2a73b8; --sg-c-saldo: #b9d3ea;
  --sg-c-concluida: #12805c; --sg-c-andamento: #2a73b8; --sg-c-parada: #c98500; --sg-c-encerrada: #a3afbb;
}
.sg-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .4rem; vertical-align: -1px; flex: none; }
.sg-sw.is-pago, .sg-hbar .is-pago, .sg-col .is-pago { background: var(--sg-c-pago); }
.sg-sw.is-saldo, .sg-hbar .is-saldo, .sg-col .is-saldo { background: var(--sg-c-saldo); }
.is-concluida { background: var(--sg-c-concluida); }
.is-andamento { background: var(--sg-c-andamento); }
.is-parada { background: var(--sg-c-parada); }
.is-encerrada { background: var(--sg-c-encerrada); }
.sg-legenda { display: inline-flex; gap: 1rem; font-size: .8rem; font-weight: 500; color: var(--sg-muted); }
.sg-legenda span { display: inline-flex; align-items: center; }
.box-title .right .sg-legenda { font-weight: 500; }
.sg-tab-count { font-size: .74rem; font-weight: 600; background: var(--sg-canvas); color: var(--sg-muted); border-radius: 999px; padding: .05rem .5rem; }
.sg-link-btn { border: 0; background: none; padding: .35rem 0 0; color: var(--sg-primary); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; justify-self: start; }
.sg-link-btn:hover { text-decoration: underline; }

/* Medidor fino (KPI de valor pago) */
.sg-meter { height: 8px; border-radius: 999px; background: var(--sg-c-saldo); overflow: hidden; margin-top: .55rem; }
.sg-meter span { display: block; height: 100%; background: var(--sg-c-pago); border-radius: 999px; }

/* Barra segmentada alta: situação dos projetos */
.sg-segbar { display: flex; gap: 2px; height: 28px; margin: .2rem 0 1.1rem; }
.sg-seg { min-width: 6px; border-radius: 4px; display: flex; align-items: center; padding-left: .5rem; color: #fff; font-size: .78rem; font-weight: 650; cursor: default; }
.sg-seg.is-encerrada, .sg-seg.is-parada { color: #13263b; }
.sg-sit-legenda { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem 1.5rem; }
.sg-sit-titulo { display: flex; align-items: center; font-weight: 650; font-size: .88rem; color: var(--sg-ink); margin-bottom: .3rem; }
.sg-sit-titulo .tabular { margin-left: auto; }
.sg-sit-item { display: flex; justify-content: space-between; gap: .5rem; padding: .2rem 0 .2rem 1.05rem; font-size: .85rem; color: var(--sg-muted); border-radius: 6px; }
a.sg-sit-item:hover { color: var(--sg-ink); background: var(--sg-canvas); }

/* Barras horizontais empilhadas */
.sg-hbars { display: grid; gap: .15rem; }
.sg-hbar { display: grid; grid-template-columns: minmax(80px, 128px) minmax(0, 1fr) 42px; gap: .75rem; align-items: center; padding: .3rem .4rem; margin: 0 -.4rem; border-radius: 8px; color: var(--sg-ink); font-size: .88rem; }
.sg-hbar:hover { background: var(--sg-canvas); color: var(--sg-ink); }
.sg-hbar .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-hbar .trilho { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.sg-hbar .barra { display: flex; gap: 2px; height: 18px; flex: none; }
.sg-hbar .barra > span { min-width: 2px; }
.sg-hbar .barra > span:last-child { border-radius: 0 4px 4px 0; }
.sg-hbar .val { font-size: .8rem; font-weight: 600; color: var(--sg-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sg-hbar .pct { font-size: .78rem; color: var(--sg-muted); text-align: right; }

/* Colunas por ano */
.sg-cols { display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: 220px auto; column-gap: .5rem; margin-top: 1.4rem; }
.sg-cols-eixo { position: relative; }
.sg-cols-eixo span { position: absolute; right: 0; transform: translateY(50%); font-size: .74rem; color: var(--sg-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sg-cols-area { position: relative; display: flex; align-items: flex-end; border-bottom: 1px solid #c9d3de; }
.sg-cols-grade { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--sg-line-in); }
.sg-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; border-radius: 6px 6px 0 0; }
.sg-col:hover { background: rgba(31, 92, 139, .05); }
.sg-col .pilha { position: relative; width: min(24px, 60%); display: flex; flex-direction: column; gap: 2px; min-height: 2px; }
.sg-col .pilha > span:not(.cap) { min-height: 2px; }
.sg-col .pilha > span:not(.cap):first-of-type { border-radius: 4px 4px 0 0; }
.sg-col .cap { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font-size: .74rem; font-weight: 650; color: var(--sg-ink); white-space: nowrap; }
.sg-cols-x { display: flex; }
.sg-cols-x span { flex: 1; text-align: center; padding-top: .35rem; font-size: .8rem; line-height: 1.25; }
.sg-cols-x strong { display: block; color: var(--sg-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.sg-cols-x .ano-curto { display: none; }
.sg-cols-x small { color: var(--sg-muted); font-size: .72rem; }
@media (max-width: 640px) {
  .sg-cols { grid-template-columns: 48px minmax(0, 1fr); grid-template-rows: 180px auto; }
  .sg-cols-x span { font-size: .72rem; }
  .sg-cols-x .ano-longo { display: none; }
  .sg-cols-x .ano-curto { display: inline; }
  .sg-hbar { grid-template-columns: minmax(70px, 100px) minmax(0, 1fr); gap: .5rem; }
  .sg-hbar .pct { display: none; }
}

/* Dica flutuante dos gráficos */
.sg-dica { position: fixed; z-index: 80; pointer-events: none; background: var(--sg-ink); color: #fff; font-size: .8rem; line-height: 1.45; padding: .5rem .7rem; border-radius: 8px; box-shadow: 0 6px 20px rgba(16, 40, 63, .25); max-width: 280px; opacity: 0; transition: opacity .08s; }
.sg-dica.is-on { opacity: 1; }
.sg-dica strong { color: #fff; }

/* Texto só para leitores de tela */
.sg-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Cadastro de pessoa: foto à esquerda, dados ao lado */
.sg-pessoa-form { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.sg-pessoa-form > .sg-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sg-foto-campo { display: grid; gap: .5rem; }
.sg-foto-moldura { display: grid; place-items: center; width: 168px; height: 168px; border-radius: 14px; background: var(--sg-canvas); border: 1px dashed #c9d3de; overflow: hidden; cursor: pointer; color: var(--sg-faint); font-size: 3.2rem; }
.sg-foto-moldura:hover { border-color: var(--sg-primary); color: var(--sg-primary); }
.sg-foto-moldura img, .sg-foto-moldura span { width: 100%; height: 100%; display: grid; place-items: center; }
.sg-foto-moldura img { object-fit: cover; }
.sg-foto-campo .help { margin: 0; }
@media (max-width: 760px) {
  .sg-pessoa-form { grid-template-columns: 1fr; }
  .sg-pessoa-form > .sg-form-grid { grid-template-columns: 1fr; }
  .sg-foto-campo { grid-template-columns: 96px 1fr; align-items: center; }
  .sg-foto-moldura { width: 96px; height: 96px; font-size: 2rem; grid-row: span 3; }
}
.sg-pessoa-form .is-span2 { grid-column: 1 / -1; }

/* Minha assinatura */
.sg-assinatura-form { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.sg-assinatura-previa { text-align: center; }
.sg-assinatura-quadro { display: grid; place-items: center; height: 120px; border: 1px dashed #c9d3de; border-radius: 12px; background: #fff; cursor: pointer; overflow: hidden; padding: .5rem; }
.sg-assinatura-quadro:hover { border-color: var(--sg-primary); }
.sg-assinatura-quadro img { max-height: 100px; max-width: 100%; object-fit: contain; }
.sg-assinatura-linha { border-top: 1px solid var(--sg-ink); margin: 0 1.5rem; padding-top: .3rem; display: grid; font-size: .85rem; }
.sg-assinatura-linha strong { color: var(--sg-ink); }
.sg-assinatura-linha span { color: var(--sg-muted); font-size: .8rem; }
@media (max-width: 760px) { .sg-assinatura-form { grid-template-columns: 1fr; } }
.sg-por-pagina { display: inline-flex; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 500; color: var(--sg-muted); }
.sg-por-pagina .select select { font-size: .82rem; }
[hidden] { display: none !important; }
.sg-foto-moldura > img[data-previa-img], .sg-assinatura-quadro > img[data-previa-img] { width: 100%; height: 100%; object-fit: contain; }
.sg-foto-moldura > img[data-previa-img] { object-fit: cover; }
.sg-tag.is-purple { background: #f1eafb; color: #6a3d9a; }

/* Demandas */
.sg-demanda-linha { display: flex; gap: 1rem; align-items: center; padding: .75rem .5rem; margin: 0 -.5rem; border-bottom: 1px solid var(--sg-line-in); border-radius: 8px; color: var(--sg-ink); }
.sg-demanda-linha:last-child { border-bottom: 0; }
.sg-demanda-linha:hover { background: var(--sg-canvas); color: var(--sg-ink); }
.sg-demanda-lado { display: grid; justify-items: end; gap: .25rem; flex: none; }
.sg-setor-barra { margin: .7rem 0; }
.sg-setor-topo { display: flex; justify-content: space-between; font-size: .88rem; margin-bottom: .3rem; }
.sg-setor-barra .sg-meter { margin-top: 0; background: var(--sg-canvas); }
.sg-atividade { display: flex; gap: .65rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--sg-line-in); color: var(--sg-ink); font-size: .88rem; }
.sg-atividade:last-child { border-bottom: 0; }
.sg-atividade .sg-dot { width: 26px; height: 26px; }
.sg-demanda-texto { white-space: pre-wrap; color: var(--sg-ink); margin-bottom: 1.1rem; font-size: .95rem; }
.sg-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.sg-meta-grid > div { background: var(--sg-canvas); border-radius: 8px; padding: .65rem .8rem; min-width: 0; }
.sg-meta-grid > div.is-span2 { grid-column: 1 / -1; }
.sg-meta-grid small { display: block; color: var(--sg-muted); font-size: .76rem; margin-bottom: .2rem; }
.sg-meta-grid b { font-weight: 600; color: var(--sg-ink); overflow-wrap: anywhere; }
.sg-acao-box { border: 1px solid #cddfec; background: #fbfdff; }
.button.is-active { box-shadow: inset 0 0 0 2px var(--sg-primary); }
.sg-setor-linha { display: grid; grid-template-columns: minmax(0, 1fr) 80px 90px auto; gap: .75rem; align-items: center; padding: .5rem .75rem; }
.sg-setor-linha .num { text-align: right; }
.sg-setor-novo { display: flex; gap: .6rem; margin-top: 1rem; }
@media (max-width: 640px) { .sg-meta-grid { grid-template-columns: 1fr; } .sg-setor-linha { grid-template-columns: 1fr auto; } .sg-setor-linha .num { display: none; } }
/* Encaminhamentos do atendimento */
.sg-enc-linha { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem .8rem; align-items: end; padding: .8rem 2.6rem .8rem .8rem; margin-bottom: .6rem; border: 1px solid var(--sg-line); border-radius: 10px; background: #fbfdff; }
.sg-enc-titulo { grid-column: 1 / -1; }
.sg-enc-linha .field { margin: 0; }
.sg-enc-remover { position: absolute; top: .45rem; right: .45rem; }
.sg-enc-existentes { display: grid; gap: .4rem; margin-bottom: .9rem; }
.sg-enc-item { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border: 1px solid var(--sg-line); border-radius: 8px; color: var(--sg-ink); font-size: .88rem; }
.sg-enc-item > span:nth-child(2) { flex: 1; min-width: 0; }
.sg-enc-item:hover { background: var(--sg-canvas); color: var(--sg-ink); }
@media (max-width: 1100px) { .sg-enc-linha { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .sg-enc-linha { grid-template-columns: 1fr; } }

/* ---------- Menu lateral: grupos recolhíveis (acordeão exclusivo com <details name>) ---------- */
.sg-grupo { margin-top: .15rem; }
.sg-grupo-titulo {
  position: relative; display: flex; align-items: center; gap: .7rem; height: 40px; padding: 0 .7rem; border-radius: 9px;
  list-style: none; cursor: pointer; user-select: none; white-space: nowrap;
  color: var(--sg-navy-text); font-size: .93rem; font-weight: 600; transition: background .12s, color .12s;
}
.sg-grupo-titulo::-webkit-details-marker { display: none; }
.sg-grupo-titulo::marker { content: ''; }
.sg-grupo-titulo > i:first-child { width: 20px; text-align: center; color: var(--sg-navy-icon); flex: none; }
.sg-grupo-titulo > span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sg-grupo-titulo:hover { background: var(--sg-navy-2); color: #fff; }
.sg-grupo-titulo:hover > i:first-child { color: #fff; }
.sg-grupo-titulo:focus-visible { outline: 2px solid var(--sg-signal); outline-offset: -2px; }
.sg-grupo-seta { font-size: .7rem; color: var(--sg-navy-icon); transition: transform .18s ease; }
.sg-grupo[open] > .sg-grupo-titulo { color: #fff; }
.sg-grupo[open] > .sg-grupo-titulo .sg-grupo-seta { transform: rotate(180deg); }
.sg-grupo[open] .sg-badge-grupo { display: none; } /* aberto, o contador aparece no próprio item */
.sg-grupo-titulo .sg-badge { margin-left: 0; }
.sg-grupo-itens { padding: .15rem 0 .4rem .45rem; margin-left: 1.05rem; border-left: 1px solid var(--sg-navy-2); }
.sg-grupo-itens .sg-menu-item { padding: 0 .55rem; gap: .6rem; }
.sg-grupo-itens .sg-menu-item { height: 36px; font-size: .9rem; }
.sg-grupo-itens .sg-menu-item.is-active::before { left: calc(-.45rem - 2px); }
.sg-menu-sep { height: 1px; background: var(--sg-navy-2); margin: .7rem .4rem; }
.sg-menu-item > span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
@media (prefers-reduced-motion: reduce) { .sg-grupo-seta { transition: none; } }

/* Menu recolhido: só ícones; o grupo aberto mostra os ícones dos itens logo abaixo */
@media (min-width: 1024px) {
  .sb-collapsed .sg-grupo-titulo { justify-content: center; padding: 0; }
  .sb-collapsed .sg-grupo-titulo > span, .sb-collapsed .sg-grupo-seta { display: none; }
  .sb-collapsed .sg-grupo-titulo .sg-badge { position: absolute; top: 4px; right: 8px; min-width: 16px; height: 16px; padding: 0 4px; font-size: .62rem; }
  .sb-collapsed .sg-grupo-itens { margin-left: 0; padding-left: 0; border-left: 0; border-top: 1px solid var(--sg-navy-2); border-bottom: 1px solid var(--sg-navy-2); }
  .sb-collapsed .sg-grupo-itens .sg-menu-item.is-active::before { left: -.75rem; }
  .sb-collapsed .sg-grupo-titulo[data-tip]:hover::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
    background: var(--sg-ink); color: #fff; font-size: .8rem; font-weight: 550; padding: .35rem .6rem; border-radius: 7px; white-space: nowrap; z-index: 60;
  }
}
.sg-menu-item.sg-troca { height: auto; min-height: 40px; padding-top: .45rem; padding-bottom: .45rem; white-space: normal; line-height: 1.25; }
.sg-menu-item.sg-troca > span { overflow: visible; }

/* Filtro segmentado (ex.: Todas · Minhas · Transferidas para mim) */
.sg-segmentos { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; margin-bottom: 1rem; background: var(--sg-surface); border: 1px solid var(--sg-line); border-radius: 10px; }
.sg-segmentos a { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .9rem; border-radius: 8px; color: var(--sg-muted); font-weight: 600; font-size: .9rem; }
.sg-segmentos a span { font-size: .78rem; font-weight: 700; background: var(--sg-canvas); color: var(--sg-muted); border-radius: 999px; padding: .05rem .5rem; }
.sg-segmentos a:hover { color: var(--sg-ink); background: var(--sg-canvas); }
.sg-segmentos a.is-active { background: var(--sg-primary); color: #fff; }
.sg-segmentos a.is-active span { background: rgba(0, 0, 0, .22); color: #fff; }

/* Grupo do menu com um item só: link direto com a mesma cara do título de grupo */
.sg-sidebar .sg-menu-solo { font-weight: 600; }
.sg-sidebar .sg-menu-solo > span { flex: 1; overflow: hidden; text-overflow: ellipsis; }

/* Aceite dos Termos de Uso e da Política de Privacidade */
.sg-aceite { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: var(--sg-canvas, #f4f7fa); }
.sg-aceite-caixa { width: 100%; max-width: 560px; background: #fff; border: 1px solid var(--sg-line, #dde4ec); border-radius: 16px; padding: 2rem; }
.sg-aceite-titulo { font-size: 1.5rem; font-weight: 700; margin-bottom: .4rem; }
.sg-aceite-docs { list-style: none; margin: 1.4rem 0; padding: 0; display: grid; gap: .6rem; }
.sg-aceite-docs a { display: flex; align-items: center; gap: .7rem; padding: .85rem 1rem; border: 1px solid var(--sg-line, #dde4ec); border-radius: 10px; font-weight: 600; color: var(--sg-ink, #13263b); }
.sg-aceite-docs a:hover { border-color: var(--sg-primary, #1f5c8b); text-decoration: none; }
.sg-aceite-docs i { color: var(--sg-primary, #1f5c8b); width: 18px; }
.sg-aceite-docs span { margin-left: auto; font-weight: 400; font-size: .82rem; color: var(--sg-muted, #55687d); }
.sg-aceite-check { display: flex !important; gap: .6rem; align-items: flex-start; line-height: 1.45; }
.sg-aceite-check input { margin-top: .2rem; width: 18px; height: 18px; flex: none; }

.sg-links-legais { display: inline-flex; flex-wrap: wrap; gap: .3rem 1rem; margin-left: .5rem; }
.sg-links-legais a { color: var(--sg-muted); text-decoration: underline; text-underline-offset: 2px; }
.sg-links-legais a:hover { color: var(--sg-primary); }

/* Acessibilidade: links dentro de texto sublinhados (não dependem só da cor) */
.sg-main p a:not(.button), .help a:not(.button), .sg-alert a:not(.button), .sg-kv dd a:not(.button) { text-decoration: underline; text-underline-offset: 2px; }
.sg-public-bar .sg-brand-sub { color: #7a5a14; }
.sg-pular { position: absolute; left: -999px; top: .5rem; z-index: 100; background: #fff; color: var(--sg-ink); padding: .5rem 1rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.sg-pular:focus { left: .5rem; }
.sg-content:focus { outline: none; }
.sg-zona-perigo { border-color: #f1c7c3; }
.sg-lista-simples { list-style: disc; margin: .3rem 0 0 1.1rem; display: grid; gap: .2rem; }

/* ---------- Métricas do site ---------- */
.sg-metricas-topo { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .5rem; }
.sg-metricas-topo .sg-segmentos { margin-bottom: 0; }
.sg-delta { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; color: var(--sg-muted); }
.sg-delta.is-sobe { color: #12684b; }
.sg-delta.is-desce { color: #9f2d20; }
.sg-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.sg-grid-3 > .box { margin-bottom: 1.25rem; }
@media (max-width: 1100px) { .sg-grid-3 { grid-template-columns: 1fr; gap: 0; } }
.sg-cols-serie .sg-col { cursor: default; }
.sg-cols-serie .sg-col .pilha { width: min(18px, 70%); }
.sg-col-lead { background: #c9a14a; color: #10283f !important; border-radius: 999px; padding: 0 .35rem; font-size: .7rem !important; line-height: 1.35; }
.sg-col-lead-mini { display: inline-block; margin-right: .35rem; position: static; transform: none; }
.sg-hbars-simples .sg-hbar { cursor: default; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sg-opcoes { display: grid; gap: .8rem; margin-top: 1rem; }
.sg-hbars-simples .sg-hbar { grid-template-columns: minmax(90px, 170px) minmax(0, 1fr) 42px; }
