/* WattBites Capture Value Reporter — capture-dashboard.css */

#wbcv-portal {
    font-family: 'Source Serif 4', Georgia, serif;
    color: #2a2a2a;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 0 2rem;
}

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

/* ---- Period nav ---- */
.wbcv-period-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.wbcv-period-label { font-size: 0.8rem; color: #888; margin-right: 4px; }
.wbcv-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;
}
.wbcv-period-btn:hover { background: #f5f0e8; border-color: #aaa; }
.wbcv-period-btn.active { background: #1a1a2e; color: #fff; border-color: #1a1a2e; }

/* ---- Headline metrics ---- */
.wbcv-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 1.25rem;
}
.wbcv-metric {
    background: #f9f6f0;
    border: 1px solid #e8e2d9;
    border-radius: 6px;
    padding: 12px 14px;
}
.wbcv-metric-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.wbcv-metric-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.wbcv-metric-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.1;
}
.wbcv-metric-sub {
    font-size: 0.7rem;
    color: #aaa;
    margin-top: 3px;
}
.wbcv-metric-disc {
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 4px;
}
.wbcv-disc-pos { color: #c62828; } /* capturing below average = bad for merchant */
.wbcv-disc-neg { color: #2e7d32; } /* capturing above average = premium */
.wbcv-disc-zero { color: #888; }

/* ---- Methodology note ---- */
.wbcv-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;
}

/* ---- Chart cards ---- */
.wbcv-chart-card {
    background: #fff;
    border: 1px solid #e8e2d9;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 1.25rem;
}
.wbcv-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;
}
.wbcv-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.wbcv-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: #666;
}
.wbcv-swatch {
    display: inline-block;
    width: 14px;
    height: 4px;
    border-radius: 2px;
    flex-shrink: 0;
}
.wbcv-chart-wrap {
    position: relative;
    width: 100%;
    height: 260px;
}

/* ---- Table card ---- */
.wbcv-table-card {
    background: #fff;
    border: 1px solid #e8e2d9;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 1.25rem;
}
.wbcv-card-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}
.wbcv-table-wrap {
    overflow-x: auto;
}
.wbcv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
    white-space: nowrap;
}
.wbcv-table th {
    padding: 7px 10px;
    text-align: right;
    color: #888;
    font-weight: 600;
    border-bottom: 1px solid #e8e2d9;
    background: #f9f6f0;
    position: sticky;
    top: 0;
}
.wbcv-table th:first-child { text-align: left; }
.wbcv-table td {
    padding: 6px 10px;
    text-align: right;
    border-bottom: 1px solid #f0ece4;
    color: #333;
}
.wbcv-table td:first-child { text-align: left; color: #555; }
.wbcv-table tr:hover td { background: #faf8f4; }
.wbcv-table tr:last-child td { border-bottom: none; }

/* Discount colouring in table */
td.wbcv-disc-pos { color: #c62828; font-weight: 600; }
td.wbcv-disc-neg { color: #2e7d32; font-weight: 600; }
td.wbcv-missing  { color: #ccc; }

.wbcv-loading-cell {
    text-align: center;
    color: #aaa;
    font-style: italic;
    padding: 1rem;
}

/* ---- State messages ---- */
.wbcv-loading-msg {
    color: #aaa;
    font-style: italic;
    font-size: 0.85rem;
    padding: 0.5rem 0;
}

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

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