/* css/indicadores_lc.css */
/* Tema para Indicadores Limpeza Concorrente (Compatível com Light/Dark Mode) */
/* Classes prefixadas com "ilc-" (não reaproveita "igl-" de indicadores_gl.css,
   nem "lc-" já usado pelo módulo operacional js/limpeza_concorrente.js) — os
   estilos de guias (.ind-tab-*) e do container #view-indicadores-gl já vêm de
   indicadores_gl.css (compartilhado por todas as guias de Indicadores). */

/* Header */
.ilc-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 .ilc-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);
}

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

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

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

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

/* Filtros & Controles */
.ilc-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 .ilc-controls-bar {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(255, 255, 255, 0.03);
}

.ilc-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 .ilc-preset-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

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

.ilc-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 */
.ilc-filter-panel {
    background: var(--bg-surface, #ffffff);
    border: 2px solid #10b981;
    padding: 18px 20px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

:root.dark-mode .ilc-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);
}

.ilc-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 .ilc-filter-panel::before {
    background: #0f172a;
}

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

.ilc-filter-select, .ilc-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 .ilc-filter-select, :root.dark-mode .ilc-filter-input {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
}

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

.ilc-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;
}
.ilc-filter-btn:hover { background: #059669; }

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

.ilc-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);
    background-color: var(--kpi-bg, #f1f5f9);
    border-top: 6px solid var(--kpi-color, #3b82f6);
}

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

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

.ilc-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";
}

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

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

/* Tabelas e Painéis */
.ilc-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 .ilc-section {
    background: rgba(30, 41, 59, 0.4);
    border-color: rgba(255, 255, 255, 0.05);
}

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

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

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

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

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

.ilc-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 .ilc-table th {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

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

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

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

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

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

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

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

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

/* Barra de progresso (SLA) */
.ilc-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 6px;
}

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

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

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

/* Modal Overlay */
.ilc-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;
}
.ilc-modal-overlay.active {
    opacity: 1;
}

.ilc-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;
}
.ilc-modal-overlay.active .ilc-modal-content {
    transform: translateY(0);
}

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

.ilc-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 .ilc-modal-header {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

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

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

.ilc-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;
}
.ilc-modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.ilc-modal-body {
    overflow-y: auto;
    padding: 16px 28px 28px;
    flex: 1;
}

.ilc-dd-table td {
    padding: 10px 12px !important;
    font-size: 0.85rem;
}
.ilc-dd-table th {
    padding: 10px 12px !important;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

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

/* Loading Overlay */
#ilc-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 #ilc-loading-overlay {
    background: rgba(15, 23, 42, 0.85);
}
#ilc-loading-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

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

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

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