/**
 * Terminal City Finances — Transparency Ledger Styles
 *
 * All classes prefixed `.cf-` (city finances).
 */

/* ── Loading ──────────────────────────────────────────────────── */

.cf-loading {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.85rem;
    color: #6b5740;
    padding: 32px 0;
}

/* ── Preamble ─────────────────────────────────────────────────── */

.cf-preamble {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.85rem;
    font-style: italic;
    color: #6b5740;
    text-align: center;
    line-height: 1.5;
    margin-bottom: 24px;
}

/* ── Summary Stats Row ────────────────────────────────────────── */

.cf-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 28px;
    padding: 16px 0;
    border-top: 1px solid rgba(139, 115, 85, 0.2);
    border-bottom: 1px solid rgba(139, 115, 85, 0.2);
}

.cf-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.cf-stat-value {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #3d2b1f;
}

.cf-stat-label {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.68rem;
    color: #8b7355;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ── Section Titles ───────────────────────────────────────────── */

.cf-section {
    margin-bottom: 24px;
}

.cf-section-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: #3d2b1f;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding-bottom: 6px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(139, 115, 85, 0.2);
}

/* ── Cost Cards ───────────────────────────────────────────────── */

.cf-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.cf-card {
    background: rgba(61, 43, 31, 0.03);
    border: 1px solid #c9b99a;
    border-radius: 4px;
    padding: 14px 16px;
}

.cf-card-title {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b5740;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.cf-card-value {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #3d2b1f;
    margin-bottom: 6px;
}

.cf-card-detail {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.72rem;
    color: #a89279;
    line-height: 1.4;
}

/* ── Line Items ───────────────────────────────────────────────── */

.cf-line-items {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cf-line-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px solid rgba(139, 115, 85, 0.08);
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.78rem;
}

.cf-line-item:last-child {
    border-bottom: none;
}

.cf-line-desc {
    color: #6b5740;
}

.cf-line-amount {
    color: #3d2b1f;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 12px;
}

.cf-line-item--total {
    border-top: 1px solid #8b7355;
    border-bottom: none;
    margin-top: 4px;
    padding-top: 8px;
    font-weight: 700;
}

.cf-line-item--total .cf-line-desc,
.cf-line-item--total .cf-line-amount {
    color: #3d2b1f;
    font-weight: 700;
}

/* ── Revenue Empty State ──────────────────────────────────────── */

.cf-revenue-note {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.82rem;
    font-style: italic;
    color: #8b7355;
    line-height: 1.5;
    padding: 12px 16px;
    border-left: 2px solid #c9b99a;
}

/* ── Balance / Status ─────────────────────────────────────────── */

.cf-balance {
    text-align: center;
    padding: 16px;
    background: rgba(61, 43, 31, 0.03);
    border: 1px solid #c9b99a;
    border-radius: 4px;
}

.cf-balance-amount {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.cf-balance-label {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.72rem;
    color: #8b7355;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cf-status--deficit { color: #b05555; }
.cf-status--balanced { color: #6a8a5a; }
.cf-status--surplus { color: #3d6b35; }

/* ── Grid Stats (build activity, economy) ─────────────────────── */

.cf-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.cf-grid-item {
    text-align: center;
    padding: 12px 8px;
    background: rgba(61, 43, 31, 0.02);
    border: 1px solid rgba(139, 115, 85, 0.15);
    border-radius: 4px;
}

.cf-grid-value {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 1rem;
    font-weight: 700;
    color: #3d2b1f;
}

.cf-grid-label {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.65rem;
    color: #a89279;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* ── Source Breakdown ─────────────────────────────────────────── */

.cf-source-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.cf-source-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.75rem;
}

.cf-source-name {
    color: #6b5740;
    min-width: 100px;
}

.cf-source-bar {
    flex: 1;
    height: 8px;
    background: #e8dcc4;
    border-radius: 4px;
    overflow: hidden;
}

.cf-source-fill {
    height: 100%;
    background: #8b7355;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.cf-source-amount {
    color: #3d2b1f;
    font-weight: 600;
    min-width: 60px;
    text-align: right;
}

/* ── Monthly Table ────────────────────────────────────────────── */

.cf-monthly-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.75rem;
    margin-top: 12px;
}

.cf-monthly-table th {
    text-align: left;
    font-size: 0.68rem;
    color: #8b7355;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px 6px;
    border-bottom: 1px solid #c9b99a;
}

.cf-monthly-table td {
    padding: 6px 8px;
    color: #3d2b1f;
    border-bottom: 1px solid rgba(139, 115, 85, 0.1);
}

.cf-monthly-table td:last-child {
    text-align: right;
    font-weight: 600;
}

/* ── Weekly Trend Chart ───────────────────────────────────────── */

.cf-chart-wrap {
    margin-top: 12px;
}

.cf-chart {
    width: 100%;
    height: auto;
    background: rgba(61, 43, 31, 0.02);
    border: 1px solid rgba(139, 115, 85, 0.15);
    border-radius: 4px;
}

.cf-chart-label {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 9px;
    fill: #8b7355;
}

.cf-chart-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.cf-chart-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.7rem;
    color: #6b5740;
}

.cf-chart-swatch {
    display: inline-block;
    width: 12px;
    height: 3px;
    border-radius: 2px;
}

/* ── Footer ───────────────────────────────────────────────────── */

.cf-footer {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.68rem;
    color: #a89279;
    text-align: center;
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid rgba(139, 115, 85, 0.15);
}

/* ── Responsive ───────────────────────────────────────────────── */

@media (max-width: 768px) {
    .cf-stats {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .cf-cards {
        grid-template-columns: 1fr;
    }

    .cf-grid {
        grid-template-columns: 1fr 1fr;
    }
}
