/* Дизайн-система в стиле WHISKEY SELLER (seller.mishwhysow.ru) */
:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #21262d;
  --border: #30363d;
  --accent: #238636;
  --accent-light: #2ea043;
  --brand: #e91e8c;
  --brand-hot: #ff2d9b;
  --danger: #da3633;
  --danger-light: #ff7b72;
  --warning: #d29922;
  --text: #e6edf3;
  --text-muted: #7d8590;
  --blue: #1f6feb;
  --blue-light: #388bfd;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--blue-light); text-decoration: none; }

/* Верхняя навигация */
.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 14px 28px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 20;
}
.topbar .logo {
  font-size: 17px; font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(90deg, var(--brand), var(--brand-hot));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.topbar nav { display: flex; gap: 6px; }
.topbar nav a {
  padding: 7px 14px; border-radius: 8px; color: var(--text-muted);
  font-size: 13px; font-weight: 600; transition: background var(--ease-out) .15s, color .15s;
}
.topbar nav a:hover { color: var(--text); background: var(--surface2); }
.topbar nav a.active { color: #fff; background: linear-gradient(90deg, var(--brand), var(--brand-hot)); }
.topbar .spacer { flex: 1; }

.wrap { padding: 24px 28px 64px; max-width: 1400px; margin: 0 auto; }

/* Заголовок страницы */
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.page-header p { color: var(--text-muted); font-size: 14px; margin-top: 4px; max-width: 70ch; }

/* Карточки */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; margin-bottom: 16px;
}
.card-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 16px 18px; min-width: 0; }

/* KPI */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 8px; }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.stat-value.green { color: var(--accent-light); }
.stat-value.brand { color: var(--brand-hot); }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 8px; border: none;
  font-size: 14px; font-weight: 500; cursor: pointer; color: #fff;
  transition: transform .1s var(--ease-out), background-color .1s ease, opacity .15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); }
.btn-primary:hover { background: var(--accent-light); }
.btn-brand { background: linear-gradient(90deg, var(--brand), var(--brand-hot)); }
.btn-brand:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Поля/фильтры */
.filters { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
input, select {
  background-color: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; max-width: 100%; font-family: inherit;
}
input:focus, select:focus { border-color: var(--blue-light); outline: none; }
label.fld { font-size: 13px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
label.chk { font-size: 13px; color: var(--text); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

/* Таблица */
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  padding: 12px 14px; text-align: right; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted);
  border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none;
}
th:first-child, td:first-child { text-align: left; }
th.active { color: var(--brand-hot); }
td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; text-align: right; }
tbody tr:hover td { background: var(--surface2); }
.pos { color: var(--accent-light); font-weight: 600; }
.neg { color: var(--danger-light); }
.muted { color: var(--text-muted); }

/* Пилюли/бейджи */
.pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pill.cs2 { background: rgba(31,111,235,.18); color: #7eb0ff; }
.pill.dota { background: rgba(218,54,51,.18); color: #ff9d97; }
.pill.tf2 { background: rgba(210,153,34,.18); color: #f0c14b; }
.pill.rust { background: rgba(219,109,40,.2); color: #e0925a; }
.pill.pubg { background: rgba(233,30,140,.18); color: #f0a0d0; }
.pill.instant { background: rgba(46,160,67,.18); color: var(--accent-light); }
.pill.hold { background: rgba(210,153,34,.18); color: var(--warning); }
.trend-up { color: var(--accent-light); }
.trend-down { color: var(--danger-light); }
.trend-flat { color: var(--text-muted); }

/* Прогресс/лог */
.panel-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.progress { flex: 1; min-width: 200px; height: 8px; background: var(--bg); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.progress > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-hot)); transition: width .4s; }
.pstate { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.pstate b { color: var(--text); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.idle { background: var(--text-muted); }
.dot.running { background: var(--warning); animation: pulse 1s infinite; }
.dot.done { background: var(--accent-light); }
.dot.error, .dot.stopped { background: var(--danger); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.log { margin-top: 12px; max-height: 160px; overflow-y: auto; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--text-muted); white-space: pre-wrap; }
.empty { padding: 48px; text-align: center; color: var(--text-muted); }
