/* =====================================================
   SahiHisab — Finance Page Styles (Redesign v2)
   Overview, Payments, Expenses, Track Record tabs
   Area chart, hero banner, animated strips
   ===================================================== */

/* ─── Tab Navigation ──────────────────────── */
.finance-tabs {
  display: flex;
  gap: 4px;
  padding: 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.finance-tabs::-webkit-scrollbar { display: none; }

.finance-tab {
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 150ms ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.finance-tab .material-symbols-rounded { font-size: 1rem; }
.finance-tab:active { transform: scale(0.96); }
body .finance-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

/* ─── Tab Content Switching ──────────────── */
.finance-tab-content { display: none; }
.finance-tab-content.active { display: block; }

/* ═══════════════════════════════════════════════
   HERO STATS BANNER
   ═══════════════════════════════════════════════ */
.fin-hero {
  margin: var(--space-md, 16px) 16px;
  border-radius: 20px;
  padding: var(--space-lg, 24px) var(--space-lg, 24px) var(--space-md, 16px);
  background: linear-gradient(135deg, hsl(215, 45%, 14%) 0%, hsl(200, 55%, 20%) 50%, hsl(215, 40%, 16%) 100%);
  color: #fff;
  position: relative;
  overflow: visible;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
/* Glow effects contained in a clipped inner layer */
.fin-hero::before {
  content: '';
  position: absolute; inset: 0; border-radius: 20px;
  overflow: hidden; pointer-events: none;
  background:
    radial-gradient(circle at 90% 10%, hsla(200, 80%, 50%, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 10% 90%, hsla(152, 60%, 50%, 0.1) 0%, transparent 50%);
}
.fin-hero-label {
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; opacity: 0.65; margin-bottom: 4px;
}
.fin-hero-amount {
  font-family: 'Outfit', sans-serif; font-size: 2.2rem; font-weight: 900;
  letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 2px;
  white-space: nowrap; overflow: visible;
}
.fin-hero-sub {
  font-size: 0.78rem; opacity: 0.6; margin-bottom: var(--space-md, 16px);
}
.fin-hero-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
  position: relative; z-index: 1;
}
.fin-hero-stat {
  padding: 10px; border-radius: 12px;
  background: hsla(0, 0%, 100%, 0.08);
  border: 1px solid hsla(0, 0%, 100%, 0.08);
}
.fin-hero-stat-label {
  font-size: 0.65rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.06em; opacity: 0.55; margin-bottom: 2px;
}
.fin-hero-stat-value {
  font-family: 'Outfit', sans-serif; font-size: 1.15rem; font-weight: 800;
  white-space: nowrap; overflow: visible;
}
.fin-hero-stat[data-type="revenue"] .fin-hero-stat-value { color: hsl(152, 70%, 60%); }
.fin-hero-stat[data-type="expense"] .fin-hero-stat-value { color: hsl(0, 70%, 68%); }
.fin-hero-stat[data-type="dues"] .fin-hero-stat-value { color: hsl(38, 85%, 65%); }

/* ═══ REVENUE / EXPENSE BREAKDOWN STRIP ═══ */
.fin-breakdown-strip {
  margin: 0 16px var(--space-md, 16px);
  display: flex; gap: 8px; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.fin-breakdown-strip::-webkit-scrollbar { display: none; }

.fin-strip-card {
  flex: 1; min-width: 110px;
  padding: 12px 14px;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: relative; overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.fin-strip-card:active { transform: scale(0.97); }
@media (hover: hover) {
  body .fin-strip-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); transform: translateY(-1px); }
}
.fin-strip-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.fin-strip-card[data-src="booking"]::before { background: #3b82f6; }
.fin-strip-card[data-src="walkin"]::before { background: #8b5cf6; }
.fin-strip-card[data-src="rental"]::before { background: #0ea5e9; }
.fin-strip-card[data-src="studio"]::before { background: #ef4444; }
.fin-strip-card[data-src="cogs"]::before { background: #f97316; }
.fin-strip-card[data-src="team"]::before { background: #ec4899; }

.fin-strip-icon {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.fin-strip-icon .material-symbols-rounded { font-size: 1rem; }
.fin-strip-card[data-src="booking"] .fin-strip-icon { background: #3b82f615; color: #3b82f6; }
.fin-strip-card[data-src="walkin"] .fin-strip-icon { background: #8b5cf615; color: #8b5cf6; }
.fin-strip-card[data-src="rental"] .fin-strip-icon { background: #0ea5e915; color: #0ea5e9; }
.fin-strip-card[data-src="studio"] .fin-strip-icon { background: #ef444415; color: #ef4444; }
.fin-strip-card[data-src="cogs"] .fin-strip-icon { background: #f9731615; color: #f97316; }
.fin-strip-card[data-src="team"] .fin-strip-icon { background: #ec489915; color: #ec4899; }

.fin-strip-label {
  font-size: 0.68rem; font-weight: 600; color: var(--text-muted, #999);
  margin-bottom: 2px;
}
.fin-strip-value {
  font-family: 'Outfit', sans-serif; font-size: 1.05rem; font-weight: 800;
  color: var(--text-primary, #111); line-height: 1.2;
  white-space: nowrap; overflow: visible;
}

/* ═══ SEGMENTED PROGRESS BAR ═══ */
.fin-segmented-bar {
  margin: 0 16px var(--space-md, 16px);
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.fin-seg-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.fin-seg-title {
  font-family: 'Outfit', sans-serif; font-size: 0.85rem; font-weight: 700;
  color: var(--text-primary, #111);
}
.fin-seg-total {
  font-family: 'Outfit', sans-serif; font-size: 0.85rem; font-weight: 800;
  color: var(--text-primary, #111); white-space: nowrap; overflow: visible;
}
.fin-seg-track {
  height: 10px; border-radius: 5px; background: var(--gray-200, #e5e5e5);
  display: flex; overflow: hidden; gap: 2px;
}
.fin-seg-fill {
  height: 100%; border-radius: 5px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.fin-seg-fill[data-seg="booking"] { background: #3b82f6; }
.fin-seg-fill[data-seg="walkin"] { background: #8b5cf6; }
.fin-seg-fill[data-seg="rental"] { background: #0ea5e9; }
.fin-seg-legend {
  display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap;
}
.fin-seg-legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.7rem; font-weight: 600; color: var(--text-secondary, #666);
}
.fin-seg-legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ═══ AREA CHART ═══ */
.fin-chart-card {
  margin: 0 16px var(--space-md, 16px);
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.fin-chart-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.fin-chart-title {
  font-family: 'Outfit', sans-serif; font-size: 0.95rem; font-weight: 700;
  color: var(--text-primary, #111); display: flex; align-items: center; gap: 6px;
}
.fin-chart-title .material-symbols-rounded { font-size: 1.1rem; color: var(--primary); }
.fin-chart-toggle {
  font-family: 'DM Sans', sans-serif; font-size: 0.75rem;
  color: var(--text-secondary); background: var(--secondary, #f0f0f0);
  padding: 4px 10px; border-radius: 8px; cursor: pointer;
  border: none; transition: background 0.15s;
}
.fin-chart-toggle:active { opacity: 0.8; }

.fin-chart-svg-wrap {
  position: relative; width: 100%; overflow: visible;
}
.fin-chart-svg-wrap svg {
  width: 100%; height: auto; display: block; max-height: 200px;
}

/* Desktop: chart + dues side by side */
.fin-chart-dues-row {
  display: flex; flex-direction: column; gap: 16px;
  margin: 0 16px var(--space-md, 16px);
}
.fin-chart-dues-row > .fin-chart-card,
.fin-chart-dues-row > .fin-dues-card {
  margin: 0;
}
@media (min-width: 769px) {
  .fin-chart-dues-row {
    flex-direction: row; align-items: stretch;
  }
  .fin-chart-dues-row > .fin-chart-card {
    flex: 1; min-width: 0;
  }
  .fin-chart-dues-row > .fin-dues-card {
    width: 280px; flex-shrink: 0;
  }
  .fin-chart-svg-wrap svg {
    max-height: 300px;
  }
}
@media (min-width: 1200px) {
  .fin-chart-dues-row > .fin-dues-card {
    width: 320px;
  }
  .fin-chart-svg-wrap svg {
    max-height: 340px;
  }
}
.fin-area-income {
  fill: none; stroke: hsl(152, 68%, 42%);
  stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round;
}
.fin-area-expense {
  fill: none; stroke: hsl(0, 68%, 56%);
  stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round;
}
.fin-chart-dot {
  r: 4; stroke-width: 2; stroke: var(--card);
  transition: r 0.15s ease; cursor: pointer;
}
.fin-chart-dot:hover { r: 6; }
.fin-chart-dot.income { fill: hsl(152, 68%, 42%); }
.fin-chart-dot.expense { fill: hsl(0, 68%, 56%); }
.fin-chart-gridline {
  stroke: var(--border-light, #eee); stroke-width: 1; stroke-dasharray: 4 4;
}
body.dark-mode .fin-chart-gridline { stroke: var(--border); }
.fin-chart-x-label {
  font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 600;
  fill: var(--text-muted, #999); text-anchor: middle;
}
.fin-chart-y-label {
  font-family: 'DM Sans', sans-serif; font-size: 10px; font-weight: 500;
  fill: var(--text-muted, #999); text-anchor: end;
}

/* Tooltip on dot hover/touch */
.fin-chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--foreground, #111);
  color: var(--card, #fff);
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.fin-chart-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--foreground, #111);
}
body.dark-mode .fin-chart-tooltip {
  background: hsl(210, 18%, 88%);
  color: hsl(215, 28%, 10%);
}
body.dark-mode .fin-chart-tooltip::after {
  border-top-color: hsl(210, 18%, 88%);
}
/* Flipped tooltip (arrow points up, tooltip below dot) */
.fin-chart-tooltip.flip-below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: var(--foreground, #111);
}
body.dark-mode .fin-chart-tooltip.flip-below::after {
  border-top-color: transparent;
  border-bottom-color: hsl(210, 18%, 88%);
}

.fin-chart-legend {
  display: flex; align-items: center; justify-content: center;
  gap: 16px; margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border-light, #eee);
}
.fin-chart-legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 600; color: var(--text-secondary, #666);
}
.fin-chart-legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ═══ PENDING DUES ═══ */
.fin-dues-card {
  margin: 0 16px var(--space-md, 16px);
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.fin-dues-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.fin-dues-title {
  font-family: 'Outfit', sans-serif; font-size: 0.85rem; font-weight: 700;
  color: var(--danger, #ef4444); display: flex; align-items: center; gap: 5px;
}
.fin-dues-title .material-symbols-rounded { font-size: 1rem; }
.fin-dues-total {
  font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 800;
  color: var(--danger, #ef4444); white-space: nowrap; overflow: visible;
}
.fin-dues-rows { display: flex; flex-direction: column; gap: 6px; }
.fin-due-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; border-radius: 8px;
  background: var(--danger-light, #fef2f2);
  border: 1px solid hsla(0, 50%, 50%, 0.08);
}
body.dark-mode .fin-due-row { border-color: hsla(0, 50%, 50%, 0.15); }
.fin-due-row-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 600; color: var(--text-secondary, #666);
}
.fin-due-row-label .material-symbols-rounded { font-size: 0.9rem; }
.fin-due-row-value {
  font-family: 'Outfit', sans-serif; font-size: 0.9rem; font-weight: 700;
  color: var(--danger, #ef4444); white-space: nowrap; overflow: visible;
}

/* ═══ WAIVER BANNER ═══ */
.fin-waiver {
  margin: 0 16px var(--space-md, 16px);
  padding: 12px 14px; border-radius: 12px;
  border: 1.5px dashed hsl(38, 70%, 60%);
  background: var(--warning-light, #fef3c7);
  display: flex; align-items: center; justify-content: space-between;
}
.fin-waiver-left { display: flex; align-items: center; gap: 10px; }
.fin-waiver-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: hsl(38, 80%, 55%); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.fin-waiver-icon .material-symbols-rounded { font-size: 1.1rem; }
.fin-waiver-label { font-size: 0.82rem; font-weight: 700; color: var(--text-primary, #111); }
.fin-waiver-sub { font-size: 0.68rem; color: var(--text-muted, #999); }
.fin-waiver-amount {
  font-family: 'Outfit', sans-serif; font-size: 1.15rem; font-weight: 800;
  color: hsl(38, 80%, 40%); white-space: nowrap; overflow: visible;
}
body.dark-mode .fin-waiver-amount { color: hsl(38, 75%, 60%); }

/* ═══ EXPENSE BREAKDOWN CARD ═══ */
.fin-expense-card {
  margin: 0 16px var(--space-md, 16px);
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.fin-expense-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.fin-expense-title {
  font-family: 'Outfit', sans-serif; font-size: 0.95rem; font-weight: 700;
  color: var(--text-primary, #111);
}
.fin-expense-rows { display: flex; flex-direction: column; gap: 4px; }
.fin-expense-row {
  display: flex; align-items: center; gap: 10px; padding: 6px 0;
}
.fin-expense-row + .fin-expense-row { border-top: 1px solid var(--border-light, #eee); }
.fin-expense-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.fin-expense-info { flex: 1; min-width: 0; }
.fin-expense-name { font-size: 0.82rem; font-weight: 600; color: var(--text-primary, #111); }
.fin-expense-pct { font-size: 0.68rem; color: var(--text-muted, #999); }
.fin-expense-bar-wrap {
  width: 60px; height: 5px; border-radius: 3px;
  background: var(--gray-200, #e5e5e5); overflow: hidden; flex-shrink: 0;
}
.fin-expense-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.fin-expense-amt {
  font-family: 'Outfit', sans-serif; font-size: 0.85rem; font-weight: 700;
  color: var(--text-primary, #111); white-space: nowrap; min-width: 70px; text-align: right;
  overflow: visible;
}

/* ═══ PAYMENTS TAB ═══ */
.fin-pay-date-row {
  display: flex; gap: 8px; margin: 0 16px var(--space-md, 16px);
  align-items: center; flex-wrap: wrap;
}
.fin-date-input {
  flex: 1; min-width: 0; min-height: 44px; font-size: 0.9rem;
  padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text-primary, #111); font-family: 'DM Sans', sans-serif;
  transition: border-color 0.15s;
}
.fin-date-input:focus { outline: none; border-color: var(--primary); }
.fin-filter-btn {
  min-height: 44px; padding: 0 16px; border-radius: 12px;
  background: var(--primary); color: #fff; border: none;
  font-family: 'DM Sans', sans-serif; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
}
.fin-filter-btn:active { opacity: 0.85; }

.fin-filter-pills {
  display: flex; gap: 6px; margin: 0 16px var(--space-md, 16px);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.fin-filter-pills::-webkit-scrollbar { display: none; }

.fin-pill {
  height: 36px; padding: 0 14px; border-radius: 18px;
  font-family: 'DM Sans', sans-serif; font-size: 0.75rem; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
  border: 1.5px solid var(--border); background: transparent;
  color: var(--text-secondary, #666); cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 5px;
}
.fin-pill:active { transform: scale(0.95); }
body .fin-pill.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

.fin-ledger-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 16px var(--space-sm, 8px);
}
.fin-ledger-title h3 {
  font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 700;
  color: var(--text-primary, #111); margin: 0;
}
.fin-ledger-title span {
  font-size: 0.75rem; color: var(--text-muted, #999);
}

/* Payment / Expense Row */
.fin-pay-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light, #eee);
  cursor: pointer; transition: background 0.1s;
}
.fin-pay-row:active { background: var(--gray-50, #fafafa); }
.fin-pay-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.fin-pay-icon .material-symbols-rounded { font-size: 1.1rem; }
.fin-pay-info { flex: 1; min-width: 0; }
.fin-pay-name {
  font-size: 0.88rem; font-weight: 600; color: var(--text-primary, #111);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fin-pay-sub {
  font-size: 0.72rem; color: var(--text-muted, #999);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-top: 1px;
}
.fin-pay-right-group {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.fin-pay-right { text-align: right; flex-shrink: 0; }
.fin-pay-amt {
  font-family: 'Outfit', sans-serif; font-size: 0.95rem; font-weight: 700;
  white-space: nowrap; overflow: visible;
}
.fin-pay-amt.green { color: var(--success, #16a34a); }
.fin-pay-amt.red { color: var(--danger, #ef4444); }
.fin-pay-mode {
  font-size: 0.68rem; color: var(--text-muted, #999); margin-top: 1px;
}
.fin-pay-actions {
  display: flex; flex-direction: column; gap: 2px; flex-shrink: 0;
}
.fin-pay-act {
  width: 32px; height: 28px; border-radius: 6px;
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted, #999); transition: background 0.15s, color 0.15s;
}
.fin-pay-act:active { transform: scale(0.9); }
.fin-pay-act .material-symbols-rounded { font-size: 0.95rem; }
.fin-pay-act[data-act="edit"]:hover { background: var(--primary-50); color: var(--primary); }
.fin-pay-act[data-act="delete"]:hover { background: var(--danger-light); color: var(--danger); }

/* ═══ EXPENSES TAB ═══ */
.fin-expense-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 0 16px var(--space-md, 16px);
}
.fin-expense-stat {
  padding: 12px; background: var(--card); border-radius: 12px;
  border: 1px solid var(--border); text-align: center;
}
.fin-expense-stat-value {
  font-family: 'Outfit', sans-serif; font-size: 1.1rem; font-weight: 800;
  line-height: 1.2; white-space: nowrap; overflow: visible;
}
.fin-expense-stat-label {
  font-size: 0.68rem; font-weight: 600; color: var(--text-muted, #999); margin-top: 2px;
}
.fin-add-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 8px 16px; border-radius: 12px;
  background: var(--primary); color: #fff; border: none;
  font-family: 'DM Sans', sans-serif; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; min-height: 44px; transition: opacity 0.15s;
}
.fin-add-btn:active { opacity: 0.85; }
.fin-add-btn .material-symbols-rounded { font-size: 1rem; }

.fin-quick-chips {
  display: flex; gap: 6px; margin: 0 16px var(--space-md, 16px);
  flex-wrap: wrap;
}
.fin-quick-chip {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 20px;
  border: 1.5px solid var(--border); background: var(--card);
  color: var(--text-secondary, #666); font-family: 'DM Sans', sans-serif;
  font-size: 0.75rem; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.fin-quick-chip:active { transform: scale(0.95); background: var(--gray-100, #f0f0f0); }
.fin-quick-chip .material-symbols-rounded { font-size: 0.9rem; }

/* ═══ TRACK RECORD TAB ═══ */
.fin-tr-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin: 0 16px var(--space-md, 16px);
}
.fin-tr-stat {
  padding: 14px 10px; background: var(--card); border-radius: 12px;
  border: 1px solid var(--border); text-align: center;
}
.fin-tr-stat-value {
  font-family: 'Outfit', sans-serif; font-size: 1.3rem; font-weight: 800;
  line-height: 1.2; white-space: nowrap; overflow: visible;
}
.fin-tr-stat-label {
  font-size: 0.68rem; font-weight: 600; color: var(--text-muted, #999); margin-top: 3px;
}

.fin-tr-type-card {
  margin: 0 16px var(--space-md, 16px);
  background: var(--card); border-radius: 12px;
  border: 1px solid var(--border); padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.fin-tr-type-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
}
.fin-tr-type-row + .fin-tr-type-row { border-top: 1px solid var(--border-light, #eee); }
.fin-tr-type-icon {
  width: 36px; height: 36px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.fin-tr-type-icon .material-symbols-rounded { font-size: 1.1rem; }
.fin-tr-type-info { flex: 1; }
.fin-tr-type-name { font-size: 0.88rem; font-weight: 600; color: var(--text-primary, #111); }
.fin-tr-type-bar {
  height: 5px; background: var(--gray-200, #e5e5e5); border-radius: 3px;
  margin-top: 4px; overflow: hidden;
}
.fin-tr-type-fill { height: 100%; border-radius: 3px; transition: width 0.5s; }
.fin-tr-type-right { text-align: right; flex-shrink: 0; }
.fin-tr-type-count {
  font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 800;
  color: var(--text-primary, #111); white-space: nowrap; overflow: visible;
}
.fin-tr-type-earned {
  font-size: 0.7rem; color: var(--text-muted, #999);
  white-space: nowrap; overflow: visible;
}

.fin-tr-month-header {
  display: flex; align-items: center; gap: 8px;
  margin: 0 16px 8px;
}
.fin-tr-month-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0;
}
.fin-tr-month-name {
  font-family: 'Outfit', sans-serif; font-size: 0.88rem; font-weight: 700;
  color: var(--text-primary, #111);
}
.fin-tr-month-meta {
  font-size: 0.72rem; color: var(--text-muted, #999); white-space: nowrap; overflow: visible;
}
.fin-tr-month-line { flex: 1; height: 1px; background: var(--border-light, #eee); }

.fin-tr-job {
  margin: 0 16px 8px;
  background: var(--card); border-radius: 12px;
  border: 1px solid var(--border); padding: 14px;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.fin-tr-job:active { transform: scale(0.985); }
@media (hover: hover) { body .fin-tr-job:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); } }
.fin-tr-job-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.fin-tr-job-client {
  font-size: 0.88rem; font-weight: 700; color: var(--text-primary, #111);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0;
}
.fin-tr-job-amount {
  font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 800;
  flex-shrink: 0; margin-left: 8px; white-space: nowrap; overflow: visible;
}
.fin-tr-job-event {
  font-size: 0.72rem; color: var(--text-muted, #999); margin-bottom: 8px;
}
.fin-tr-job-progress {
  height: 6px; background: var(--gray-200, #e5e5e5); border-radius: 3px; overflow: hidden;
}
.fin-tr-job-progress-fill {
  height: 100%; border-radius: 3px; transition: width 0.4s;
}
.fin-tr-job-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px; font-size: 0.72rem; font-weight: 600;
}
.fin-tr-job-paid { color: var(--success, #16a34a); }
.fin-tr-job-due { color: var(--danger, #ef4444); }

/* ═══ ANIMATIONS ═══ */
@keyframes finFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes finSlideIn {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.fin-hero { animation: finFadeUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fin-breakdown-strip { animation: finFadeUp 0.4s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fin-segmented-bar { animation: finFadeUp 0.4s 0.14s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fin-chart-card { animation: finFadeUp 0.4s 0.18s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fin-dues-card { animation: finFadeUp 0.4s 0.22s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fin-expense-card { animation: finFadeUp 0.4s 0.26s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fin-waiver { animation: finFadeUp 0.4s 0.30s cubic-bezier(0.22, 1, 0.36, 1) both; }

/* Payment rows stagger */
.fin-pay-row { animation: finSlideIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fin-pay-row:nth-child(1) { animation-delay: 50ms; }
.fin-pay-row:nth-child(2) { animation-delay: 80ms; }
.fin-pay-row:nth-child(3) { animation-delay: 110ms; }
.fin-pay-row:nth-child(4) { animation-delay: 140ms; }
.fin-pay-row:nth-child(5) { animation-delay: 170ms; }
.fin-pay-row:nth-child(6) { animation-delay: 200ms; }
.fin-pay-row:nth-child(7) { animation-delay: 230ms; }
.fin-pay-row:nth-child(8) { animation-delay: 260ms; }

/* Strip cards stagger */
.fin-strip-card { animation: finFadeUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fin-strip-card:nth-child(1) { animation-delay: 60ms; }
.fin-strip-card:nth-child(2) { animation-delay: 120ms; }
.fin-strip-card:nth-child(3) { animation-delay: 180ms; }

/* Track record jobs stagger */
.fin-tr-job { animation: finFadeUp 0.35s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fin-tr-job:nth-child(1) { animation-delay: 50ms; }
.fin-tr-job:nth-child(2) { animation-delay: 100ms; }
.fin-tr-job:nth-child(3) { animation-delay: 150ms; }
.fin-tr-job:nth-child(4) { animation-delay: 200ms; }
.fin-tr-job:nth-child(5) { animation-delay: 250ms; }

/* Stat cards */
.fin-expense-stat, .fin-tr-stat { animation: finFadeUp 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fin-expense-stat:nth-child(1), .fin-tr-stat:nth-child(1) { animation-delay: 50ms; }
.fin-expense-stat:nth-child(2), .fin-tr-stat:nth-child(2) { animation-delay: 100ms; }
.fin-expense-stat:nth-child(3), .fin-tr-stat:nth-child(3) { animation-delay: 150ms; }

/* Type breakdown rows */
.fin-tr-type-row { animation: finSlideIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fin-tr-type-row:nth-child(1) { animation-delay: 60ms; }
.fin-tr-type-row:nth-child(2) { animation-delay: 110ms; }
.fin-tr-type-row:nth-child(3) { animation-delay: 160ms; }
.fin-tr-type-row:nth-child(4) { animation-delay: 210ms; }
.fin-tr-type-row:nth-child(5) { animation-delay: 260ms; }

/* Due rows */
.fin-due-row { animation: finSlideIn 0.25s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fin-due-row:nth-child(1) { animation-delay: 40ms; }
.fin-due-row:nth-child(2) { animation-delay: 80ms; }
.fin-due-row:nth-child(3) { animation-delay: 120ms; }
.fin-due-row:nth-child(4) { animation-delay: 160ms; }

/* Quick chips */
.fin-quick-chip { animation: finFadeUp 0.25s cubic-bezier(0.22, 1, 0.36, 1) both; }
.fin-quick-chip:nth-child(1) { animation-delay: 40ms; }
.fin-quick-chip:nth-child(2) { animation-delay: 70ms; }
.fin-quick-chip:nth-child(3) { animation-delay: 100ms; }
.fin-quick-chip:nth-child(4) { animation-delay: 130ms; }
.fin-quick-chip:nth-child(5) { animation-delay: 160ms; }
.fin-quick-chip:nth-child(6) { animation-delay: 190ms; }

/* ═══ RESPONSIVE — 375px base ═══ */
@media (max-width: 480px) {
  .fin-pay-icon { width: 36px; height: 36px; }
  .fin-pay-icon .material-symbols-rounded { font-size: 1rem; }
  .fin-pay-right-group { gap: 4px; }
  .fin-pay-actions { gap: 1px; }
  .fin-pay-act { width: 28px; height: 24px; }
  .fin-pay-act .material-symbols-rounded { font-size: 0.85rem; }

  .fin-hero-stat-value { font-size: 1rem; }
  .fin-hero-stat { padding: 8px; }
  .fin-hero-row { gap: 6px; }
  .fin-hero-amount { font-size: 2rem; }

  .fin-expense-stats, .fin-tr-stats { gap: 6px; }
  .fin-expense-stat-value, .fin-tr-stat-value { font-size: 0.95rem; }
  .fin-expense-stat, .fin-tr-stat { padding: 10px 6px; }

  .fin-strip-card { min-width: 100px; padding: 10px 12px; }
  .fin-strip-value { font-size: 0.95rem; }

  .fin-quick-chips { gap: 5px; }
  .fin-quick-chip { padding: 5px 10px; font-size: 0.72rem; }

  .fin-tr-job-amount { font-size: 0.9rem; }
  .fin-tr-type-earned { font-size: 0.65rem; }

  .fin-pay-date-row { gap: 6px; }
  .fin-date-input { font-size: 0.85rem; padding: 8px; }
}

@media (max-width: 374px) {
  .fin-hero-amount { font-size: 1.7rem; }
  .fin-hero-stat-value { font-size: 0.82rem; }
  .fin-hero-stat-label { font-size: 0.58rem; }
  .fin-hero-row { gap: 4px; }
  .fin-strip-card { min-width: 90px; padding: 8px 10px; }
  .fin-strip-value { font-size: 0.82rem; }
  .fin-strip-label { font-size: 0.62rem; }
  .fin-expense-stat-value, .fin-tr-stat-value { font-size: 0.82rem; }
  .fin-expense-stat-label, .fin-tr-stat-label { font-size: 0.6rem; }
  .fin-pay-name { font-size: 0.8rem; }
  .fin-pay-amt { font-size: 0.82rem; }
  .fin-pay-mode { font-size: 0.62rem; }
  .fin-tr-job-client { font-size: 0.8rem; }
  .fin-tr-job-amount { font-size: 0.82rem; }
  .fin-tr-type-name { font-size: 0.8rem; }
  .fin-tr-type-count { font-size: 0.88rem; }
  .fin-dues-total { font-size: 0.95rem; }
  .fin-due-row-value { font-size: 0.82rem; }
  .fin-waiver-amount { font-size: 1rem; }
  .fin-seg-total { font-size: 0.78rem; }
  .fin-expense-amt { font-size: 0.78rem; min-width: 60px; }
}

/* ─── Legacy compat (keep old classes for modals/helpers that still use them) ─── */
.finance-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px;
}
.finance-stat-card {
  padding: 14px; background: var(--card); border-radius: 14px;
  border: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px;
}
.finance-stat-label {
  font-family: 'DM Sans', sans-serif; font-size: 0.75rem; color: var(--text-secondary, #666);
}
.finance-stat-value {
  font-family: 'Outfit', sans-serif; font-size: 1.2rem; font-weight: 700;
}
.finance-stat-value.green { color: #16a34a; }
.finance-stat-value.red { color: #ef4444; }
.finance-stat-value.blue { color: var(--primary); }

.finance-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--card);
  border-bottom: 1px solid var(--border-light, #eee);
  cursor: pointer; transition: background 100ms ease;
}
.finance-row:active { background: var(--gray-50, #fafafa); }
.finance-row-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.finance-row-icon .material-symbols-rounded { font-size: 1.15rem; }
.finance-row-info { flex: 1; min-width: 0; }
.finance-row-title {
  font-family: 'DM Sans', sans-serif; font-size: 0.875rem; font-weight: 600;
  color: var(--foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.finance-row-subtitle {
  font-family: 'DM Sans', sans-serif; font-size: 0.72rem; color: var(--text-secondary, #666);
}
.finance-row-amount {
  font-family: 'Outfit', sans-serif; font-size: 0.94rem; font-weight: 700; flex-shrink: 0;
}
.finance-row-amount.green { color: #16a34a; }
.finance-row-amount.red { color: #ef4444; }
.finance-row-method {
  font-family: 'DM Sans', sans-serif; font-size: 0.69rem;
  color: var(--text-secondary, #666); text-align: right;
}

.filter-pill {
  height: 36px; padding: 0 14px; border-radius: 18px;
  font-family: 'DM Sans', sans-serif; font-size: 0.75rem; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text-secondary, #666); cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 5px;
}
body .filter-pill.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}

.expense-breakdown { background: var(--card); border-radius: 16px; border: 1px solid var(--border); padding: 16px; margin: 0 16px; }
.expense-breakdown-title { font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 12px; }
.expense-breakdown-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
.expense-breakdown-label { display: flex; align-items: center; gap: 8px; font-size: 0.82rem; }
.expense-breakdown-dot { width: 8px; height: 8px; border-radius: 4px; flex-shrink: 0; }
.expense-breakdown-value { font-size: 0.82rem; font-weight: 600; }

.track-record-card { background: var(--card); border-radius: 14px; border: 1px solid var(--border); padding: 14px; margin: 0 16px 10px; display: flex; flex-direction: column; gap: 8px; }
.track-record-header { display: flex; align-items: center; justify-content: space-between; }
.track-record-client { font-size: 0.875rem; font-weight: 600; }
.track-record-event { font-size: 0.72rem; color: var(--text-secondary, #666); }
.track-record-amount { font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 700; }
.track-record-progress { height: 6px; background: var(--muted, #e5e5e5); border-radius: 3px; overflow: hidden; }
.track-record-progress-bar { height: 100%; border-radius: 3px; background: #22c55e; transition: width 300ms ease; }
.track-record-progress-bar.partial { background: #f59e0b; }
.track-record-footer { display: flex; align-items: center; justify-content: space-between; font-size: 0.75rem; color: var(--text-secondary, #666); }
.track-record-paid { color: #16a34a; font-weight: 600; }
.track-record-due { color: #ef4444; font-weight: 600; }

.finance-filters { display: flex; gap: 8px; padding: 8px 16px; overflow-x: auto; scrollbar-width: none; }
.finance-filters::-webkit-scrollbar { display: none; }
.finance-filter-pill {
  height: 36px; padding: 0 14px; border-radius: 18px;
  font-family: 'DM Sans', sans-serif; font-size: 0.72rem; font-weight: 500;
  white-space: nowrap; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text-secondary, #666); cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 5px;
}
body .finance-filter-pill.active {
  background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600;
}

/* Bar chart (legacy for graph/table toggle) */
.finance-bar-chart { background: var(--card); border-radius: 16px; border: 1px solid var(--border); padding: 16px; margin: 0 16px; }
.finance-bar-chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.finance-bar-chart-title { font-family: 'Outfit', sans-serif; font-size: 1rem; font-weight: 700; }
.finance-bar-chart-period { font-size: 0.75rem; color: var(--text-secondary); background: var(--secondary, #f0f0f0); padding: 4px 10px; border-radius: 8px; cursor: pointer; }
.finance-bar-chart-area { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding: 0 4px; }
.finance-bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.finance-bar-pair { display: flex; align-items: flex-end; gap: 3px; width: 100%; justify-content: center; }
.finance-bar { width: 12px; border-radius: 4px 4px 0 0; min-height: 4px; transition: height 300ms ease; }
.finance-bar.income { background: #22c55e; }
.finance-bar.expense { background: #ef4444; }
.finance-bar-label { font-size: 0.75rem; color: var(--text-secondary); text-align: center; }
.finance-bar-legend { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.finance-bar-legend-item { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-secondary); }
.finance-bar-legend-dot { width: 8px; height: 8px; border-radius: 4px; }
.finance-bar-legend-dot.income { background: #22c55e; }
.finance-bar-legend-dot.expense { background: #ef4444; }
.finance-bar-profit { text-align: center; margin-top: 8px; font-family: 'Outfit', sans-serif; font-size: 0.875rem; font-weight: 700; color: #16a34a; }

/* Mobile containment */
@media (max-width: 768px) {
  .finance-row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .finance-row { width: 100%; overflow: hidden; }
}
@media (max-width: 480px) {
  .finance-stats-grid { padding: 0 12px; }
  .finance-bar { width: 10px; }
  .finance-bar-chart-area { gap: 4px; height: 120px; }
}
