/* CSRD Dashboard Styles */

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

/* Header */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-header h2 {
    margin: 0;
    color: #2d3748;
    font-size: 28px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-header .subtitle {
    color: #718096;
    font-size: 14px;
    margin-top: 5px;
}

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-icon.blue { background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%); }
.stat-icon.yellow { background: linear-gradient(135deg, #ecc94b 0%, #d69e2e 100%); }
.stat-icon.green { background: linear-gradient(135deg, #48bb78 0%, #38a169 100%); }
.stat-icon.purple { background: linear-gradient(135deg, #9f7aea 0%, #805ad5 100%); }

.stat-content h3 {
    margin: 0;
    font-size: 32px;
    color: #2d3748;
    font-weight: 700;
}

.stat-content p {
    margin: 5px 0 0 0;
    color: #718096;
    font-size: 14px;
}

/* Filters */
.filters-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

.filter-group select {
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-group select:hover {
    border-color: #cbd5e0;
}

.filter-group select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Reports List */
.reports-list {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.loading-state, .empty-state {
    padding: 60px 20px;
    text-align: center;
    color: #718096;
}

.loading-state i {
    font-size: 32px;
    margin-bottom: 10px;
    color: #4299e1;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.empty-state i {
    font-size: 64px;
    color: #cbd5e0;
}

.empty-state h3 {
    margin: 0;
    color: #2d3748;
}

.empty-state p {
    margin: 0;
    color: #718096;
}

/* Reports Table */
.reports-table {
    overflow-x: auto;
}

.reports-table table {
    width: 100%;
    border-collapse: collapse;
}

.reports-table thead {
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
}

.reports-table th {
    padding: 15px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reports-table td {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    color: #2d3748;
}

.reports-table tbody tr:hover {
    background: #f7fafc;
}

.reports-table code {
    background: #edf2f7;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: #2d3748;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.status-grey {
    background: #edf2f7;
    color: #4a5568;
}

.status-badge.status-yellow {
    background: #fefcbf;
    color: #b7791f;
}

.status-badge.status-blue {
    background: #bee3f8;
    color: #2c5282;
}

.status-badge.status-green {
    background: #c6f6d5;
    color: #22543d;
}

/* Progress Bar */
.progress-bar {
    position: relative;
    width: 120px;
    height: 24px;
    background: #edf2f7;
    border-radius: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.progress-fill.progress-poor { background: #fc8181; }
.progress-fill.progress-fair { background: #f6ad55; }
.progress-fill.progress-good { background: #68d391; }
.progress-fill.progress-excellent { background: #48bb78; }

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 600;
    color: #2d3748;
}

/* Action Buttons */
.btn-icon {
    background: none;
    border: none;
    color: #4a5568;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
}

.btn-icon:hover {
    background: #edf2f7;
    color: #2d3748;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content.modal-large {
    max-width: 900px;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 20px;
}

.btn-close {
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    font-size: 18px;
    transition: background 0.2s, color 0.2s;
}

.btn-close:hover {
    background: #edf2f7;
    color: #2d3748;
}

.modal-body {
    padding: 20px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #3182ce 0%, #2c5282 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: #edf2f7;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

/* Report Details */
.report-details {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.detail-section h4 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.detail-item label {
    font-size: 12px;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    font-size: 14px;
    color: #2d3748;
    font-weight: 500;
}

/* Emissions Chart */
.emissions-chart {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.emission-item {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #e2e8f0;
}

.emission-item.total {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
}

.emission-item label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    color: #718096;
}

.emission-item.total label {
    color: white;
    font-weight: 600;
}

.emission-value {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
}

.emission-item.total .emission-value {
    color: white;
}

.detail-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .stats-cards {
        grid-template-columns: 1fr;
    }

    .filters-section {
        flex-direction: column;
    }

    .filter-group {
        min-width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .reports-table {
        font-size: 12px;
    }

    .reports-table th,
    .reports-table td {
        padding: 10px;
    }

    .modal-content {
        max-width: 100%;
        margin: 10px;
    }
}
