* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    padding: 15px;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header-content h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.print-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s;
    white-space: nowrap;
}

.print-btn:hover { background-color: #2980b9; }

.filters {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 250px;
}

.filters select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 16px;
    outline: none;
    width: 100%;
}

.filters select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

.kpi-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    text-align: center;
    border-bottom: 4px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card h3 {
    font-size: 13px;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.card .value {
    font-size: 22px;
    font-weight: bold;
    word-break: break-word;
}

.positive { color: #27ae60; }
.card:nth-child(1), .card:nth-child(2) { border-bottom-color: #27ae60; }

.neutral { color: #2980b9; }
.card:nth-child(3) { border-bottom-color: #2980b9; }

.negative { color: #c0392b; }
.card:nth-child(4), .card:nth-child(5) { border-bottom-color: #c0392b; }

.alert { color: #d35400; }
.card:nth-child(6) { border-bottom-color: #d35400; background-color: #fff9f5; }

.card small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 12px;
}

.chart-disclaimer {
    font-size: 11px;
    color: #e67e22;
    margin-top: 15px;
    text-align: justify;
    font-style: italic;
    line-height: 1.4;
    background-color: #fdfbf7;
    padding: 10px;
    border-left: 3px solid #e67e22;
    border-radius: 4px;
}

.details-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    border-top: 4px solid #f39c12;
}

.details-section h2 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.details-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

.details-table th, .details-table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.details-table th { background-color: #f8f9fa; color: #333; }
.details-table tfoot th { background-color: #ecf0f1; font-size: 16px; }
.details-table tbody tr:hover { background-color: #fcfcfc; }

.charts-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.chart-box {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    width: 100%;
}

.canvas-container {
    position: relative;
    width: 100%;
    height: 350px;
}

.full-width { grid-column: 1 / -1; }

.chart-box h2 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 15px;
    text-align: center;
}

@media print {
    body { background-color: white; padding: 0; }
    .print-btn, .filters { display: none; }
    .dashboard-container { max-width: 100%; }
    .chart-box, .details-section { break-inside: avoid; box-shadow: none; border: 1px solid #eee; }
    .kpi-cards { grid-template-columns: repeat(3, 1fr); }
    .canvas-container { height: 250px; }
}

@media (max-width: 900px) {
    .charts-wrapper { grid-template-columns: 1fr; }
    .kpi-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    header { flex-direction: column; text-align: center; }
    .kpi-cards { grid-template-columns: 1fr; }
    .header-content h1 { font-size: 20px; }
    .filter-group { flex-direction: column; align-items: flex-start; }
}