/* ==========================================================================
   INGRA — Relatórios (Agilidade, Produtividade, Gestão), Gestão BI e Metas
   ========================================================================== */

.ig-rel { display: flex; flex-direction: column; gap: 16px; }
.ig-rel-abas { margin: 0; }
.ig-rel .ig-dash, .ig-bi { display: flex; flex-direction: column; gap: 16px; }
.ig-rel-filtros { margin: 0; align-items: end; }
.ig-rel-filtros-acoes { display: flex; align-items: end; justify-content: flex-end; }
.ig-rel-carregando { opacity: .7; }
.ig-rel-check { align-self: end; padding-bottom: 8px; }
.ig-rel-ic { width: 16px; height: 16px; }
.ig-rel-muted { color: #94a3b8; font-size: 12px; }
.ig-rel-centro { text-align: center; margin-top: 8px; }
.ig-rel-de { font-size: 15px; color: var(--ig-muted); font-weight: 700; margin-left: 4px; }
.ig-rel-ajuda { margin: 8px 0 12px; font-size: 12.5px; color: var(--ig-text-2, #64748b); max-width: 980px; }
.ig-rel-total {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 13px;
    color: #fff; background: linear-gradient(120deg, #013252, #01527d); box-shadow: 0 3px 10px rgba(1, 50, 82, .22);
}

/* Donut de agilidade + gráfico empilhado */
.ig-rel-agil { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .ig-rel-agil { grid-template-columns: 1fr; } }
.ig-rel-donut { position: relative; width: 170px; height: 170px; margin: 0 auto; }
.ig-rel-donut svg { width: 100%; height: 100%; }
.ig-rel-donut .trilho { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 12; }
.ig-rel-donut .valor { fill: none; stroke: var(--ig-accent); stroke-width: 12; stroke-linecap: round; filter: drop-shadow(0 0 8px rgba(45, 212, 234, .55)); transition: stroke-dasharray .5s ease; }
.ig-rel-donut-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ig-rel-donut-num strong { font-size: 34px; font-weight: 800; color: var(--ig-ink); letter-spacing: -.5px; }
.ig-rel-donut-num span { font-size: 11px; font-weight: 700; color: var(--ig-muted); text-transform: uppercase; letter-spacing: .08em; }

.ig-rel-empilhada { display: flex; height: 22px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .06); }
.ig-rel-empilhada i { display: block; height: 100%; transition: width .4s ease; }
.ig-rel-empilhada i.dia, .ig-rel-legenda i.dia { background: linear-gradient(90deg, #0a83bd, var(--ig-accent)); }
.ig-rel-empilhada i.atraso, .ig-rel-legenda i.atraso { background: linear-gradient(90deg, #f97316, #ef4444); }
.ig-rel-empilhada i.pendente, .ig-rel-legenda i.pendente { background: rgba(191, 240, 251, .35); }
.ig-rel-legenda i.atribuidas { background: #fbbf24; }
.ig-rel-legenda i.oportunidades { background: #1e40af; }
.ig-rel-legenda i.execucao { background: #16a34a; }
.ig-rel-legenda { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.ig-rel-legenda div { display: grid; grid-template-columns: 12px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; }
.ig-rel-legenda i { width: 12px; height: 12px; border-radius: 4px; grid-row: span 2; }
.ig-rel-legenda span { color: var(--ig-muted); font-size: 12px; font-weight: 700; }
.ig-rel-legenda strong { color: var(--ig-ink); font-size: 22px; font-weight: 800; }
.ig-rel-legenda small { grid-column: 2; color: #fca5a5; font-size: 11px; font-weight: 700; }
.ig-rel-legenda-linha { display: flex; flex-wrap: wrap; gap: 16px; }
.ig-rel-legenda-linha div { display: inline-flex; gap: 6px; }
.ig-rel-legenda-linha i { grid-row: auto; }

.ig-rel-prazos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
@media (max-width: 720px) { .ig-rel-prazos, .ig-rel-legenda { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ig-rel-prazos button {
    display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; cursor: pointer; font: inherit;
    padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(45, 212, 234, .18); background: rgba(255, 255, 255, .04); color: var(--ig-ink);
    transition: background .15s ease, transform .15s ease;
}
.ig-rel-prazos button:hover { background: rgba(45, 212, 234, .12); transform: translateY(-1px); }
.ig-rel-prazos span { font-size: 11px; font-weight: 700; color: var(--ig-muted); text-transform: uppercase; letter-spacing: .05em; }
.ig-rel-prazos strong { font-size: 24px; font-weight: 800; }
.ig-rel-prazos .perda strong { color: #fca5a5; }
.ig-rel-fill-alerta { background: linear-gradient(90deg, #f97316, #ef4444) !important; box-shadow: 0 0 10px rgba(239, 68, 68, .45) !important; }

/* Cards quantitativos (claros, clicáveis) */
.ig-rel-quant { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.ig-rel-quant-item {
    display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; font: inherit; cursor: pointer;
    padding: 14px 16px; border-radius: 16px; border: 1px solid var(--ig-line); background: var(--ig-surface, #fff); color: var(--ig-text);
    box-shadow: 0 6px 18px -12px rgba(1, 50, 82, .35); transition: all .15s ease; position: relative; overflow: hidden;
}
div.ig-rel-quant-item { cursor: default; }
.ig-rel-quant-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--ig-brand), var(--ig-accent)); }
.ig-rel-quant-item span { font-size: 11px; font-weight: 800; color: var(--ig-text-2, #64748b); text-transform: uppercase; letter-spacing: .05em; }
.ig-rel-quant-item strong { font-size: 24px; font-weight: 800; color: var(--ig-heading, #013252); letter-spacing: -.3px; }
.ig-rel-quant-item small { font-size: 11.5px; color: var(--ig-text-2, #64748b); }
button.ig-rel-quant-item:hover { border-color: rgba(0, 102, 153, .35); transform: translateY(-1px); }
.ig-rel-quant-item.on { background: linear-gradient(120deg, #013252, #01527d); border-color: transparent; }
.ig-rel-quant-item.on span, .ig-rel-quant-item.on small { color: var(--ig-muted); }
.ig-rel-quant-item.on strong { color: #fff; }
.ig-rel-quant-item.ciclo-prospeccao::before { background: linear-gradient(180deg, #0a83bd, var(--ig-accent)); }
.ig-rel-quant-item.ciclo-producao::before { background: #1e40af; }
.ig-rel-quant-item.ciclo-execucao::before { background: #16a34a; }
.ig-rel-quant-item.ciclo-rotacao::before { background: #ef4444; }

/* Tabelas dos relatórios */
.ig-rel-painel { padding-bottom: 16px; }
.ig-rel-painel .ig-filtros { margin-top: 12px; }
.ig-rel-tabela-wrap { overflow-x: auto; margin-top: 12px; border: 1px solid var(--ig-line); border-radius: 14px; }
.ig-rel-tabela { width: 100%; border-collapse: collapse; font-size: 13px; color: var(--ig-text); }
.ig-rel-tabela th {
    text-align: left; white-space: nowrap; padding: 10px 12px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    color: #eaf7fc; background: linear-gradient(120deg, #013252, #01527d);
}
.ig-rel-tabela td { padding: 10px 12px; border-top: 1px solid var(--ig-line); vertical-align: middle; }
.ig-rel-tabela tbody tr:nth-child(even) td { background: var(--ig-surface-2, #f8fafc); }
.ig-rel-tabela tbody tr:hover td { background: var(--ig-surface-brand, #eef6fb); }
.ig-rel-tabela .num { text-align: right; font-variant-numeric: tabular-nums; }
.ig-rel-tabela td.alerta { color: #b91c1c; font-weight: 700; }
.ig-rel-tabela td.vazio { text-align: center; color: var(--ig-text-2, #64748b); padding: 28px 12px; }
.ig-rel-tabela tfoot td { font-weight: 800; color: var(--ig-heading, #013252); background: var(--ig-surface-2, #f8fafc); border-top: 2px solid rgba(0, 102, 153, .25); }
.ig-rel-avatar {
    display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-right: 8px; border-radius: 50%;
    font-size: 10px; font-weight: 800; color: var(--ig-brand-text, #01527d); background: rgba(45, 212, 234, .18); border: 1px solid rgba(0, 102, 153, .2); vertical-align: middle;
}
.ig-rel-barrinha { display: inline-block; width: 90px; height: 7px; border-radius: 999px; background: var(--ig-surface-3, #f1f5f9); overflow: hidden; vertical-align: middle; margin-right: 6px; }
.ig-rel-barrinha i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--ig-brand), var(--ig-accent)); }
.ig-rel-input { width: 120px; border: 1px solid rgba(2, 26, 51, .14); border-radius: 10px; padding: 7px 10px; font-size: 13px; text-align: right; }
.ig-rel-erro { display: block; color: #b91c1c; font-size: 11px; margin-top: 2px; }

/* Gestão BI */
.ig-bi-filtros-topo { margin: 0; }
.ig-bi-tools label { display: inline-flex; flex-direction: column; gap: 3px; }
.ig-bi-tools label span { font-size: 10.5px; font-weight: 800; color: var(--ig-text-2, #64748b); text-transform: uppercase; letter-spacing: .05em; }
.ig-bi-tools select { border: 1px solid rgba(2, 26, 51, .14); border-radius: 10px; padding: 6px 30px 6px 10px; font-size: 13px; }
.ig-bi-link { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }
.ig-bi-sub { color: var(--ig-muted); font-weight: 600; font-size: 11px; margin-left: 6px; }
.ig-bi-vazio { grid-column: 1 / -1; background: var(--ig-surface, #fff); border-radius: 16px; border: 1px dashed rgba(0, 102, 153, .25); color: var(--ig-text-2, #64748b); }

.ig-bi-duplas .ig-bar-col { cursor: default; }
.ig-bi-par { flex: 1; width: 100%; display: flex; gap: 3px; }
.ig-bi-par .ig-bar-track { flex: 1; }
.ig-bi-atribuidas { background: linear-gradient(to top, #b45309, #fbbf24) !important; box-shadow: 0 0 12px rgba(251, 191, 36, .35) !important; }
.ig-bi-oportunidades { background: linear-gradient(to top, #172554, #1e40af) !important; box-shadow: 0 0 12px rgba(30, 64, 175, .45) !important; }

.ig-bi-agil { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.ig-bi-agil div { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); }
.ig-bi-agil span { display: block; font-size: 10.5px; color: var(--ig-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.ig-bi-agil strong { font-size: 20px; color: var(--ig-ink); font-weight: 800; }

.ig-bi-membros { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; margin-top: 14px; }
.ig-bi-membro { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.ig-bi-membro header { display: flex; align-items: center; gap: 10px; }
.ig-bi-membro header strong { display: block; color: var(--ig-ink); font-size: 14.5px; }
.ig-bi-membro header small { color: var(--ig-muted); font-size: 11.5px; }
.ig-bi-membro-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ig-bi-membro-kpis div { text-align: center; padding: 8px 4px; border-radius: 10px; background: rgba(255, 255, 255, .05); }
.ig-bi-membro-kpis span { display: block; font-size: 9.5px; font-weight: 800; color: var(--ig-muted); text-transform: uppercase; letter-spacing: .04em; }
.ig-bi-membro-kpis strong { font-size: 17px; color: var(--ig-ink); }
.ig-bi-membro-kpis .alerta strong { color: #fca5a5; }
.ig-bi-graficos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ig-bi-rotulo { display: block; font-size: 10px; font-weight: 700; color: var(--ig-muted); margin-bottom: 4px; }
.ig-bi-membro footer { font-size: 11.5px; color: var(--ig-muted); border-top: 1px solid rgba(255, 255, 255, .06); padding-top: 8px; }
.ig-bi-membro footer b { color: var(--ig-accent); }
.ig-bi-spark { width: 100%; height: 36px; overflow: visible; }
.ig-bi-spark polyline { fill: none; stroke: #4ade80; stroke-width: 2; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(74, 222, 128, .5)); }
.ig-bi-spark line { stroke: rgba(255, 255, 255, .15); stroke-width: 1; }
.ig-bi-mini-barras { display: flex; align-items: flex-end; gap: 3px; height: 44px; }
.ig-bi-mini-barras span { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.ig-bi-mini-barras i { display: block; width: 100%; border-radius: 3px 3px 1px 1px; background: linear-gradient(to top, var(--ig-brand), var(--ig-accent)); }
.ig-bi-mini-barras small { font-size: 8.5px; color: var(--ig-muted); margin-top: 2px; }
.ig-bi-mini-claro { margin-top: 6px; }
.ig-bi-tag-atribuida { color: #fcd34d !important; background: rgba(252, 211, 77, .12) !important; border-color: rgba(252, 211, 77, .3) !important; }

.ig-bi-ciclos { display: flex; flex-direction: column; gap: 12px; }
.ig-bi-ciclo-linha { display: flex; flex-direction: column; gap: 3px; }
.ig-bi-ciclo-linha > strong { color: var(--ig-ink); font-size: 13px; }
.ig-bi-ciclo-linha small { color: var(--ig-muted); font-weight: 600; font-size: 11px; }
.ig-bi-ciclo { display: flex; align-items: center; gap: 6px; height: 9px; }
.ig-bi-ciclo i { display: block; height: 100%; border-radius: 999px; }
.ig-bi-ciclo em { font-style: normal; font-size: 10px; color: var(--ig-muted); font-weight: 700; }
.ig-bi-ciclo.prospeccao i { background: linear-gradient(90deg, #0a83bd, var(--ig-accent)); }
.ig-bi-ciclo.producao i { background: #1e40af; }
.ig-bi-ciclo.execucao i { background: #16a34a; }
.ig-bi-ciclo.rotacao i { background: #ef4444; }

.ig-bi-sucesso { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }

/* Tema escuro */
.dark .ig-rel-quant-item { background: #0b2233; border-color: rgba(45, 212, 234, .14); color: var(--ig-ink); }
.dark .ig-rel-quant-item strong { color: var(--ig-ink); }
.dark .ig-rel-quant-item span, .dark .ig-rel-quant-item small { color: var(--ig-muted); }
.dark .ig-rel-tabela-wrap { border-color: rgba(45, 212, 234, .14); }
.dark .ig-rel-tabela { color: var(--ig-ink); }
.dark .ig-rel-tabela td { border-top-color: rgba(255, 255, 255, .06); }
.dark .ig-rel-tabela tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .02); }
.dark .ig-rel-tabela tbody tr:hover td { background: rgba(45, 212, 234, .06); }
.dark .ig-rel-tabela tfoot td { background: rgba(45, 212, 234, .08); color: var(--ig-ink); }
.dark .ig-rel-tabela td.alerta { color: #fca5a5; }
.dark .ig-rel-avatar { color: var(--ig-accent); }
.dark .ig-rel-ajuda, .dark .ig-rel-tabela td.vazio { color: var(--ig-muted); }
.dark .ig-rel-input, .dark .ig-bi-tools select { background: #0b2233; color: var(--ig-ink); border-color: rgba(45, 212, 234, .2); }
.dark .ig-bi-vazio { background: #0b2233; color: var(--ig-muted); }
.dark .ig-rel-barrinha { background: rgba(255, 255, 255, .1); }
