* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f3f3f4;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

.header {
    background: white;
    border-radius: 4px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}

.header h1 {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 10px;
}

.header-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.filter-control {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-control label {
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 600;
}

.filter-control select,
.filter-control input {
    padding: 8px 12px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    min-width: 150px;
    cursor: pointer;
}

.filter-control input[type="month"] {
    min-width: 140px;
}

.filter-control select:hover,
.filter-control input:hover {
    border-color: #1c84c6;
}

.filter-control select:focus,
.filter-control input:focus {
    outline: none;
    border-color: #1a7bb9;
    box-shadow: 0 0 0 3px rgba(28, 132, 198, 0.1);
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.kpi-card {
    background: white;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.kpi-card.primary::before {
    background: #1c84c6;
}

.kpi-card.success::before {
    background: #1ab394;
}

.kpi-card.warning::before {
    background: #f8ac59;
}

.kpi-card.danger::before {
    background: #ed5565;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.kpi-title {
    color: #718096;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.kpi-card.primary .kpi-icon {
    background: rgba(28, 132, 198, 0.1);
    color: #1c84c6;
}

.kpi-card.success .kpi-icon {
    background: rgba(26, 179, 148, 0.1);
    color: #1ab394;
}

.kpi-card.warning .kpi-icon {
    background: rgba(248, 172, 89, 0.1);
    color: #f8ac59;
}

.kpi-card.danger .kpi-icon {
    background: rgba(237, 85, 101, 0.1);
    color: #ed5565;
}

.kpi-value {
    font-size: 32px;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 5px;
}

.kpi-subtitle {
    color: #a0aec0;
    font-size: 12px;
}

.kpi-variation {
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
    padding: 4px 0;
}

.kpi-variation.variation-up {
    color: #1ab394;
}

.kpi-variation.variation-down {
    color: #ed5565;
}

.kpi-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.kpi-change.positive {
    background: rgba(26, 179, 148, 0.1);
    color: #1ab394;
}

.kpi-change.negative {
    background: rgba(237, 85, 101, 0.1);
    color: #ed5565;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: #1ab394;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
    margin-bottom: 20px;
    width: 100%;
}

    /* MUDANÇA AQUI: De .col-X para .dash-col-X */
    .dashboard-grid .dash-col-4 {
        grid-column: span 4;
    }

    .dashboard-grid .dash-col-6 {
        grid-column: span 6;
    }

    .dashboard-grid .dash-col-8 {
        grid-column: span 8;
    }

    .dashboard-grid .dash-col-12 {
        grid-column: span 12;
    }

/* Atualizar também as Media Queries */
@media (max-width: 1024px) { /* Ajustado para quebrar tablets mais cedo se necessário */
    .dashboard-grid .dash-col-4,
    .dashboard-grid .dash-col-6,
    .dashboard-grid .dash-col-8 {
        grid-column: span 12;
    }
}

/* Gráfico de Barras Alternativo */
.bar-chart {
    margin: 20px 0;
}

.bar-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    position: relative;
}

.bar-label {
    min-width: 140px;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 15px; /* Garante o espaço entre o nome e a barra */
}

.bar-container {
    flex: 1;
    height: 32px;
    background: #f7fafc;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    color: white;
    font-size: 13px;
    font-weight: bold;
    transition: width 0.8s ease;
}

.bar-fill-1 {
    background: #1c84c6;
    width: 95%;
}

.bar-fill-2 {
    background: #1c84c6;
    width: 91%;
}

.bar-fill-3 {
    background: #1c84c6;
    width: 83%;
}

.bar-fill-4 {
    background: #f8ac59;
    width: 75%;
}

.bar-fill-5 {
    background: #f8ac59;
    width: 71%;
}

.bar-fill-6 {
    background: #f8ac59;
    width: 65%;
}

/* Posições 7-9: Vermelho (Regular) */
.bar-fill-7 {
    background: #ed5565;
}

.bar-fill-8 {
    background: #ed5565;
}

.bar-fill-9 {
    background: #ed5565;
}

/* Posições 10-12: Vermelho escuro (Abaixo) */
.bar-fill-10 {
    background: #c0392b;
}

.bar-fill-11 {
    background: #c0392b;
}

.bar-fill-12 {
    background: #c0392b;
}

/* Posições 13-15: Cinza escuro (Crítico) */
.bar-fill-13 {
    background: #636e72;
}

.bar-fill-14 {
    background: #636e72;
}

.bar-fill-15 {
    background: #636e72;
}

.tech-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #1c84c6;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 11px;
}

.ranking-table {
    width: 100%;
    margin-top: 20px;
}

.ranking-table thead {
    background: #f7fafc;
}

.ranking-table th {
    padding: 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ranking-table td {
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    font-size: 13px;
    color: #4a5568;
}

.ranking-table tr:hover {
    background: #f7fafc;
    transition: background 0.2s ease;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: rgba(26, 179, 148, 0.1);
    color: #1ab394;
}

.badge-warning {
    background: rgba(248, 172, 89, 0.1);
    color: #f8ac59;
}

.badge-danger {
    background: rgba(237, 85, 101, 0.1);
    color: #ed5565;
}

.chart-container {
    position: relative;
    height: 500px;
    margin-top: 20px;
}

.chart-container-large {
    position: relative;
    height: 550px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .dashboard-grid .col-4,
    .dashboard-grid .col-6,
    .dashboard-grid .col-8,
    .dashboard-grid .col-12 {
        grid-column: span 12 !important;
    }

    .bar-label {
        min-width: 120px;
    }
}

@media (max-width: 640px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .header-controls {
        flex-direction: column;
    }

    .filter-control select,
    .filter-control input {
        width: 100%;
    }

    .bar-label {
        min-width: 100px;
        font-size: 12px;
    }

    .tech-avatar {
        width: 25px;
        height: 25px;
        font-size: 10px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Estilos para Distribuição por Equipamento */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 20px;
}

.stat-card {
    text-align: center;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
    transition: background 0.3s ease;
}

.stat-card:hover {
    background: #edf2f7;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #2d3748;
}

.stat-label {
    font-size: 11px;
    color: #718096;
    text-transform: uppercase;
    margin-top: 5px;
}

/* Estilos para Página de Configurações */
.config-card {
    background: white;
    border-radius: 4px;
    padding: 25px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}

.info-icon {
    cursor: help;
    opacity: 0.5;
    font-size: 14px;
    margin-left: 8px;
    transition: opacity 0.2s ease;
}

.info-icon:hover {
    opacity: 1;
}

.card-description {
    color: #718096;
    font-size: 14px;
    line-height: 1.6;
    margin-top: 10px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 3px solid #1c84c6;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.config-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-label {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.label-icon.excelente {
    background: rgba(26, 179, 148, 0.1);
    color: #1ab394;
}

.label-icon.bom {
    background: rgba(28, 132, 198, 0.1);
    color: #1c84c6;
}

.label-icon.regular {
    background: rgba(248, 172, 89, 0.1);
    color: #f8ac59;
}

.input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-input {
    flex: 1;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    background: white;
    color: #2d3748;
    font-weight: 600;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.config-input:hover {
    border-color: #1c84c6;
}

.config-input:focus {
    outline: none;
    border-color: #1a7bb9;
    box-shadow: 0 0 0 3px rgba(28, 132, 198, 0.1);
}

.input-unit {
    font-size: 13px;
    color: #718096;
    white-space: nowrap;
}

.input-hint {
    font-size: 12px;
    color: #a0aec0;
    font-style: italic;
}

.config-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    margin-bottom: 40px;
    padding-top: 20px;
    border-top: 1px solid #e0e6ed;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: #1c84c6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #1a7bb9;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover:not(:disabled) {
    background: #cbd5e0;
}

.message {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-success {
    background: rgba(26, 179, 148, 0.1);
    color: #1ab394;
    border-left: 4px solid #1ab394;
}

.message-error {
    background: rgba(237, 85, 101, 0.1);
    color: #ed5565;
    border-left: 4px solid #ed5565;
}

@media (max-width: 768px) {
    .config-grid {
        grid-template-columns: 1fr;
    }

    .config-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

.dash-card {
    background: white;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
}

.dash-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0; /* Essa é a linha de separação */
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ========================================
   Corporativos com Dados - Info Box
   ======================================== */

.corporativos-info {
    background: linear-gradient(135deg, #f8fafc 0%, #edf2f7 100%);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.corporativos-contador {
    color: #4a5568;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.corporativos-icon {
    font-size: 18px;
}

.corporativos-contador strong {
    color: #667eea;
    font-weight: 700;
}

.corporativos-lista {
    margin-top: 12px;
}

.corporativos-lista summary {
    cursor: pointer;
    color: #667eea;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 0;
    user-select: none;
    transition: color 0.2s ease;
}

.corporativos-lista summary:hover {
    color: #5a67d8;
}

.corporativos-lista summary::marker {
    color: #667eea;
}

.corporativos-lista ul {
    margin-top: 12px;
    padding: 0;
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
}

.corporativos-lista li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    font-size: 13px;
    border: 1px solid #e2e8f0;
}

.corporativos-lista .corp-nome {
    color: #2d3748;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 12px;
}

.corporativos-lista .corp-inspecoes {
    color: #718096;
    font-size: 12px;
    white-space: nowrap;
    background: #edf2f7;
    padding: 2px 8px;
    border-radius: 4px;
}

/* =====================================================
   MODAL DE TÉCNICOS
   ===================================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 450px;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.2s ease-out;
    overflow: hidden;
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.modal-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-body {
    padding: 20px 24px;
    max-height: 60vh;
    overflow-y: auto;
}

.tecnicos-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tecnicos-list li {
    padding: 12px 16px;
    border-bottom: 1px solid #edf2f7;
    color: #2d3748;
    font-size: 14px;
    transition: background 0.15s;
}

.tecnicos-list li:last-child {
    border-bottom: none;
}

.tecnicos-list li:hover {
    background: #f7fafc;
}

/* Modal subtitle */
.modal-subtitle {
    padding: 0 20px 15px;
    color: #718096;
    font-size: 14px;
    border-bottom: 1px solid #e2e8f0;
}

/* Técnico ativo/inativo no modal */
.tecnicos-list li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tecnico-icon {
    width: 20px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
}

.tecnico-ativo .tecnico-icon {
    color: #48bb78;
}

.tecnico-ativo .tecnico-nome {
    color: #2d3748;
    font-weight: 500;
}

.tecnico-inativo .tecnico-icon {
    color: #cbd5e0;
}

.tecnico-inativo .tecnico-nome {
    color: #a0aec0;
}

/* KPI Card clicável */
.kpi-card.clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
