/* css/indicadores_gl.css */
/* Tema Moderno para Indicadores GL (Compatível com Light/Dark Mode) */

#view-indicadores-gl {
    padding: 24px;
    background-color: transparent;
    color: var(--text-primary, #1e293b);
    overflow-y: auto;
    height: 100%;
    font-family: 'Inter', system-ui, sans-serif;
}

/* Guias de módulo (GL / Transporte / Nutrição / Limpeza Concorrente) */
.ind-tabs-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.ind-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
    background: var(--bg-surface, #ffffff);
    color: var(--text-muted, #64748b);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

:root.dark-mode .ind-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.ind-tab-btn i {
    font-size: 1.1rem;
}

.ind-tab-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ind-tab-btn.active {
    background: #10b981 !important;
    color: #fff !important;
    border-color: #10b981 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.ind-tab-content {
    display: none;
}

.ind-tab-content.active {
    display: block;
    animation: indFadeInTab 0.3s ease;
}

@keyframes indFadeInTab {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ind-tab-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted, #64748b);
    background: var(--bg-surface, #ffffff);
    border: 1px dashed var(--border-color, #e2e8f0);
    border-radius: 16px;
}

:root.dark-mode .ind-tab-placeholder {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

.ind-tab-placeholder i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
    opacity: 0.5;
}

/* Header */
.igl-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface, #ffffff);
    padding: 20px 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color, #e2e8f0);
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

:root.dark-mode .igl-header-container {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.igl-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.igl-header-title i {
    font-size: 2rem;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    padding: 8px;
    border-radius: 12px;
}

.igl-header-title h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary, #1e293b);
    letter-spacing: -0.5px;
}

.igl-header-title span {
    font-size: 0.85rem;
    color: var(--text-muted, #64748b);
    display: block;
    margin-top: 4px;
}

/* Filtros & Controles */
.igl-controls-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    align-items: center;
    background: var(--bg-surface, #f8fafc);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
}

:root.dark-mode .igl-controls-bar {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.03);
}

.igl-preset-btn {
    background: var(--bg-body, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-muted, #64748b);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

:root.dark-mode .igl-preset-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.igl-preset-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.igl-preset-btn.active {
    background: #10b981 !important;
    color: #fff !important;
    border-color: #10b981 !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

/* Painel de Filtros (Estilo PowerBI) */
.igl-filter-panel {
    background: var(--bg-surface, #ffffff);
    border: 2px solid #10b981; /* Borda Verde Hospital Nove de Julho style */
    padding: 18px 20px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

:root.dark-mode .igl-filter-panel {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Um subtítulo sutil que acompanha painéis de filtro modernos */
.igl-filter-panel::before {
    content: 'Filtros Dinâmicos';
    position: absolute;
    top: -12px;
    left: 16px;
    background: var(--bg-surface, #ffffff);
    padding: 0 10px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #10b981;
}

:root.dark-mode .igl-filter-panel::before {
    background: #0f172a; /* matches bg-body/surface for darkmode usually */
}

.igl-filter-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    margin-bottom: 6px;
    text-transform: uppercase;
}

.igl-filter-select, .igl-filter-input {
    width: 100%;
    background: var(--bg-body, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-primary, #334155);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s ease;
}

:root.dark-mode .igl-filter-select, :root.dark-mode .igl-filter-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.igl-filter-select:focus, .igl-filter-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Combobox buscável single-select — usado nos filtros com lista longa de opções
   (ex: Tipo de Transporte, Andar em Indicadores Transporte), no lugar de uma
   parede de botões que não escala além de umas 6-8 opções. */
.igl-combo {
    position: relative;
}

.igl-combo-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: var(--bg-body, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-primary, #334155);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.igl-combo-trigger span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.igl-combo-trigger i {
    flex-shrink: 0;
    color: var(--text-muted, #64748b);
    font-size: 0.8rem;
}

.igl-combo-trigger:hover {
    border-color: #10b981;
}

:root.dark-mode .igl-combo-trigger {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.igl-combo-panel {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 220px;
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 8px;
    z-index: 30;
}

.igl-combo-panel.open {
    display: block;
}

:root.dark-mode .igl-combo-panel {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.igl-combo-search {
    width: 100%;
    background: var(--bg-body, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    color: var(--text-primary, #334155);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    outline: none;
    margin-bottom: 6px;
}

.igl-combo-search:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

:root.dark-mode .igl-combo-search {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

.igl-combo-options {
    max-height: 240px;
    overflow-y: auto;
}

.igl-combo-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-primary, #334155);
    cursor: pointer;
    white-space: nowrap;
}

.igl-combo-option input {
    cursor: pointer;
    flex-shrink: 0;
}

.igl-combo-option span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.igl-combo-option:hover {
    background: rgba(16, 185, 129, 0.1);
}

:root.dark-mode .igl-combo-option {
    color: #cbd5e1;
}

.igl-combo-empty {
    padding: 8px 10px;
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
    text-align: center;
}

.igl-filter-btn {
    background: #10b981;
    color: white;
    font-weight: 600;
    border: none;
    width: 100%;
    padding: 9px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s ease;
}
.igl-filter-btn:hover { background: #059669; }

/* Grid de KPIs (Cards Altamente Coloridos) */
.igl-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.igl-kpi-card {
    border-radius: 16px;
    padding: 24px 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    /* Cores Injetadas dinamicamente via style="..." */
    background-color: var(--kpi-bg, #f1f5f9);
    border-top: 6px solid var(--kpi-color, #3b82f6);
}

.igl-kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.igl-kpi-card--clickable {
    cursor: pointer;
}

.igl-kpi-icon {
    font-size: 2rem;
    color: var(--kpi-color, #3b82f6);
    margin-bottom: 12px;
}

.igl-kpi-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 8px;
    color: var(--kpi-text, #1e293b);
    font-feature-settings: "tnum";
}

.igl-kpi-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--kpi-color, #3b82f6);
    margin-bottom: 4px;
}

.igl-kpi-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    font-weight: 500;
}

/* Tabelas e Paineis */
.igl-section {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

:root.dark-mode .igl-section {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(255, 255, 255, 0.05);
}

.igl-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.igl-section-title i {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    padding: 6px;
    border-radius: 8px;
}

.igl-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-color, #e2e8f0);
}

:root.dark-mode .igl-table-wrapper {
    border-color: rgba(255, 255, 255, 0.04);
}

.igl-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.igl-table th {
    background: var(--bg-body, #f8fafc);
    padding: 14px 16px;
    text-align: left;
    color: var(--text-muted, #64748b);
    font-weight: 700;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

:root.dark-mode .igl-table th {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.igl-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color, #f1f5f9);
    color: var(--text-primary, #334155);
    font-weight: 500;
}

:root.dark-mode .igl-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    color: #e2e8f0;
}

.igl-table tbody tr:last-child td {
    border-bottom: none;
}

.igl-table tbody tr {
    transition: background 0.2s ease;
}

.igl-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

:root.dark-mode .igl-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.igl-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.igl-badge.neutral { background: rgba(148, 163, 184, 0.15); color: #64748b; }
.igl-badge.success { background: rgba(16, 185, 129, 0.15); color: #059669; }
.igl-badge.warning { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.igl-badge.critical { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.igl-badge.info { background: rgba(168, 85, 247, 0.15); color: #9333ea; }

:root.dark-mode .igl-badge.success { color: #34d399; }
:root.dark-mode .igl-badge.warning { color: #fbbf24; }
:root.dark-mode .igl-badge.critical { color: #f87171; }
:root.dark-mode .igl-badge.neutral { color: #cbd5e1; }
:root.dark-mode .igl-badge.info { color: #c084fc; }

/* Gráficos customizados */
.igl-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 6px;
}

.igl-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Container para Gráficos ChartJS */
.igl-chart-container {
    height: 280px;
    width: 100%;
    position: relative;
    padding-top: 10px;
}

/* Linhas clicáveis para Drill-Down */
.igl-drilldown-row {
    cursor: pointer !important;
}
.igl-drilldown-row:hover {
    background: rgba(16, 185, 129, 0.06) !important;
}
:root.dark-mode .igl-drilldown-row:hover {
    background: rgba(16, 185, 129, 0.08) !important;
}
.igl-drilldown-row td:first-child i.ph-arrow-square-out {
    transition: opacity 0.2s;
}
.igl-drilldown-row:hover td:first-child i.ph-arrow-square-out {
    opacity: 0.7 !important;
    color: #10b981;
}

/* Modal Overlay */
.igl-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 24px;
}
.igl-modal-overlay.active {
    opacity: 1;
}

/* Modal Content */
.igl-modal-content {
    background: var(--bg-surface, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 20px;
    width: 100%;
    max-width: 1100px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}
.igl-modal-overlay.active .igl-modal-content {
    transform: translateY(0);
}

:root.dark-mode .igl-modal-content {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

/* Modal Header */
.igl-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 24px 28px 16px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    flex-shrink: 0;
}
:root.dark-mode .igl-modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.igl-modal-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary, #1e293b);
    display: flex;
    align-items: center;
    gap: 10px;
}
.igl-modal-header h2 i {
    color: #10b981;
    font-size: 1.4rem;
}

.igl-modal-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
    margin-top: 6px;
    display: block;
}

.igl-modal-close {
    background: none;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted, #64748b);
    font-size: 1.1rem;
    transition: all 0.2s;
    flex-shrink: 0;
}
.igl-modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.igl-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.igl-modal-export {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid #10b981;
    border-radius: 8px;
    padding: 0 14px;
    height: 36px;
    color: #10b981;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.igl-modal-export:hover {
    background: #10b981;
    color: #fff;
}

/* Filtros locais (Status/Validade/Tipo/Andar) dentro do modal de drill-down — só nas
   telas onde faz sentido refinar mais a lista já filtrada por outro critério (Atrasados/
   Volume Mensal/Volume por Andar/Ranking por Agente). Reaproveita .igl-filter-select/
   .igl-filter-label já usados em "Detalhes Transporte". */
.igl-modal-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    padding: 16px 28px;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    flex-shrink: 0;
}

.igl-modal-filters > div {
    min-width: 160px;
}

:root.dark-mode .igl-modal-filters {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

/* Modal Body (scrollable) */
.igl-modal-body {
    overflow-y: auto;
    padding: 16px 28px 28px;
    flex: 1;
}

/* Tabela do Drill-Down (compacta) */
.igl-dd-table td {
    padding: 10px 12px !important;
    font-size: 0.85rem;
}
.igl-dd-table th {
    padding: 10px 12px !important;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* Drill-down de Impedimento (Indicadores Transporte) — tabela larga (15 colunas),
   modal ocupa quase toda a largura da tela e as células não quebram linha. */
.igl-modal-content.igl-modal-content--full {
    max-width: 96vw;
    width: 96vw;
}
.indtp-dd-table td,
.indtp-dd-table th {
    white-space: nowrap;
}

/* Spin animation */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Indicador "Atualizando dados..." — spinner global exibido enquanto qualquer fetch
   da guia (Visão Geral ou a sub-guia aberta) está em voo. */
.igl-loading-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #10b981;
}

/* Interruptor compacto "Mostrar totais nos gráficos" (Validade/Atrasados/Volume Mensal
   em Indicadores Transporte) — versão pequena do padrão iOS já usado em .geral-switch,
   dimensionado pra caber ao lado de um rótulo numa única linha acima dos gráficos. */
.igl-switch-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.igl-switch-inline input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.igl-switch-inline .igl-switch-slider {
    position: relative;
    display: inline-block;
    width: 34px;
    height: 18px;
    flex-shrink: 0;
    background: rgba(100, 116, 139, 0.3);
    border-radius: 18px;
    transition: background 0.2s ease;
}

.igl-switch-inline .igl-switch-slider::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.igl-switch-inline input:checked + .igl-switch-slider {
    background: #10b981;
}

.igl-switch-inline input:checked + .igl-switch-slider::before {
    transform: translateX(16px);
}

.igl-switch-inline .igl-switch-inline-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary, #334155);
}

/* ═══════════════════════════════════════════════════════════════
   CICLOS MODULE — Altas × Limpezas × Retrabalho
   ═══════════════════════════════════════════════════════════════ */

/* Hero Cards (Altas + Limpezas) */
.igl-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.igl-hero-card {
    border-radius: 20px;
    padding: 32px 28px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    border: 1px solid transparent;
}
.igl-hero-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0,0,0,0.15);
}
.igl-hero-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 120px; height: 120px;
    border-radius: 50%;
    opacity: 0.08;
    transform: translate(30%, -30%);
}
.igl-hero-card.altas {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
}
.igl-hero-card.altas::after { background: #fff; }
.igl-hero-card.limpezas {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: #fff;
}
.igl-hero-card.limpezas::after { background: #fff; }

.igl-hero-icon { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.9; }
.igl-hero-value {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 8px;
    font-feature-settings: "tnum";
}
.igl-hero-label {
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.9;
}
.igl-hero-sub {
    font-size: 0.82rem;
    opacity: 0.7;
    margin-top: 4px;
}

/* Mini KPI row abaixo dos hero cards */
.igl-mini-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}
.igl-mini-kpi {
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 14px;
    padding: 18px 20px;
    text-align: center;
    transition: transform 0.2s;
}
.igl-mini-kpi:hover { transform: translateY(-2px); }
:root.dark-mode .igl-mini-kpi {
    background: rgba(30,41,59,0.4);
    border-color: rgba(255,255,255,0.05);
}
.igl-mini-kpi-value {
    font-size: 1.8rem;
    font-weight: 800;
    font-feature-settings: "tnum";
}
.igl-mini-kpi-label {
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Charts Grid */
.igl-charts-grid {
    display: grid;
    gap: 24px;
    margin-bottom: 32px;
}
.igl-charts-grid.layout-2 {
    grid-template-columns: 1fr 1fr;
}
.igl-charts-grid.layout-full {
    grid-template-columns: 1fr;
}
.igl-charts-grid.layout-3 {
    grid-template-columns: 1fr 1fr 1fr;
}
.igl-chart-card {
    background: var(--bg-surface, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
:root.dark-mode .igl-chart-card {
    background: rgba(30,41,59,0.4);
    border-color: rgba(255,255,255,0.05);
}
.igl-chart-card.highlight {
    border: 2px solid #f59e0b;
    box-shadow: 0 6px 20px rgba(245,158,11,0.1);
}
.igl-chart-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #1e293b);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.igl-chart-card-title i {
    font-size: 1.2rem;
    opacity: 0.7;
}
.igl-chart-card-title .igl-highlight-tag {
    background: #f59e0b;
    color: #fff;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ciclo Table (dentro do modal) */
.igl-ciclo-row-ok { background: rgba(16,185,129,0.06) !important; }
.igl-ciclo-row-desvio { background: rgba(239,68,68,0.06) !important; }
:root.dark-mode .igl-ciclo-row-ok { background: rgba(16,185,129,0.08) !important; }
:root.dark-mode .igl-ciclo-row-desvio { background: rgba(239,68,68,0.08) !important; }
.igl-ciclo-row-ok:hover { background: rgba(16,185,129,0.12) !important; }
.igl-ciclo-row-desvio:hover { background: rgba(239,68,68,0.12) !important; }

/* Timeline Vertical */
.igl-timeline {
    position: relative;
    padding-left: 36px;
    margin: 20px 0;
}
.igl-timeline::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #6366f1, #0ea5e9, #10b981);
    border-radius: 3px;
}
.igl-timeline-item {
    position: relative;
    padding: 16px 20px;
    margin-bottom: 16px;
    background: var(--bg-surface, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    transition: box-shadow 0.2s;
}
.igl-timeline-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
:root.dark-mode .igl-timeline-item {
    background: rgba(15,23,42,0.6);
    border-color: rgba(255,255,255,0.06);
}
.igl-timeline-dot {
    position: absolute;
    left: -30px;
    top: 20px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid var(--bg-surface, #fff);
    box-shadow: 0 0 0 2px currentColor;
}
:root.dark-mode .igl-timeline-dot {
    border-color: #1e293b;
}
.igl-timeline-dot.limpeza { color: #10b981; background: #10b981; }
.igl-timeline-dot.extra { color: #f59e0b; background: #f59e0b; }
.igl-timeline-dot.checklist { color: #8b5cf6; background: #8b5cf6; }
.igl-timeline-tipo {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 6px;
}
.igl-timeline-detalhe {
    font-size: 0.85rem;
    color: var(--text-primary, #334155);
    line-height: 1.6;
}
.igl-timeline-detalhe strong {
    color: var(--text-primary, #1e293b);
}

/* Filtro por Agente (dentro do filter panel) */
.igl-filter-agent-select {
    width: 100%;
}

/* Loading Overlay */
#igl-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-body, rgba(248, 250, 252, 0.85));
    backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
:root.dark-mode #igl-loading-overlay {
    background: rgba(15, 23, 42, 0.85);
}
#igl-loading-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.igl-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.igl-loading-ring {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(16, 185, 129, 0.15);
    border-top: 4px solid #10b981;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.igl-loading-text {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    letter-spacing: 0.3px;
}

/* Leito Detalhe Modal */
.igl-leito-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.igl-leito-stat {
    background: var(--bg-body, #f8fafc);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}
:root.dark-mode .igl-leito-stat {
    background: rgba(15, 23, 42, 0.4);
    border-color: rgba(255, 255, 255, 0.05);
}
.igl-leito-stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    font-feature-settings: "tnum";
    line-height: 1;
}
.igl-leito-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted, #64748b);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.igl-leito-cycle {
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color, #e2e8f0);
    transition: box-shadow 0.2s;
}
.igl-leito-cycle:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.igl-leito-cycle.ok {
    border-left: 4px solid #10b981;
}
.igl-leito-cycle.desvio {
    border-left: 4px solid #ef4444;
}
:root.dark-mode .igl-leito-cycle {
    border-color: rgba(255, 255, 255, 0.06);
}

.igl-leito-cycle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-body, #f8fafc);
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}
:root.dark-mode .igl-leito-cycle-header {
    background: rgba(0, 0, 0, 0.15);
    border-bottom-color: rgba(255, 255, 255, 0.04);
}

.igl-leito-cycle-events {
    padding: 8px 16px;
}
.igl-leito-cycle-events > div:last-child {
    border-bottom: none !important;
}

/* Responsivo */
@media (max-width: 768px) {
    .igl-hero-grid { grid-template-columns: 1fr; }
    .igl-charts-grid.layout-2 { grid-template-columns: 1fr; }
    .igl-charts-grid.layout-3 { grid-template-columns: 1fr; }
    .igl-hero-value { font-size: 2.5rem; }
    .igl-leito-stats-row { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════════════════════════
   Exportar PDF — Fluxo do giro (15/09/26)
   A regra @page (orientação) é injetada/removida por JS em iglExportPDF()
   (js/indicadores_gl.js), pois @page não aceita ser escopada por seletor
   de classe. Aqui só o que É escopável por body.igl-print-landscape: some
   com o chrome do app (sidebar, cabeçalho, barra de presets, filtros) e
   garante que a tabela larga não fique cortada pela rolagem horizontal
   que ela usa normalmente em tela (overflow visível + fonte menor).
   ═══════════════════════════════════════════════════════════════════ */
@media print {
    body.igl-print-landscape .sidebar-main,
    body.igl-print-landscape .main-header,
    body.igl-print-landscape .ind-tabs-bar,
    body.igl-print-landscape .igl-controls-bar,
    body.igl-print-landscape #igl-filter-container {
        display: none !important;
    }
    body.igl-print-landscape #view-indicadores-gl {
        padding: 0;
        overflow: visible;
        height: auto;
    }
    body.igl-print-landscape .igl-fluxo-giro-content .igl-table-wrapper {
        overflow: visible !important;
    }
    body.igl-print-landscape .igl-fluxo-giro-content table.igl-table {
        width: 100%;
        table-layout: auto;
        font-size: 7.5pt;
    }
    body.igl-print-landscape .igl-fluxo-giro-content table.igl-table th,
    body.igl-print-landscape .igl-fluxo-giro-content table.igl-table td {
        padding: 3px 4px;
        white-space: normal;
    }
    /* "+N ciclos"/linha do tempo expandida não precisam repetir no PDF de todas
       as linhas -- só a tabela consolidada, que já tem tudo que a coluna pede. */
    body.igl-print-landscape .igl-fluxo-giro-content [id^="igl-fg-detalhe-"] {
        display: none !important;
    }
}
