/* ============================================================
   style-23-workshop-performance.css — FEAT-049
   Prefix: wsp-*
   Supports both light and dark themes.
   ============================================================ */

/* ── Page layout ──────────────────────────────────────────── */
.wsp-page {
    padding: 24px;
    min-height: 100vh;
    background: var(--bg-primary, #0e1117);
    color: var(--text-primary, #e8eaf0);
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

body[data-theme="light"] .wsp-page {
    background: #f4f6fa;
    color: #1a1d2e;
}

/* ── Header ───────────────────────────────────────────────── */
.wsp-header {
    margin-bottom: 20px;
}

.wsp-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #e8eaf0;
    margin: 0 0 4px;
}

body[data-theme="light"] .wsp-page-title {
    color: #1a1d2e;
}

.wsp-page-sub {
    font-size: 0.9rem;
    color: #adb5bd;
    margin: 0;
}

/* ── Mode bar ─────────────────────────────────────────────── */
.wsp-mode-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.wsp-mode-btn {
    padding: 7px 18px;
    border: 1px solid #2a2f45;
    border-radius: 6px;
    background: transparent;
    color: #adb5bd;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s;
}

.wsp-mode-btn:hover {
    border-color: #4a90e2;
    color: #e8eaf0;
}

body[data-theme="light"] .wsp-mode-btn {
    border-color: #dee2e6;
    color: #495057;
}

body[data-theme="light"] .wsp-mode-btn:hover {
    border-color: #4a90e2;
    color: #1a1d2e;
}

.wsp-mode-active {
    background: #4a90e2;
    border-color: #4a90e2;
    color: #fff;
    font-weight: 600;
}

.wsp-mode-active:hover {
    background: #357abd;
    border-color: #357abd;
    color: #fff;
}

body[data-theme="light"] .wsp-mode-active {
    background: #4a90e2;
    border-color: #4a90e2;
    color: #fff;
}

/* ── Date range row ───────────────────────────────────────── */
.wsp-daterange-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: var(--bg-secondary, #161b2e);
    border: 1px solid var(--border-color, #2a2f45);
    border-radius: 8px;
}

body[data-theme="light"] .wsp-daterange-row {
    background: #fff;
    border-color: #dee2e6;
}

.wsp-period-icon {
    font-size: 1.1rem;
}

.wsp-export-btn {
    padding: 6px 14px;
    background: #198754;
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.wsp-export-btn:hover {
    background: #146c43;
}

/* ── KPI row ──────────────────────────────────────────────── */
.wsp-kpi-row {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* ── Table section ────────────────────────────────────────── */
.wsp-table-section {
    background: var(--bg-secondary, #161b2e);
    border: 1px solid var(--border-color, #2a2f45);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
}

body[data-theme="light"] .wsp-table-section {
    background: #fff;
    border-color: #dee2e6;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.wsp-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e8eaf0;
    margin: 0 0 4px;
}

body[data-theme="light"] .wsp-section-title {
    color: #1a1d2e;
}

.wsp-section-sub {
    font-size: 0.8rem;
    color: #adb5bd;
    margin: 0 0 14px;
}

/* ── Data table ───────────────────────────────────────────── */
.wsp-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.wsp-data-table th {
    background: #1e2537;
    color: #adb5bd;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    padding: 10px 12px;
    border-bottom: 1px solid #2a2f45;
    text-align: left;
    white-space: nowrap;
}

body[data-theme="light"] .wsp-data-table th {
    background: #f1f3f5;
    color: #6c757d;
    border-bottom-color: #dee2e6;
}

.wsp-data-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #1e2537;
    color: #e8eaf0;
}

body[data-theme="light"] .wsp-data-table td {
    border-bottom-color: #f1f3f5;
    color: #1a1d2e;
}

.wsp-data-table tr:hover td {
    background: rgba(74, 144, 226, 0.06);
}

.wsp-data-table tr:last-child td {
    border-bottom: none;
}

.wsp-col-rank {
    font-weight: 700;
    color: #e8a020;
    width: 60px;
    text-align: center;
}

body[data-theme="light"] .wsp-col-rank {
    color: #d97706;
}

.wsp-col-pct {
    font-weight: 600;
}

/* ── Filter bar — sticky (FEAT-062) ──────────────────────── */
.wsp-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    background: #12171f;
    border: 1px solid #2a2f45;
    border-radius: 8px;
    padding: 14px 16px;
}

body[data-theme="light"] .wsp-filter-bar {
    background: #fff;
    border-color: #d1d9e8;
}

.wsp-filter-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary, #0e1117);
    border-bottom: 1px solid #2a2f45;
    border-radius: 0;
    padding: 12px 16px;
    margin-bottom: 16px;
}

body[data-theme="light"] .wsp-filter-sticky {
    background: #f4f6fa;
    border-bottom-color: #dee2e6;
}

/* ── Two-up chart row (FEAT-062) ──────────────────────────── */
.wsp-charts-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.wsp-chart-panel {
    background: #12171f;
    border: 1px solid #2a2f45;
    border-radius: 8px;
    padding: 16px;
    flex: 1;
    min-width: 280px;
    overflow: hidden;
}

body[data-theme="light"] .wsp-chart-panel {
    background: #ffffff;
    border-color: #d1d9e8;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .wsp-charts-row  { flex-direction: column; }
    .wsp-chart-panel { min-width: 0; }
}

@media (max-width: 390px) {
    .wsp-page {
        padding: 14px;
    }
    .wsp-kpi-row {
        flex-direction: column;
    }
    .wsp-chart-panel { min-width: 0; }
    .wsp-data-table th,
    .wsp-data-table td {
        padding: 7px 8px;
        font-size: 0.8rem;
    }
}
