* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Export Section */
.export-section {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 20px;
}

.export-btn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.export-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.export-btn:active {
    transform: translateY(0);
}

/* Header Cards */
.header-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: linear-gradient(135deg, #1E90FF, #4169E1);
    color: white;
    padding: 25px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
}

.card-icon {
    font-size: 28px;
    margin-right: 20px;
}

.card-content h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.card-value {
    font-size: 28px;
    font-weight: bold;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.chart-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    height: 500px;
    overflow: hidden;
}

.chart-container:first-child {
    grid-column: 1 / -1;
    height: 450px;
}

/* Gráfico de evolução diária ocupa toda a largura */
.chart-evolucao {
    grid-column: 1 / -1;
    height: 600px; /* Altura maior para acomodar mais linhas */
}

.chart-container canvas {
    max-height: 250px !important;
}

/* Canvas maior para o gráfico de evolução */
.chart-evolucao canvas {
    max-height: 350px !important;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.chart-header h3 {
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.date-filter {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.date-filter input,
.user-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.user-select {
    min-width: 150px;
    background-color: white;
}

.filter-btn {
    background: #333;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.filter-btn:hover {
    background: #555;
}

/* Legendas customizadas */
.legend-container {
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid #eee;
    padding-top: 10px;
}

.custom-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 4px;
    max-height: 180px;
    overflow-y: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 8px;
    padding: 3px 5px;
    border-radius: 3px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background-color: #fafafa;
    margin-bottom: 2px;
}

.legend-item:hover {
    background-color: #e8f4fd;
    border-color: #1E90FF;
}

.legend-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.1);
}

.legend-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    font-weight: 500;
    color: #333;
}

/* Estado desabilitado */
.legend-item.disabled {
    opacity: 0.5;
    background-color: #f5f5f5;
}

.legend-item.disabled .legend-text {
    text-decoration: line-through;
    color: #999;
}

.legend-item.disabled .legend-color {
    opacity: 0.5;
    filter: grayscale(50%);
}

/* Scrollbar customizada para as legendas */
.legend-container::-webkit-scrollbar,
.custom-legend::-webkit-scrollbar {
    width: 6px;
}

.legend-container::-webkit-scrollbar-track,
.custom-legend::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.legend-container::-webkit-scrollbar-thumb,
.custom-legend::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.legend-container::-webkit-scrollbar-thumb:hover,
.custom-legend::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Table */
.table-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.table-header h3 {
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    background: #f5f5f5;
    padding: 12px 8px;
    text-align: left;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
}

td {
    padding: 12px 8px;
    border-bottom: 1px solid #eee;
}

tr:hover {
    background: #f9f9f9;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 5px;
}

.status-online {
    background: #4CAF50;
}

.status-offline {
    background: #f44336;
}

.stars {
    color: #ffc107;
}

/* Responsive Design */
@media (max-width: 768px) {
    .export-section {
        justify-content: center;
        flex-wrap: wrap;
    }

    .header-cards {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .charts-section {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 450px;
    }

    .chart-container:first-child {
        height: 400px;
    }

    .chart-container canvas {
        max-height: 200px !important;
    }

    .legend-container {
        max-height: 180px;
    }

    .custom-legend {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .legend-item {
        font-size: 7px;
        padding: 2px 4px;
    }

    .legend-text {
        max-width: 100px;
    }

    .chart-header,
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .date-filter {
        width: 100%;
        justify-content: flex-start;
    }

    .card {
        padding: 20px;
    }

    .card-content h3 {
        font-size: 14px;
    }

    .card-value {
        font-size: 24px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px 4px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }

    .export-section {
        margin-bottom: 15px;
    }

    .export-btn {
        padding: 8px 16px;
        font-size: 12px;
    }

    .header-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .chart-container {
        height: 400px;
        padding: 15px;
    }

    .chart-container:first-child {
        height: 350px;
    }

    .chart-container canvas {
        max-height: 150px !important;
    }

    .legend-container {
        max-height: 150px;
    }

    .custom-legend {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    }

    .legend-item {
        font-size: 6px;
        padding: 1px 3px;
    }

    .legend-text {
        max-width: 80px;
    }

    .legend-color {
        width: 6px;
        height: 6px;
        margin-right: 3px;
    }

    .date-filter {
        flex-direction: column;
        align-items: stretch;
    }

    .date-filter input,
    .filter-btn,
    .user-select {
        width: 100%;
        margin-bottom: 5px;
    }

    .card {
        padding: 15px;
    }

    .card-icon {
        font-size: 24px;
        margin-right: 15px;
    }

    .card-content h3 {
        font-size: 12px;
    }

    .card-value {
        font-size: 20px;
    }
}

