/* ============================================================
   Financial Report (admin only) — fx-fin- prefix.
   ============================================================ */

.fx-fin-page { padding: 8px 4px 40px; }

.fx-fin-denied { max-width: 640px; margin: 24px auto; }

/* ---- Header ------------------------------------------------ */
.fx-fin-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.fx-fin-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted, #8a8f98);
}

.fx-fin-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .15);
}

.fx-fin-title-block h1 { margin: 6px 0 2px; font-size: 26px; font-weight: 600; }
.fx-fin-title-block h1 em { font-style: italic; color: #2563eb; }
.fx-fin-title-block p { margin: 0; color: var(--text-muted, #8a8f98); font-size: 14px; }

/* ---- Toolbar ----------------------------------------------- */
.fx-fin-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.fx-fin-date { flex: 0 0 170px; width: 170px; }
.fx-fin-obtain { flex: 0 0 auto; height: 40px; border-radius: 8px; }

.fx-fin-actions .mud-input.mud-input-outlined {
    background-color: #ffffff;
    border-radius: 8px;
}

/* ---- Presets ------------------------------------------------ */
.fx-fin-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.fx-fin-preset-chip { cursor: pointer; }

.fx-fin-progress { margin-bottom: 16px; border-radius: 4px; }

/* ---- Empty state -------------------------------------------- */
.fx-fin-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 64px 16px;
    border: 1px dashed var(--border, #e6e8eb);
    border-radius: 14px;
    color: var(--text-muted, #8a8f98);
    background: var(--surface, #fff);
}
.fx-fin-empty h3 { margin: 8px 0 0; font-size: 17px; font-weight: 600; color: var(--text, #1f2430); }
.fx-fin-empty p { margin: 0; font-size: 14px; }

/* ---- Statement bar ------------------------------------------ */
.fx-fin-statement-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 12px;
}

.fx-fin-statement-label {
    display: block;
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.fx-fin-statement-bar strong { font-size: 16px; font-weight: 600; }
.fx-fin-statement-meta { font-size: 12px; color: #94a3b8; }

/* ---- KPI tiles ---------------------------------------------- */
.fx-fin-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.fx-fin-kpis-secondary { margin-bottom: 22px; }

.fx-fin-kpi {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e6e8eb);
    border-left: 4px solid #94a3b8;
    border-radius: 12px;
}

.fx-fin-kpi-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--text-muted, #8a8f98);
}

.fx-fin-kpi-value {
    font-size: 24px;
    font-weight: 650;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.fx-fin-kpi-cur {
    font-size: 12px;
    font-weight: 600;
    margin-left: 5px;
    color: var(--text-muted, #8a8f98);
}

.fx-fin-kpi-hint { font-size: 12px; color: var(--text-muted, #8a8f98); }

.fx-fin-kpi-spend   { border-left-color: #ef4444; }
.fx-fin-kpi-topup   { border-left-color: #16a34a; }
.fx-fin-kpi-gateway { border-left-color: #7c3aed; }
.fx-fin-kpi-net-pos { border-left-color: #16a34a; }
.fx-fin-kpi-net-neg { border-left-color: #ef4444; }
.fx-fin-kpi-users   { border-left-color: #0ea5e9; }
.fx-fin-kpi-avg     { border-left-color: #f59e0b; }
.fx-fin-kpi-float   { border-left-color: #14b8a6; }

/* ---- Cards --------------------------------------------------- */
.fx-fin-card {
    background: var(--surface, #fff);
    border: 1px solid var(--border, #e6e8eb);
    border-radius: 14px;
    padding: 18px 18px 10px;
    margin-bottom: 18px;
}

.fx-fin-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.fx-fin-card-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-muted, #8a8f98);
}

.fx-fin-card-head h3 { margin: 4px 0 0; font-size: 17px; font-weight: 600; }

/* ---- Chart row ----------------------------------------------- */
.fx-fin-chart-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 18px;
}

.fx-fin-nochart {
    padding: 48px 8px;
    text-align: center;
    color: var(--text-muted, #8a8f98);
    font-size: 14px;
}

.fx-fin-legend { display: flex; gap: 14px; }

.fx-fin-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted, #8a8f98);
}

.fx-fin-legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.fx-fin-legend-item.spend .fx-fin-legend-dot { background: #ef4444; }
.fx-fin-legend-item.topup .fx-fin-legend-dot { background: #16a34a; }

.fx-fin-donut-wrap {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.fx-fin-donut-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 150px; }

.fx-fin-donut-legend li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
}

.fx-fin-donut-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.fx-fin-donut-name { flex: 1 1 auto; }
.fx-fin-donut-val { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---- Two-column layout ---------------------------------------- */
.fx-fin-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

/* ---- Tables ---------------------------------------------------- */
.fx-fin-table { font-size: 13px; }

.fx-fin-table th {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-muted, #8a8f98);
    white-space: nowrap;
}

.fx-fin-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx-fin-money { font-family: "Geist Mono", ui-monospace, monospace; }
.fx-fin-zero { color: var(--text-muted, #c3c7ce); text-align: right; }

.fx-fin-pos { color: #16a34a; }
.fx-fin-neg { color: #ef4444; }

.fx-fin-total-row td {
    font-weight: 700;
    border-top: 2px solid var(--border, #e6e8eb);
    background: rgba(15, 23, 42, .03);
}

.fx-fin-quiet td { color: var(--text-muted, #b6bac2); }

.fx-fin-none {
    text-align: center;
    padding: 22px 8px;
    color: var(--text-muted, #8a8f98);
}

.fx-fin-swatch {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

/* ---- Share bars -------------------------------------------------- */
.fx-fin-share-col { width: 170px; }

.fx-fin-share { display: flex; align-items: center; gap: 8px; }

.fx-fin-share-bar {
    flex: 1 1 auto;
    height: 7px;
    border-radius: 99px;
    background: var(--border, #eef0f3);
    overflow: hidden;
}

.fx-fin-share-bar span {
    display: block;
    height: 100%;
    border-radius: 99px;
}

.fx-fin-share-val {
    flex: 0 0 46px;
    text-align: right;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted, #8a8f98);
}

/* ---- Status pills ------------------------------------------------ */
.fx-fin-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
}

.fx-fin-pill.pending  { background: rgba(245, 158, 11, .14); color: #b45309; }
.fx-fin-pill.failed   { background: rgba(239, 68, 68, .14);  color: #b91c1c; }
.fx-fin-pill.reversed { background: rgba(100, 116, 139, .16); color: #475569; }
.fx-fin-pill.unknown  { background: rgba(148, 163, 184, .18); color: #475569; }

/* ---- Notes --------------------------------------------------------- */
.fx-fin-note {
    margin: 10px 2px 6px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-muted, #8a8f98);
}

/* ---- Scroll containers --------------------------------------------- */
.fx-fin-scroll { overflow-x: auto; }
.fx-fin-daybook { max-height: 460px; overflow-y: auto; }

/* ---- Responsive ------------------------------------------------------ */
@media (max-width: 1200px) {
    .fx-fin-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fx-fin-chart-row,
    .fx-fin-two-col { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
    .fx-fin-kpis { grid-template-columns: minmax(0, 1fr); }
    .fx-fin-date { flex: 1 1 100%; width: 100%; }
    .fx-fin-obtain { flex: 1 1 100%; }
}
