/* ============================================================
   style-28-tyre-cost.css — Tyre Cost Analytics (FEAT-018)
   Prefix: tyre-*
   Supports both light and dark themes.
   ============================================================ */

/* ── Page layout ──────────────────────────────────────────── */
.tyre-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"] .tyre-page {
    background: #f4f6fa;
    color: #1a1d2e;
}

/* ── Header ───────────────────────────────────────────────── */
.tyre-header {
    margin-bottom: 20px;
}

.tyre-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #e8eaf0;
    margin: 0 0 4px;
}

body[data-theme="light"] .tyre-page-title {
    color: #1a1d2e;
}

.tyre-page-sub {
    font-size: 0.9rem;
    color: #adb5bd;
    margin: 0;
}

/* ── Filter bar — sticky (FEAT-062) ──────────────────────── */
.tyre-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 20px;
    background: #12171f;
    border: 1px solid #2a2f45;
    border-radius: 8px;
    padding: 14px 16px;
}

body[data-theme="light"] .tyre-filter-bar {
    background: #fff;
    border-color: #d1d9e8;
}

.tyre-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"] .tyre-filter-sticky {
    background: #f4f6fa;
    border-bottom-color: #dee2e6;
}

.tyre-filter-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 260px;
}

.tyre-filter-right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 220px;
}

.tyre-shortcut-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tyre-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;
}

.tyre-sh-btn:hover {
    background: #2a2f45;
    color: #e8eaf0;
}

.tyre-sh-active {
    background: #1e3a2f;
    border-color: #2a9d8f;
    color: #2a9d8f;
    font-weight: 600;
}

body[data-theme="light"] .tyre-sh-btn {
    background: #f0f2f8;
    border-color: #c8d0e0;
    color: #555d75;
}

body[data-theme="light"] .tyre-sh-btn:hover {
    background: #e0e4f0;
    color: #1a1d2e;
}

body[data-theme="light"] .tyre-sh-active {
    background: #d4f0ec;
    border-color: #2a9d8f;
    color: #1e6e66;
}

.tyre-period-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tyre-period-label {
    font-size: 0.85rem;
    color: #adb5bd;
    white-space: nowrap;
}

body[data-theme="light"] .tyre-period-label {
    color: #555d75;
}

.tyre-filter-label {
    font-size: 0.85rem;
    color: #adb5bd;
    white-space: nowrap;
}

body[data-theme="light"] .tyre-filter-label {
    color: #555d75;
}

/* ── KPI row ──────────────────────────────────────────────── */
.tyre-kpi-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

/* ── Two-up chart row (FEAT-062) ──────────────────────────── */
.tyre-charts-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tyre-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"] .tyre-chart-panel {
    background: #fff;
    border-color: #d1d9e8;
}

/* Keep old class for graceful degradation */
.tyre-chart-section {
    background: #12171f;
    border: 1px solid #2a2f45;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 22px;
}

body[data-theme="light"] .tyre-chart-section {
    background: #fff;
    border-color: #d1d9e8;
}

.tyre-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e8eaf0;
    margin: 0 0 12px;
}

body[data-theme="light"] .tyre-section-title {
    color: #1a1d2e;
}

.tyre-section-sub {
    font-size: 0.82rem;
    color: #adb5bd;
    margin: -8px 0 10px;
}

body[data-theme="light"] .tyre-section-sub {
    color: #6b7280;
}

/* ── Table section ────────────────────────────────────────── */
.tyre-table-section {
    background: #12171f;
    border: 1px solid #2a2f45;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 22px;
}

body[data-theme="light"] .tyre-table-section {
    background: #fff;
    border-color: #d1d9e8;
}

/* ── Tab body ─────────────────────────────────────────────── */
.tyre-tab-body {
    /* inner wrapper inside each tab */
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .tyre-filter-bar    { flex-direction: column; }
    .tyre-filter-right  { min-width: 100%; }
    .tyre-charts-row    { flex-direction: column; }
    .tyre-chart-panel   { min-width: 0; }
}

@media (max-width: 390px) {
    .tyre-page {
        padding: 12px;
    }

    .tyre-page-title {
        font-size: 1.2rem;
    }

    .tyre-filter-right {
        min-width: 100%;
    }

    .tyre-sh-btn {
        font-size: 0.76rem;
        padding: 4px 8px;
    }

    .analytics-tab {
        padding: 8px 10px !important;
        font-size: 0.82rem !important;
    }

    .analytics-tab--selected {
        padding: 8px 10px !important;
    }
}
