/* ============================================================
   style-21-fuel.css — Fuel Cost Dashboard (FEAT-014)
   Prefix: fuel-*
   Supports both light and dark themes.
   ============================================================ */

/* ── Page layout ──────────────────────────────────────────── */
.fuel-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"] .fuel-page {
    background: #f4f6fa;
    color: #1a1d2e;
}

/* ── Header ───────────────────────────────────────────────── */
.fuel-header {
    margin-bottom: 20px;
}

.fuel-page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #e8eaf0;
    margin: 0 0 4px;
}

body[data-theme="light"] .fuel-page-title {
    color: #1a1d2e;
}

.fuel-page-sub {
    font-size: 0.9rem;
    color: #adb5bd;
    margin: 0;
}

/* ── Filter bar — sticky (FEAT-061) ──────────────────────── */
.fuel-filter-bar {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.fuel-filter-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary, #0e1117);
    border-bottom: 1px solid #2a2f45;
    padding: 12px 0;
    margin-bottom: 16px;
}

body[data-theme="light"] .fuel-filter-sticky {
    background: #f4f6fa;
    border-bottom-color: #dee2e6;
}

.fuel-filter-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fuel-filter-right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 260px;
}

.fuel-filter-label {
    font-size: 0.85rem;
    color: #adb5bd;
    white-space: nowrap;
}

.fuel-shortcut-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.fuel-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;
}

.fuel-sh-btn:hover {
    background: #2a2f45;
    color: #e8eaf0;
}

.fuel-sh-active {
    background: #2a3555;
    border-color: #4a5580;
    color: #e8a020;
    font-weight: 600;
}

body[data-theme="light"] .fuel-sh-btn {
    background: #f0f2f5;
    border-color: #dee2e6;
    color: #495057;
}

body[data-theme="light"] .fuel-sh-active {
    background: #fff3cd;
    border-color: #e8a020;
    color: #b07000;
}

.fuel-period-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fuel-period-label {
    font-size: 0.85rem;
    color: #adb5bd;
    white-space: nowrap;
}

.fuel-pnl-dropdown {
    min-width: 220px;
}

/* ── KPI row ──────────────────────────────────────────────── */
.fuel-kpi-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

/* ── Section titles ───────────────────────────────────────── */
.fuel-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e8eaf0;
    margin: 0 0 8px;
}

body[data-theme="light"] .fuel-section-title {
    color: #1a1d2e;
}

.fuel-section-sub {
    font-size: 0.8rem;
    color: #adb5bd;
    margin: 0 0 10px;
}

/* ── Two-up chart row (FEAT-061) ──────────────────────────── */
.fuel-charts-row {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.fuel-chart-panel {
    background: var(--bg-secondary, #161b2e);
    border: 1px solid #2a2f45;
    border-radius: 10px;
    padding: 16px 20px;
    flex: 1;
    min-width: 300px;
    overflow: hidden;
}

body[data-theme="light"] .fuel-chart-panel {
    background: #ffffff;
    border-color: #dee2e6;
}

.fuel-trend-chart,
.fuel-owner-bar-chart {
    margin-top: 4px;
}

/* ── Tabbed tables (FEAT-061) — SR-17 analytics-tab styles ── */
.analytics-tabs-wrapper {
    background: var(--bg-secondary, #161b2e);
    border: 1px solid #2a2f45;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

body[data-theme="light"] .analytics-tabs-wrapper {
    background: #ffffff;
    border-color: #dee2e6;
}

/* dcc.Tabs strip */
.analytics-tabs .tab-content {
    background: transparent !important;
}

.analytics-tabs > .tab-bar {
    border-bottom: 1px solid #2a2f45 !important;
    background: var(--bg-secondary, #161b2e) !important;
    padding: 0 12px;
}

body[data-theme="light"] .analytics-tabs > .tab-bar {
    background: #ffffff !important;
    border-bottom-color: #dee2e6 !important;
}

/* Individual tab button */
.analytics-tab {
    background: transparent !important;
    border: none !important;
    border-bottom: 3px solid transparent !important;
    color: #adb5bd !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    padding: 10px 18px !important;
    margin-right: 4px !important;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s !important;
}

.analytics-tab:hover {
    color: #e8eaf0 !important;
    background: rgba(255,255,255,0.04) !important;
}

body[data-theme="light"] .analytics-tab {
    color: #6c757d !important;
}

body[data-theme="light"] .analytics-tab:hover {
    color: #212529 !important;
    background: rgba(0,0,0,0.03) !important;
}

/* Active tab */
.analytics-tab--selected {
    background: transparent !important;
    border: none !important;
    border-bottom: 3px solid #e8a020 !important;
    color: #e8a020 !important;
    font-weight: 600 !important;
    padding: 10px 18px !important;
}

body[data-theme="light"] .analytics-tab--selected {
    border-bottom-color: #e8a020 !important;
    color: #b07000 !important;
}

/* Tab content area */
.analytics-tab-content {
    padding: 16px 20px;
}

.fuel-tab-body {
    /* inner wrapper inside each tab */
}

/* ── Show-all toggle button (SR-17) ───────────────────────── */
.analytics-topn-toggle {
    margin-top: 12px;
    background: transparent;
    border: 1px solid #2a2f45;
    color: #adb5bd;
    border-radius: 6px;
    padding: 5px 14px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.analytics-topn-toggle:hover {
    background: #2a2f45;
    color: #e8eaf0;
    border-color: #4a5580;
}

body[data-theme="light"] .analytics-topn-toggle {
    border-color: #dee2e6;
    color: #6c757d;
}

body[data-theme="light"] .analytics-topn-toggle:hover {
    background: #f0f2f5;
    color: #212529;
}

.fuel-bug118-notice {
    font-size: 0.82rem;
    color: #e8a020;
    background: rgba(232,160,32,0.08);
    border: 1px solid rgba(232,160,32,0.25);
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    line-height: 1.4;
}

body[data-theme="light"] .fuel-bug118-notice {
    background: #fff8e6;
    border-color: #e8a020;
    color: #b07000;
}

/* ── Data table ───────────────────────────────────────────── */
.fuel-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.fuel-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;
}

.fuel-data-table td {
    padding: 8px 10px;
    color: #e8eaf0;
    border-bottom: 1px solid rgba(42,47,69,0.5);
    white-space: nowrap;
}

.fuel-data-table tr:last-child td {
    border-bottom: none;
}

.fuel-data-table tr:hover td {
    background: rgba(255,255,255,0.03);
}

body[data-theme="light"] .fuel-data-table th {
    color: #495057;
    border-bottom-color: #dee2e6;
}

body[data-theme="light"] .fuel-data-table td {
    color: #212529;
    border-bottom-color: #f0f2f5;
}

body[data-theme="light"] .fuel-data-table tr:hover td {
    background: #f8f9fa;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
    .fuel-filter-bar   { flex-direction: column; }
    .fuel-filter-right { min-width: 100%; }
    .fuel-charts-row   { flex-direction: column; }
    .fuel-kpi-row      { gap: 8px; }
    .fuel-chart-panel  { min-width: 0; }
}

@media (max-width: 390px) {
    .fuel-page         { padding: 12px; }
    .fuel-kpi-row      { flex-direction: column; }
    .fuel-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; }
}
