/* JSRS Metrics Dashboard - Enhanced Styles */

.jsrs-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.jsrs-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e5e5e5;
}

.jsrs-dash-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    color: #1e293b;
}

.jsrs-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.jsrs-filters label {
    font-weight: 500;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.jsrs-filters input[type="month"] {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
}

.jsrs-filters .button {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.jsrs-filters .button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

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

.jsrs-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.jsrs-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.jsrs-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.jsrs-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.jsrs-card-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jsrs-card-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}

/* Coverage Section */
.jsrs-coverage-section {
    margin: 30px 0;
    padding: 24px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.jsrs-coverage-section h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
    color: #1e293b;
}

.jsrs-coverage-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.jsrs-coverage-cards .jsrs-card {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* Chart Controls */
.jsrs-chart-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.jsrs-chart-controls label {
    font-weight: 500;
    color: #475569;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jsrs-chart-controls select {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    min-width: 150px;
}

.jsrs-ds-toggles {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.jsrs-ds-toggles label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
    color: #64748b;
}

.jsrs-ds-toggles input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Chart Wrapper */
.jsrs-chart-wrap {
    background: white;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.jsrs-chart-wrap h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
}

.jsrs-chart-wrap canvas {
    max-height: 400px;
}

/* Breakdowns Section */
.jsrs-breakdowns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.jsrs-breakdown {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.jsrs-breakdown h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

/* Tables */
.jsrs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.jsrs-table thead {
    background: #f1f5f9;
}

.jsrs-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
}

.jsrs-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #334155;
}

.jsrs-table tbody tr:hover {
    background: #f8fafc;
}

.jsrs-table tfoot {
    background: #f1f5f9;
    font-weight: 600;
}

.jsrs-table tfoot th,
.jsrs-table tfoot td {
    padding: 12px;
    border-top: 2px solid #cbd5e1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .jsrs-dash-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .jsrs-filters {
        flex-direction: column;
        width: 100%;
    }
    
    .jsrs-filters input[type="month"],
    .jsrs-filters .button {
        width: 100%;
    }
    
    .jsrs-cards {
        grid-template-columns: 1fr;
    }
    
    .jsrs-chart-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .jsrs-chart-controls select {
        width: 100%;
    }
    
    .jsrs-breakdowns {
        grid-template-columns: 1fr;
    }
}

/* Loading State */
.jsrs-loading {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.jsrs-loading::after {
    content: "Loading...";
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* User Dashboard Specific */
.jsrs-user .jsrs-cards {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.jsrs-user-entries td {
    font-size: 13px;
}