/* ============================================================
   style-26-route-schedule.css — Route Schedule Trip Compliance (FEAT-017)
   Prefix: rs-*
   Supports both light and dark themes.
   ============================================================ */

/* ── Page layout ──────────────────────────────────────────── */
.rs-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"] .rs-page {
    background: #f4f6fa;
    color: #1a1d2e;
}

/* ── Header ───────────────────────────────────────────────── */
.rs-header {
    margin-bottom: 20px;
}

.rs-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #e8eaf0;
    margin: 0 0 4px;
}

body[data-theme="light"] .rs-page-title {
    color: #1a1d2e;
}

.rs-page-sub {
    font-size: 0.9rem;
    color: #adb5bd;
    margin: 0;
}

/* ── Filter bar — sticky (FEAT-062) ──────────────────────── */
.rs-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"] .rs-filter-bar {
    background: #fff;
    border-color: #d1d9e8;
}

.rs-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"] .rs-filter-sticky {
    background: #f4f6fa;
    border-bottom-color: #dee2e6;
}

.rs-shortcut-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.rs-sh-btn {
    background: #1e2537;
    border: 1px solid #2a2f45;
    color: #adb5bd;
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.rs-sh-btn:hover {
    background: #2a2f45;
    color: #e8eaf0;
}

.rs-sh-active {
    background: #1e3555;
    border-color: #3a65a0;
    color: #4a9eff;
    font-weight: 600;
}

body[data-theme="light"] .rs-sh-btn {
    background: #f0f2f5;
    border-color: #dee2e6;
    color: #495057;
}

body[data-theme="light"] .rs-sh-active {
    background: #e8f0ff;
    border-color: #4a9eff;
    color: #1a5cc8;
}

.rs-period-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rs-period-label {
    font-size: 0.85rem;
    color: #adb5bd;
    white-space: nowrap;
}

.rs-min-date-note {
    font-size: 0.78rem;
    color: #6c757d;
    font-style: italic;
}

/* ── KPI row ──────────────────────────────────────────────── */
.rs-kpi-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* ── Section titles ───────────────────────────────────────── */
.rs-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e8eaf0;
    margin: 0 0 8px;
}

body[data-theme="light"] .rs-section-title {
    color: #1a1d2e;
}

/* ── Two-up chart row (FEAT-062) ──────────────────────────── */
.rs-charts-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.rs-chart-panel {
    background: #12171f;
    border: 1px solid #2a2f45;
    border-radius: 8px;
    padding: 16px 20px;
    flex: 1;
    min-width: 300px;
    overflow: hidden;
}

body[data-theme="light"] .rs-chart-panel {
    background: #ffffff;
    border-color: #d1d9e8;
}

/* Keep old class for graceful degradation */
.rs-chart-section {
    background: var(--bg-secondary, #161b2e);
    border: 1px solid #2a2f45;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}

body[data-theme="light"] .rs-chart-section {
    background: #ffffff;
    border-color: #dee2e6;
}

/* ── Table section ────────────────────────────────────────── */
.rs-table-section {
    background: var(--bg-secondary, #161b2e);
    border: 1px solid #2a2f45;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    overflow-x: auto;
}

body[data-theme="light"] .rs-table-section {
    background: #ffffff;
    border-color: #dee2e6;
}

/* ── Data honesty note ────────────────────────────────────── */
.rs-data-note {
    font-size: 0.8rem;
    color: #adb5bd;
    background: rgba(74, 158, 255, 0.08);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    line-height: 1.5;
}

.rs-note-icon {
    color: #4a9eff;
    font-style: normal;
    margin-right: 2px;
}

body[data-theme="light"] .rs-data-note {
    background: #e8f0ff;
    border-color: #4a9eff;
    color: #495057;
}

/* ── Data table ───────────────────────────────────────────── */
.rs-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.rs-data-table th {
    text-align: left;
    padding: 8px 10px;
    color: #adb5bd;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid #2a2f45;
    white-space: nowrap;
}

.rs-data-table td {
    padding: 8px 10px;
    color: #e8eaf0;
    border-bottom: 1px solid rgba(42,47,69,0.5);
    white-space: nowrap;
}

.rs-data-table tr:last-child td {
    border-bottom: none;
}

.rs-data-table tr:hover td {
    background: rgba(255,255,255,0.03);
}

.rs-td-route {
    font-weight: 600;
    color: #4a9eff;
}

body[data-theme="light"] .rs-data-table th {
    color: #495057;
    border-bottom-color: #dee2e6;
}

body[data-theme="light"] .rs-data-table td {
    color: #212529;
    border-bottom-color: #f0f2f5;
}

body[data-theme="light"] .rs-data-table tr:hover td {
    background: #f8f9fa;
}

body[data-theme="light"] .rs-td-route {
    color: #1a5cc8;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .rs-shortcut-row { flex-wrap: wrap; }
    .rs-kpi-row      { gap: 8px; }
    .rs-charts-row   { flex-direction: column; }
    .rs-chart-panel  { min-width: 0; }
}

@media (max-width: 390px) {
    .rs-page         { padding: 12px; }
    .rs-kpi-row      { flex-direction: column; }
    .rs-sh-btn       { font-size: 0.76rem; padding: 4px 8px; }
    .rs-chart-panel  { min-width: 0; }
}
