/* Admin Dashboard - Layout & Cards */

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

.summary-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.summary-card h3 {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.summary-card .value {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin: 10px 0;
}

.summary-card .subtext {
    color: #999;
    font-size: 13px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background-color: #ffffff;
    color: #333333;
    padding: 20px;
    transition: width 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    flex-shrink: 0;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    border-right: 1px solid #e0e0e0;
}

.sidebar h3 {
    font-size: 18px;
    font-weight: 600;
    color: #28537b;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #28537b;
}

.sidebar-section {
    margin-bottom: 4px;
}

.sidebar-heading {
    font-size: 16px;
    font-weight: 600;
    color: #28537b;
    margin: 20px 0 12px 0;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    margin-bottom: 5px;
    font-size: 14px;
    background-color: transparent;
}

.radio-label:hover {
    background-color: rgba(40, 83, 123, 0.08);
}

.radio-label input[type="radio"] {
    margin: 0 10px 0 0;
    cursor: pointer;
    accent-color: #28537b;
}

.radio-label span {
    color: #333333;
    font-size: 14px;
}

.radio-label input[type="radio"]:checked + span {
    color: #28537b;
    font-weight: 600;
}

.sidebar-button {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    color: #333333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.sidebar-button:hover {
    background-color: #e9ecef;
    border-color: #28537b;
    color: #28537b;
}

/* Panel Management */
.admin-panel { 
    display: none; 
}

.admin-panel.active { 
    display: block; 
}

/* Score Badges */
.score-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
}

.score-excellent {
    background: #d4edda;
    color: #155724;
}

.score-good {
    background: #d1ecf1;
    color: #0c5460;
}

.score-average {
    background: #fff3cd;
    color: #856404;
}

.score-needs-improvement {
    background: #f8d7da;
    color: #721c24;
}

/* Role Badges */
.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-admin {
    background: #007bff;
    color: white;
}

.role-faculty {
    background: #6c757d;
    color: white;
}

.role-student {
    background: #28a745;
    color: white;
}

/* Action Buttons */
.action-button {
    background: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}

.action-button:hover {
    background: #0056b3;
}

.no-data {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* Analytics panel (Cross-Instance Analytics) */
.analytics-mgmt-header {
    margin-bottom: 24px;
}

.analytics-mgmt-header h1 {
    margin: 0 0 4px 0;
    color: #333;
    font-size: 28px;
}

.analytics-mgmt-header .subtitle {
    color: #666;
    font-size: 15px;
    margin: 0;
}

.analytics-section-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #dee2e6;
}

.analytics-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.analytics-tab {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.analytics-tab:hover {
    background: #e9ecef;
    border-color: #28537b;
    color: #28537b;
}

.analytics-tab.active {
    background: #fff;
    border-color: #ddd;
    color: #28537b;
    font-weight: 600;
}

.analytics-subtitle {
    margin: 24px 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.analytics-subtitle:first-of-type {
    margin-top: 0;
}

.analytics-overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.analytics-metric-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.analytics-metric-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.analytics-metric-label {
    font-size: 13px;
    color: #666;
}

.analytics-instance-table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
}

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

.analytics-instance-table th,
.analytics-instance-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.analytics-instance-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.analytics-instance-table tbody tr:last-child td {
    border-bottom: none;
}

.analytics-download-btn {
    padding: 10px 20px;
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.analytics-download-btn:hover {
    background: #e9ecef;
    border-color: #28537b;
    color: #28537b;
}

.analytics-placeholder {
    color: #666;
    margin: 0;
}

/* Performance Comparison tab */
.perf-compare-instance-wrap {
    margin-bottom: 20px;
}

.perf-compare-instance-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.perf-compare-instance-select {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
}

.perf-compare-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.perf-compare-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: #28537b;
    color: #fff;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.perf-compare-chip-remove {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 0 0 4px;
    opacity: 0.9;
}

.perf-compare-chip-remove:hover {
    opacity: 1;
}

.perf-compare-instance-dropdown {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    color: #333;
    background: #fff;
    min-width: 120px;
}

.perf-compare-chart-title,
.perf-compare-stats-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 24px 0 12px 0;
}

.perf-compare-chart-wrap {
    margin-bottom: 24px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fafafa;
    padding: 16px;
}

.perf-compare-chart {
    min-height: 260px;
}

.perf-chart-axis path,
.perf-chart-axis line {
    stroke: #999;
}

.perf-chart-axis-label {
    fill: #666;
    font-size: 12px;
}

.perf-compare-tables {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.perf-compare-table-block {
    margin-bottom: 0;
}

.perf-compare-table-heading {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.perf-compare-table {
    margin: 0;
}

/* Usage Statistics tab */
.usage-period-wrap {
    margin-bottom: 20px;
}

.usage-period-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.usage-period-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    min-width: 160px;
}

.usage-kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.usage-kpi-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.usage-kpi-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.usage-kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.usage-kpi-change {
    font-size: 13px;
    font-weight: 500;
}

.usage-kpi-change-up {
    color: #28a745;
}

.usage-kpi-change-down {
    color: #dc3545;
}

.usage-chart-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 24px 0 4px 0;
}

.usage-chart-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px 0;
}

.usage-chart-wrap {
    margin-bottom: 28px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fafafa;
    padding: 16px;
}

.usage-daily-chart {
    min-height: 260px;
}

.usage-peak-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
}

.usage-peak-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: start;
}

@media (max-width: 640px) {
    .usage-peak-layout {
        grid-template-columns: 1fr;
    }
}

.usage-peak-table-wrap {
    overflow-x: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
}

.usage-peak-table {
    margin: 0;
}

.usage-summary-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    min-width: 220px;
}

.usage-summary-item {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* Correlation Analysis tab */
.correlation-info-box {
    background: #e7f1fa;
    border: 1px solid #28537b;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

.correlation-instance-selectors {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.correlation-instance-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.correlation-instance-field label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.correlation-instance-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    min-width: 120px;
}

.correlation-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.correlation-metric-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.correlation-metric-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.correlation-metric-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
}

.correlation-plot-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
}

.correlation-chart-wrap {
    margin-bottom: 24px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fafafa;
    padding: 16px;
}

.correlation-scatter-chart {
    min-height: 320px;
}

.correlation-interp-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.correlation-interp-box {
    background: #e7f1fa;
    border: 1px solid #28537b;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
}

.correlation-interp-box p {
    margin: 0;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

/* Feedback Analysis tab */
.feedback-analysis-desc {
    font-size: 14px;
    color: #666;
    margin: 0 0 16px 0;
}

.feedback-instance-wrap {
    margin-bottom: 20px;
}

.feedback-instance-wrap label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.feedback-instance-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    min-width: 160px;
}

.feedback-kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.feedback-kpi-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.feedback-kpi-value {
    font-size: 26px;
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
}

.feedback-kpi-label {
    font-size: 13px;
    color: #666;
}

.feedback-kpi-meta {
    font-size: 12px;
    color: #28a745;
    margin-top: 4px;
}

.feedback-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 24px 0 4px 0;
}

.feedback-section-subtitle {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px 0;
}

.feedback-chart-wrap {
    margin-bottom: 24px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fafafa;
    padding: 16px;
}

.feedback-trends-chart,
.feedback-instance-chart {
    min-height: 260px;
}

.feedback-distribution-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.feedback-dist-card {
    border-radius: 8px;
    padding: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.feedback-dist-green {
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.feedback-dist-orange {
    background: #fff3e0;
    border: 1px solid #ffe0b2;
}

.feedback-dist-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.feedback-dist-avg {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.feedback-dist-bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.feedback-dist-bar-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.feedback-dist-rating {
    width: 14px;
    color: #666;
}

.feedback-dist-bar-wrap {
    flex: 1;
    height: 14px;
    background: rgba(0,0,0,0.08);
    border-radius: 4px;
    overflow: hidden;
}

.feedback-dist-bar {
    height: 100%;
    min-width: 2px;
    border-radius: 4px;
    transition: width 0.2s;
}

.feedback-dist-green .feedback-dist-bar {
    background: #28a745;
}

.feedback-dist-orange .feedback-dist-bar {
    background: #fd7e14;
}

.feedback-dist-count {
    width: 24px;
    text-align: right;
    font-size: 12px;
    color: #666;
}

.feedback-table-wrap {
    overflow-x: auto;
    margin-bottom: 24px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fff;
}

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

.feedback-breakdown-table th,
.feedback-breakdown-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.feedback-breakdown-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.feedback-heat {
    font-weight: 500;
}

.feedback-heat.heat-5 { background: #1b5e20; color: #fff; }
.feedback-heat.heat-4 { background: #388e3c; color: #fff; }
.feedback-heat.heat-3 { background: #81c784; color: #333; }
.feedback-heat.heat-2 { background: #c8e6c9; color: #333; }
.feedback-heat.heat-1 { background: #e8f5e9; color: #333; }

.feedback-summary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 640px) {
    .feedback-summary-row { grid-template-columns: 1fr; }
}

.feedback-summary-card {
    border-radius: 8px;
    padding: 18px;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
}

.feedback-summary-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.feedback-summary-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.feedback-icon-green {
    background: #28a745;
}

.feedback-icon-red {
    background: #dc3545;
}

.feedback-summary-card ul {
    margin: 0;
    padding-left: 20px;
    color: #333;
    font-size: 14px;
    line-height: 1.6;
}

.feedback-download-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.feedback-download-row .analytics-download-btn {
    margin-right: 0;
}
