/* WattBites IMRP Reporter — imrp-dashboard.css */

#wbimrp-portal {
    font-family: 'Source Serif 4', Georgia, serif;
    color: #2a2a2a;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 0 2rem;
}
.wbimrp-header { margin-bottom: 1.25rem; }
.wbimrp-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.01em;
    margin-bottom: 3px;
}
.wbimrp-subtitle { font-size: 0.85rem; color: #666; margin-bottom: 8px; }
.wbimrp-meta-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wbimrp-badge {
    font-size: 0.72rem; padding: 3px 9px; border-radius: 20px;
    background: #f0ece4; color: #666; border: 1px solid #ddd;
}
.wbimrp-badge-live  { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.wbimrp-badge-building { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.wbimrp-badge-error { background: #fff3e0; color: #bf360c; border-color: #ffcc80; }
.wbimrp-meta { font-size: 0.75rem; color: #aaa; }

/* Period nav */
.wbimrp-period-nav { display: flex; align-items: center; gap: 6px; margin-bottom: 1.25rem; flex-wrap: wrap; }
.wbimrp-period-label { font-size: 0.8rem; color: #888; margin-right: 4px; }
.wbimrp-period-btn {
    font-family: inherit; font-size: 0.78rem; padding: 4px 12px;
    border: 1px solid #ccc; background: #fff; color: #555; border-radius: 4px; cursor: pointer;
    transition: all 0.15s;
}
.wbimrp-period-btn:hover { background: #f5f0e8; border-color: #aaa; }
.wbimrp-period-btn.active { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }

/* Methodology note */
.wbimrp-method-note {
    font-size: 0.78rem; color: #888; background: #f9f6f0;
    border-left: 3px solid #c8a84b; padding: 8px 12px;
    border-radius: 0 4px 4px 0; margin-bottom: 1.25rem; line-height: 1.6;
}

/* Metrics */
.wbimrp-metrics {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px; margin-bottom: 1.25rem;
}
.wbimrp-metric {
    background: #f9f6f0; border: 1px solid #e8e2d9; border-radius: 6px; padding: 12px 14px;
}
.wbimrp-metric-label {
    font-size: 0.7rem; color: #888; text-transform: uppercase;
    letter-spacing: 0.04em; margin-bottom: 4px;
}
.wbimrp-metric-value { font-size: 1.4rem; font-weight: 700; color: #1a1a2e; line-height: 1.1; }
.wbimrp-metric-sub { font-size: 0.7rem; color: #aaa; margin-top: 3px; }
.wbimrp-metric-value.neg-imrp { color: #c0392b; }
.wbimrp-metric-value.zero-floor { color: #e67e22; }

/* Chart cards */
.wbimrp-chart-card {
    background: #fff; border: 1px solid #e8e2d9; border-radius: 8px;
    padding: 16px; margin-bottom: 1.25rem;
}
.wbimrp-chart-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    font-size: 0.8rem; color: #888; margin-bottom: 12px; flex-wrap: wrap; gap: 8px;
}
.wbimrp-legend { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.wbimrp-legend-item { display: flex; align-items: center; gap: 5px; font-size: 0.72rem; color: #666; }
.wbimrp-swatch { display: inline-block; width: 14px; height: 4px; border-radius: 2px; flex-shrink: 0; }
.wbimrp-chart-wrap { position: relative; width: 100%; height: 260px; }

/* Day selector */
.wbimrp-day-selector { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; }
.wbimrp-day-btn {
    font-size: 0.75rem; padding: 2px 8px; border: 1px solid #ddd;
    background: #fff; cursor: pointer; border-radius: 3px; color: #555;
}
.wbimrp-day-btn:hover { background: #f5f0e8; }
.wbimrp-day-label { font-size: 0.78rem; color: #444; min-width: 100px; text-align: center; }

/* Exchange stats bar */
.wbimrp-exchange-stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0ece4;
    font-size: 0.75rem; color: #666;
}
.wbimrp-exchange-item strong { display: block; color: #1a1a2e; font-size: 0.85rem; }

/* Table */
.wbimrp-table-card {
    background: #fff; border: 1px solid #e8e2d9; border-radius: 8px;
    padding: 16px; margin-bottom: 1.25rem;
}
.wbimrp-card-title {
    font-size: 0.75rem; font-weight: 600; color: #888;
    text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px;
}
.wbimrp-table-wrap { overflow-x: auto; }
.wbimrp-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; white-space: nowrap; }
.wbimrp-table th {
    padding: 7px 10px; text-align: right; color: #888; font-weight: 600;
    border-bottom: 1px solid #e8e2d9; background: #f9f6f0;
}
.wbimrp-table th:first-child { text-align: left; }
.wbimrp-table td { padding: 6px 10px; text-align: right; border-bottom: 1px solid #f0ece4; color: #333; }
.wbimrp-table td:first-child { text-align: left; color: #555; }
.wbimrp-table tr:hover td { background: #faf8f4; }
.wbimrp-table tr:last-child td { border-bottom: none; }
td.wbimrp-neg-price { color: #c0392b; font-weight: 600; }
td.wbimrp-zero-floor { color: #e67e22; font-weight: 600; }
td.wbimrp-lccc { color: #2e7d32; font-size: 0.68rem; }
td.wbimrp-calc { color: #888; font-size: 0.68rem; }
.wbimrp-loading-cell { text-align: center; color: #aaa; font-style: italic; padding: 1rem; }
.wbimrp-loading-sm { color: #aaa; font-style: italic; font-size: 0.85rem; }

/* Negative price row highlight */
.wbimrp-table tr.has-neg-price td { background: #fff5f5; }
.wbimrp-table tr.zero-floor-day td { background: #fff9f0; }

/* Footer */
.wbimrp-footer {
    font-size: 0.7rem; color: #bbb; padding-top: 1rem;
    border-top: 1px solid #f0ece4; line-height: 1.7;
}

@media (max-width: 600px) {
    .wbimrp-metrics { grid-template-columns: 1fr 1fr; }
    .wbimrp-chart-wrap { height: 200px; }
}

/* ── TABS ─────────────────────────────────────────────────────── */
.wbimrp-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #e8e2d9;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.wbimrp-tab {
    font-family: inherit;
    font-size: 0.85rem;
    padding: 8px 20px;
    border: none;
    background: none;
    color: #888;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s;
}
.wbimrp-tab:hover { color: #333; }
.wbimrp-tab.active { color: #1a1a2e; font-weight: 600; border-bottom-color: #c8a84b; }
.wbimrp-tab-panel { display: block; }

/* ── CfD SELECTOR ─────────────────────────────────────────────── */
.wbimrp-cfd-selector {
    background: #f9f6f0;
    border: 1px solid #e8e2d9;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 1.25rem;
}
.wbimrp-selector-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.wbimrp-selector-row:last-child { margin-bottom: 0; }
.wbimrp-selector-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    min-width: 80px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.wbimrp-selector-btns { display: flex; gap: 5px; flex-wrap: wrap; }
.wbimrp-sel-btn {
    font-family: inherit;
    font-size: 0.72rem;
    padding: 4px 10px;
    border: 1px solid #ccc;
    background: #fff;
    color: #555;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s;
}
.wbimrp-sel-btn:hover { background: #f0ece4; }
.wbimrp-sel-btn.active { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }

/* ── YTD GRID ─────────────────────────────────────────────────── */
.wbimrp-ytd-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 1.25rem;
}
.wbimrp-ytd-card {
    background: #fff;
    border: 1px solid #e8e2d9;
    border-radius: 6px;
    padding: 12px 14px;
    border-left: 4px solid #ccc;
}
.wbimrp-ytd-card.topup   { border-left-color: #1D9E75; }
.wbimrp-ytd-card.payback { border-left-color: #c0392b; }
.wbimrp-ytd-card.mixed   { border-left-color: #e67e22; }
.wbimrp-ytd-label { font-size: 0.7rem; color: #888; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.wbimrp-ytd-tech  { font-size: 0.8rem; font-weight: 600; color: #333; margin-bottom: 2px; }
.wbimrp-ytd-round { font-size: 0.68rem; color: #aaa; margin-bottom: 6px; }
.wbimrp-ytd-stat  { font-size: 1.1rem; font-weight: 700; color: #1a1a2e; }
.wbimrp-ytd-sub   { font-size: 0.7rem; color: #999; margin-top: 2px; }
.wbimrp-ytd-margin-pos { color: #c0392b; }
.wbimrp-ytd-margin-neg { color: #1D9E75; }

/* ── SECTION LABEL ────────────────────────────────────────────── */
.wbimrp-section-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    margin-top: 4px;
}

/* ── SUBSCRIBE FORM ───────────────────────────────────────────── */
.wbimrp-subscribe-card {
    background: #fff;
    border: 1px solid #e8e2d9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 1.25rem;
    max-width: 500px;
}
.wbimrp-form-row { margin-bottom: 10px; }
.wbimrp-input {
    width: 100%;
    font-family: inherit;
    font-size: 0.9rem;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: #333;
    box-sizing: border-box;
}
.wbimrp-input:focus { outline: none; border-color: #1a1a2e; }
.wbimrp-checkbox-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wbimrp-checkbox-row label {
    font-size: 0.8rem;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.wbimrp-submit-btn {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 10px 24px;
    background: #1a1a2e;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.15s;
}
.wbimrp-submit-btn:hover { background: #2d2d4e; }
.wbimrp-sub-msg {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
}
.wbimrp-sub-msg.ok    { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.wbimrp-sub-msg.error { background: #fff3e0; color: #bf360c; border: 1px solid #ffcc80; }
.wbimrp-sub-note {
    font-size: 0.72rem;
    color: #aaa;
    margin-top: 12px;
    line-height: 1.5;
}
