/* ---------- Токены ---------- */
:root {
  --black: #0a0a0a;
  --surface: #131313;
  --surface-2: #1a1a1a;
  --line: #2a2a2a;
  --line-strong: #444;
  --white: #f2f2f2;
  --gray: #8f8f8f;
  --gray-dim: #5c5c5c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Верхняя панель ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--black);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner {
  max-width: 880px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-family: "Space Grotesk", -apple-system, sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--white);
}

.nav { display: flex; align-items: center; gap: 14px; }
.nav-user { color: var(--gray); font-size: 13px; }
.nav-link { color: var(--white); text-decoration: none; font-size: 13px; border-bottom: 1px solid var(--line-strong); }
.nav-link:hover { color: var(--gray); border-color: var(--gray); }

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 20px 48px;
}

/* ---------- Раскладка ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--white);
}

.muted { color: var(--gray); font-size: 13px; }

/* ---------- Вход ---------- */
.auth-wrap {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  width: 100%;
  max-width: 340px;
}

.auth-card h1 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 6px;
}

/* ---------- Формы ---------- */
label {
  display: block;
  font-size: 12.5px;
  color: var(--gray);
  margin: 12px 0 5px;
}

input[type="text"], input[type="password"], input[type="number"] {
  width: 100%;
  padding: 9px 11px;
  background: var(--black);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--white);
  font-size: 14px;
}

input::placeholder { color: var(--gray-dim); }
input:focus { outline: none; border-color: var(--line-strong); }

.stack { display: flex; flex-direction: column; }
.stack-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stack-inline input { width: auto; flex: 1; min-width: 140px; }
.inline { display: inline; }

.checkbox-label { display: flex; align-items: center; gap: 6px; color: var(--gray); font-size: 13px; }
.checkbox-label input { width: auto; }

/* ---------- Кнопки ----------
   Заполненная белая = основное/подтверждающее действие.
   Контурная = второстепенное/отменяющее действие.
   Различие по стилю, не по цвету. */
.btn {
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
  border: 1px solid transparent;
}
.btn:hover { opacity: 0.85; }
.btn-full { width: 100%; margin-top: 16px; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

.btn-primary { background: var(--white); color: var(--black); }
.btn-secondary { background: transparent; color: var(--white); border-color: var(--line-strong); }
.btn-ok { background: var(--white); color: var(--black); }
.btn-bad { background: transparent; color: var(--gray); border-color: var(--line-strong); }
.btn-bad:hover { color: var(--white); border-color: var(--white); }

.link { color: var(--white); text-decoration: none; font-weight: 600; }
.link:hover { color: var(--gray); }

/* ---------- Статистика ---------- */
.stat-row { display: flex; gap: 20px; margin-bottom: 6px; }
.stat { text-align: center; flex: 1; }
.stat-value { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11.5px; color: var(--gray); margin-top: 2px; }
.stat-approved, .stat-pending, .stat-rejected { color: var(--white); }

/* ---------- Топ ---------- */
.top-list { margin: 0; padding-left: 18px; }
.top-list li { padding: 3px 0; font-variant-numeric: tabular-nums; }

/* ---------- Таблицы ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  color: var(--gray);
  font-weight: 500;
  font-size: 11.5px;
  padding: 6px 6px;
  border-bottom: 1px solid var(--line);
}
.table td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: none; }
.actions { display: flex; gap: 6px; }

/* ---------- Статусы (значок + стиль рамки, без цвета) ---------- */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--line-strong);
}
.badge-ok { color: var(--white); border-style: solid; }
.badge-ok::before { content: "✓ "; }
.badge-bad { color: var(--gray); border-style: solid; }
.badge-bad::before { content: "✗ "; }
.badge-wait { color: var(--gray); border-style: dashed; }
.badge-wait::before { content: "… "; }

/* ---------- Уведомления ---------- */
.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-size: 13.5px;
  border: 1px solid var(--line-strong);
}
.flash-success { color: var(--white); }
.flash-success::before { content: "✓ "; }
.flash-error { color: var(--gray); }
.flash-error::before { content: "✗ "; }
