/* Gestão CIPA — Estilos específicos dos módulos */
.tx-danger { color: var(--danger-tx); }
.tx-warn { color: var(--warn-tx); }
.mb { margin-bottom: 12px; }
.toolbar.flat { border: 0; padding: 0 0 12px; background: none; }
.kpis-4 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 0; }
.detail-top { display: flex; flex-direction: column; gap: 12px; }
.detail-cta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mb-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; }
.chk { display: inline-flex !important; align-items: center; gap: 8px; font-weight: 500 !important; }
.chk input { width: auto !important; min-height: 0 !important; }
.plain-ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.plain-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 13px; }
select.mini, input.mini { height: 30px; min-height: 30px; padding: 2px 26px 2px 8px; border-radius: 7px; border: 1px solid var(--g-300); background-color: #fff; font-size: 12.5px; }
input.mini { padding-right: 8px; }

/* Membros / composição */
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.comp-col { padding: 14px; }
.comp-col h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.comp-person { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: none; padding: 7px 6px; border-radius: 10px; }
.comp-person:hover { background: var(--g-50); }
.comp-person span:last-child { display: flex; flex-direction: column; min-width: 0; }
.comp-person b { font-size: 13px; font-weight: 600; }
.comp-person small { font-size: 11.5px; color: var(--text-3); }
.mandate-bar .mb-row { color: var(--text-2); }
.faltas { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }

/* Eleições */
.tl-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.tl-head h4 { display: flex; align-items: center; gap: 7px; }
.el-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; position: relative; }
.el-step { display: grid; grid-template-columns: 30px 1fr; gap: 10px; position: relative; padding-bottom: 12px; }
.el-step:not(:last-child)::before { content: ''; position: absolute; left: 14px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.el-ic { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--g-100); color: var(--g-500); position: relative; z-index: 1; }
.el-ic .ic { width: 16px; height: 16px; }
.st-ok .el-ic { background: var(--ok-bg); color: var(--ok); }
.st-bad .el-ic { background: var(--danger-bg); color: var(--danger); }
.el-step div { display: flex; flex-direction: column; padding-top: 4px; }
.el-step b { font-size: 13px; }
.el-date { font-size: 12.5px; color: var(--g-700); font-weight: 550; }
.el-step small { font-size: 11.8px; color: var(--text-3); }
.st-bad small { color: var(--danger-tx); }

/* Presenças */
.pres-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.pres-table select, .pres-table input { width: 100%; height: 32px; border: 1px solid var(--g-300); border-radius: 8px; padding: 0 28px 0 8px; font-size: 12.5px; background-color: #fff; }
.pres-table input { padding-right: 8px; }
.pres-table .g-name { height: 28px; font-weight: 600; }
.quadro th.c, .quadro td.c { text-align: center; }
.pq { display: inline-flex; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 7px; font-weight: 700; font-size: 12px; }
.pq.tone-ok { background: #176b35; color: #fff; }
.pq.tone-warn { background: #dc5555; color: #fff; }
.pq.tone-danger { background: #a61520; color: #fff; }
.pq.tone-muted { color: var(--g-400); }
.legend-inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-2); }
.legend-inline .pq { width: 20px; height: 20px; font-size: 11px; margin-left: 6px; }

/* Atas */
.ata-preview { white-space: pre-wrap; font-size: 13px; line-height: 1.55; background: var(--g-50); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; max-height: 340px; overflow: auto; font-family: var(--font); }
.ata-text { width: 100%; min-height: 58vh; border: 1px solid var(--g-300); border-radius: 12px; padding: 14px 16px; font-size: 13.5px; line-height: 1.6; resize: vertical; font-family: var(--font); }
.ata-text:focus { outline: none; border-color: var(--o-500); box-shadow: 0 0 0 3px rgba(242, 106, 27, .14); }

/* Microatividades / itens */
.micro { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.micro li { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 9px; background: var(--g-50); }
.micro li label { flex: 1; display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; min-width: 0; }
.micro li input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--o-500); flex: none; }
.micro li.done label span { text-decoration: line-through; color: var(--g-500); }
.micro-meta { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.micro-add { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.micro-add input { flex: 1 1 200px; height: 34px; border: 1px solid var(--g-300); border-radius: 9px; padding: 0 10px; font-size: 13px; }
.micro-add input[type=date] { flex: 0 0 150px; }

/* Kanban */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kb-col { background: var(--g-100); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 300px; transition: background .15s, box-shadow .15s; }
.kb-col.over { background: var(--o-50); box-shadow: inset 0 0 0 2px var(--o-200); }
.kb-h { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 4px; }
.kb-h b { font-size: 12px; color: var(--g-500); }
.kb-list { display: flex; flex-direction: column; gap: 8px; }
.kb-card { background: #fff; border-radius: 11px; padding: 10px 12px; box-shadow: var(--sh-1); border: 1px solid var(--line); cursor: grab; display: flex; flex-direction: column; gap: 6px; }
.kb-card:hover { box-shadow: var(--sh-2); }
.kb-card.dragging { opacity: .5; }
.kb-card.late { border-left: 3px solid var(--danger); }
.kb-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.kb-card h5 { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--g-900); }
.kb-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11.5px; color: var(--text-3); }
.kb-meta span { display: inline-flex; align-items: center; gap: 4px; }
.kb-meta .ic { width: 13px; height: 13px; }
.kb-empty { font-size: 12px; color: var(--g-400); text-align: center; padding: 18px 0; }

/* Checklist do programa */
.ck-summary { margin-bottom: 14px; }
.ck-cats { display: flex; flex-direction: column; gap: 10px; }
.ck-cat summary { display: flex; align-items: center; gap: 14px; padding: 13px 16px; cursor: pointer; list-style: none; }
.ck-cat summary::-webkit-details-marker { display: none; }
.ck-cat summary::before { content: '›'; font-size: 18px; color: var(--g-400); transition: transform .15s; }
.ck-cat[open] summary::before { transform: rotate(90deg); }
.ck-t { flex: 1; font-weight: 600; font-size: 13.5px; }
.ck-p { display: flex; align-items: center; gap: 8px; width: 200px; }
.ck-p .progress { flex: 1; }
.ck-p small { font-size: 11.5px; color: var(--text-3); min-width: 44px; text-align: right; }
.ck-items { list-style: none; margin: 0; padding: 0 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.ck-items li { display: grid; grid-template-columns: 38px 1fr 160px auto; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 9px; font-size: 13px; }
.ck-items li:hover { background: var(--g-50); }
.ck-n { font-size: 11.5px; color: var(--g-400); font-weight: 650; text-align: right; }
.ck-a { display: flex; flex-direction: column; }
.ck-a small { color: var(--text-3); font-size: 11.5px; }
.ck-s { height: 30px; border: 1px solid var(--g-300); border-radius: 8px; padding: 0 26px 0 8px; font-size: 12.5px; background-color: #fff; }
.st-concluido .ck-a { color: var(--g-500); text-decoration: line-through; }
.st-concluido .ck-s { border-color: #B7E4C7; background-color: var(--ok-bg); }
.st-em-andamento .ck-s { border-color: #F8D89A; background-color: var(--warn-bg); }

/* Inspeções */
.insp-items { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.insp-items li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 11px; border: 1px solid var(--line); background: #fff; }
.insp-items li.res-nao-conforme { border-color: #F5C2C2; background: #FFFAFA; }
.insp-items li.res-conforme { border-color: #C7EBD3; }
.ii-main { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ii-main b { font-size: 13px; font-weight: 600; }
.ii-obs { height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; font-size: 12.5px; background: var(--g-50); }
.ii-res { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg { border: 0; background: #fff; padding: 0 10px; height: 30px; font-size: 12px; font-weight: 700; color: var(--g-500); border-right: 1px solid var(--line); }
.seg:last-child { border-right: 0; }
.seg.on[data-r="Conforme"] { background: var(--ok); color: #fff; }
.seg.on[data-r="Não conforme"] { background: var(--danger); color: #fff; }
.seg.on[data-r="Não aplicável"] { background: var(--g-500); color: #fff; }
.seg.on[data-r="Não verificado"] { background: var(--g-200); color: var(--g-800); }
.ii-act { display: flex; gap: 4px; align-items: center; }

/* Riscos */
.lvl { display: inline-flex; min-width: 28px; height: 24px; padding: 0 6px; border-radius: 7px; align-items: center; justify-content: center; font-weight: 750; font-size: 12px; color: #fff; background: var(--c); }
.risk-score { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--c) 9%, white); border: 1px solid color-mix(in srgb, var(--c) 30%, white); }
.rs-n { width: 54px; height: 54px; border-radius: 14px; background: var(--c); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; }
.risk-score div:last-child { display: flex; flex-direction: column; }
.risk-score b { font-size: 16px; }
.risk-score span { font-size: 12.5px; color: var(--text-2); }
.heat-wrap { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 14px; }
.heat { display: flex; align-items: center; gap: 8px; }
.heat-ylab { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11.5px; font-weight: 650; color: var(--g-500); }
.heat-grid { display: grid; grid-template-columns: 24px repeat(5, 1fr); gap: 5px; flex: 1; }
.heat-axis { display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; color: var(--g-500); }
.heat-cell { aspect-ratio: 1; border: 0; border-radius: 9px; background: color-mix(in srgb, var(--c) calc(var(--o) * 100%), white); color: #fff; font-weight: 800; font-size: 16px; opacity: 1; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .04); }
.heat-cell:hover { transform: scale(1.04); }
.heat-cell.sel { box-shadow: 0 0 0 3px var(--g-900); }
.heat-xlab { text-align: center; font-size: 11.5px; font-weight: 650; color: var(--g-500); margin-top: 6px; padding-left: 50px; }
.heat-list { max-height: 520px; overflow: auto; }
.risk-row { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; border: 0; background: var(--g-50); padding: 8px 10px; border-radius: 10px; margin-bottom: 6px; font-size: 13px; }
.risk-row span { flex: 1; }
.risk-row:hover { background: var(--o-50); }

/* Conformidade */
.seg-group { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--line); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg-opt input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); color: var(--g-900); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--o-400); }
.tema-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 12.5px; color: var(--text-2); }

/* Configurações */
.cfg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.count-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.count-grid div { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: 12.8px; }
.count-grid code { grid-column: 1 / -1; font-size: 10.5px; background: none; padding: 0; color: var(--g-400); }
.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.chips-static { display: flex; flex-wrap: wrap; gap: 5px; }
.chips-static span { font-size: 11.5px; padding: 3px 8px; border-radius: 999px; background: var(--g-100); color: var(--g-700); }

@media (max-width: 900px) {
  .kanban { grid-template-columns: repeat(5, 260px); }
  .heat-wrap { grid-template-columns: 1fr; }
  .ck-items li { grid-template-columns: 30px 1fr; }
  .ck-items li .ck-s { grid-column: 2; }
  .ck-items li [data-e] { display: none; }
  .ck-p { width: 120px; }
  .insp-items li { grid-template-columns: 1fr; }
  .tema-row { grid-template-columns: 1fr; gap: 4px; }
}

/* Organograma de membros */
.org-scroll { overflow-x: auto; padding: 12px 2px 20px; }
.org-grade { display: flex; align-items: flex-start; gap: 24px; width: max-content; min-width: 100%; }
.org-empresa { flex: 0 0 390px; padding: 18px; border: 1px solid #e7e7e7; border-radius: 12px; background: #fff; text-align: center; }
.org-nome { display: inline-block; margin: 0 0 18px; padding: 9px 24px; border-radius: 24px; background: #ff6b0b; color: white; font-size: 14px; }
.org-presidentes { width: 62%; margin: 0 auto; }
.org-card { min-width: 0; margin-bottom: 9px; padding: 10px 7px; border: 1px solid #ff6b0b; border-radius: 5px; color: #44241d; background: #fff; display: flex; flex-direction: column; align-items: center; gap: 5px; overflow-wrap: anywhere; }
.org-card strong { font-size: 13px; }
.org-funcao { font-size: 10px; text-transform: uppercase; color: #a54620; }
.org-tipo { border-radius: 12px; padding: 3px 10px; font-size: 10px; font-weight: 700; color: #fff; background: #777; }
.org-eleito { background: #358132; } .org-indicado { background: #bd4d13; }
.org-vazio { border-style: dashed; color: #777; font-size: 11px; }
.org-conector { height: 16px; width: 1px; margin: -9px auto 0; background: #ff9b6b; }
.org-lideres, .org-membros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.org-titulo { color: #c44715; text-transform: uppercase; letter-spacing: 1px; font-size: 11px; margin: 18px 0 12px; }
.org-sem { grid-column: 1 / -1; font-size: 12px; color: #777; }
@media (max-width: 600px) { .org-empresa { flex-basis: 310px; padding: 12px; } }
