﻿/* PAGE */
.stat-page {
  max-width: 1200px; margin: 0 auto;
  padding: 32px 32px 64px;
  display: flex; flex-direction: column; gap: 20px;
  width: 100%;
}

/* Заголовок */
.stat-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.stat-title { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.stat-subtitle { font-size: 13px; color: var(--text-faint); margin-top: 3px; }
.stat-period-tabs {
  display: flex; background: var(--bg-card); border: 1px solid rgba(var(--accent-rgb),0.12);
  border-radius: 10px; padding: 4px; gap: 2px;
}
.stat-period-btn {
  padding: 7px 14px; border-radius: 7px; border: none; background: none;
  font-size: 12px; font-weight: 700; color: var(--text-faint); white-space: nowrap;
  cursor: pointer; transition: background 0.2s, color 0.2s;
}
.stat-period-btn:hover { color: var(--text-dim); background: var(--bg-card); }
.stat-period-btn.active { background: var(--bg-card); color: var(--accent); border: 1px solid rgba(var(--accent-rgb),0.2); }

/* KPI */
.stat-kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.stat-kpi-card {
  background: var(--bg-card); border: 1px solid rgba(var(--accent-rgb),0.12); border-radius: 14px;
  padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color 0.2s, transform 0.2s; position: relative; overflow: hidden;
}
.stat-kpi-card:hover { border-color: rgba(var(--accent-rgb),0.2); transform: translateY(-2px); }
.stat-kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  border-radius: 14px 14px 0 0;
}
.stat-kpi-card:nth-child(1)::before { background: var(--accent); }
.stat-kpi-card:nth-child(2)::before { background: var(--accent); }
.stat-kpi-card:nth-child(3)::before { background: #a47fd4; }
.stat-kpi-card:nth-child(4)::before { background: #4ad476; }
.stat-kpi-card:nth-child(5)::before { background: var(--accent); }
.stat-kpi-top { display: flex; align-items: center; justify-content: space-between; }
.stat-kpi-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  border: 1px solid; display: flex; align-items: center; justify-content: center;
}
.stat-kpi-label { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; color: var(--text-faint); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-kpi-value { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-kpi-value.green  { color: #4ad476; }
.stat-kpi-value.gold   { color: var(--accent); }
.stat-kpi-value.purple { color: #a47fd4; }
.stat-kpi-value.blue   { color: var(--accent); }
.stat-kpi-value.red    { color: #d4634a; }
.stat-kpi-sub { font-size: 11px; color: var(--text-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Grid */
.stat-main-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.stat-col-left  { display: flex; flex-direction: column; gap: 16px; }
.stat-col-right { display: flex; flex-direction: column; gap: 16px; }

/* Карточка */
.stat-card {
  background: var(--bg-card); border: 1px solid rgba(var(--accent-rgb),0.12); border-radius: 14px;
  padding: 22px; display: flex; flex-direction: column; gap: 18px;
}
.stat-card-title {
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  color: var(--text-faint); text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.stat-card-title::after { content: ''; flex: 1; height: 1px; background: rgba(var(--accent-rgb),0.08); }

/* Donut */
.stat-wl-visual { display: flex; align-items: center; gap: 28px; }
.stat-wl-donut  { position: relative; flex-shrink: 0; }
.stat-wl-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.stat-wl-pct { font-size: 22px; font-weight: 800; color: #4ad476; line-height: 1; }
.stat-wl-lbl { font-size: 10px; color: var(--text-faint); margin-top: 2px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-wl-legend { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.stat-wl-leg-item { display: flex; align-items: center; gap: 10px; }
.stat-wl-dot  { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.stat-wl-leg-val { font-size: 16px; font-weight: 800; color: var(--text); line-height: 1; white-space: nowrap; }
.stat-wl-leg-lbl { font-size: 11px; color: var(--text-faint); margin-top: 2px; white-space: nowrap; }
.stat-wl-leg-sep { height: 1px; background: rgba(var(--accent-rgb),0.08); }

/* Daily bars */
.stat-bar-chart-wrap { display: flex; flex-direction: column; gap: 8px; }
.stat-bar-chart-title { font-size: 11px; color: var(--text-mute); font-weight: 600; letter-spacing: 0.5px; }
.stat-bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 64px; }
.stat-bar-item {
  flex: 1; border-radius: 4px 4px 0 0; min-height: 4px;
  cursor: pointer; transition: opacity 0.2s;
}
.stat-bar-item:hover { opacity: 0.75; }
.stat-bar-item.win   { background: linear-gradient(180deg, #4ad476, #2eaa58); }
.stat-bar-item.loss  { background: linear-gradient(180deg, #d4634a, #b04030); }
.stat-bar-item.mixed { background: linear-gradient(180deg, #1a9fff, #d4a820); }
.stat-bar-days { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-mute); }

/* Games table */
.stat-games-table { display: flex; flex-direction: column; }
.stat-games-row {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr;
  padding: 11px 12px; border-radius: 8px;
  font-size: 13px; color: var(--text-dim); transition: background 0.15s;
}
.stat-games-row > div:not(:first-child) { text-align: right; }
.stat-games-row:not(.stat-games-head):hover { background: #0e1320; }
.stat-games-head {
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  color: var(--text-mute); text-transform: uppercase;
  border-bottom: 1px solid rgba(var(--accent-rgb),0.12); border-radius: 0; margin-bottom: 4px;
}
.stat-game-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.stat-game-pnl.pos { color: #4ad476; font-weight: 700; white-space: nowrap; }
.stat-game-pnl.neg { color: #d4634a; font-weight: 700; white-space: nowrap; }
.stat-game-bar-wrap { height: 4px; background: var(--bg-card); border-radius: 2px; overflow: hidden; margin-top: 3px; width: 70px; }
.stat-game-bar-fill { height: 100%; border-radius: 2px; }

/* Серии */
.stat-streaks { display: flex; flex-direction: column; gap: 10px; }
.stat-streak-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 10px;
  background: #0e1320; border: 1px solid #1a2235;
}
.stat-streak-icon {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.stat-streak-icon.win  { background: rgba(74,212,118,0.1);  border: 1px solid rgba(74,212,118,0.2); }
.stat-streak-icon.loss { background: rgba(212,99,74,0.1);   border: 1px solid rgba(212,99,74,0.2); }
.stat-streak-icon.cur  { background: rgba(var(--accent-rgb),0.1);  border: 1px solid rgba(var(--accent-rgb),0.2); }
.stat-streak-val { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1; white-space: nowrap; }
.stat-streak-lbl { font-size: 11px; color: var(--text-faint); margin-top: 2px; white-space: nowrap; }

/* Рекорды */
.stat-records { display: flex; flex-direction: column; }
.stat-record-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--bg-card);
}
.stat-record-item:last-child { border-bottom: none; }
.stat-record-icon { flex-shrink: 0; }
.stat-record-label { flex: 1; font-size: 12px; color: var(--text-dim); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-record-value { font-size: 13px; font-weight: 800; color: var(--text); white-space: nowrap; flex-shrink: 0; }

/* Часы */
.stat-hours-chart { display: flex; align-items: flex-end; gap: 2px; height: 48px; }
.stat-hour-bar { flex: 1; border-radius: 2px 2px 0 0; min-height: 3px; background: linear-gradient(180deg, #1a9fff, #0070d0); cursor: pointer; transition: opacity 0.2s; }
.stat-hour-bar:hover { opacity: 0.65; }
.stat-hours-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-mute); margin-top: 6px; }

/* Финансы */
.stat-finance-card { gap: 16px; }
.stat-finance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
}
.stat-finance-col {
  padding: 0 24px;
  border-right: 1px solid rgba(var(--accent-rgb),0.12);
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
}
.stat-finance-col:first-child { padding-left: 0; }
.stat-finance-col:last-child  { border-right: none; }
.stat-finance-col-header {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-radius: 12px;
}
.stat-finance-col-header.dep  { background: rgba(74,212,118,0.06); border: 1px solid rgba(74,212,118,0.15); }
.stat-finance-col-header.with { background: rgba(var(--accent-rgb),0.06); border: 1px solid rgba(var(--accent-rgb),0.15); }
.stat-finance-icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.stat-finance-icon.dep  { background: rgba(74,212,118,0.12); border: 1px solid rgba(74,212,118,0.25); color: #4ad476; }
.stat-finance-icon.with { background: rgba(var(--accent-rgb),0.12); border: 1px solid rgba(var(--accent-rgb),0.25); color: var(--accent); }
.stat-finance-label { font-size: 12px; color: var(--text-dim); font-weight: 600; white-space: nowrap; }
.stat-finance-count { font-size: 11px; color: var(--text-mute); margin-top: 1px; white-space: nowrap; }
.stat-finance-amount { font-size: 15px; font-weight: 800; margin-left: auto; white-space: nowrap; flex-shrink: 0; }
.stat-finance-amount.dep  { color: #4ad476; }
.stat-finance-amount.with { color: var(--accent); }
.stat-finance-net-col { align-items: center; }
.stat-finance-net-label { font-size: 11px; color: var(--text-faint); font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.stat-finance-net-val   { font-size: 28px; font-weight: 800; color: var(--accent); }
.stat-finance-txn-col { gap: 4px; }
.stat-finance-txn-title { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; color: var(--text-mute); text-transform: uppercase; margin-bottom: 4px; }

/* Транзакции */
.stat-txn-list { display: flex; flex-direction: column; }
.stat-txn-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--bg-card);
}
.stat-txn-item:last-child { border-bottom: none; }
.stat-txn-dot  { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.stat-txn-info { flex: 1; }
.stat-txn-type { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-txn-date { font-size: 10px; color: var(--text-mute); margin-top: 1px; white-space: nowrap; }
.stat-txn-amt  { font-size: 12px; font-weight: 800; white-space: nowrap; flex-shrink: 0; }
.stat-txn-amt.dep  { color: #4ad476; }
.stat-txn-amt.with { color: var(--accent); }
