/* 万星门店工作台 · 财务（只有店长能看） */
:root { --fin-in: #D97757; --fin-out: #3B7BB8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --fin-out: #5C9BD6; } }
:root[data-theme="dark"] { --fin-out: #5C9BD6; }

.stat .fin-v { font-size: 30px; white-space: nowrap; }
@media (max-width: 860px) { .stat .fin-v { font-size: 22px; } }

/* 横条：钱花在哪 / 钱从哪来 */
.fin-bars { display: flex; flex-direction: column; gap: 14px; }
.fb { display: grid; grid-template-columns: 64px 1fr 76px; align-items: center; gap: 12px; font-size: 13.5px; }
.fb .k { color: var(--text-2); }
.fb .track { height: 10px; border-radius: 5px; background: var(--bg-2); overflow: hidden; }
.fb .track i { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--accent); transition: width .8s var(--ease) .2s; }
.fb .v { text-align: right; font-size: 14px; }

/* 近 6 个月收入和支出：竖柱 */
.fin-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); }
.fin-legend span, .fc-tip span { display: inline-flex; align-items: center; gap: 6px; }
.sw.in, .sw.out { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.in { background: var(--fin-in); }
.sw.out { background: var(--fin-out); }
.fin-chart { position: relative; display: flex; align-items: flex-end; gap: 6px; height: 220px; padding-top: 56px; border-bottom: 1px solid var(--line); }
.fc-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; cursor: pointer; border-radius: 8px; outline: none; position: relative; }
.fc-col::before { content: ''; position: absolute; inset: -4px 0 -26px; border-radius: 8px; background: var(--surface-2); opacity: 0; transition: opacity .2s; }
.fc-col.hover::before, .fc-col:focus-visible::before { opacity: 1; }
.fc-bars { position: relative; flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.fc-bars i { width: min(18px, 34%); height: var(--h); border-radius: 4px 4px 0 0; transform-origin: bottom; animation: barUp .7s var(--ease) both; }
.fc-bars i.in { background: var(--fin-in); }
.fc-bars i.out { background: var(--fin-out); animation-delay: .06s; }
.fc-m { position: absolute; bottom: -24px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.fc-m em { font-style: normal; margin-left: 2px; color: var(--accent-ink); font-size: 11px; }
.fin-chart + * { margin-top: 0; }
.fin-chart { margin-bottom: 26px; }
.fc-tip { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-wrap: wrap; gap: 2px 10px; justify-content: center; max-width: 200px; padding: 7px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow, 0 6px 20px rgba(0,0,0,.08)); font-size: 12px; color: var(--text-2); opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 2; }
.fc-tip.show { opacity: 1; }
.fc-tip b { width: 100%; text-align: center; color: var(--text); font-weight: 600; }
.fc-tip .fc-p { width: 100%; justify-content: center; color: var(--text); }

/* 列表右侧金额 */
.fin-amt { font-size: 15px; font-weight: 600; white-space: nowrap; }
.fin-amt.plus { color: var(--ok); }
.fin-amt.neg { color: var(--text-2); font-weight: 500; font-size: 13px; }
.fin-r { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.fin-r b { font-size: 15px; font-weight: 600; }
.fin-r span { font-size: 12px; color: var(--text-3); }

/* 工资条 */
.fin-slip { border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px; background: var(--surface); }
.fs-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.fs-row:last-child { border-bottom: 0; }
.fs-row span { display: flex; flex-direction: column; gap: 2px; }
.fs-row em { font-style: normal; font-size: 12px; color: var(--text-3); }
.fs-row b { font-weight: 600; white-space: nowrap; }
.fs-row b.neg { color: var(--danger); }
.fs-total { border-top: 1px solid var(--line); border-bottom: 0; font-size: 15px; }
.fs-total b { font-size: 20px; color: var(--accent-2); }

/* 收支明细顶部合计 */
.fin-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.fin-sum > div { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.fin-sum span { font-size: 12.5px; color: var(--text-3); }
.fin-sum b { font-size: 20px; font-weight: 600; }
.fin-sum b.plus { color: var(--ok); }
@media (max-width: 560px) { .fin-sum b { font-size: 16px; } .fin-sum > div { padding: 12px; } .fb { grid-template-columns: 56px 1fr 70px; } }
