:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #17202a;
  --muted: #5b6572;
  --border: #e3e8ee;
  --accent: #3f8f4f;
  --accent2: #57b06a;
  --danger: #d64545;
  --header-bg: rgba(255, 255, 255, 0.85);
}
html.dark {
  --bg: #10151c;
  --card: #1a2230;
  --text: #e6ebf2;
  --muted: #93a0b4;
  --border: rgba(255, 255, 255, 0.1);
  --header-bg: rgba(16, 21, 28, 0.85);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.container { width: 100%; max-width: 1060px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 28px; padding-bottom: 40px; }

/* Шапка */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; padding-top: 12px; padding-bottom: 12px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 16px;
}
.nav { display: flex; gap: 4px; }
.nav a {
  padding: 6px 12px; border-radius: 8px; font-size: 14px;
  color: var(--muted); text-decoration: none;
}
.nav a:hover { background: rgba(127,127,127,0.12); color: var(--text); }
.nav a.active { background: var(--accent); color: #fff; }
.header-side { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px; font-size: 12px;
  background: rgba(127,127,127,0.12); color: var(--muted); white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-loading { background: #9aa3ad; animation: pulse 1.2s infinite; }
.dot-on { background: #34a853; }
.dot-off { background: #d64545; }
@keyframes pulse { 50% { opacity: 0.4; } }

/* Кнопки и карточки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px; font-size: 14px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: rgba(127,127,127,0.12); }
.btn-danger { background: transparent; border-color: var(--border); color: var(--danger); }
.btn-icon { padding: 6px 10px; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px;
  box-shadow: 0 1px 2px rgba(16, 21, 28, 0.05);
}
.muted { color: var(--muted); }
.mono {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  background: rgba(127,127,127,0.12); padding: 8px 12px; border-radius: 8px;
}
.flash {
  margin-bottom: 16px; padding: 12px 16px; border-radius: 10px;
  background: rgba(63, 143, 79, 0.12); border: 1px solid rgba(63,143,79,.35);
  color: var(--accent); font-size: 14px;
}
.flash-error { background: rgba(214,69,69,.1); border-color: rgba(214,69,69,.35); color: var(--danger); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 24px; align-items: center; margin-bottom: 40px; }
.hero h1 { font-size: 38px; margin: 0 0 12px; line-height: 1.15; }
.hero p { color: var(--muted); margin: 0 0 20px; font-size: 16px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-art { min-height: 240px; border-radius: 16px; overflow: hidden; position: relative; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; }
.hero-art.placeholder {
  background:
    linear-gradient(135deg, rgba(63,143,79,.85), rgba(87,176,106,.65)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 16px, transparent 16px 32px);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 56px;
}

/* Блоки главной */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.status-card .ip-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-top: 8px; }

/* Вкладки */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab-btn {
  padding: 9px 16px; border: none; background: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.rules-body { white-space: pre-line; line-height: 1.7; color: var(--text); }

/* Магазин */
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.product { overflow: hidden; padding: 0; display: flex; flex-direction: column; position: relative; }
.product-img { height: 150px; background: linear-gradient(135deg, rgba(63,143,79,.2), rgba(87,176,106,.2)); display: flex; align-items: center; justify-content: center; font-size: 44px; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: #e8a020; color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .4px;
}
.product-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-body h3 { margin: 0; font-size: 16px; }
.product-body .desc { color: var(--muted); font-size: 13px; flex: 1; }
.product-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.price { font-size: 18px; font-weight: 800; color: var(--accent); }
html.dark .price { color: var(--accent2); }

/* Прогресс-бары сборов */
.goal { margin-bottom: 20px; }
.goal-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; gap: 10px; flex-wrap: wrap; }
.goal-head h3 { margin: 0; font-size: 16px; }
.progress { height: 16px; background: rgba(127,127,127,0.18); border-radius: 999px; overflow: hidden; }
.progress > div {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .5s;
}
.goal-meta { font-size: 13px; color: var(--muted); margin-top: 6px; text-align: right; }

/* Формы */
.field { margin-bottom: 14px; }
.label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); margin-bottom: 5px; }
.input, .textarea, select.input {
  width: 100%; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none;
}
.input:focus, .textarea:focus { border-color: var(--accent); }
.textarea { min-height: 140px; resize: vertical; }

/* Таблицы в админке */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.table .num { text-align: right; }
.table input[type=text], .table input[type=number] { width: 100%; min-width: 80px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.pill-pending { background: rgba(232,160,32,.15); color: #b07608; }
.pill-confirmed { background: rgba(63,143,79,.15); color: var(--accent); }
.pill-rejected { background: rgba(214,69,69,.12); color: var(--danger); }

.login-box { max-width: 360px; margin: 60px auto; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0; text-align: center; font-size: 12px; color: var(--muted);
}

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .grid-2 { grid-template-columns: 1fr; }
  .status-badge { display: none; }
}
