/* Панель модерации и страница подтверждения из письма. Палитра и приёмы — как
   в cosmogen-retouch, акцент — золото из писем магазина. */

:root {
  --bg: #f5f4f1;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --text: #1c1c22;
  --muted: #6b6b76;
  --border: #e4e1d9;
  --accent: #121212;
  --accent-text: #ffffff;
  --gold: #b89b52;
  --ok: #1f9d55;
  --warn: #b7791f;
  --error: #d64545;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131316;
    --surface: #1c1c21;
    --surface-2: #25252b;
    --text: #ececf1;
    --muted: #9a9aa6;
    --border: #2f2f38;
    --accent: #ececf1;
    --accent-text: #131316;
    --gold: #d2b76f;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

[hidden] { display: none !important; }
a { color: inherit; }
h1, h2 { margin: 0; line-height: 1.25; }
h2 { font-size: 18px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pad { padding: 16px; }
.error { color: var(--error); margin: 8px 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 8px 14px; font: inherit; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--text); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.danger { color: var(--error); }

input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: -1px; }

/* Вход */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login__card {
  width: min(360px, 100%); display: grid; gap: 12px; padding: 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}

/* Каркас */
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 12px 20px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { font-weight: 600; letter-spacing: .02em; }
.brand span { color: var(--gold); }
.shop-status { margin-left: auto; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot--ok { background: var(--ok); }
.dot--error { background: var(--error); }

.banner { margin: 0; padding: 10px 20px; font-size: 13px; }
.banner--warn { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }

.tabs {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 12px 20px 0; max-width: 980px; margin: 0 auto;
}
.tabs__spacer { flex: 1; }
.tab {
  border: 0; background: transparent; color: var(--muted); font: inherit; cursor: pointer;
  padding: 8px 12px; border-radius: 8px;
}
.tab:hover { color: var(--text); }
.tab.is-active { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.tab span:not(:empty) {
  display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px;
  background: var(--gold); color: #fff; font-size: 12px; text-align: center;
}

.main { max-width: 980px; margin: 0 auto; padding: 16px 20px 48px; }
.search { margin-bottom: 12px; }

/* Отзывы */
.reviews { display: grid; gap: 12px; }
.review, .panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
}
.review__head { display: flex; align-items: baseline; gap: 12px; }
.review__product { font-weight: 600; text-decoration: none; }
.review__product[href]:hover { text-decoration: underline; }
.review__status { margin-left: auto; }
.review__stars, .stars { margin: 8px 0 0; color: var(--gold); letter-spacing: 2px; font-size: 17px; }
.review__title { margin: 6px 0 0; font-weight: 600; }
.review__body { margin: 6px 0 0; white-space: pre-line; }
.review__meta { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.review__actions { display: flex; gap: 8px; margin-top: 12px; }
.review__actions .danger { margin-left: auto; }

.status { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.status--approved { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.status--rejected { color: var(--error); background: color-mix(in srgb, var(--error) 10%, transparent); }
.status--pending { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }

/* Форма и настройки */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 500; }
.form label .muted { font-weight: 400; font-size: 12px; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.result { margin: 0; padding: 10px 12px; border-radius: 8px; }
.result--ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.result--error { background: color-mix(in srgb, var(--error) 10%, transparent); color: var(--error); }

.settings { display: grid; gap: 4px; margin-top: 12px; }
.setting {
  display: flex; align-items: end; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border);
  transition: background .3s;
}
.setting:first-child { border-top: 0; }
.setting > div, .setting > label:not(.toggle) { flex: 1; display: grid; gap: 6px; }
.setting p { margin: 2px 0 0; }
.setting code { color: var(--muted); word-break: break-all; }
.setting.is-saved { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { width: auto; }

/* Страница подтверждения из письма */
.moderate { min-height: 100vh; display: grid; place-items: start center; padding: 40px 16px; }
.moderate__card {
  width: min(560px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.moderate .eyebrow { margin: 0 0 8px; color: var(--gold); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; }
.moderate h1 { font-size: 22px; font-weight: 500; }
.moderate__product { margin: 16px 0 0; font-weight: 600; }
.quote { margin: 12px 0; padding: 14px 16px; background: var(--surface-2); border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; }
.quote__title { margin: 8px 0 0; font-weight: 600; }
.quote__body { margin: 8px 0 0; white-space: pre-line; }
.quote__meta { margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.moderate form { margin-top: 16px; }
.button {
  display: inline-block; padding: 12px 28px; border: 1px solid var(--accent); border-radius: 8px;
  background: var(--accent); color: var(--accent-text); font: inherit; letter-spacing: .04em;
  text-decoration: none; cursor: pointer;
}
.button--secondary { background: transparent; color: var(--text); }
.hint { margin-top: 20px; font-size: 13px; }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; }
  .tabs__spacer { display: none; }
  .review__actions { flex-wrap: wrap; }
}
