/* Админка — минимальные дополнения к app.css */
.admin-main { padding-bottom: 48px; }

.admin-form {
  display: grid;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  max-width: 900px;
}

.form-row { display: grid; gap: 6px; }
.form-row label { font-weight: 600; font-size: 14px; color: var(--ink-2); }
.form-row-wide { grid-column: 1 / -1; }
.form-row small { font-size: 12px; }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }

/* Тест */
.test-options label.check:has(input:checked) {
  border-color: var(--brand-500);
  background: var(--brand-50);
}
.test-options label.check { border: 1.5px solid var(--line-2); background: var(--white); }

/* JSON-поля */
.form-row textarea[rows="14"] {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.45;
}

/* Избранное */
[data-favorite].btn-primary { background: var(--brand-500); color:#fff; border-color: var(--brand-500); }

/* Checklist */
.checklist-item { transform: scale(1.1); }
#checklist-progress { color: var(--brand-700); }

/* Маршрут */
.path-step { transform: scale(1.1); margin-right: 8px; }

/* Таблицы характеристик */
.admin-table th { text-align: left; }
.admin-table td strong { color: var(--ink); }

/* Details в карточках */
details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--brand-700);
  margin: 8px 0;
  list-style: none;
}
details summary::before { content: '▸ '; }
details[open] summary::before { content: '▾ '; }
details[open] summary { margin-bottom: 8px; }

/* Кнопка «Наверх» */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--brand-500);
  color: #fff;
  border: 0;
  font-size: 20px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-3);
  z-index: 30;
}
.to-top.visible { display: flex; }
.to-top:hover { background: var(--brand-600); }

/* Копирование ссылки */
.btn-copy { position: relative; }
.btn-copy.copied::after {
  content: 'Скопировано';
  position: absolute;
  top: -34px; left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  white-space: nowrap;
}

/* ============================================================
   Тёмная тема
   ============================================================ */
[data-theme="dark"] {
  --cream:    #161310;
  --cream-2:  #1e1a16;
  --cream-3:  #2a251f;
  --white:    #221d18;
  --ink:      #f4ede3;
  --ink-2:    #d6ccbd;
  --ink-3:    #9a8d7d;
  --ink-4:    #6c6358;
  --line:     #2f2820;
  --line-2:   #3e352b;

  --brand-50:  #2a1a10;
  --brand-100: #3d2213;
  --brand-200: #5a301a;
  --brand-500: #f97316;
  --brand-600: #fb923c;
  --brand-700: #fdba74;

  --green-100: #143020;
  --green-500: #22c55e;
  --green-700: #86efac;
  --amber-100: #3a2a0d;
  --amber-700: #fcd34d;
  --red-100:   #3a1515;
  --red-700:   #fca5a5;
  --blue-100:  #172038;
  --blue-700:  #93c5fd;
}

[data-theme="dark"] body {
  background: var(--cream);
  color: var(--ink);
}

[data-theme="dark"] .site-header {
  background: rgba(22,19,16,.92);
  border-bottom-color: var(--line);
}

[data-theme="dark"] .hero::before { opacity: .3; }
[data-theme="dark"] .card,
[data-theme="dark"] .feature,
[data-theme="dark"] .scenario,
[data-theme="dark"] .recipe-card,
[data-theme="dark"] .card-panel,
[data-theme="dark"] .picker-section,
[data-theme="dark"] .auth { background: var(--white); }

[data-theme="dark"] .btn:not(.btn-primary):not(.btn-danger) {
  background: var(--cream-2);
  border-color: var(--line-2);
  color: var(--ink);
}
[data-theme="dark"] .btn:not(.btn-primary):not(.btn-danger):hover {
  background: var(--brand-50);
  border-color: var(--brand-200);
}
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: var(--cream-2);
  border-color: var(--line-2);
  color: var(--ink);
}
[data-theme="dark"] .admin-table th { background: var(--cream-3); color: var(--ink-2); }
[data-theme="dark"] .admin-table td { color: var(--ink); }
[data-theme="dark"] .admin-table tr:hover td { background: var(--cream-2); }

/* Переключатель темы */
.theme-toggle {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--r-full);
  color: var(--ink-2);
  font-size: 16px;
  transition: background .15s;
}
.theme-toggle:hover { background: var(--brand-50); color: var(--brand-700); }

/* Улучшения печати памяток и чек-листов */
@media print {
  body.safety-print { background: #fff !important; color: #000 !important; }
  body.safety-print .site-header,
  body.safety-print .site-footer,
  body.safety-print .mobile-bar,
  body.safety-print .flash,
  body.safety-print .no-print { display: none !important; }
  body.safety-print main { padding: 0 !important; max-width: 100% !important; }
}